ai-agentmanager 1.28.0 → 1.30.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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.30.0 (2026-11-07)
4
+
5
+ - **Bug hunts fix what they find.** Turn on *Fix automatically* on a hunt, and the bugs it finds at or above the severity you pick (high and up by default) are fixed without you: each by its own agent on its own branch, which must add a test that fails before the fix and passes after, and pass the whole suite. The hunt's test command (optional) is run on the fix too, and the AI judge, when it's on, reviews the change. Only then is a **draft** pull request opened, with the bug, the test and the checks in its description; nothing is merged. They show in Today as *Fix ready* and under Bugs → *Draft PRs*. At most 3 a run, within the hunt's cost limit. A fix that doesn't hold up stays in the list with the reason, and with *file it as an issue* on, it's filed on GitHub so it isn't lost.
6
+
7
+ ## 1.29.0 (2026-11-07)
8
+
9
+ - **Questions for you, with answers ready.** The assistant now also finds questions put to you in Slack (and email and meeting notes, with those on), including ones you're only copied or mentioned on, and prepares an answer for each: it reads the thread and checks the code of your projects, Jira and docs. They show in Today (*Asked you* is pressing, *CC'd* can wait) and under Actions → Questions, with the draft to *Copy*, *Edit*, or *Draft again*, and *Thread* to open where it was asked. A question without a draft has *Draft an answer*, which starts a session that researches it. Nothing is ever sent for you. (`agentmgr actions add --question … [--cc]`, `agentmgr actions answer <id> "<text>"`.)
10
+ - **Answer agents right in Today.** An agent's question shows the choices it offered as buttons (or press 1–6) and a box to type an answer; a permission prompt shows its options. No need to open the session.
11
+ - **Finish work with no pull request.** When an agent is done but opened no pull request, Today and the Jira list offer *See changes* (the diff), *Open PR* (commits what's left, pushes and opens one, titled after the issue) and, in Today, *Send back* with a note.
12
+ - **Snooze everywhere.** Actions, Jira issues and questions can be snoozed until tomorrow 9am (*Snooze*, or `z`); they come back by themselves. Snoozed ones are under the new *Snoozed* filters and in Today's *Set aside*, with *Bring back*.
13
+ - Typing in a box in Today, the Jira, Actions or Bugs list is no longer interrupted when the list refreshes.
14
+
3
15
  ## 1.28.0 (2026-11-07)
4
16
 
5
17
  - **Bug hunts.** *Bugs* (or `b`) runs agents that look for bugs in the background, in a project or one folder of it: in what changed since the last run, or the whole module a part at a time, for any bug or the kinds you pick (races, error handling, leaks, security, data). A hunt runs by hand (*Hunt now*) or every night, one at a time, and stops at its cost limit. The hunter reads the code and runs the tests on its own copy and never commits or pushes. Each bug must come with evidence (a failing test, or the path through the code), and the AI judge checks each one against the code: only those that hold up are listed, worst first, and nothing is reported twice. On each: *Fix* starts an agent with the finding and its test, *File it* opens a filled-in GitHub issue (or copies it as Markdown), *Not a bug* keeps it from coming back, *Snooze* hides it until tomorrow or Monday. Critical and high ones show in Today.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-agentmanager",
3
- "version": "1.28.0",
3
+ "version": "1.30.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/actions.js CHANGED
@@ -11,7 +11,9 @@ const PROJECT = 'agentmgr.actionsProject';
11
11
  const FILTERS = [
12
12
  ['open', 'Open'],
13
13
  ['assigned', 'Assigned'],
14
+ ['questions', 'Questions'],
14
15
  ['skipped', 'Skipped'],
16
+ ['snoozed', 'Snoozed'],
15
17
  ['done', 'Done'],
16
18
  ['all', 'All'],
17
19
  ['removed', 'Removed'],
@@ -20,12 +22,14 @@ const STATES = [
20
22
  ['open', '—', 'Not decided yet'],
21
23
  ['assign', 'Assign', 'An agent does it (in the project picked above)'],
22
24
  ['skip', 'Skip', 'Not now'],
23
- ['done', 'Done', 'Handled'],
25
+ ['snooze', 'Snooze', 'Until tomorrow 9am: then open again'],
26
+ ['done', 'Done', 'Handled (or answered)'],
24
27
  ['remove', 'Remove', 'Not mine, or not needed: off the list (under Removed)'],
25
28
  ];
26
29
  const ICON = { slack: '💬', gemini: '📝', other: '•' };
27
30
 
28
31
  export function initActions({ api, $, esc, ago, toast, openAgent, projects = () => [] }) {
32
+ let editing = null; // the question whose answer is being edited
29
33
  const dialog = $('#actions-dialog');
30
34
  const body = $('#actions-body');
31
35
  let data = null;
@@ -59,6 +63,13 @@ export function initActions({ api, $, esc, ago, toast, openAgent, projects = ()
59
63
  if (btn && f) btn.hidden = !f.slack && !f.gemini;
60
64
  }
61
65
 
66
+ /** A question's drafted answer: shown, copied, edited, or asked for. */
67
+ function answerHtml(r) {
68
+ if (editing === r.id) return `<form class="today-draft-edit" data-act-edit="${esc(r.id)}"><textarea rows="4">${esc(r.answer?.text ?? '')}</textarea><div><button class="small primary">Save</button> <button type="button" class="small" data-act-answer="cancel">Cancel</button></div></form>`;
69
+ if (!r.answer) return `<div class="today-draft"><button class="small" data-act-answer="draft" title="A session reads the thread, finds the answer in your code, Jira and docs, and drafts it">Draft an answer</button> <button class="link" data-act-answer="edit">Write one</button></div>`;
70
+ return `<div class="today-draft"><div class="today-draft-text">${esc(r.answer.text)}</div><div class="hint">${r.answer.by === 'you' ? 'Your edit' : 'Drafted by the assistant'}${r.answer.sources ? ` · from ${esc(r.answer.sources)}` : ''} · <button class="link" data-act-answer="copy">Copy</button> · <button class="link" data-act-answer="edit">Edit</button> · <button class="link" data-act-answer="draft">Draft again</button></div></div>`;
71
+ }
72
+
62
73
  function row(r) {
63
74
  const opts = STATES.map(([v, label, title]) => `<option value="${v}" title="${esc(title)}" ${r.status === v ? 'selected' : ''}>${label}</option>`).join('');
64
75
  const where = r.link ? `<a href="${esc(r.link)}" target="_blank" rel="noopener" title="Open where it was asked">${esc(r.sourceLabel)} ↗</a>` : esc(r.sourceLabel);
@@ -69,7 +80,7 @@ export function initActions({ api, $, esc, ago, toast, openAgent, projects = ()
69
80
  : `<button class="small" data-act-discuss="${esc(r.id)}" title="Talk it through with Claude: what it asks, and what to do (c)">💬 Discuss</button>`;
70
81
  return `<tr data-row-id="${esc(r.id)}" class="action-${esc(r.status)}">
71
82
  <td class="issue-action"><select data-act-state="${esc(r.id)}" class="act-${esc(r.status === 'assign' ? 'none' : r.status)}" aria-label="Your decision">${opts}</select></td>
72
- <td><div class="action-text">${esc(r.text)}</div>${r.context ? `<div class="issue-synopsis" title="${esc(r.context)}">${esc(r.context)}</div>` : ''}<div class="hint action-meta">${meta}</div></td>
83
+ <td>${r.kind === 'question' ? `<span class="tag">${r.cc ? "CC'd" : 'Asked you'}</span> ` : ''}<div class="action-text">${esc(r.kind === 'question' ? r.question : r.text)}</div>${r.context ? `<div class="issue-synopsis" title="${esc(r.context)}">${esc(r.context)}</div>` : ''}<div class="hint action-meta">${meta}${r.snoozeUntil ? ` · until ${esc(new Date(r.snoozeUntil).toLocaleString([], { weekday: 'short', hour: 'numeric', minute: '2-digit' }))}` : ''}</div>${r.kind === 'question' ? answerHtml(r) : ''}</td>
73
84
  <td class="nowrap">${talk}${agent ? `<div class="hint">Agent: ${agent}</div>` : ''}</td>
74
85
  </tr>`;
75
86
  }
@@ -80,7 +91,7 @@ export function initActions({ api, $, esc, ago, toast, openAgent, projects = ()
80
91
  body.innerHTML = '<p class="hint">Loading…</p>';
81
92
  return;
82
93
  }
83
- const inGroup = (r, g) => (g === 'all' ? r.group !== 'removed' : r.group === g);
94
+ const inGroup = (r, g) => (g === 'all' ? r.group !== 'removed' : g === 'questions' ? r.kind === 'question' && r.group === 'open' : r.group === g);
84
95
  const count = (g) => data.rows.filter((r) => inGroup(r, g)).length;
85
96
  const rows = data.rows.filter((r) => inGroup(r, filter));
86
97
  const f = data.features ?? {};
@@ -95,12 +106,12 @@ export function initActions({ api, $, esc, ago, toast, openAgent, projects = ()
95
106
  <option value="">pick a project</option>
96
107
  ${list.map((p) => `<option value="${esc(p.key)}" ${p.key === project ? 'selected' : ''}>${esc(p.name ?? p.key)}</option>`).join('')}
97
108
  </select></label>
98
- ${['skipped', 'done', 'removed'].includes(filter) && rows.length ? `<button class="small" data-act="back-all" title="Every one here back to open, undecided">Bring all ${rows.length} back</button>` : ''}
109
+ ${['skipped', 'snoozed', 'done', 'removed'].includes(filter) && rows.length ? `<button class="small" data-act="back-all" title="Every one here back to open, undecided">Bring all ${rows.length} back</button>` : ''}
99
110
  <button class="small" data-act="refresh" title="Look again (r)">↻</button>
100
111
  ${expandButton(dialog)}
101
112
  <button class="small" data-act="close" title="Close (Esc)">Close</button>
102
113
  </div>
103
- <p class="hint">What's asked of you in ${esc(from || 'Slack and meeting notes')}, found by the assistant on its checks. Decide on the left; <b>Discuss</b> talks one through with Claude. Keys: j/k move, a assign, s skip, d done, x remove, o open again, c discuss, Enter opens the source, f bigger.</p>
114
+ <p class="hint">What's asked of you in ${esc(from || 'Slack and meeting notes')}, found by the assistant on its checks. Decide on the left; <b>Discuss</b> talks one through with Claude. Questions put to you come with a drafted answer to edit, copy and send yourself. Keys: j/k move, a assign, s skip, z snooze, d done, x remove, o open again, c discuss, Enter opens the source, f bigger.</p>
104
115
  ${rows.length
105
116
  ? `<div class="issues-scroll"><table class="issues actions-table">
106
117
  <thead><tr><th class="issue-action">Decision</th><th>Action</th><th></th></tr></thead>
@@ -124,7 +135,7 @@ export function initActions({ api, $, esc, ago, toast, openAgent, projects = ()
124
135
  // What each was before, to take the change back.
125
136
  const before = new Map(ids.map((id) => [id, data?.rows.find((x) => x.id === id)?.status ?? 'open']));
126
137
  try {
127
- const r = await api('POST', '/actions/set', { ids, state, project: project || null });
138
+ const r = await api('POST', '/actions/set', { ids, state, project: project || null, ...(state === 'snooze' ? { until: tomorrow9() } : {}) });
128
139
  const bad = r.failed.map((x) => x.reason).join('; ');
129
140
  const label = STATES.find(([v]) => v === state)?.[1] ?? state;
130
141
  const msg = r.started.length ? `Agent ${r.started.map((x) => x.agent.name).join(', ')} started` : bad ? `Not changed: ${bad}` : state === 'open' ? (ids.length > 1 ? `${r.set.length} open again` : 'Open again') : label;
@@ -139,6 +150,34 @@ export function initActions({ api, $, esc, ago, toast, openAgent, projects = ()
139
150
  load();
140
151
  }
141
152
 
153
+ /** Tomorrow at 9 in the morning. */
154
+ function tomorrow9() {
155
+ const t = new Date();
156
+ t.setDate(t.getDate() + 1);
157
+ t.setHours(9, 0, 0, 0);
158
+ return t.toISOString();
159
+ }
160
+
161
+ async function answerAct(id, what) {
162
+ const r = data?.rows.find((x) => x.id === id);
163
+ if (!r) return;
164
+ try {
165
+ if (what === 'edit') return (editing = id), render();
166
+ if (what === 'cancel') return (editing = null), render();
167
+ if (what === 'copy') {
168
+ const ok = await navigator.clipboard?.writeText(r.answer?.text ?? '').then(() => true, () => false);
169
+ return toast?.(ok ? 'Copied: paste it in the thread' : "Couldn't copy: select the text instead", 3000, r.link ? { label: 'Open thread', run: () => window.open(r.link, '_blank', 'noopener') } : undefined);
170
+ }
171
+ if (what === 'draft') {
172
+ const x = await api('POST', `/actions/${id}/draft`, {});
173
+ toast?.(x.existing ? 'A session is drafting it already' : 'Drafting: a session reads the thread and finds the answer', 5000, { label: 'Watch', run: () => (dialog.close(), openAgent(x.agent.id)) });
174
+ }
175
+ } catch (e) {
176
+ toast?.(e.message, 6000);
177
+ }
178
+ load();
179
+ }
180
+
142
181
  /** Set each action back to what it was: [[id, status]]. */
143
182
  async function undoTo(pairs) {
144
183
  for (const state of new Set(pairs.map(([, st]) => st))) {
@@ -164,6 +203,7 @@ export function initActions({ api, $, esc, ago, toast, openAgent, projects = ()
164
203
  s: (r) => set([r.dataset.rowId], 'skip'),
165
204
  d: (r) => set([r.dataset.rowId], 'done'),
166
205
  x: (r) => set([r.dataset.rowId], 'remove'),
206
+ z: (r) => set([r.dataset.rowId], 'snooze'),
167
207
  o: (r) => set([r.dataset.rowId], 'open'),
168
208
  c: (r) => discuss(r.dataset.rowId),
169
209
  Enter: (r) => r.querySelector('.action-meta a')?.click(),
@@ -185,7 +225,24 @@ export function initActions({ api, $, esc, ago, toast, openAgent, projects = ()
185
225
  }
186
226
  });
187
227
 
228
+ body.addEventListener('submit', async (e) => {
229
+ const f = e.target.closest('[data-act-edit]');
230
+ if (!f) return;
231
+ e.preventDefault();
232
+ document.activeElement?.blur?.();
233
+ try {
234
+ await api('PUT', `/actions/${f.dataset.actEdit}/answer`, { text: f.querySelector('textarea').value });
235
+ editing = null;
236
+ toast?.('Answer saved', 2000);
237
+ } catch (err) {
238
+ return toast?.(err.message, 6000);
239
+ }
240
+ load();
241
+ });
242
+
188
243
  body.addEventListener('click', (e) => {
244
+ const an = e.target.closest('[data-act-answer]');
245
+ if (an) return answerAct(e.target.closest('tr[data-row-id]')?.dataset.rowId, an.dataset.actAnswer);
189
246
  const o = e.target.closest('[data-act-open]');
190
247
  if (o) {
191
248
  dialog.close();
package/public/app.js CHANGED
@@ -227,6 +227,7 @@ const issuesUi = initIssues({
227
227
  toast: (m, ms, a) => toast(m, ms, a),
228
228
  openAgent: (id) => (showTab('agents'), select(id)),
229
229
  openDoc: (id, kind) => (showTab('agents'), select(id), openDoc(id, kind)),
230
+ openChanges: (id) => (showTab('agents'), select(id), reviewUi.open(id)),
230
231
  });
231
232
  $('#issues-btn').onclick = () => issuesUi.open();
232
233
  // Actions: what's asked of you in Slack and meeting notes.
@@ -264,7 +265,8 @@ const todayUi = initToday({
264
265
  openActions: () => actionsUi.open(),
265
266
  openIssues: () => issuesUi.open(),
266
267
  openReviews: () => reviewsUi.open(),
267
- openBugs: () => bugsUi.open({ show: 'open' }),
268
+ openBugs: (show = 'open') => bugsUi.open({ show }),
269
+ openChanges: (id) => (showTab('agents'), select(id), reviewUi.open(id)),
268
270
  });
269
271
  $('#today-btn').onclick = () => todayUi.open();
270
272
  // Designs: every agent's design doc, the ones waiting for your review first.
package/public/bughunt.js CHANGED
@@ -1,7 +1,8 @@
1
1
  // Bugs: what background bug hunts found, checked, worst first; and the hunts themselves (a project
2
2
  // or a folder of it, recent changes or the whole module, by hand or every night, with a cost
3
3
  // limit per run). Each finding opens to its evidence; Fix starts an agent on it, File it opens a
4
- // filled-in issue, Not a bug keeps it from coming back, Snooze hides it until later.
4
+ // filled-in issue, Not a bug keeps it from coming back, Snooze hides it until later. A hunt can
5
+ // fix the serious ones itself: those come as draft pull requests, under Draft PRs.
5
6
 
6
7
  import { holdWhilePicking, rowKeys } from './rowkeys.js';
7
8
  import { expandButton, expandable } from './expand.js';
@@ -10,9 +11,11 @@ const SAVED = 'agentmgr.bugsFilter';
10
11
  const FILTERS = [
11
12
  ['open', 'Open'],
12
13
  ['fixing', 'Fixing'],
14
+ ['pr', 'Draft PRs'],
13
15
  ['snoozed', 'Snoozed'],
14
16
  ['filed', 'Filed'],
15
17
  ['notbug', 'Not a bug'],
18
+ ['done', 'Done'],
16
19
  ['dropped', 'Not kept'],
17
20
  ['hunts', 'Hunts'],
18
21
  ];
@@ -70,9 +73,21 @@ export function initBugHunt({ api, $, esc, ago, toast, openAgent }) {
70
73
  <button class="small" data-bug="file" title="A filled-in issue to submit (i)">File it</button>
71
74
  <button class="small" data-bug="notbug" title="Not a bug: it won't be reported again (x)">Not a bug</button>
72
75
  <select class="small" data-bug-snooze title="Hide it until then (s: tomorrow)"><option value="">Snooze…</option><option value="day">Until tomorrow 9am</option><option value="week">Until Monday 9am</option></select>`
73
- : f.status === 'fixing' && f.fixAgentId
74
- ? `<button class="small" data-bug="open-fix" title="Open the agent fixing it">Open fix</button> <button class="small" data-bug="back" title="Back to open (o)">Bring back</button>`
75
- : `<button class="small" data-bug="back" title="Back to open (o)">Bring back</button>`;
76
+ : f.status === 'pr'
77
+ ? `${f.prUrl ? `<a class="small-link primary-link" href="${esc(f.prUrl)}" target="_blank" rel="noopener" title="The draft pull request: look it over, then mark it ready">Open PR ↗</a>` : ''}
78
+ <button class="small" data-bug="done" title="You looked at it: off the list (d)">Done</button>
79
+ ${f.fixAgentId ? '<button class="small" data-bug="open-fix" title="The session that fixed it">Session</button>' : ''}`
80
+ : f.status === 'fixing' && f.fixAgentId
81
+ ? `<button class="small" data-bug="open-fix" title="Open the agent fixing it">Open fix</button> <button class="small" data-bug="back" title="Back to open (o)">Bring back</button>`
82
+ : `<button class="small" data-bug="back" title="Back to open (o)">Bring back</button>`;
83
+ const auto =
84
+ f.auto?.state === 'fixing'
85
+ ? ' · fixing automatically'
86
+ : f.auto?.state === 'failed'
87
+ ? ` · the automatic fix didn't hold up: ${f.auto.reason}`
88
+ : f.status === 'pr'
89
+ ? ' · fixed automatically: a draft pull request'
90
+ : '';
76
91
  const full =
77
92
  opened === f.id
78
93
  ? `<tr class="bug-detail"><td colspan="3">
@@ -80,18 +95,20 @@ export function initBugHunt({ api, $, esc, ago, toast, openAgent }) {
80
95
  <p><b>Evidence: ${f.evidence.type === 'test' ? 'a failing test' : 'the path through the code'}.</b></p><pre>${esc(f.evidence.detail)}</pre>
81
96
  ${f.evidence.test ? `<p><b>Test.</b></p><pre>${esc(f.evidence.test)}</pre>` : ''}
82
97
  ${f.fix ? `<p><b>Suggested fix.</b> ${esc(f.fix)}</p>` : ''}
98
+ ${f.auto?.check ? `<p class="hint">The fix was reviewed by the AI judge: ${esc(f.auto.check.reason ?? '')} (${Math.round(f.auto.check.confidence * 100)}%).</p>` : ''}
99
+ ${f.issueUrl ? `<p class="hint">Filed: <a href="${esc(f.issueUrl)}" target="_blank" rel="noopener">${esc(f.issueUrl)}</a></p>` : ''}
83
100
  <p class="hint">${f.check ? `Second check: ${f.check.real ? 'holds up' : 'does not hold up'} (${Math.round(f.check.confidence * 100)}%). ${esc(f.check.reason ?? '')}` : 'Second check: not asked (the AI judge is off); kept because a test fails.'} Found ${esc(ago(f.at))} by the ${esc(f.hunt ?? '')} hunt${f.foundBy ? ` · <button class="link" data-bug-agent="${esc(f.foundBy)}">its session</button>` : ''}.</p>
84
101
  </td></tr>`
85
102
  : '';
86
103
  return `<tr data-row-id="${esc(f.id)}" class="bug-${esc(f.severity)}">
87
104
  <td class="nowrap"><span class="bug-sev ${esc(f.severity)}">${esc(SEV[f.severity] ?? f.severity)}</span></td>
88
- <td><div class="today-title">${esc(f.title)}</div><div class="hint">${esc(where(f))}${f.evidence?.type === 'test' ? ' · a test fails' : ''}${f.snoozeUntil ? ` · until ${esc(new Date(f.snoozeUntil).toLocaleString())}` : ''}</div></td>
105
+ <td><div class="today-title">${esc(f.title)}</div><div class="hint">${esc(where(f))}${f.evidence?.type === 'test' ? ' · a test fails' : ''}${esc(auto)}${f.snoozeUntil ? ` · until ${esc(new Date(f.snoozeUntil).toLocaleString())}` : ''}</div></td>
89
106
  <td class="nowrap today-acts">${acts}</td>
90
107
  </tr>${full}`;
91
108
  }
92
109
 
93
110
  function huntForm(h) {
94
- const p = h ?? { focus: 'changes', schedule: 'manual', maxUsd: 5, kinds: [], path: '', project: projects[0]?.shortcut ?? '' };
111
+ const p = h ?? { focus: 'changes', schedule: 'manual', maxUsd: 5, kinds: [], path: '', project: projects[0]?.shortcut ?? '', autoFix: false, fixAt: 'high', fileIssues: false, testCommand: '' };
95
112
  return `<form class="hunt-form alerts-body" data-hunt-form="${esc(h?.id ?? 'new')}">
96
113
  <h3>${h ? `Edit ${esc(h.name)}` : 'New hunt'}</h3>
97
114
  <div class="row three">
@@ -106,6 +123,14 @@ export function initBugHunt({ api, $, esc, ago, toast, openAgent }) {
106
123
  <label>Cost limit per run ($) <input name="maxUsd" type="number" min="0.5" max="500" step="0.5" value="${esc(p.maxUsd)}" /></label>
107
124
  </div>
108
125
  <p class="hint">The hunter reads the code and runs the tests on its own copy; it never commits or pushes. One hunt runs at a time, and it stops at the cost limit.</p>
126
+ <fieldset><legend>Fix automatically</legend>
127
+ <label class="check"><input type="checkbox" name="autoFix" ${p.autoFix ? 'checked' : ''} /> Fix the bugs it finds, from
128
+ <select name="fixAt" class="small">${Object.entries(SEV).map(([k, label]) => `<option value="${k}" ${(p.fixAt ?? 'high') === k ? 'selected' : ''}>${esc(label)}${k === 'critical' ? ' only' : ' and up'}</option>`).join('')}</select>,
129
+ as draft pull requests</label>
130
+ <label>Test command <span class="hint">(optional: run on each fix before its pull request, like npm test)</span><input name="testCommand" value="${esc(p.testCommand ?? '')}" placeholder="npm test" autocomplete="off" /></label>
131
+ <label class="check"><input type="checkbox" name="fileIssues" ${p.fileIssues ? 'checked' : ''} /> When a fix doesn't hold up, file the bug as a GitHub issue <span class="hint">(issues on a public repository are public)</span></label>
132
+ <p class="hint">Each fix is made by its own agent on its own branch: its test must fail before and pass after, the whole suite must pass, and the AI judge (when it's on) reviews the change. Only then is a <b>draft</b> pull request opened; nothing is merged. At most 3 a run, within the cost limit above.</p>
133
+ </fieldset>
109
134
  <div class="dialog-actions"><button type="button" class="ghost" data-bug="cancel-hunt">Cancel</button><button type="submit" class="primary">${h ? 'Save' : 'Add hunt'}</button></div>
110
135
  </form>`;
111
136
  }
@@ -116,7 +141,7 @@ export function initBugHunt({ api, $, esc, ago, toast, openAgent }) {
116
141
  .map((h) => {
117
142
  const last = h.last ? `${h.last.status === 'running' ? 'running now' : `${h.last.kept ?? 0} kept of ${h.last.found ?? 0} new`} · ${ago(h.last.at)}` : 'not run yet';
118
143
  return `<tr data-hunt="${esc(h.id)}">
119
- <td><div class="today-title">${esc(h.name)}</div><div class="hint">${esc(h.focus === 'changes' ? 'recent changes' : `whole module${h.coveredCount ? ` (${h.coveredCount} parts covered)` : ''}`)}${h.kinds.length ? ` · ${esc(h.kinds.join(', '))}` : ''} · ${esc(h.schedule === 'nightly' ? 'nightly' : 'by hand')} · up to $${esc(h.maxUsd)}</div></td>
144
+ <td><div class="today-title">${esc(h.name)}</div><div class="hint">${esc(h.focus === 'changes' ? 'recent changes' : `whole module${h.coveredCount ? ` (${h.coveredCount} parts covered)` : ''}`)}${h.kinds.length ? ` · ${esc(h.kinds.join(', '))}` : ''} · ${esc(h.schedule === 'nightly' ? 'nightly' : 'by hand')} · up to $${esc(h.maxUsd)}${h.autoFix ? ` · fixes ${esc(h.fixAt === 'critical' ? 'critical ones' : `${h.fixAt} and up`)} as draft PRs` : ''}</div></td>
120
145
  <td class="hint">${esc(last)}${h.open ? ` · ${h.open} open` : ''}</td>
121
146
  <td class="nowrap today-acts"><button class="small primary" data-bug="run" ${data.running ? 'disabled title="A hunt is running; one at a time"' : 'title="Start a run now"'}>Hunt now</button> <button class="small" data-bug="edit">Edit</button> <button class="small ${sure === h.id ? 'danger' : ''}" data-bug="delete">${sure === h.id ? 'Delete it?' : 'Delete'}</button></td>
122
147
  </tr>`;
@@ -136,6 +161,7 @@ export function initBugHunt({ api, $, esc, ago, toast, openAgent }) {
136
161
  const empty = {
137
162
  open: data.hunts.length ? 'No open bugs. Hunts add what they find here, worst first.' : 'No bugs yet: set up a hunt under Hunts.',
138
163
  dropped: "Findings the second check didn't confirm. They aren't reported again.",
164
+ pr: 'No draft pull requests. A hunt with Fix automatically on opens one for each bug it fixes and the checks accept.',
139
165
  };
140
166
  body.innerHTML = `
141
167
  <div class="issues-head">
@@ -152,7 +178,7 @@ export function initBugHunt({ api, $, esc, ago, toast, openAgent }) {
152
178
  : rows.length
153
179
  ? `<div class="issues-scroll"><table class="issues today-table"><tbody>${rows.map(findingRow).join('')}</tbody></table></div>`
154
180
  : `<p class="hint issues-empty">${esc(empty[filter] ?? 'None here.')}</p>`}
155
- ${filter === 'hunts' ? '' : '<p class="hint">Keys: j/k move (or click a row), Enter shows the evidence, a fix, i file it, x not a bug, s snooze until tomorrow, o bring back, r look again, [ ] filters, f bigger.</p>'}`;
181
+ ${filter === 'hunts' ? '' : '<p class="hint">Keys: j/k move (or click a row), Enter shows the evidence, a fix, i file it, x not a bug, s snooze until tomorrow, d done (a draft PR looked at), o bring back, r look again, [ ] filters, f bigger.</p>'}`;
156
182
  keys.redraw();
157
183
  }
158
184
  const render = holdWhilePicking(body, draw);
@@ -165,7 +191,7 @@ export function initBugHunt({ api, $, esc, ago, toast, openAgent }) {
165
191
  const before = ids.map((id) => [id, finding(id)?.status, finding(id)?.snoozeUntil]);
166
192
  try {
167
193
  await api('POST', '/findings/set', { ids, status, until });
168
- const label = { open: 'Back on the list', notbug: 'Not a bug: it won\'t be reported again', snoozed: 'Snoozed', filed: 'Marked filed' }[status];
194
+ const label = { open: 'Back on the list', notbug: 'Not a bug: it won\'t be reported again', snoozed: 'Snoozed', filed: 'Marked filed', done: 'Done' }[status];
169
195
  const undo = undoing ? null : { label: 'Undo', run: async () => {
170
196
  for (const [id, st, u] of before) if (st && st !== 'fixing') await decide([id], st, st === 'snoozed' ? u : null, { undoing: true });
171
197
  } };
@@ -199,6 +225,7 @@ export function initBugHunt({ api, $, esc, ago, toast, openAgent }) {
199
225
  }
200
226
  }
201
227
  if (what === 'notbug') return decide([id], 'notbug');
228
+ if (what === 'done') return decide([id], 'done');
202
229
  if (what === 'snooze') return decide([id], 'snoozed', later(extra || 'day'));
203
230
  if (what === 'back') return decide([id], 'open');
204
231
  if (what === 'open-fix' && f.fixAgentId) return dialog.close(), openAgent(f.fixAgentId);
@@ -218,6 +245,7 @@ export function initBugHunt({ api, $, esc, ago, toast, openAgent }) {
218
245
  x: (r) => act(r.dataset.rowId, 'notbug'),
219
246
  s: (r) => act(r.dataset.rowId, 'snooze', 'day'),
220
247
  o: (r) => act(r.dataset.rowId, 'back'),
248
+ d: (r) => act(r.dataset.rowId, 'done'),
221
249
  r: Object.assign(() => load(), { needsRow: false }),
222
250
  },
223
251
  });
@@ -255,8 +283,9 @@ export function initBugHunt({ api, $, esc, ago, toast, openAgent }) {
255
283
  const form = e.target.closest('[data-hunt-form]');
256
284
  if (!form) return;
257
285
  e.preventDefault();
286
+ document.activeElement?.blur?.();
258
287
  const fd = new FormData(form);
259
- const input = { project: fd.get('project'), path: fd.get('path'), name: fd.get('name'), focus: fd.get('focus'), kinds: fd.getAll('kind'), schedule: fd.get('schedule'), maxUsd: Number(fd.get('maxUsd')) };
288
+ const input = { project: fd.get('project'), path: fd.get('path'), name: fd.get('name'), focus: fd.get('focus'), kinds: fd.getAll('kind'), schedule: fd.get('schedule'), maxUsd: Number(fd.get('maxUsd')), autoFix: fd.get('autoFix') === 'on', fixAt: fd.get('fixAt'), fileIssues: fd.get('fileIssues') === 'on', testCommand: fd.get('testCommand') };
260
289
  try {
261
290
  const id = form.dataset.huntForm;
262
291
  await api(id === 'new' ? 'POST' : 'PUT', id === 'new' ? '/hunts' : `/hunts/${id}`, input);
package/public/issues.js CHANGED
@@ -15,18 +15,20 @@ const FILTERS = [
15
15
  ['agent', 'Agents on it'],
16
16
  ['done', 'Done'],
17
17
  ['skipped', 'Skipped'],
18
+ ['snoozed', 'Snoozed'],
18
19
  ['all', 'All'],
19
20
  ['removed', 'Removed'],
20
21
  ];
21
22
  const ACTIONS = [
22
23
  ['assign', 'Assign', 'An agent works on it (assigning one not started yet starts its agent)'],
23
24
  ['skip', 'Skip', 'Not now: under Skipped, and not proposed or started again'],
25
+ ['snooze', 'Snooze', 'Until tomorrow 9am: then back on the list'],
24
26
  ['done', 'Done', 'Handled (by you or elsewhere): under Done'],
25
27
  ['remove', 'Remove', 'Off the list (under Removed, to bring back)'],
26
28
  ];
27
29
  const CHECKS = { passed: ['✓', 'Checks pass'], failed: ['✗', 'Checks failing'], running: ['●', 'Checks running'] };
28
30
 
29
- export function initIssues({ api, $, esc, ago, openAgent, openDoc, toast }) {
31
+ export function initIssues({ api, $, esc, ago, openAgent, openDoc, openChanges, toast }) {
30
32
  const dialog = $('#issues-dialog');
31
33
  const ext = (label, url, title = '') => `<a href="${esc(url)}" target="_blank" rel="noopener" title="${esc(title)}">${esc(label)} ↗</a>`;
32
34
  const body = $('#issues-body');
@@ -118,7 +120,7 @@ export function initIssues({ api, $, esc, ago, openAgent, openDoc, toast }) {
118
120
  return `<tr data-row-id="${esc(r.key)}" class="stage-${esc(r.stage)} action-${esc(r.action)}">${box}${actionCell(r)}
119
121
  <td>${issue}${aboutIssue(r)}</td>
120
122
  <td>${status}</td>
121
- <td class="issue-note">${esc(r.note)}</td>
123
+ <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>
122
124
  <td class="nowrap">${plan}</td>
123
125
  <td class="nowrap">${design}</td>
124
126
  <td>${pr}</td>
@@ -154,7 +156,7 @@ export function initIssues({ api, $, esc, ago, openAgent, openDoc, toast }) {
154
156
  : filter === 'removed'
155
157
  ? 'Nothing removed. Set an issue back to another action here to bring it back.'
156
158
  : 'None here.';
157
- const backAll = ['skipped', 'done', 'removed'].includes(filter) ? setAsideShown().length : 0;
159
+ const backAll = ['skipped', 'snoozed', 'done', 'removed'].includes(filter) ? setAsideShown().length : 0;
158
160
  body.innerHTML = `
159
161
  <div class="issues-head">
160
162
  <h2>Jira</h2>
@@ -189,7 +191,7 @@ export function initIssues({ api, $, esc, ago, openAgent, openDoc, toast }) {
189
191
 
190
192
  /** The issues shown that you skipped, marked done or removed (not those done in Jira). */
191
193
  function setAsideShown() {
192
- const g = { skipped: 'skip', done: 'done', removed: 'remove' }[filter];
194
+ const g = { skipped: 'skip', snoozed: 'snooze', done: 'done', removed: 'remove' }[filter];
193
195
  return (data?.rows ?? []).filter((r) => r.group === filter && r.action === g).map((r) => r.key);
194
196
  }
195
197
  expandable(dialog, draw);
@@ -199,7 +201,7 @@ export function initIssues({ api, $, esc, ago, openAgent, openDoc, toast }) {
199
201
  // What each was before, to take the change back.
200
202
  const before = new Map(keys.map((k) => [k, data?.rows.find((x) => x.key === k)?.action ?? null]));
201
203
  try {
202
- const r = await api('POST', '/issues/action', { keys, action: action || null });
204
+ const r = await api('POST', '/issues/action', { keys, action: action || null, ...(action === 'snooze' ? { until: tomorrow9() } : {}) });
203
205
  for (const k of r.set) ticked.delete(k);
204
206
  const bad = r.failed.map((x) => `${x.key}: ${x.reason}`).join('; ');
205
207
  const label = ACTIONS.find(([v]) => v === action)?.[1] ?? 'Cleared';
@@ -217,6 +219,30 @@ export function initIssues({ api, $, esc, ago, openAgent, openDoc, toast }) {
217
219
  load();
218
220
  }
219
221
 
222
+ /** Tomorrow at 9 in the morning. */
223
+ function tomorrow9() {
224
+ const t = new Date();
225
+ t.setDate(t.getDate() + 1);
226
+ t.setHours(9, 0, 0, 0);
227
+ return t.toISOString();
228
+ }
229
+
230
+ /** Done with no pull request: look at the changes, or open one. */
231
+ async function ship(agentId, what) {
232
+ if (what === 'changes') {
233
+ dialog.close();
234
+ return openChanges?.(agentId);
235
+ }
236
+ try {
237
+ toast?.('Opening its pull request…', 3000);
238
+ const r = await api('POST', `/agents/${agentId}/ship`, {});
239
+ toast?.(r.url ? 'Pull request opened' : 'Pushed', 6000, r.url ? { label: 'Open it', run: () => window.open(r.url, '_blank', 'noopener') } : undefined);
240
+ } catch (e) {
241
+ toast?.(e.message, 8000);
242
+ }
243
+ load();
244
+ }
245
+
220
246
  /** Set each issue back to what it was: [[key, action]]. */
221
247
  async function undoTo(pairs) {
222
248
  for (const action of new Set(pairs.map(([, a]) => a))) {
@@ -232,6 +258,7 @@ export function initIssues({ api, $, esc, ago, openAgent, openDoc, toast }) {
232
258
  s: (r) => setAction([r.dataset.rowId], 'skip'),
233
259
  d: (r) => setAction([r.dataset.rowId], 'done'),
234
260
  x: (r) => setAction([r.dataset.rowId], 'remove'),
261
+ z: (r) => setAction([r.dataset.rowId], 'snooze'),
235
262
  o: (r) => setAction([r.dataset.rowId], null),
236
263
  Enter: (r) => r.querySelector('a.issue-key')?.click(),
237
264
  r: Object.assign(() => load({ fresh: true }), { needsRow: false }),
@@ -277,6 +304,8 @@ export function initIssues({ api, $, esc, ago, openAgent, openDoc, toast }) {
277
304
  }
278
305
 
279
306
  body.addEventListener('click', async (e) => {
307
+ const sh = e.target.closest('[data-issue-ship]');
308
+ if (sh) return ship(sh.dataset.agent, sh.dataset.issueShip);
280
309
  const o = e.target.closest('[data-issue-open]');
281
310
  if (o) {
282
311
  dialog.close();
package/public/keys.js CHANGED
@@ -41,6 +41,8 @@ export const SHORTCUTS = [
41
41
  [['s'], 'Skip', null],
42
42
  [['d'], 'Done', null],
43
43
  [['x'], 'Remove', null],
44
+ [['z'], 'Snooze until tomorrow 9am', null],
45
+ [['1–6'], "Pick one of an agent's answers (Today)", null],
44
46
  [['o'], 'Undecided again (Actions) or clear (Jira)', null],
45
47
  [['c'], 'Discuss it with Claude (Actions)', null],
46
48
  [['Enter'], 'Open the issue or where it was asked', null],
package/public/rowkeys.js CHANGED
@@ -82,7 +82,8 @@ export function holdWhilePicking(body, render) {
82
82
  let waiting = false;
83
83
  const picking = () => {
84
84
  const f = document.activeElement;
85
- return f?.tagName === 'SELECT' && body.contains(f);
85
+ // A menu open, or a box being typed in: drawing again would close it or lose the place.
86
+ return (f?.tagName === 'SELECT' || f?.tagName === 'TEXTAREA' || (f?.tagName === 'INPUT' && !['checkbox', 'radio', 'button', 'submit'].includes(f.type))) && body.contains(f);
86
87
  };
87
88
  body.addEventListener('focusout', () => {
88
89
  if (!waiting) return;
package/public/style.css CHANGED
@@ -1337,3 +1337,16 @@ tr.bug-detail pre { white-space: pre-wrap; max-height: 280px; overflow: auto; pa
1337
1337
  .today-bug .today-label { color: var(--red); }
1338
1338
  #bugs-dialog td.today-acts { white-space: normal; text-align: right; }
1339
1339
  #bugs-dialog td.today-acts > * { margin: 2px 0; }
1340
+
1341
+ /* Answering from the lists */
1342
+ .today-answer { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
1343
+ .today-reply { display: flex; gap: 6px; flex: 1 1 260px; }
1344
+ .today-reply input { flex: 1; min-width: 0; }
1345
+ .today-draft { margin-top: 6px; }
1346
+ .today-draft-text { white-space: pre-wrap; padding: 6px 10px; border-left: 3px solid var(--accent, currentColor); font-size: 13px; }
1347
+ .today-draft-edit { margin-top: 6px; display: grid; gap: 6px; }
1348
+ .today-draft-edit textarea { width: 100%; font: inherit; font-size: 13px; resize: vertical; }
1349
+ .issue-ship { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
1350
+ .today-ask .today-label { color: var(--accent, currentColor); }
1351
+ table.today-table td.today-acts { white-space: normal; text-align: right; width: 34%; }
1352
+ table.today-table td.today-acts > * { margin: 2px 0; }