kaizen-agent 1.49.1 → 1.50.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.
@@ -135,7 +135,7 @@ After the findings, an `## Acceptance` section: one line per criterion,
135
135
  `G-01 PASS: …`, `R-01 CANNOT VERIFY: …`. Never number these lines — numbered lines are
136
136
  read as findings to fix.
137
137
 
138
- End the file with a one-line verdict: `PASS` (nothing at or above medium and no
138
+ End the file with a one-line verdict: `PASS` (no findings and no
139
139
  `CANNOT VERIFY`) or `FINDINGS: <n> critical, <n> high, <n> medium, <n> low`, followed
140
140
  by `; <n> cannot verify` when any criterion was — even when every count is 0, so an
141
141
  open human check never reads as a clean pass.
package/cli/notes.test.ts CHANGED
@@ -224,7 +224,7 @@ test("the side menu is the board's on the notebook, line for line", () => {
224
224
  };
225
225
  for (const [from, to] of [["/* side menu:", "/* end side menu */"], ['<nav class="rail"', "</script>"]] as const)
226
226
  for (const page of ["notes.html", "video.html"]) expect(between(page, from, to)).toBe(between("board.html", from, to));
227
- const syms = (f: string) => ["board", "note", "video", "link", "gear", "side", "sun", "moon"].map((n) => readFileSync(join(root, "web", f), "utf8").split("\n").find((l) => l.startsWith(`<symbol id="i-${n}"`)));
227
+ const syms = (f: string) => ["board", "note", "video", "link", "gear", "side", "sun", "moon", "more"].map((n) => readFileSync(join(root, "web", f), "utf8").split("\n").find((l) => l.startsWith(`<symbol id="i-${n}"`)));
228
228
  expect(syms("notes.html")).toEqual(syms("board.html"));
229
229
  expect(syms("video.html")).toEqual(syms("board.html"));
230
230
  expect(syms("board.html").every(Boolean)).toBe(true);
@@ -82,9 +82,11 @@ test("a row dims while the setting it depends on has it switched off, and a left
82
82
 
83
83
  test("a config still holding git.branch_before_implement keeps its preset", () => {
84
84
  const text = readFileSync(defaults, "utf8");
85
+ expect(inProject(`return value("auto_fix.min_severity")`)).toBe("low");
85
86
  const low = applyPreset(text, "low", text).replace("git:\n", "git:\n branch_before_implement: true\n");
86
87
  expect(detectPreset(low, text)).toBe("low");
87
88
  expect(detectPreset(text, text)).toBe("medium");
89
+ expect(applyPreset(text, "medium", text)).toContain("min_severity: low");
88
90
  });
89
91
 
90
92
  test("a low-preset config saved before review.executor existed still reads as low", () => {
package/cli/settings.ts CHANGED
@@ -38,7 +38,7 @@ export const PRESETS: Record<PresetName, {
38
38
  },
39
39
  medium: {
40
40
  label: "Medium",
41
- hint: "balanced (recommended) — full runner, subagents, plan approval, auto-fix high/critical",
41
+ hint: "balanced (recommended) — full runner, subagents, plan approval, auto-fix all findings",
42
42
  settings: {
43
43
  mode: "approve",
44
44
  runner: "full",
@@ -47,7 +47,7 @@ export const PRESETS: Record<PresetName, {
47
47
  "approvals.review": "false",
48
48
  "approvals.each_file": "false",
49
49
  "auto_fix.enabled": "true",
50
- "auto_fix.min_severity": "high",
50
+ "auto_fix.min_severity": "low",
51
51
  "auto_fix.max_iterations": "2",
52
52
  "git.auto_commit": "false",
53
53
  "git.worktree_per_run": "true",
package/cli/state.test.ts CHANGED
@@ -77,6 +77,17 @@ test("inbox round-trips and ignores malformed lines", () => {
77
77
  expect(readInbox(state).map((l) => l.status)).toEqual(["open", "open", "started", "rejected"]);
78
78
  });
79
79
 
80
+ test("inbox reads a bullet typed by hand as an open idea", () => {
81
+ const dir = mkdtempSync(join(tmpdir(), "kz-inbox-"));
82
+ writeFileSync(join(dir, "inbox.md"), "# Ideas\n- Add dark mode\n* [ ] Faster search\n- done: shipped\n a note\n");
83
+ expect(readInbox(dir).map((l) => [l.status, l.text, l.notes])).toEqual([
84
+ ["open", "Add dark mode", undefined],
85
+ ["open", "Faster search", undefined],
86
+ ["done", "shipped", "a note"],
87
+ ]);
88
+ rmSync(dir, { recursive: true, force: true });
89
+ });
90
+
80
91
  test("boardCards: idea retired once a run's request contains it; started idea sits in planning", () => {
81
92
  const cards = boardCards([state], Date.now());
82
93
  const ideas = cards.filter((k) => k.kind === "idea").map((k) => [k.text, k.column, k.status]);
package/cli/state.ts CHANGED
@@ -823,6 +823,12 @@ export function readInbox(state: string): InboxLine[] {
823
823
  out.push(a ? { status: m[1]!, text: m[2]!.slice(0, a.index).trim(), added: +a[1]! } : { status: m[1]!, text: m[2]!.trim() });
824
824
  continue;
825
825
  }
826
+ // A bullet typed by hand, without a status, is an open idea.
827
+ const b = /^[-*]\s+(?:\[ \]\s+)?(.+)$/.exec(raw);
828
+ if (b) {
829
+ out.push({ status: "open", text: b[1]!.trim() });
830
+ continue;
831
+ }
826
832
  // An indented line belongs to the bullet above it; anything else is noise.
827
833
  const last = out[out.length - 1];
828
834
  if (last && /^\s{2,}\S/.test(raw)) last.notes = (last.notes ? last.notes + "\n" : "") + raw.trim();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaizen-agent",
3
- "version": "1.49.1",
3
+ "version": "1.50.0",
4
4
  "description": "Staged workflow for AI agents — code, writing, research, operations: plan, human approval, build, independent review, bounded fix loop.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -87,9 +87,9 @@ rather than quietly patched.
87
87
 
88
88
  ## What a run decided not to do
89
89
 
90
- Both stops throw things away. The planner's out-of-scope suggestions you did not take,
91
- the low findings nobody fixed, the "later" you said at an approval — all real work, all
92
- previously surviving only in the conversation.
90
+ Some work is intentionally left open: a "later" you said at an approval, a review
91
+ finding the bounded fix loop could not close, or a check only you can verify.
92
+ Unaccepted planner suggestions are not open work unless you explicitly defer them.
93
93
 
94
94
  Kaizen writes them down instead, into `06-backlog.md` inside the run that produced
95
95
  them, so an item sits next to the plan and the review that explain it. You do not
@@ -168,7 +168,7 @@ height, in which case the larger fraction could overflow where the old one did n
168
168
 
169
169
  > `FINDINGS: 0 critical, 0 high, 0 medium, 1 low`
170
170
 
171
- Low is below the default fix threshold, so it was not auto-fixed. It was reported, with
171
+ At the time, low was below the default fix threshold, so it was not auto-fixed. It was reported, with
172
172
  the exact command to settle it when that monitor is next plugged in. The reviewer also
173
173
  left a line in `memory.md`, which every later run in this directory reads:
174
174
 
@@ -203,7 +203,7 @@ the defaults.
203
203
  | `approvals.review` | `false` | Set `true` to add a second human stop after the review; with `auto_fix` on it mostly re-approves a report you are already reading |
204
204
  | `approvals.each_file` | `false` | You want to confirm every single file edit. Maximum control, slowest |
205
205
  | `auto_fix.enabled` | `true` | Set `false` and every finding becomes your decision instead |
206
- | `auto_fix.min_severity` | `high` | Lower to `medium` or `low` to have more auto-fixed; raise findings you see instead of auto-fixing |
206
+ | `auto_fix.min_severity` | `low` | Raise to `medium` or `high` if you want minor findings reported instead of auto-fixed |
207
207
  | `auto_fix.max_iterations` | `2` | Fix/recheck rounds before whatever is left is escalated to you |
208
208
  | `review.memory_max_lines` | `100` | The cap on `memory.md`, which every stage of every run reads. Raise only if the lessons are genuinely all load-bearing |
209
209
  | `git.auto_commit` | `false` | `true` commits the files a run changed when it is done, by path. Never pushes |
@@ -104,13 +104,9 @@ A tool that charges the same for a typo and a payroll change gets turned off for
104
104
 
105
105
  **Small changes take the short path.** Where the approved plan touches roughly two
106
106
  files or fifty lines, run the stages in this session (`runner: lite`, below)
107
- rather than dispatching them, then stop after the review: report the findings and let
108
- the user choose, rather than entering the fix loop. The loop
109
- exists because a fix to something intricate can be worse than the defect — it is not
110
- worth two more stages to confirm a one-line message now reads correctly. A finding at
111
- `high` or above still enters the fix loop whatever the run's size, since that
112
- severity is the loop's whole reason for existing — on the same runner, which is fixed
113
- at intake.
107
+ rather than dispatching them. Keep the plan and review brief, then apply the same
108
+ bounded fix loop to review findings. Small size does not leave a finding for a later
109
+ run when it can be fixed within this one.
114
110
 
115
111
  **Short work still gets a run.** A one-line change is not skipped past the stages: the card on the board moves through plan, build and review like any other. Run it with `runner: lite` and the short path above — a brief plan, the build, a short review — so the cost stays small and the run stays visible.
116
112
 
@@ -171,10 +167,10 @@ When the reviewer reports findings, behavior depends on config:
171
167
  decision, listed by the reviewer's number so the user can name a subset. Nothing is
172
168
  fixed automatically.
173
169
  - `auto_fix.enabled: true` — the builder fixes findings at or above
174
- `auto_fix.min_severity` (default `high`), the reviewer re-checks, repeating up to
175
- `auto_fix.max_iterations` (default 2). Findings below the threshold, and anything
176
- still open when iterations run out, are reported to the user rather than silently
177
- dropped.
170
+ `auto_fix.min_severity` (default `low`, so every finding), the reviewer re-checks,
171
+ repeating up to `auto_fix.max_iterations` (default 2). Findings below a configured
172
+ higher threshold, and anything still open when iterations run out, are reported to
173
+ the user rather than silently dropped.
178
174
 
179
175
  Every iteration is written to `runs/<id>/05-iterations/` so the loop is auditable.
180
176
 
@@ -182,9 +178,9 @@ Every iteration is written to `runs/<id>/05-iterations/` so the loop is auditabl
182
178
 
183
179
  Each run keeps its own backlog at `runs/<id>/06-backlog.md`. You write it, in the main
184
180
  thread, at two writes that already happen: `02-approval.md` at the plan approval
185
- (out-of-scope suggestions not folded into the approved scope, and anything cut at the
186
- approval) and `stage: "done"` at the final approval (findings still open, findings
187
- below the fix threshold, and the builder's out-of-scope notes). No subagent writes it.
181
+ (only work the user explicitly deferred) and `stage: "done"` at the final approval
182
+ (findings still open after the fix loop, unresolved verification, and explicit
183
+ deferrals). Suggestions the user did not request are not backlog items. No subagent writes it.
188
184
  The full rules are in [`spec-main.md`](spec-main.md).
189
185
 
190
186
  `/kaizen status` and `/kaizen backlog`: read [`status.md`](status.md) first and follow
@@ -52,7 +52,7 @@ auto_fix:
52
52
  # true: findings at or above min_severity are fixed and re-reviewed automatically.
53
53
  enabled: true
54
54
  # critical | high | medium | low
55
- min_severity: high
55
+ min_severity: low
56
56
  # Fix/recheck rounds before remaining findings are escalated to the user. Each round
57
57
  # is a full builder pass plus a full reviewer pass, so this is the most expensive
58
58
  # knob in the file. A third round rarely closes what two could not.
@@ -74,8 +74,8 @@ review:
74
74
  memory_max_lines: 100
75
75
 
76
76
  backlog:
77
- # Capture what a run deliberately did not do: out-of-scope suggestions the user did
78
- # not take, findings below the fix threshold, and debts deferred at an approval.
77
+ # Capture work explicitly deferred, unresolved findings after the bounded fix loop,
78
+ # and verification the user still needs to settle.
79
79
  # Written by the main thread at the plan approval and again at the final approval.
80
80
  enabled: true
81
81
 
@@ -6,16 +6,16 @@ the final approval. No subagent reads this file.
6
6
  ---
7
7
  ## Backlog
8
8
 
9
- Every run produces work it deliberately does not do. Four sources, all already
10
- written down by the time a run ends:
9
+ Some runs leave work deliberately unresolved. Capture only:
11
10
 
12
- 1. Out of scope suggestions the planner listed and the user did not fold into the
13
- approved scope.
14
- 2. Findings below `auto_fix.min_severity`, and findings the fix loop could not close.
15
- 3. Debts deferred at an approval because they fell outside the approved scope.
16
- 4. Criteria the reviewer answered `CANNOT VERIFY` that the user did not settle.
11
+ 1. Work the user explicitly deferred at an approval.
12
+ 2. Findings still open after the bounded fix loop, or below a configured higher
13
+ `auto_fix.min_severity` that the user chose not to fix.
14
+ 3. Criteria the reviewer answered `CANNOT VERIFY` that the user did not settle.
17
15
 
18
- Without capture these survive only in the conversation that produced them.
16
+ Planner suggestions and builder notes outside the approved scope are reported, but
17
+ are not backlog items unless the user explicitly defers them. Without capture,
18
+ unresolved work would survive only in the conversation that produced it.
19
19
 
20
20
  `backlog.enabled: false` skips both capture points — the `02-approval.md` append at
21
21
  plan approval and the `06-backlog.md` append at final approval — for that run. The run
@@ -69,8 +69,8 @@ unconditionally:
69
69
 
70
70
  | Capture point | Stage | What gets appended |
71
71
  |---|---|---|
72
- | Writing `02-approval.md`, when the decision is an approval | Plan approval | Every out-of-scope suggestion not folded into the approved scope, and anything cut from scope at the approval |
73
- | Setting `stage: "done"` | Final approval | Findings still open, findings below the fix threshold, and out-of-scope notes the builder wrote into `03-impl.md` |
72
+ | Writing `02-approval.md`, when the decision is an approval | Plan approval | Only work the user explicitly deferred |
73
+ | Setting `stage: "done"` | Final approval | Unresolved findings and `CANNOT VERIFY` criteria, plus explicit deferrals not already recorded |
74
74
 
75
75
  Neither is optional and neither is a separate step to remember — a run cannot finish
76
76
  without touching both files.
@@ -158,11 +158,13 @@ touched, and goes to the backlog as `open` like any other deferred item. This is
158
158
  same granularity the fix loop already works at; the only change is that the user
159
159
  picks the subset instead of accepting or declining the whole review.
160
160
 
161
- Before setting `stage: "done"`, append the same categories just reported — findings
162
- still open, findings below the fix threshold, `CANNOT VERIFY` criteria the user did
163
- not settle, and the builder's out-of-scope notes from `03-impl.md` — to `runs/<id>/06-backlog.md`, each as `open`, in the format
164
- given in *Backlog* above. Every input is already assembled at this moment; the only
165
- change is that it is written down rather than spoken and discarded.
161
+ Before setting `stage: "done"`, append findings still open after the fix loop,
162
+ findings below a configured higher fix threshold that the user chose not to fix,
163
+ `CANNOT VERIFY` criteria the user did not settle, and work explicitly deferred at
164
+ the final approval to `runs/<id>/06-backlog.md`, each as `open`, in the format given
165
+ in *Backlog* above. Check existing entries and do not append a duplicate. Builder
166
+ notes outside the approved scope are reported, but are not filed without an explicit
167
+ deferral.
166
168
 
167
169
  Set `stage: "done"` in `state.json` once the user accepts.
168
170
 
@@ -203,7 +205,7 @@ that records the approval files increments 2 to N, in order, from the project fo
203
205
  kept in the text where it has one. Increment 1 is this run's own build. Nothing starts
204
206
  by itself: the user starts an increment from its card when they choose, and the parent's
205
207
  card lists its children with their status. An increment cut at the approval is not
206
- filed; it goes to the backlog like anything else cut there.
208
+ filed; it goes to the backlog only when the user explicitly defers it.
207
209
 
208
210
  ## Discovery rounds
209
211
 
@@ -292,12 +292,12 @@ goal goes back through the planner instead.
292
292
 
293
293
  Write the outcome to `02-approval.md`: decision, reason, timestamp, and any
294
294
  modification the user asked for. When the decision is an approval — full or partial —
295
- the same write appends to `runs/<id>/06-backlog.md` every out-of-scope suggestion that
296
- was not folded into the approved scope, plus anything cut from scope at this approval,
297
- each as `open` — see *Backlog* below for the format. The backlog is a candidate list,
298
- not a commitment list, so silence at the approval captures the item rather than losing
299
- it. A rejection appends nothing: there is no approved scope yet to measure against, and
300
- the approval of the revised plan is what captures the items, once.
295
+ the same write appends to `runs/<id>/06-backlog.md` only work the user explicitly
296
+ deferred, each as `open` — see *Backlog* below for the format. An unaccepted
297
+ out-of-scope suggestion is not a backlog item merely because it appeared in the plan;
298
+ silence is not a request to do it later. A rejection appends nothing: there is no
299
+ approved scope yet to measure against, and the approval of the revised plan is what
300
+ captures any explicit deferral, once.
301
301
 
302
302
  **A rejection is one of two different things, and the reason says which.** "Do it
303
303
  differently" is a revise: hand the file back to the planner with the reason, it
@@ -119,8 +119,8 @@ suspicions, never criteria: a criterion that cannot be settled is `CANNOT VERIFY
119
119
  not silence. No praise, no summary of what the code does, no style nits that do not
120
120
  change meaning.
121
121
 
122
- The file ends with one verdict line: `PASS` when no finding is at or above medium
123
- and no criterion is `CANNOT VERIFY`; otherwise
122
+ The file ends with one verdict line: `PASS` when there are no findings and no
123
+ criterion is `CANNOT VERIFY`; otherwise
124
124
  `FINDINGS: <n> critical, <n> high, <n> medium, <n> low`, followed by
125
125
  `; <n> cannot verify` when any criterion was — even when every count is 0, so an open
126
126
  human check never reads as a clean pass.
@@ -68,9 +68,9 @@ request itself was wrong: set `stage: "abandoned"` and stop, nothing to revise t
68
68
  ## Fix loop
69
69
 
70
70
  - `auto_fix.enabled: false` — every finding stops the run, becomes a user decision.
71
- - `auto_fix.enabled: true` — builder fixes findings at or above `auto_fix.min_severity`,
72
- reviewer re-checks, up to `auto_fix.max_iterations` rounds. Findings below threshold,
73
- and anything still open when iterations run out, are reported to the user.
71
+ - `auto_fix.enabled: true` — builder fixes findings at or above `auto_fix.min_severity`
72
+ (default `low`, all findings), reviewer re-checks, up to `auto_fix.max_iterations`
73
+ rounds. Anything still open when iterations run out is reported to the user.
74
74
 
75
75
  Each iteration is written to `runs/<id>/05-iterations/`.
76
76
 
@@ -87,7 +87,7 @@ Each iteration is written to `runs/<id>/05-iterations/`.
87
87
  | `build.executor` | `subagent` | Who builds: `subagent`, `inline` (main thread), or `ask` at the approval |
88
88
  | `review.executor` | `inline` | Lite only — who reviews: `inline` (this session), `subagent` (cold agent), or `ask` |
89
89
  | `auto_fix.enabled` | `true` | Auto-fix findings vs. escalate everything |
90
- | `auto_fix.min_severity` | `high` | Threshold for auto-fix (`critical\|high\|medium\|low`) |
90
+ | `auto_fix.min_severity` | `low` | Threshold for auto-fix (`critical\|high\|medium\|low`) |
91
91
  | `auto_fix.max_iterations` | `2` | Fix/recheck rounds before escalating remaining findings |
92
92
  | `review.write_memory` | `true` | Let the reviewer append lessons to `.kaizen/memory.md` |
93
93
  | `backlog.enabled` | `true` | Capture what a run deliberately did not do |
@@ -113,7 +113,8 @@ this skill's `config.default.yml`.
113
113
 
114
114
  ## Backlog and status
115
115
 
116
- Backlog items: `- <status>: <item text>`, `<status>` one of `open`, `done`, `rejected`
116
+ Backlog records explicit deferrals and findings still unresolved after the fix loop,
117
+ not every out-of-scope suggestion. Items: `- <status>: <item text>`, `<status>` one of `open`, `done`, `rejected`
117
118
  (`rejected` carries a reason after `|`). `/kaizen backlog`/`status` are **read-only** —
118
119
  never edit `06-backlog.md` or `state.json`, even to fix a spotted inconsistency; report
119
120
  it and ask.
@@ -25,8 +25,8 @@ export async function resume(c, b) {
25
25
  }
26
26
  }
27
27
  export const APPROVAL = {
28
- "approvals.plan": "The plan is ready. Read it in the Plan tab, then approve or send it back.",
29
- "approvals.review": "The work is ready to check. Approve to finish it, or revise with what to change.",
28
+ "approvals.plan": "Read the plan, then: Approve starts the build; Revise sends it back with what to change.",
29
+ "approvals.review": "The work is ready to check. Approve finishes it; Revise sends it back with what to change.",
30
30
  findings: "The review has open findings. Approve as-is to accept them and finish, or fix selected findings first.",
31
31
  },
32
32
  decided = new Set(),
@@ -170,7 +170,7 @@ function card(c) {
170
170
  : "";
171
171
  el.innerHTML =
172
172
  (pick ? html`<input type="checkbox" class="pick" ${raw(picked.has(k) ? "checked" : "")} aria-label="Select">` : "") +
173
- html`<div class="c-id"><span class="st d-${st}" role="img" title="${sttl}" aria-label="${sttl}"><svg><use href="#s-${st}"/></svg></span><span class="idt">${idt}</span><span class="age">${c.kind === "run" ? age(c.moved || store.S.now, store.S.now) : ""}</span><button class="ib sm more" data-a="menu" title="Actions" aria-label="Actions" aria-haspopup="menu" aria-expanded="${String(k === store.menuKey)}">${ico("more")}</button></div>
173
+ html`<div class="c-id"><span class="st d-${st}" role="img" title="${sttl}" aria-label="${sttl}"><svg><use href="#s-${st}"/></svg></span><span class="idt"${c.kind === "run" && c.title ? html` title="${c.title}"` : ""}>${idt}</span><span class="age">${c.kind === "run" ? age(c.moved || store.S.now, store.S.now) : ""}</span><button class="ib sm more" data-a="menu" title="Actions" aria-label="Actions" aria-haspopup="menu" aria-expanded="${String(k === store.menuKey)}">${ico("more")}</button></div>
174
174
  <div class="c-title"${c.kind === "idea" && brief(c.text).parts.length ? html` title="${c.text}"` : ""}>${c.kind === "idea" ? brief(c.text).head : c.title || c.id}</div>
175
175
  ${act}
176
176
  ${chips.length || marks.length ? html`<div class="c-foot"><span class="c-chips">${chips}</span><span class="c-marks">${marks}</span></div>` : ""}`;
@@ -466,7 +466,7 @@ async function startRun(c, kind) {
466
466
  load();
467
467
  }
468
468
 
469
- const HINT = { 1: "Ideas you run are planned here", 2: "Approved plans are built here", 3: "Finished builds are checked here" };
469
+ const HINT = { 0: "Add an idea to start a run", 1: "Ideas you run are planned here", 2: "Approved plans are built here", 3: "Finished builds are checked here" };
470
470
 
471
471
  // The new-idea form, wired into f: inline at the top of Ideas, or in a modal.
472
472
  function ideaForm(f, close) {
@@ -703,7 +703,7 @@ export function render() {
703
703
  ]
704
704
  .map(
705
705
  ([v, l, svg, k]) =>
706
- `<button role="tab" aria-selected="${String(ideasTab === v)}" data-t="${v}" title="${l}" aria-label="${l}, ${k}">${svg}<i>${k}</i></button>`,
706
+ `<button role="tab" aria-selected="${String(ideasTab === v)}" data-t="${v}" title="${l}" aria-label="${l}, ${k}">${svg}${ideasTab === v ? `<b>${l.split(":")[0]}</b>` : ""}<i>${k}</i></button>`,
707
707
  )
708
708
  .join("")}</span>`
709
709
  : `${name}<i>${list.length || ""}</i>`;
@@ -858,7 +858,7 @@ export function render() {
858
858
  ul.appendChild(li);
859
859
  }
860
860
  // An empty middle column says what lands in it, so it does not look broken.
861
- if (!list.length && ci >= 1 && ci <= 3 && cs.length && !filter && !q && !archive)
861
+ if (!list.length && ci <= 3 && !bl && cs.length && !filter && !q && !archive)
862
862
  ul.innerHTML = `<li class="hint">${HINT[ci]}</li>`;
863
863
  if (bl && !list.length && !filter && !q)
864
864
  ul.innerHTML = `<li class="hint">${sev ? "Nothing at this severity" : "What finished runs left undone shows here"}</li>`;
@@ -324,7 +324,7 @@ export async function openSources() {
324
324
  )}`,
325
325
  )
326
326
  : ""}`;
327
- const bar = html`<div class="ice-bar">${order.length ? html`<input type="checkbox" id="ice-all" aria-label="Select every request shown"${nSel && nSel === order.length ? " checked" : ""}>` : ""}<span class="count">${iceCat === "Dismissed" || iceCat === "Done" ? `${order.length} ${iceCat.toLowerCase()}` : `${order.length < waiting ? `${order.length} of ${waiting}` : waiting} waiting`}</span><span class="end"></span>${String(chips) ? html`<details class="ice-filt"><summary class="ib${iceCat || iceSrc ? " on" : ""}" aria-label="Filter requests" title="Filter requests">${ico("filter")}</summary><div class="ice-fpop">${chips}</div></details>` : ""}<button class="btn ghost sm" id="ice-new" title="Add a request by hand">${ico("plus")} Add</button><button class="btn sm" id="src-go"${list.length ? "" : " disabled"}>${ico("refresh")} Gather all</button><button class="btn ghost sm" id="src-tog" aria-expanded="${String(srcShow ?? !list.length)}" aria-controls="src-sec">${ico("link")} Sources · ${list.length}</button></div>`;
327
+ const bar = html`<div class="ice-bar">${order.length ? html`<input type="checkbox" id="ice-all" aria-label="Select every request shown"${nSel && nSel === order.length ? " checked" : ""}>` : ""}<span class="count">${iceCat === "Dismissed" || iceCat === "Done" ? `${order.length} ${iceCat.toLowerCase()}` : `${order.length < waiting ? `${order.length} of ${waiting}` : waiting} waiting`}</span><span class="end"></span>${String(chips) ? html`<details class="ice-filt"><summary class="ib${iceCat || iceSrc ? " on" : ""}" aria-label="Filter requests" title="Filter requests">${ico("filter")}</summary><div class="ice-fpop">${chips}</div></details>` : ""}<button class="btn ghost sm" id="ice-new" title="Add a request by hand">${ico("plus")} Add</button><button class="btn sm" id="src-go"${list.length ? "" : " disabled"}>${ico("refresh")} Gather all</button><button class="btn ghost sm" id="src-tog" aria-expanded="${String(!!srcShow)}" aria-controls="src-sec">${ico("link")} Sources · ${list.length}</button></div>`;
328
328
  const bulk = iceSel.size
329
329
  ? html`<div class="ice-bulk" role="toolbar" aria-label="Selected requests"><span>${iceSel.size} selected</span><span class="end"></span><button class="btn sm" id="ice-bp" title="Promote (p)">${ico("plus")} Promote</button><button class="btn ghost sm" id="ice-bd" title="Dismiss (d)">${ico("x")} Dismiss</button><button class="btn ghost sm" id="ice-bc" title="Clear selection (Esc)">Clear</button></div>`
330
330
  : "";
@@ -362,10 +362,10 @@ export async function openSources() {
362
362
  ? html`<div class="ice-zero"><h4>No matches</h4><p style="margin-top:10px"><button class="btn sm" id="ice-unf">Clear filters</button></p></div>`
363
363
  : order.length
364
364
  ? html`<div class="ice-list">${[...groups].map(([g, ix]) => html`<div class="ice-cat">${g}<i>${ix.length}</i></div>${ix.map(row)}`)}</div>`
365
- : html`<div class="ice-zero"><h4>Nothing waiting</h4></div>`;
366
- // The sources, in the right-hand drawer: shut until asked for, open by itself while there
367
- // are none until closed. Slid in only when opened; a rebuild while open shows it in place.
368
- const drawer = srcShow ?? !list.length,
365
+ : html`<div class="ice-zero"><h4>Nothing waiting</h4><p>Requests gathered from your sources wait here until you turn them into ideas.</p>${list.length ? "" : html`<p style="margin-top:10px"><button class="btn sm pri" id="ice-addsrc">${ico("plus")} Add a source</button></p>`}</div>`;
366
+ // The sources, in the right-hand drawer: shut until asked for. Slid in only when opened;
367
+ // a rebuild while open shows it in place.
368
+ const drawer = !!srcShow,
369
369
  slide = drawer && !$("src-sec")?.classList.contains("open");
370
370
  const sec = html`<div class="src-scrim${drawer && !slide ? " on" : ""}" id="src-scrim"></div><aside class="src-sec${drawer && !slide ? " open" : ""}" id="src-sec" aria-label="Sources"${drawer ? "" : " inert"}><header><div class="t"><b>Sources</b><div class="src-chips"><a id="src-to-settings" class="schip" role="button" tabindex="0" title="${d && d.every && d.every !== "off" ? `Checked every ${d.every}` : "Auto-check off"}: change in Settings">${ico("clock")}${d && d.every && d.every !== "off" ? (d.every) : "Off"}</a>${G.connected ? html`<span class="schip on" title="ChatGPT${G.email ? ": " + (G.email) : ""}">${ico("ai")}ChatGPT<a id="cg-out" role="button" tabindex="0" aria-label="Disconnect ChatGPT" title="Disconnect">${ico("x")}</a></span>` : html`<a id="cg-in" class="schip" role="button" tabindex="0" title="Connect ChatGPT">${ico("ai")}ChatGPT</a>`}${(d.google || {}).connected ? html`<span class="schip on" title="Google connected">${ico("google")}Google<a id="gg-out" role="button" tabindex="0" aria-label="Disconnect Google" title="Disconnect">${ico("x")}</a></span>` : html`<a id="gg-in" class="schip" role="button" tabindex="0" title="Connect Google">${ico("google")}Google</a>`}</div></div><div class="src-hda">${list.length ? html`<button class="btn sm" id="src-new" aria-expanded="${String(addOn)}" aria-controls="src-addbox">${ico("plus")} Add</button>` : ""}<button class="ib" id="src-x" aria-label="Close sources" title="Close">${ico("close")}</button></div></header><div class="body">${addBox}${list.length ? html`<div class="src-list">${cards}</div>` : emptyState}</div></aside>`;
371
371
  // First visit: offer the ChatGPT plan for social sources, or keep the agent.
@@ -486,6 +486,7 @@ export async function openSources() {
486
486
  srcShow = true;
487
487
  openSources().then(() => srcShow && $("src-url")?.focus());
488
488
  };
489
+ if ($("ice-addsrc")) $("ice-addsrc").onclick = $("src-tog").onclick;
489
490
  wirePick("ice-fs", (v) => {
490
491
  iceSrc = v;
491
492
  openSources();
@@ -215,13 +215,13 @@ export async function openRun(c, refresh, again) {
215
215
  asks = !pq
216
216
  ? " It has open questions the board cannot show: answer them in the terminal running this run, or approve and your agent asks them."
217
217
  : qs.length
218
- ? ` It asks ${qs.length === 1 ? "one question" : qs.length + " questions"}: Approve opens ${qs.length === 1 ? "it" : "them"}.`
218
+ ? ` Approve first asks you ${qs.length === 1 ? "its question" : "its " + qs.length + " questions"}.`
219
219
  : "";
220
220
  // gitBtn's buttons restyled as menu rows.
221
221
  const more =
222
222
  gitBtn(c).replace(/class="btn( pri)?"/g, "") +
223
223
  `<button data-a="archive">Archive</button><hr><button data-a="ab" class="danger">Abandon</button>`;
224
- foot.innerHTML = html`<span class="note">${sent ? "Sent to your agent." : APPROVAL[c.awaiting] + asks + " Answering here opens a new agent session."}</span><details class="more"><summary class="btn ghost">More</summary><div class="menu-pop">${raw(more)}</div></details>${raw(rs)}<span class="dec"><button class="btn" data-a="revise"${sent ? " disabled" : ""}>Revise</button><button class="btn pri" data-a="approve"${sent ? " disabled" : ""}>${c.awaiting === "findings" ? "Approve as-is" : "Approve"}</button></span>`;
224
+ foot.innerHTML = html`<span class="note">${sent ? "Sent to your agent." : APPROVAL[c.awaiting] + asks}</span><details class="more"><summary class="btn ghost">More</summary><div class="menu-pop">${raw(more)}</div></details>${raw(rs)}<span class="dec"><button class="btn" data-a="revise"${sent ? " disabled" : ""}>Revise</button><button class="btn pri" data-a="approve"${sent ? " disabled" : ""}>${c.awaiting === "findings" ? "Approve as-is" : "Approve"}</button></span>`;
225
225
  } else if (c.status === "waiting")
226
226
  foot.innerHTML = html`<span class="note">Waiting on you: ${need(c.awaiting)}. Answer in the ${c.pty && c.pty.alive ? "terminal (button at the top)" : "terminal running this run"}.</span>${raw(arch)}<button class="btn ghost" data-a="ab">Abandon</button>${raw(rs)}`;
227
227
  else if (c.status === "done") foot.innerHTML = raw(arch + rs);
package/web/board.html CHANGED
@@ -59,6 +59,7 @@ svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.6;stroke
59
59
  [data-rail=min] .theme{flex-direction:column}
60
60
  [data-rail=min] .theme button{width:34px;flex:none}
61
61
  @media(max-width:640px){#fold{display:none}}
62
+ .mtab{display:none}
62
63
  /* phones: the side menu is a bottom tab bar, in the page flow so nothing sits under it; it owns the bottom safe area */
63
64
  @media(max-width:640px){body{flex-direction:column;padding-bottom:0}.app{flex:1;min-height:0}
64
65
  .rail,[data-rail=min] .rail{order:2;width:auto;flex-direction:row;align-items:stretch;gap:0;padding:4px 6px calc(4px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--bg-2);overflow:visible}
@@ -66,6 +67,16 @@ svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.6;stroke
66
67
  .rail a.it,[data-rail=min] .rail a.it{flex:1;width:auto;flex-direction:column;justify-content:center;gap:2px;height:auto;min-height:48px;padding:4px 0;font-size:11px}
67
68
  .rail a.it[aria-current=page]{background:none;color:var(--accent)}
68
69
  [data-rail=min] .rail .lbl{position:static;width:auto;height:auto;overflow:visible;clip-path:none}
70
+ .rail a.it.fold{display:none}
71
+ .mtab{display:flex;flex:1;position:relative}
72
+ .mtab summary{flex:1;list-style:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:48px;padding:4px 0;font-size:11px;font-weight:500;color:var(--dim);cursor:pointer}
73
+ .mtab summary::-webkit-details-marker{display:none}
74
+ .mtab svg{width:18px;height:18px}
75
+ .mtab[open] summary,.rail:has(a.it.fold[aria-current=page]) .mtab summary{color:var(--accent)}
76
+ .mpop{position:absolute;right:0;bottom:calc(100% + 8px);z-index:30;min-width:160px;display:flex;flex-direction:column;padding:6px;background:var(--bg-2);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow-2)}
77
+ .mpop a{display:flex;align-items:center;gap:10px;min-height:44px;padding:0 12px;border-radius:var(--r-s);font-size:14px;color:var(--ink);text-decoration:none}
78
+ .mpop a:hover{background:var(--hover)}
79
+ .rail:has(a.it.fold.upd) .mtab summary{position:relative}.rail:has(a.it.fold.upd) .mtab summary::after{content:"";position:absolute;left:calc(50% + 6px);top:4px;width:8px;height:8px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 2px var(--bg)}
69
80
  body .rail a.upd::after{left:calc(50% + 6px);top:4px}body .toast{left:16px;bottom:calc(68px + env(safe-area-inset-bottom))}}
70
81
  /* end side menu */
71
82
  .rail a.it[data-n]{position:relative}.rail a.it[data-n]::after{content:attr(data-n);position:absolute;left:24px;top:3px;min-width:16px;height:16px;padding:0 4px;box-sizing:border-box;border-radius:8px;background:var(--dim);color:var(--bg);font:600 10px/16px var(--font);text-align:center;box-shadow:0 0 0 2px var(--bg)}
@@ -151,7 +162,7 @@ section h2 .ib{margin-left:auto}
151
162
  .itabs [role=tab]{min-height:26px;padding:0 8px;border:0;border-radius:13px;background:none;color:var(--dim);font:inherit;font-size:12px;cursor:pointer;display:inline-flex;align-items:center;gap:5px}
152
163
  .itabs [role=tab] svg{width:14px;height:14px;stroke-width:1.7}
153
164
  .itabs [role=tab][aria-selected=true]{color:var(--ink);font-weight:500;background:color-mix(in srgb,var(--dim) 14%,transparent)}
154
- .itabs i{font-style:normal}
165
+ .itabs i{font-style:normal}.itabs b{font-weight:inherit}
155
166
  .itabs button:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
156
167
  section h2 .sevf{margin-left:auto}section h2 .sevf~.ib{margin-left:0}
157
168
  section h2 .sevf.on{color:var(--accent);background:color-mix(in srgb,var(--accent) 12%,transparent)}
@@ -191,7 +202,7 @@ section h2 .clear{margin-left:auto;min-height:22px;padding:0 8px}
191
202
  .c-title{font-size:13px;font-weight:500;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:var(--ink)}
192
203
  .c-foot{display:flex;align-items:center;gap:8px;margin-top:2px}
193
204
  .card .act{align-self:flex-start;min-height:24px;padding:0 10px;font-size:12px}
194
- .card.compact{flex-direction:row;align-items:center;gap:8px;padding:7px 12px}.card.compact .c-id{display:contents}.card.compact .idt{display:none}.card.compact .c-title{order:1;flex:1;min-width:0;-webkit-line-clamp:1}.card.compact .age{order:2}.card.compact .more{order:3}.card.compact .c-foot,.card.compact .kids{display:none}
205
+ .card.compact{flex-direction:row;align-items:center;gap:8px;padding:7px 12px}.card.compact .c-id{display:contents}.card.compact .idt{order:1;min-width:0;color:var(--ink)}.card.compact .c-title{display:none}.card.compact .age{order:2}.card.compact .more{order:3}.card.compact .c-foot,.card.compact .kids{display:none}
195
206
  section li.hint{display:block;padding:14px;border:1px dashed var(--line);border-radius:var(--r-s);color:var(--dim);font-size:12px;text-align:center}
196
207
  #bq{width:220px;min-height:30px}
197
208
  .c-chips{display:flex;gap:4px;flex-wrap:wrap;flex:1;min-width:0}
@@ -393,8 +404,8 @@ aside .foot .more .menu-pop{left:0;right:auto;top:auto;bottom:calc(100% + 4px)}.
393
404
  .ice-fpop{position:absolute;right:0;top:calc(100% + 4px);z-index:9;display:flex;flex-direction:column;gap:6px;padding:8px;background:var(--bg-2);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow-2)}.ice-fpop .ice-combo .menu-pop{left:auto;right:0}
394
405
  .ice-bar .count{font-size:13px;font-weight:600;color:var(--ink)}
395
406
  .ice-bar .end{flex:1}
396
- .ice-bar .btn,.ice-bulk .btn,.ice-ra .btn{display:inline-flex;align-items:center;gap:6px}
397
- .ice-bar .btn svg,.ice-bulk .btn svg,.ice-ra .btn svg{width:14px;height:14px}
407
+ .ice-bar .btn,.ice-bulk .btn,.ice-ra .btn,.ice-zero .btn{display:inline-flex;align-items:center;gap:6px}
408
+ .ice-bar .btn svg,.ice-bulk .btn svg,.ice-ra .btn svg,.ice-zero .btn svg{width:14px;height:14px}
398
409
  .ice-bar>input,.ice-row input,.ice-bulk input{accent-color:var(--accent);width:15px;height:15px;margin:0;flex-shrink:0}
399
410
  .ice-bar .ice-sel{width:auto;max-width:170px;height:28px;font-size:12px;padding:2px 26px 2px 8px}
400
411
  @media(max-width:640px){.ice-bar{flex-wrap:wrap}.ice-bar .ice-combo{min-width:0;flex:1 1 40%}.ice-bar .ice-combo>.sel{max-width:none;width:100%}}
@@ -420,7 +431,7 @@ aside .foot .more .menu-pop{left:0;right:auto;top:auto;bottom:calc(100% + 4px)}.
420
431
  .ice-open{display:grid;gap:8px;padding:6px 12px 12px 61px}
421
432
  .ice-zero{padding:40px 16px;text-align:center;border:1px solid var(--line);border-radius:var(--r);background:var(--bg-2)}
422
433
  .ice-zero h4{margin:0 0 6px;font-size:14px;font-weight:600;color:var(--ink)}
423
- .ice-zero p{margin:0;font-size:12px;color:var(--dim);line-height:1.5}
434
+ .ice-zero p{margin:0 auto;font-size:12px;color:var(--dim);line-height:1.5}
424
435
  .ice-open .hint{font-size:12px;color:var(--dim)}
425
436
  /* the sources: the run panel's drawer (aside rules), sliding over the icebox page */
426
437
  body:not(.paged) .src-sec,body:not(.paged) .src-scrim{display:none}
@@ -591,9 +602,10 @@ a.schip:hover{color:var(--ink);border-color:color-mix(in srgb,var(--line) 60%,va
591
602
  <a class="it" href="/?view=icebox" data-view="sources" title="Icebox: requests gathered from your sources"><svg><use href="#i-inbox"/></svg><span class="lbl">Icebox</span></a>
592
603
  <a class="it" href="/" data-view="board" title="Board"><svg><use href="#i-board"/></svg><span class="lbl">Board</span></a>
593
604
  <a class="it" href="/notebook" data-view="notes" title="Notes"><svg><use href="#i-note"/></svg><span class="lbl">Notes</span></a>
594
- <a class="it" href="/video" data-view="video" title="Video: make and edit videos"><svg><use href="#i-video"/></svg><span class="lbl">Video</span></a>
605
+ <a class="it fold" href="/video" data-view="video" title="Video: make and edit videos"><svg><use href="#i-video"/></svg><span class="lbl">Video</span></a>
595
606
  <a class="it" href="/?view=terminal" data-view="terminal" title="Terminal: every agent running in its card"><svg><use href="#i-term"/></svg><span class="lbl">Terminal</span></a>
596
- <a class="it" href="/?view=settings" data-view="settings" title="Settings"><svg><use href="#i-gear"/></svg><span class="lbl">Settings</span></a>
607
+ <a class="it fold" href="/?view=settings" data-view="settings" title="Settings"><svg><use href="#i-gear"/></svg><span class="lbl">Settings</span></a>
608
+ <details class="mtab"><summary title="More"><svg><use href="#i-more"/></svg><span class="lbl">More</span></summary><div class="mpop"><a href="/video" data-view="video"><svg><use href="#i-video"/></svg>Video</a><a href="/?view=settings" data-view="settings"><svg><use href="#i-gear"/></svg>Settings</a></div></details>
597
609
  <span class="end"></span>
598
610
  <div class="theme" role="group" aria-label="Theme"><button data-t="light" title="Light theme"><svg><use href="#i-sun"/></svg><span class="lbl">Light</span></button><button data-t="dark" title="Dark theme"><svg><use href="#i-moon"/></svg><span class="lbl">Dark</span></button></div>
599
611
  </nav>
@@ -614,7 +626,10 @@ a.schip:hover{color:var(--ink);border-color:color-mix(in srgb,var(--line) 60%,va
614
626
  window.setMotion=m=>{if(m==="system")delete r.dataset.motion;else r.dataset.motion=m;try{m==="system"?localStorage.removeItem("kz-motion"):localStorage.setItem("kz-motion",m)}catch(e){}};
615
627
  try{const m=localStorage.getItem("kz-motion");if(m)r.dataset.motion=m}catch(e){}
616
628
  os.addEventListener("change",paint);paint();
617
- document.querySelectorAll(".theme button").forEach(b=>b.onclick=()=>setTheme(b.dataset.t))})();
629
+ document.querySelectorAll(".theme button").forEach(b=>b.onclick=()=>setTheme(b.dataset.t));
630
+ // Phones: More holds the tabs that do not fit; a pick or a tap elsewhere closes it.
631
+ const more=document.querySelector(".mtab");more.querySelectorAll("a").forEach(a=>a.addEventListener("click",()=>more.open=false));
632
+ addEventListener("pointerdown",e=>{if(more.open&&!more.contains(e.target))more.open=false},true)})();
618
633
  </script>
619
634
  <div class="app">
620
635
  <div class="hdr">