create-pmos 0.541.0 → 0.542.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.
Files changed (55) hide show
  1. package/package.json +20 -26
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/adler-moments-test.js +4 -8
  7. package/workspace/briefing-premium-board-test.js +1 -1
  8. package/workspace/briefing-premium-initiative-test.js +1 -1
  9. package/workspace/briefing-premium-sources-test.js +3 -3
  10. package/workspace/briefing-premium-test.js +2 -4
  11. package/workspace/changelog.json +19 -0
  12. package/workspace/ev-everywhere-test.js +3 -3
  13. package/workspace/guide/home.md +22 -9
  14. package/workspace/guide/intelligence-okr-goals.md +1 -1
  15. package/workspace/guide/settings-and-switches.md +1 -0
  16. package/workspace/home-rows-test.js +19 -24
  17. package/workspace/lib/briefing-premium-agent.js +7 -2
  18. package/workspace/lib/cos-chat.js +75 -0
  19. package/workspace/lib/done-feed.js +33 -0
  20. package/workspace/lib/grill-runs.js +1 -1
  21. package/workspace/lib/headless.js +29 -2
  22. package/workspace/lib/loop-health.js +65 -0
  23. package/workspace/lib/proposal-runs.js +1 -1
  24. package/workspace/lib/proposals.js +44 -9
  25. package/workspace/lib/routes-sources.js +2 -0
  26. package/workspace/lib/routes-your-move.js +25 -4
  27. package/workspace/lib/verify-runs.js +22 -1
  28. package/workspace/package-lock.json +2 -2
  29. package/workspace/package.json +1 -1
  30. package/workspace/public/pm/batch-press.js +184 -0
  31. package/workspace/public/pm/bd-fc-card.js +2 -1
  32. package/workspace/public/pm/bd-next.js +2 -1
  33. package/workspace/public/pm/chat-src.js +18 -0
  34. package/workspace/public/pm/cozy-home.css +4 -0
  35. package/workspace/public/pm/cozy-lab-ins.js +17 -1
  36. package/workspace/public/pm/cozy-nav.js +22 -21
  37. package/workspace/public/pm/cozy-search.js +18 -9
  38. package/workspace/public/pm/cozy-today.css +7 -0
  39. package/workspace/public/pm/cozy-viewer.js +1 -1
  40. package/workspace/public/pm/goal-chat.js +1 -1
  41. package/workspace/public/pm/good-morning.js +1 -1
  42. package/workspace/public/pm/home-app.js +65 -14
  43. package/workspace/public/pm/home-chat.js +8 -4
  44. package/workspace/public/pm/home-day.js +46 -14
  45. package/workspace/public/pm/home-today.js +5 -4
  46. package/workspace/public/pm/ini-props.js +7 -2
  47. package/workspace/public/pm/ini-view.css +14 -0
  48. package/workspace/public/pm/move-rank.js +67 -9
  49. package/workspace/public/pm/outbox-view.js +35 -0
  50. package/workspace/public/pm/page-chat.css +2 -0
  51. package/workspace/public/pm/page-chat.js +33 -5
  52. package/workspace/run-tests.js +23 -4
  53. package/workspace/server.js +2 -1
  54. package/workspace/task-links-test.js +6 -2
  55. package/workspace/test-lists/chief-of-staff-chat.json +9 -0
@@ -83,6 +83,8 @@ const boardQ = (pre = '?') => (BOARD ? pre + 'board=' + encodeURIComponent(BOARD
83
83
  const PHONE = 760;
84
84
  const isPhone = () => innerWidth <= PHONE;
85
85
  const SVG = (d, w = 16, sw = 1.8) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
86
+ /** The Everything chip's globe (chief-of-staff C1, board CsA). */
87
+ const GLOBE = 'M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18M3 12h18M12 3c3 3 3 15 0 18M12 3c-3 3-3 15 0 18';
86
88
  const I = {
87
89
  plus: 'M12 5v14M5 12h14', fold: 'M4 5h16v14H4zM9 5v14', chev: 'M9 6l6 6-6 6', down: 'M6 9l6 6 6-6', x: 'M6 6l12 12M18 6L6 18',
88
90
  clock: 'M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18M12 7v5l3 2', flag: 'M5 21V4M5 4h12l-2 4 2 4H5', check: 'M5 12l4.5 4.5L19 7',
@@ -304,6 +306,8 @@ setInterval(() => { if (!document.hidden) load(); }, 300000);
304
306
  let shownAt = Date.now();
305
307
  document.addEventListener('visibilitychange', () => { if (document.hidden || Date.now() - shownAt < 15000) return; shownAt = Date.now(); load(); });
306
308
  window.addEventListener('hm:reload', () => load());
309
+ // Mentions by name (its list row is gone, chief-of-staff C3): Your day's This week row, a reply owed in Your move, or this event
310
+ window.addEventListener('hm:mentions', () => { if (S.day) S.day = false; S.sel = 'mentions'; drawList(); MEN.openMentions(menCtx()); });
307
311
 
308
312
  /* ── the list ── */
309
313
  const dotCls = (st) => ({ needs: 'you', blocked: 'late', working: 'ok run' }[st] || 'none');
@@ -346,7 +350,7 @@ function homeListHtml() {
346
350
  S.M = M;
347
351
  // Adler's ears over the floating button (batch 17 item 4-B, AdP6): the place menu hears how many calls are the PM's
348
352
  { const n = (M.move || []).filter((r) => r.call).length; if (n !== S.calls) { S.calls = n; document.dispatchEvent(new CustomEvent('cz:calls', { detail: { count: n } })); } }
349
- const lg = M.groups.find((g) => g.kind === 'loose'); if (lg) lg.chip = LPV.chipOf();
353
+ // the ✦ chip on "Not in an initiative" is gone (UI grill delete list): Claude's clean-up is a row in Your move (rankIn extra)
350
354
  const R = L.reviewModel(S.D, NOW());
351
355
  // a group is open until the PM folds it; another product starts folded; "Not in an initiative" starts folded on a phone (HvAC, HvACDesk)
352
356
  const pOpen = (g) => (g.key in S.pg ? !!S.pg[g.key] : g.kind === 'loose' ? !isPhone() : g.kind === 'program' || g.primary || M.products.length === 1);
@@ -354,7 +358,7 @@ function homeListHtml() {
354
358
  S.lo = { sel, ses: S.ses, restOpen: (k) => S.rest.has(k), pin: S.pin, phone: false }; // the folded rail's card draws Home's rows with these
355
359
  return TD.listHtml(M, todayModel(), {
356
360
  sel, selHead: S.head, ses: S.ses, pOpen, here: isPhone() ? null : TD.groupOfOpen(M, sel) || S.head, restOpen: (k) => S.rest.has(k), cap: S.cap, pin: S.pin, avHtml, ready: S.ready, err: S.D.err.length ? S.D.err[0] : '',
357
- pick: S.D.pick, tones: pickTones(), review: R, mic: canDictate(), phone: isPhone(), day: S.day, news: S.news && S.news.ok ? S.news.count : 0, top: S.ready ? revealLeft(S.reveal) + RECROW.html() + MEN.rowHtml(S.D, { sel: S.sel }) + (S.impact ? IMP.rowHtml(S.impact.c, { esc, sel: S.sel === 'impact' }) : '') + (S.drift ? DRIFT.rowHtml(S.drift.c, { esc, sel: S.sel === 'drift' }) : '') : S.menIn ? '<div class="ls-stale" inert>' + LS.inert(MEN.rowHtml(S.D, {})) + '</div>' : LS.menShape(), // Mentions on its own clock, seen but not pressed until Home is fresh (SpG)
361
+ pick: S.D.pick, tones: pickTones(), review: R, mic: canDictate(), phone: isPhone(), day: S.day, news: S.news && S.news.ok ? S.news.count : 0, top: S.ready ? revealLeft(S.reveal) + RECROW.html() + (S.drift ? DRIFT.rowHtml(S.drift.c, { esc, sel: S.sel === 'drift' }) : '') : '', // chief-of-staff C3: the Mentions and Your impact cards are gone; their asks land in Your move
358
362
  last: S.ready ? '' : LS.last(LAST_KEY), keep: S.ready && S.filter === 'today' && !S.ini ? (b) => LS.keepLast(LAST_KEY, b) : null,
359
363
  imFace: IM.faceHtml(S.im, { joy: S.imJoy }), grill: S.ready ? grillNews() : null,
360
364
  });
@@ -372,17 +376,40 @@ function rankIn() {
372
376
  const I = p.model.initiatives || {};
373
377
  return { ws: p.ws || boardWs() || '', name: p.name, board: (p.model.board && p.model.board.id) || '', rows: (I.list && I.list.rows) || p.model.rows || [] };
374
378
  });
375
- return { products, programs: S.D.programs || [], move: S.move || {} };
379
+ // chief-of-staff C3: every ask lands in Your move — the conversations waiting on a reply (Mentions) and the outbox drafts too
380
+ // the UI grill's delete list: Your impact's card and the ✦ chip on "Not in an initiative" are gone from Home; they land here instead
381
+ const extra = [];
382
+ if (S.impact && S.impact.c && !S.impact.c.looked) extra.push({ key: 'impact', go: 'impact', title: 'Your impact: ' + S.impact.c.label + ' is ready to check', sub: 'A thank-you and what really moved, from your records.' });
383
+ const lp = LPV.chipOf(); if (lp) extra.push({ key: 'loose', go: 'loose', title: 'Not in an initiative: ' + lp.n + (lp.n === 1 ? ' row' : ' rows') + ' to tidy', sub: 'Claude proposes where each one belongs.' });
384
+ for (const l of S.lab || []) extra.push({ key: 'lab:' + l.ws, go: 'lab', ws: l.ws, board: l.board, title: 'Lab: ' + l.n + (l.n === 1 ? ' finding fits' : ' findings fit') + ' no initiative', sub: l.say || 'Keep one to start an initiative, or let it go.' });
385
+ return { products, programs: S.D.programs || [], move: S.move || {}, mentions: MEN.mentionsOf(S.D).waiting, outbox: S.outbox || [], extra };
376
386
  }
377
387
  /** Each product's GET /api/your-move, read when Your day opens (never on Home's first draw: page speed). */
378
388
  async function readMove() {
379
- const L = ((S.M && S.M.products) || []).filter((p) => p.model).map((p) => p.ws || boardWs() || '');
389
+ const PR = ((S.M && S.M.products) || []).filter((p) => p.model);
390
+ const L = PR.map((p) => p.ws || boardWs() || '');
380
391
  const got = await Promise.all(L.map((ws) => pmGet('/api/your-move' + (ws ? '?ws=' + encodeURIComponent(ws) : '')).catch(() => null)));
381
392
  const next = {};
382
- L.forEach((ws, i) => { const r = got[i]; if (r && r.ok) next[ws] = { verdicts: r.verdicts || [], kr: r.kr || null }; });
383
- const same = JSON.stringify(next) === JSON.stringify(S.move || null);
384
- S.move = next;
393
+ // C2 Done: the full-autonomy build's GET /api/autonomy (✦ auto-keeps and Driver auto-applies, one Undo each) when it answers; until then
394
+ // the agent's keep lines in proposals.jsonl (lib/done-feed.js, in GET /api/your-move). Its demotion notices are said once, then marked seen.
395
+ const auto = await Promise.all(L.map((ws) => pmGet('/api/autonomy' + (ws ? '?ws=' + encodeURIComponent(ws) : '')).catch(() => null)));
396
+ // C3: the Lab's findings that fit no initiative are a row here (its section on Intelligence is gone)
397
+ const labs = await Promise.all(PR.map((p, i) => { const b = (p.model.board && p.model.board.id) || ''; const q = [L[i] ? 'ws=' + encodeURIComponent(L[i]) : '', b ? 'board=' + encodeURIComponent(b) : ''].filter(Boolean).join('&');
398
+ return pmGet('/api/lab' + (q ? '?' + q : '')).then((r) => (r && r.ok && r.lab && (r.lab.loose || []).length ? { ws: L[i], board: b, n: r.lab.loose.length, say: r.lab.say || '' } : null)).catch(() => null); }));
399
+ L.forEach((ws, i) => {
400
+ const r = got[i], A = auto[i] && auto[i].ok ? auto[i] : null; if (!r || !r.ok) return;
401
+ const done = A ? (A.done || []).map((d) => ({ ref: d.ref, ini: d.ini || '', said: d.title || 'done', at: d.at, via: 'autonomy' }))
402
+ : (r.done || []).map((d) => ({ ref: d.batch, ini: d.ini, board: d.board, said: d.said, at: d.at, via: 'proposals' }));
403
+ next[ws] = { verdicts: r.verdicts || [], kr: r.kr || null, expired: r.expired || [], done, notices: A ? A.notices || [] : [] };
404
+ });
405
+ const ob = await pmGet('/api/outbox').catch(() => null);
406
+ const outbox = ob && ob.ok && Array.isArray(ob.entries) ? ob.entries.filter((e) => e && (e.state === 'queued' || e.state === 'blocked')) : [];
407
+ const lab = labs.filter(Boolean);
408
+ const same = JSON.stringify(next) === JSON.stringify(S.move || null) && JSON.stringify(outbox) === JSON.stringify(S.outbox || []) && JSON.stringify(lab) === JSON.stringify(S.lab || []);
409
+ S.move = next; S.outbox = outbox; S.lab = lab;
385
410
  if (!same) redrawLater();
411
+ // a demotion notice is said once: drawn now, then marked seen so the next read leaves it out
412
+ for (const [ws, m] of Object.entries(next)) for (const n of m.notices || []) pmPost('/api/autonomy/seen', { ws: ws || undefined, job: n.job, product: n.product, until: n.until }).catch(() => {});
386
413
  }
387
414
  /** Redraw Your day after a late read, but never under something passing on it (Adler's dress tip, the pull's "Reading your day again"):
388
415
  * it waits until that is gone. */
@@ -393,7 +420,7 @@ function redrawLater() {
393
420
  const mo = new MutationObserver(() => { if (!body.querySelector(PASSING)) { mo.disconnect(); redrawDay(); } });
394
421
  mo.observe(body, { childList: true, subtree: true });
395
422
  }
396
- const moveRow = (key) => { const Y = S.Y && S.Y.rank; return Y ? Y.rows.concat(Y.older).find((r) => r.key === key) || null : null; };
423
+ const moveRow = (key) => { const Y = S.Y && S.Y.rank; return Y ? Y.rows.concat(Y.wait || [], Y.older || []).find((r) => r.key === key) || null : null; };
397
424
  const insightsHref = (ws) => '/premium-intelligence.html' + (ws ? '?ws=' + encodeURIComponent(ws) : '');
398
425
  /** The ✦ of one initiative of any product Home reads, over its page (pm/ini-props.js). */
399
426
  async function openProps(ws, board, id) {
@@ -409,8 +436,20 @@ async function movePress(b) {
409
436
  const r = moveRow(b.dataset.key); if (!r || b.disabled) return;
410
437
  const act = b.dataset.yd;
411
438
  const prog = r.program ? (S.D.programs || []).find((p) => p.id === r.program) : null;
412
- if (act === 'mv-open' || act === 'mv-alt' && (r.kind === 'other' || r.kind === 'kr' || r.kind === 'verdict' || r.kind === 'meeting')) {
439
+ if (act === 'mv-open' || act === 'mv-alt' && (r.kind === 'other' || r.kind === 'kr' || r.kind === 'verdict' || r.kind === 'meeting' || r.kind === 'mention' || r.kind === 'outbox' || r.kind === 'extra')) {
413
440
  if (r.kind === 'verdict' || r.kind === 'kr') { location.href = insightsHref(r.ws); return; }
441
+ // C3: a conversation that waits on the PM opens in Mentions (its card on Home is gone; this is the way in)
442
+ if (r.kind === 'extra') {
443
+ if (r.go === 'impact') { S.day = false; S.sel = 'impact'; if (isPhone()) S.phoneChat = true; openTarget(homeTarget()); drawList(); return; }
444
+ if (r.go === 'loose') { VW.drill(); LPV.open(lpHost); return; }
445
+ if (r.go === 'lab') { VW.drill(); import('./cozy-lab-ins.js').then((LB) => LB.openLab({ where: () => ({ ws: r.ws, board: r.board }), iniHref: (id) => '/premium-initiative.html?' + (r.ws ? 'ws=' + encodeURIComponent(r.ws) + '&' : '') + 'id=' + encodeURIComponent(id), toast: (m, undo) => (undo ? toastUndo(m, undo) : toast(m)) })); return; }
446
+ return;
447
+ }
448
+ if (r.kind === 'mention') { S.day = false; S.sel = 'mentions'; drawList(); MEN.openMentions(menCtx(), { sel: r.mention.id }); return; }
449
+ if (r.kind === 'outbox') { VW.drill(); import('./outbox-view.js').then((O) => O.openDraft(r.outbox, { pmPost, toast, toastUndo, reload: () => readMove() })); return; }
450
+ // C4: one press per initiative — its ✦ as one commit-style summary (pm/batch-press.js); the full ✦ stays one press away there
451
+ if (r.kind === 'other') { VW.drill(); import('./batch-press.js').then((B) => B.openBatch({ ws: r.ws, board: r.board, ini: r.ini, title: (iniRowOf(r.ini) || {}).title || r.ini },
452
+ { pmGet, pmPost, toast, toastUndo, reload: () => load().then(() => readMove()), full: () => openProps(r.ws, r.board, r.ini) })); return; }
414
453
  if (r.kind === 'meeting') { if (prog) { VW.drill(); goProgram(prog.id); } else if (r.props[0]) { VW.drill(); openProps(r.props[0].ws, r.props[0].board, r.props[0].ini); } return; }
415
454
  if (r.kind === 'call') { select(r.call.id); return; }
416
455
  VW.drill(); openProps(r.ws, r.board, r.ini); return;
@@ -443,6 +482,15 @@ async function movePress(b) {
443
482
  const undo = batches.length ? async () => { let ok = true; for (const x of batches) { const u = await pmPost('/api/proposals/undo', x).catch(() => null); if (!u || !u.ok) ok = false; } load().then(() => readMove()); return { ok }; } : null;
444
483
  done(failed ? 'Kept, but ' + failed + (failed === 1 ? ' part was' : ' parts were') + ' not saved.' : 'Kept.', undo);
445
484
  }
485
+ /** Undo on a line of Done (C2): the whole batch Claude kept by itself goes back (POST /api/proposals/undo); it counts as a correction. */
486
+ async function doneUndo(b) {
487
+ if (b.disabled) return; b.disabled = true;
488
+ const d = b.dataset, ws = d.ws || undefined;
489
+ const res = d.via === 'autonomy' ? await pmPost('/api/autonomy/undo', { ws, ref: d.ref }).catch(() => null)
490
+ : await pmPost('/api/proposals/undo', { ws, board: d.board, batch: d.ref }).catch(() => null);
491
+ if (!res || !res.ok) { b.disabled = false; toast((res && res.error) || 'It could not be undone. Nothing changed.'); return; }
492
+ toast('Undone.'); load().then(() => readMove());
493
+ }
446
494
  /** The notes Home's recorder holds (GET /api/notes rows), for Good morning's rail. */
447
495
  const noteRows = () => (REC && REC.notes ? REC.notes() || [] : []);
448
496
  function dayParts() {
@@ -561,9 +609,11 @@ function day(on) {
561
609
  if (b.dataset.yd === 'fin') { const d = (dayParts().Y.drafts || [])[+b.dataset.i]; if (d && d.fin) { VW.drill(); openFinished(d.fin); } return; }
562
610
  if (b.dataset.yd === 'sel') { const c = b.closest('.yd-call'); if (c) select(c.dataset.id); return; }
563
611
  if (/^mv-/.test(b.dataset.yd || '')) { movePress(b); return; }
612
+ if (b.dataset.yd === 'done-undo') { doneUndo(b); return; }
564
613
  if (/^gm-/.test(b.dataset.yd || '')) { gmPress(b); return; }
565
614
  if (b.dataset.yd === 'retry' || b.dataset.yd === 'prep') { dayAct(b); return; }
566
615
  if (b.dataset.yd === 'sync') { syncAgain(b); return; }
616
+ if (b.dataset.yd === 'mentions') { S.day = false; S.sel = 'mentions'; drawList(); MEN.openMentions(menCtx()); return; }
567
617
  if (b.dataset.yd === 'ask') { S.day = false; S.sel = 'mentions'; drawList(); MEN.openMentions(menCtx(), { sel: b.dataset.id }); return; }
568
618
  if (b.dataset.yd === 'news' || b.dataset.yd === 'news-all') { VW.drill(); MORE.openInbox(searchGo, b.dataset.yd === 'news' ? b.dataset.id : ''); return; }
569
619
  if (b.dataset.yd === 'seen') { daySeen(b); return; }
@@ -985,7 +1035,7 @@ function chatHeadOf(t, r, title) {
985
1035
  }
986
1036
  function scopeItems() {
987
1037
  const cur = chat.current(), fresh = cur && cur.newChat;
988
- return [{ label: 'All work', sub: 'Home', go: () => select(null) }, { label: H.productName(S.D) + ' · product', go: () => goIni('product') }]
1038
+ return [{ label: 'Everything', sub: 'Ask PMOS', go: () => select(null) }, { label: H.productName(S.D) + ' · product', go: () => goIni('product') }]
989
1039
  .concat(H.boardRows(S.D).map((r) => ({ label: r.title, sub: [r.lane, r.stage].filter(Boolean).join(' · '), go: () => goIni(r.id) })))
990
1040
  // a product's chat or an initiative's: a fresh conversation in the same place, beside its first (batch 9 item 3)
991
1041
  .concat(fresh ? [{ sep: true }, { label: 'A new session', sub: 'A fresh conversation in ' + cur.about, go: fresh }] : []);
@@ -1030,7 +1080,7 @@ async function workItem(text, t) {
1030
1080
  }
1031
1081
  // a row made from a next step (otherIni) carries its clipped subject: the initiative's own title wins once it is read
1032
1082
  const iniTitle = (id) => { if (id === 'product') return H.productName(S.D) + ' · product'; const r = iniRowOf(id) || {}, m = S.IM && S.IMid === id ? S.IM.title : null; return (r.made && m) || r.title || (S.IM && S.IM.title) || id; };
1033
- const scopeOf = (ini) => (ini ? { text: iniTitle(ini), icon: I.flag } : { text: 'All work', icon: I.home, loose: false });
1083
+ const scopeOf = (ini) => (ini ? { text: iniTitle(ini), icon: I.flag } : { text: 'Everything', icon: GLOBE, loose: false });
1034
1084
  const rich = () => !!S.ini;
1035
1085
  function iniTarget(id) {
1036
1086
  const h = S.H || {};
@@ -1268,8 +1318,9 @@ function insTarget(key) {
1268
1318
  placeholder: 'Message Claude about ' + label, context: 'The PM asked from Intelligence about ' + label + ', one of the goals of ' + prod + '. Answer from that product\'s goals and readings.' };
1269
1319
  }
1270
1320
  function homeTarget() {
1271
- return { key: 'chat:main', ws: WS || undefined, title: 'Home', scope: { text: 'All work', icon: I.home }, rich: false, placeholder: 'Message Claude', role: CLAUDE,
1272
- empty: 'Ask anything about your work. Claude reads your repositories and works in a real Claude Code session.', also: alsoOf(null),
1321
+ // chief-of-staff C1 (board CsA): Home's own chat is the one chat with no scope. Its chip reads Everything; reads run at once and show their source
1322
+ return { key: 'chat:main', ws: WS || undefined, title: 'Ask PMOS', scope: { text: 'Everything', icon: GLOBE }, rich: false, placeholder: 'Ask or tell PMOS anything', role: CLAUDE,
1323
+ empty: 'Ask anything about your work. I read it with PMOS and say where each answer came from. Changes come back for you to keep.', also: alsoOf(null),
1273
1324
  intro: S.sel === 'drift' && S.drift ? S.drift.intro : S.impact ? S.impact.intro : S.drift ? S.drift.intro : S.moment ? S.moment.intro : undefined };
1274
1325
  }
1275
1326
  /* Your impact (batch 16 item 7; batch 23 item 4, IcA): while last week's check is open, Home's own chat opens on Claude's thank-you card.
@@ -2167,7 +2218,7 @@ PO.mount({ programs: () => S.D.programs || [], stateOf: (p) => (((S.M && S.M.gro
2167
2218
  saved: (p) => { const L2 = S.D.programs || [], i = L2.findIndex((x) => x.id === p.id); if (i >= 0) L2[i] = { ...L2[i], ...p }; drawList(); },
2168
2219
  say: (m, undo) => (undo ? toastUndo(m, undo) : toast(m)), openIni: (id) => goIni(id) });
2169
2220
  SO.mount({ redraw: () => { S.D.order = SO.layout(); drawList(); }, say: (m, undo) => (undo ? toastUndo(m, undo) : toast(m)) });
2170
- mountNav('home', document, { here: () => { if (VW.isOpen()) VW.close(); goHome(); } });
2221
+ mountNav('home', document, { here: () => { if (VW.isOpen()) VW.close(); goHome(); }, chat: () => { if (S.ini || S.sel) goHome(); talk(); } }); // the menu's chat icon (C5): Home's own chat is the chief-of-staff chat
2171
2222
  // the Live pill (batch 6 item 2): on Home a row opens in place, the session's chat (with its Viewer page) or the meeting; the open one is tinted
2172
2223
  const liveGo = (x) => {
2173
2224
  if (x.kind === 'rec') { const id = /[?&]meeting=([^&]+)/.exec(x.href || ''); if (!id) return false; openMeeting({ note: decodeURIComponent(id[1]) }); return true; }
@@ -29,6 +29,7 @@ import { turnsOf } from './chat-context.js';
29
29
  import { askCardHtml, answerText } from './chat-ask.js';
30
30
  import { permissionAsk, splitAsk, blockAsk, iconBtn, openAsk, askCardHtml as kindCardHtml } from './home-ask.js';
31
31
  import { splitChase, runStop, sweepLine, stopText } from './home-sweep.js';
32
+ import { splitSrc, srcHtml } from './chat-src.js'; // chief-of-staff C1: where each answer came from
32
33
  import { splitFiles, filesHtml, sizeText, MAX_BYTES, MAX_FILES, setAttachSink } from './premium-attach.js';
33
34
  import * as VWC from './cozy-viewer.js';
34
35
  import { canDictate, dictate } from './home-dictate.js';
@@ -142,13 +143,14 @@ export function mountChat(el, host) {
142
143
  }
143
144
  const last = i === R.lastAgent;
144
145
  const asking = last && R.asking; // the message that asks before a change: no tools while the ask is open, and the name on its own line (AgChatAsk)
145
- const g = splitGoal(it.text), rp0 = splitReport(g.text), ak = splitAsk(splitChase(rp0.text).text), rp = { ...rp0, text: ak.text };
146
+ const sr = splitSrc(it.text); // chief-of-staff C1: the answer's sources, drawn under it (pm/chat-src.js)
147
+ const g = splitGoal(sr.text), rp0 = splitReport(g.text), ak = splitAsk(splitChase(rp0.text).text), rp = { ...rp0, text: ak.text };
146
148
  const goal = C.th && C.th.goal, gl = it.mi === R.lastMsg && R.waiting && !!goal && goal.state === 'grilling';
147
149
  const go = GU.blockOpts(it.mi, g.block, gl); // home-goal.js: the newest plan, the method menu, the editor in place
148
150
  // a run that stopped: the divider sits where it finished, over Claude's last message, and the fix sits under it (canvas XcbOptions, Routine)
149
151
  const stopAt = R.stop && i === R.lastAgent;
150
152
  const av = last && isClaude(R.role) ? adlerAvHtml(asking || ak.block ? 'needs-you' : stopAt ? 'honest' : running() ? 'thinking' : 'handled') : avHtml(R.role);
151
- return (stopAt ? dividerHtml({ tone: R.stop.tone, text: R.stop.text }) : '') + `<div class="hm-a${asking ? ' ask' : ''}">${av}<div class="hm-ab"><p class="hm-who">${esc(R.role.name)} <span>${esc(hm(it.at))}</span></p>${rp.text ? mdHtml(rp.text) : ''}${goalBlockHtml(go.block, go)}${reportChipHtml(rp.block, it.mi)}${R.chips(it.mi)}`
153
+ return (stopAt ? dividerHtml({ tone: R.stop.tone, text: R.stop.text }) : '') + `<div class="hm-a${asking ? ' ask' : ''}">${av}<div class="hm-ab"><p class="hm-who">${esc(R.role.name)} <span>${esc(hm(it.at))}</span></p>${rp.text ? mdHtml(rp.text) : ''}${srcHtml(sr.src)}${goalBlockHtml(go.block, go)}${reportChipHtml(rp.block, it.mi)}${R.chips(it.mi)}`
152
154
  + (asking ? '' : `<div class="hm-tools" role="group" aria-label="Message actions"><button type="button" data-hm-copy="${i}">Copy</button>${last && !running() && !(stopAt && R.stop.actions.length) ? `<button type="button" data-hm-retry>Retry</button>` : ''}<button type="button" data-hm-wi="${i}">Make a work-item</button></div>`) + '</div></div>'
153
155
  + (stopAt && R.stop.actions.length ? `<div class="hm-fix" role="group" aria-label="What to do next">${R.stop.actions.map((a, k) => iconBtn({ icon: a.icon, label: a.label, attr: a.data, pri: k === 0 })).join('')}</div>` : '')
154
156
  + blockAskHtml(ak.block, it, R);
@@ -422,7 +424,7 @@ export function mountChat(el, host) {
422
424
  const also = t.also && !(C.conv && C.conv.ask) ? `<button type="button" class="hm-also" data-hm-also><i aria-hidden="true"></i><span><b>Also waiting on you:</b> ${esc(t.also.text)}</span><em>${esc(t.also.verb || 'Answer')}</em></button>` : '';
423
425
  // while it works the PM talks as usual (Claude reads it after its tool call); a goal that stopped says how to go on (principle 8)
424
426
  const ph = C.conv && C.conv.ask ? 'Or tell ' + R.role.name + ' what to do instead' : goal && goal.state === 'stopped' && !running() ? 'Reply to go on, or /goal for a new goal' : t.placeholder || 'Message Claude';
425
- const sc = t.scope || { text: 'All work', icon: 'M5 21V4M5 4h12l-2 4 2 4H5' };
427
+ const sc = t.scope || { text: 'Everything', icon: 'M5 21V4M5 4h12l-2 4 2 4H5' };
426
428
  const keep = foot.querySelector('textarea'); const val = keep ? keep.value : '';
427
429
  // the session's terminal: watch it read only while the session runs; copy the line that resumes an ended chat
428
430
  const live = sid() && C.conv && C.conv.state !== 'ended';
@@ -444,7 +446,9 @@ export function mountChat(el, host) {
444
446
  + `<span class="hm-pmenu hm-addm" role="menu" aria-label="Add"${addOpen ? ' data-esc-layer' : ' hidden'}>${attach}${notesBtn}${term}${link}</span>${t.key ? '<input type="file" id="hmFile" multiple hidden>' : ''}</span>` : '';
445
447
  const wait = C.conv && C.conv.ask && t.also ? `<button type="button" class="hm-chip" data-hm-also><i class="dot" aria-hidden="true"></i><span>1 more next step</span></button>` : '';
446
448
  const to = t.to && !wait ? `<button type="button" class="hm-chip to" data-hm-to aria-label="Who reads this: ${esc(t.to.name)}. Change">${avHtml(t.to, 20)}<span>To: ${esc(t.to.name)}</span></button>` : '';
447
- const scope = !to && !wait ? `<button type="button" class="hm-chip${sc.loose ? ' loose' : ''}" data-hm-scope aria-label="Where this goes: ${esc(sc.text)}. Change" title="Where this goes: ${esc(sc.text)}">${SVG(sc.icon, 14)}<span>In: ${esc(sc.text)}</span></button>` : '';
449
+ // chief-of-staff C5 (CsB): the soft "You are on …" chip of the chat over a page; × drops it (sc.drop), and the chip then reads Everything
450
+ const scope = to || wait ? '' : sc.drop ? `<button type="button" class="hm-chip soft" data-hm-scope aria-label="${esc(sc.text)}. Drop this" title="Drop this">${SVG(sc.icon, 14)}<span>${esc(sc.text)}</span>${SVG(XX, 14)}</button>`
451
+ : `<button type="button" class="hm-chip${sc.loose ? ' loose' : ''}" data-hm-scope aria-label="Where this goes: ${esc(sc.text)}. Change" title="Where this goes: ${esc(sc.text)}">${SVG(sc.icon, 14)}<span>In: ${esc(sc.text)}</span></button>`;
448
452
  const html = `${also}<form class="hm-box${on ? ' ut-on' : ''}" id="hmForm">${dot}<textarea id="hmIn" rows="1" aria-label="A message for ${esc(R.role.name)}" placeholder="${esc(ph)}"></textarea>`
449
453
  + `<div class="hm-tb">${add}`
450
454
  + to + wait + scope + `<span class="sp"></span>${host.viewerClosed() ? '<span class="hm-key">Enter sends · Shift+Enter for a new line</span>' : ''}`
@@ -5,7 +5,9 @@
5
5
  * the work Claude really did; Your move holds only the calls that need the PM; the rest folds:
6
6
  * Your move one ranked list (workspace grill W3, frame WgW3Move; pm/move-rank.js): every open ✦ of the products Home reads, in
7
7
  * order of consequence, each with its age and one press, then the calls only the PM can make (homeList's move rows
8
- * with call: true). Proposals older than two weeks fold under "Older", never gone. Open by default
8
+ * with call: true). At most 5 show (chief-of-staff C3); the rest lead Can wait. A ✦ unanswered for 14 days expires
9
+ * on the server and one quiet line says so. Open by default
10
+ * Done (C2) what Claude finished by itself in the last 14 days, one line per batch with Undo; folded, silent at zero
9
11
  * New for you (feedback batch 16 item 5b, canvas FmA2Day) the FYI items of GET /api/news-for-you: tasks given to the PM and work
10
12
  * finished while away. The tasks given to the PM are one row, "32 tasks given to you" (W3), that opens the list; the 3
11
13
  * newest other items, then "N more" (the whole list in the Viewer, cozy-news.js); ✓✓ in the fold's header
@@ -13,7 +15,7 @@
13
15
  * for you page of the place menu.
14
16
  * Drafted for you the drafts of today's morning prep run (GET /api/phone-day finished) and the weekly update; a draft the PM is done
15
17
  * with ("Done with it" in the Finished Viewer, batch 18 item 2) leaves it
16
- * Can wait every other row that was "Your move" (tasks, brief items, Jira)
18
+ * Can wait the ranked asks after the first 5, then every other row that was "Your move" (tasks, brief items, Jira)
17
19
  * Now the phone's moment card (home-phone-card.js), open by default
18
20
  * Tomorrow after 17:00 only (canvas FmA5Evening, was More › End of the day): tomorrow's meetings (GET /api/phone-day tomorrow);
19
21
  * not on a phone, whose Now card shows tomorrow then
@@ -207,7 +209,7 @@ function callHtml(r) {
207
209
  }
208
210
  /* one row of the ranked Your move (W3, WgW3Move): ✦, the sentence and what it rests on, its age, and its presses, icon only. The text opens what
209
211
  * the row is about (the initiative's ✦, the program, Intelligence); ✓ does the one thing it says; the second icon picks, decides or drops. */
210
- const ALT_ICON = { verdict: PEN, meeting: PEN, grill: XX, other: CHEV, kr: CHEV };
212
+ const ALT_ICON = { verdict: PEN, meeting: PEN, grill: XX, other: CHEV, kr: CHEV, mention: CHEV, outbox: CHEV, extra: CHEV };
211
213
  function moveRowHtml(r) {
212
214
  if (r.kind === 'call') return callHtml(r.call);
213
215
  const late = r.rank <= 2 && r.days != null && r.days > 0;
@@ -216,11 +218,39 @@ function moveRowHtml(r) {
216
218
  return `<div class="yd-mv" data-key="${esc(r.key)}"><span class="yd-mvs" aria-hidden="true">✦</span><button type="button" class="yd-mvt" data-yd="mv-open" data-key="${esc(r.key)}"><b>${esc(r.title)}</b>${r.sub ? `<em>${esc(r.sub)}</em>` : ''}</button>`
217
219
  + `${r.age ? `<span class="yd-age${late ? ' late' : ''}">${esc(r.age)}</span>` : ''}<span class="yd-mva">${yes}${alt}</span></div>`;
218
220
  }
219
- /** Your move's fold from the ranked list: the rows, then "Older than two weeks · N" folded (never gone). null when nothing is there. */
221
+ /** Your move's fold from the ranked list (C3, board CsE): at most 5 asks, then one quiet line for the ✦ that expired after 14 days with no
222
+ * answer. The rest of the ranked list goes to the top of Can wait (waitSection). null when nothing is there. */
223
+ const AT = 'M16 12a4 4 0 1 0-1.2 2.85M16 8v5a2.5 2.5 0 0 0 5 0v-1a9 9 0 1 0-3.5 7.1';
224
+ /** This week: the Weekly review, and Mentions (chief-of-staff C3: its row on Home's list is gone; a reply owed is a row in Your move, and
225
+ * what only tells you something and what you answered stay one press away here). */
226
+ function weekSection(Y) {
227
+ const rv = `<div class="hm-r hv-r two" data-id="review"><button type="button" class="hm-rm" data-hm-review aria-label="Weekly review: ${esc(Y.week.sub)}. Open"><span class="hv-mk">${svg(CAL, 16)}</span><span class="hm-rt"><b>Weekly review</b><em>${esc(Y.week.sub)}</em></span><span class="hv-cv">${svg(CHEV, 16)}</span></button></div>`;
228
+ const mn = `<div class="hm-r hv-r two" data-id="mentions"><button type="button" class="hm-rm" data-yd="mentions" aria-label="Mentions: to read and answered this week. Open"><span class="hv-mk">${svg(AT, 16)}</span><span class="hm-rt"><b>Mentions</b><em>To read, and what you answered this week</em></span><span class="hv-cv">${svg(CHEV, 16)}</span></button></div>`;
229
+ return { id: 'week', title: 'This week', count: Y.week.sub, html: `<div class="hv-card">${rv}${mn}</div>` };
230
+ }
220
231
  export function moveSection(R) {
221
- if (!R || (!R.rows.length && !R.older.length)) return null;
222
- const older = R.older.length ? `<details class="yd-older"><summary>Older than two weeks · ${R.older.length}</summary>${R.older.map(moveRowHtml).join('')}</details>` : '';
223
- return { id: 'move', title: 'Your move', count: R.rows.length + (R.older.length ? ' · ' + R.older.length + ' older' : ''), open: true, html: `<div class="yd-mvl">${R.rows.map(moveRowHtml).join('')}${older}</div>` };
232
+ if (!R) return null;
233
+ const ex = R.expired || [], wait = R.wait || [];
234
+ if (!R.rows.length && !ex.length) return null;
235
+ const exLine = ex.length ? `<p class="yd-exp">${esc((ex.length === 1 ? 'One ask' : ex.length + ' asks') + ' expired after 14 days with no answer. I left ' + (ex.length === 1 ? 'it' : 'them') + ' as ' + (ex.length === 1 ? 'it was' : 'they were') + ' and wrote why in History.')}</p>` : '';
236
+ return { id: 'move', title: 'Your move', count: R.rows.length + (wait.length ? ' · ' + wait.length + ' can wait' : ''), open: true, html: `<div class="yd-mvl">${R.rows.map(moveRowHtml).join('')}${exLine}</div>` };
237
+ }
238
+ /** Can wait: the ranked asks after the first 5 (Claude's order), then the list's own rows that can wait (tasks, brief items, Jira). */
239
+ export function waitSection(R, rows) {
240
+ const more = (R && R.wait) || [], L = rows || [];
241
+ if (!more.length && !L.length) return null;
242
+ return { id: 'wait', title: 'Can wait', count: more.length + L.length, html: (more.length ? `<div class="yd-mvl">${more.map(moveRowHtml).join('')}</div>` : '') + (L.length ? `<div class="hv-card hd-move">${L.map(waitRow).join('')}</div>` : '') };
243
+ }
244
+ const UNDO = 'M9 14L4 9l5-5M4 9h10a6 6 0 0 1 0 12h-3';
245
+ /** Done (C2, board CsD): what Claude finished by itself, one quiet line per batch, each with one Undo. Folded; zero is silence. */
246
+ export function doneSection(R) {
247
+ const L = (R && R.done) || [];
248
+ if (!L.length && !((R && R.notices) || []).length) return null;
249
+ const row = (d) => `<div class="yd-mv yd-dn" data-ref="${esc(d.ref)}"><span class="yd-mvs dn" aria-hidden="true">${svg(CHECK, 14, 2.4)}</span><span class="yd-mvt"><b>${esc((d.name ? d.name + ': ' : '') + (d.said || 'done'))}</b></span>`
250
+ + `<span class="yd-mva"><button type="button" class="yd-alt sm" data-yd="done-undo" data-ref="${esc(d.ref)}" data-via="${esc(d.via || 'proposals')}" data-ws="${esc(d.ws || '')}" data-board="${esc(d.board || '')}" aria-label="${esc('Undo: ' + (d.name ? d.name + ', ' : '') + (d.said || ''))}" title="Undo">${svg(UNDO, 16, 2)}</button></span></div>`;
251
+ // a job that fell back to proposing (two Undos in a row, the full-autonomy safety net) is said once, at the top
252
+ const nt = ((R && R.notices) || []).map((n) => `<p class="yd-exp">${esc(n.text || ((n.job || 'A job') + ' asks again before it changes anything, until ' + String(n.until || '').slice(0, 10) + '.'))}</p>`).join('');
253
+ return { id: 'done', title: 'Done', count: L.length, open: !!nt, html: `${nt}<div class="yd-mvl">${L.map(row).join('')}</div>` };
224
254
  }
225
255
  /* one row that can wait: the list's own row, so a press opens what the list row opens; no "late" words (here and now) */
226
256
  function waitRow(r) {
@@ -298,7 +328,7 @@ export function dayParts(Y, o = {}) {
298
328
  const sections = [], now = o.now || Date.now();
299
329
  // the tea figure only after a real day (something done, drafted or waiting): nothing at all stays silent (zero is silence)
300
330
  const real = Y.done > 0 || Y.chips.length || Y.drafts.length || Y.wait.length;
301
- const ranked = Y.rank && (Y.rank.rows.length || Y.rank.older.length);
331
+ const ranked = Y.rank && (Y.rank.rows.length || (Y.rank.wait || []).length);
302
332
  const big = Y.calls.length || ranked || Y.mood === 'concerned' ? null : Y.mood === 'delighted' ? 'win' : real ? 'tea' : null;
303
333
  const mv = Y.rank ? moveSection(Y.rank) : null;
304
334
  if (mv) sections.push(mv);
@@ -306,11 +336,12 @@ export function dayParts(Y, o = {}) {
306
336
  else if (big) sections.push({ id: 'move', title: 'Your move', open: true, html: bigHtml(big) });
307
337
  { const nw = newsSection(Y.news || [], o.now, Y.digests || 0); if (nw) sections.push(nw); }
308
338
  if (Y.drafts.length) sections.push({ id: 'drafts', title: 'Drafted for you', count: Y.drafts.length, html: `<div class="hv-card">${Y.drafts.map((d, i) => draftRow(d, i)).join('')}</div>` });
309
- if (Y.wait.length) sections.push({ id: 'wait', title: 'Can wait', count: Y.wait.length, html: `<div class="hv-card hd-move">${Y.wait.map(waitRow).join('')}</div>` });
339
+ { const w = waitSection(Y.rank, Y.wait); if (w) sections.push(w); }
340
+ { const d = doneSection(Y.rank); if (d) sections.push(d); }
310
341
  // the meeting on now or next is Home's own meeting line (say it once, batch 18 item 3); a phone's moment card shows only what Home does not
311
342
  if (o.moment) sections.push({ id: 'now', title: 'Now', open: true, html: '<div class="hd-now"></div>' }); // drawDay puts the moment card in
312
343
  if (Y.tomorrow && !o.moment) sections.push(tomorrowSection(Y.tomorrow)); // a phone's moment card already shows tomorrow at the end of the day (say it once)
313
- sections.push({ id: 'week', title: 'This week', count: Y.week.sub, html: `<div class="hv-card"><div class="hm-r hv-r two" data-id="review"><button type="button" class="hm-rm" data-hm-review aria-label="Weekly review: ${esc(Y.week.sub)}. Open"><span class="hv-mk">${svg(CAL, 16)}</span><span class="hm-rt"><b>Weekly review</b><em>${esc(Y.week.sub)}</em></span><span class="hv-cv">${svg(CHEV, 16)}</span></button></div></div>` });
344
+ sections.push(weekSection(Y));
314
345
  const scene = !big && o.first && Y.mood !== 'concerned' && new Date(now).getHours() < 12;
315
346
  const night = Y.mood !== 'concerned' && asleep(now) ? nightHtml(Y) : '';
316
347
  return { open: openHtml(Y, { big: !!big, scene }), sections, night };
@@ -322,14 +353,15 @@ export function dayParts(Y, o = {}) {
322
353
  export function gmParts(Y, G, o = {}) {
323
354
  const now = o.now || Date.now(), sections = [];
324
355
  const rest = Y.rank ? Y.rank.rows.filter((r) => !G.move.some((m) => m.key === r.key) && !(G.call && r.kind === 'call' && r.call && r.call.id === G.call.id)) : [];
325
- if (G.state !== 'evening' && (rest.length || (Y.rank && Y.rank.older.length))) {
326
- const mv = moveSection({ rows: rest, older: Y.rank.older });
356
+ if (G.state !== 'evening' && (rest.length || (Y.rank && (Y.rank.expired || []).length))) {
357
+ const mv = moveSection({ rows: rest, expired: Y.rank.expired, wait: Y.rank.wait });
327
358
  if (mv) sections.push({ ...mv, id: 'more', title: 'More in Your move', open: false });
328
359
  }
329
360
  if (Y.drafts.length) sections.push({ id: 'drafts', title: 'Drafted for you', count: Y.drafts.length, html: `<div class="hv-card">${Y.drafts.map((d, i) => draftRow(d, i)).join('')}</div>` });
330
- if (Y.wait.length) sections.push({ id: 'wait', title: 'Can wait', count: Y.wait.length, html: `<div class="hv-card hd-move">${Y.wait.map(waitRow).join('')}</div>` });
361
+ { const w = waitSection(Y.rank, Y.wait); if (w) sections.push(w); }
362
+ { const d = doneSection(Y.rank); if (d) sections.push(d); }
331
363
  if (o.moment) sections.push({ id: 'now', title: 'Now', open: true, html: '<div class="hd-now"></div>' });
332
- sections.push({ id: 'week', title: 'This week', count: Y.week.sub, html: `<div class="hv-card"><div class="hm-r hv-r two" data-id="review"><button type="button" class="hm-rm" data-hm-review aria-label="Weekly review: ${esc(Y.week.sub)}. Open"><span class="hv-mk">${svg(CAL, 16)}</span><span class="hm-rt"><b>Weekly review</b><em>${esc(Y.week.sub)}</em></span><span class="hv-cv">${svg(CHEV, 16)}</span></button></div></div>` });
364
+ sections.push(weekSection(Y));
333
365
  // one Adler per screen: the morning scene on the day's first open before noon, else his face on the lead
334
366
  // the daily morning banner is gone (frames G1-G4: a face beside the line); a festival's own day keeps its scene once (AsPlaces, Deepavali)
335
367
  const D = dress(), scene = !!o.first && !!D && !!dressDay(D, now) && Y.mood !== 'concerned' && G.state === 'morning' && new Date(now).getHours() < 12;
@@ -2,7 +2,7 @@
2
2
  * HvAOpen, HvACDesk, PgHomePhone, PgHomeDesk), over the one list of premium-uncovered-features (HmMyWork, HmDay, HmMic, HmReview).
3
3
  *
4
4
  * The list column, top to bottom: one header line ("Good morning" with a chevron that opens Your day, the product picker when Home reads
5
- * more than one product, on a desktop the filter icon for Kept and Done, New), the "N are yours" line, the Today card only while the day has
5
+ * more than one product, on a desktop the filter icon for Kept and Done, New), the Today card only while the day has
6
6
  * a moment (a recording, a meeting soon or on now, the end of the day, the weekly review open), each program's group, then each product's
7
7
  * group (an initials tile, the name, the goal dots, a chevron; one-line rows with the stage track on the right; an initiative's sessions,
8
8
  * next steps and meetings sit in a pill on its row that lists them on a press; its tasks are on its page in the Viewer, not here), and "Not in an initiative" as a folded line. Your day (dayHtml) is a sheet over the list: the date
@@ -320,13 +320,15 @@ const MOMENT = new Set(['rec', 'soon', 'live', 'eod', 'review']);
320
320
  export function listHtml(M, T, o) {
321
321
  const flt = M.filter !== 'today' ? M.filters.find((f) => f.key === M.filter) : null;
322
322
  // the blue dot after "Good morning": something is new for you, in Your day's New for you fold (feedback batch 16 item 5b, FmA4Desk)
323
- const nw = o.news > 0 ? '. ' + o.news + ' new for you' : '';
323
+ // chief-of-staff C3 (UI grill delete list): the greeting carries no dot and no "N new for you" count, and the "N are yours" line is gone:
324
+ // Your move is the one place that says what is yours (the menu button carries the one dot)
325
+ const nw = '';
324
326
  // Your impact (batch 16 item 7, GmA1Home): with it on, the greeting's face is its own press, Adler with the week's leaves (pm/impact.js faceHtml)
325
327
  // Adler beside the greeting from the first frame (SpM): thinking while Home reads, handled when it is in, honest if the read failed.
326
328
  // While Home reads, a hollow ring follows the greeting (SpA); a fresh page shows no sign of having been checked
327
329
  const own = o.imFace && !o.err && o.ready;
328
330
  const face = own ? '' : AD.adler(o.err ? 'honest' : o.ready ? 'handled' : 'thinking', 36, { label: false, cls: 'hv-ad' });
329
- const head = `<div class="hm-hd hv-bar">${own ? o.imFace : ''}<button type="button" class="hv-hi" ${o.ready ? 'data-hm-day' : 'aria-disabled="true"'} aria-expanded="${!!o.day}" aria-label="${esc(M.word || 'Today')}${nw}. Open your day">${face}<b>${esc(M.word || 'Today')}</b>${o.ready ? '' : LS.ringHtml()}${o.news > 0 ? '<i class="hv-nd" aria-hidden="true"></i>' : ''}${svg(P.chevD, 18)}</button><span class="hv-acts">`
331
+ const head = `<div class="hm-hd hv-bar">${own ? o.imFace : ''}<button type="button" class="hv-hi" ${o.ready ? 'data-hm-day' : 'aria-disabled="true"'} aria-expanded="${!!o.day}" aria-label="${esc(M.word || 'Today')}${nw}. Open your day">${face}<b>${esc(M.word || 'Today')}</b>${o.ready ? '' : LS.ringHtml()}${svg(P.chevD, 18)}</button><span class="hv-acts">`
330
332
  // the product chip, always (it is also the way to add one): the ticked products' tiles, or All (canvas XhpA2States)
331
333
  + (o.pick ? chipHtml(o.pick, { id: 'hmPick', attrs: 'data-hm-pick', label: 'Products on Home', tones: o.tones }) : '')
332
334
  + (o.phone ? '' : `<button type="button" class="ut-ib hv-ib${flt ? ' on' : ''}" data-hm-flt aria-haspopup="menu" aria-label="Show: Today, Kept or Done${flt ? '. Now ' + esc(flt.label) : ''}" title="Show: Today, Kept or Done">${svg(P.filter, 18)}</button>`)
@@ -334,7 +336,6 @@ export function listHtml(M, T, o) {
334
336
  + `<button type="button" class="ut-ib hv-ib" data-hm-new aria-haspopup="menu" aria-label="New" title="New">${svg(P.plus, 20)}</button>`
335
337
  // fold the list to the rail (batch 18 item 15, TbT1Split): the rail's list button brings it back; a phone has no rail
336
338
  + (o.phone ? '' : `<button type="button" class="ut-ib hv-ib" data-hm-fold aria-label="Fold the list to the rail" title="Fold the list to the rail">${svg(P.fold, 18)}</button>`) + '</span></div>'
337
- + (M.yours ? `<p class="hv-sub">${M.yours} ${M.yours === 1 ? 'is' : 'are'} yours</p>` : '')
338
339
  // Claude grilled something by itself this week and left findings (canvas FcPhone, Home): one quiet line with ✦, else nothing
339
340
  + (o.grill ? `<p class="hv-sub hv-gn"><span>${esc(o.grill.text)}</span><button type="button" class="ut-ib hv-ib" data-hm-gn="${esc(o.grill.id)}" aria-label="${esc('Open the ' + o.grill.n + (o.grill.n === 1 ? ' finding' : ' findings') + ' on ' + o.grill.title)}" title="Open the findings">${svg('M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z', 18)}</button></p>` : '');
340
341
  // the Today card only while the day has a moment; the plain day (its meetings and load) is in Your day
@@ -3,7 +3,8 @@
3
3
  * are lib/proposals.js and lib/routes-proposals.js; the Board's row carries r.props (null: nothing to show) and r.found (what a ✓ kept).
4
4
  *
5
5
  * chipOf(props) → the Viewer's chip after the title: { n, looking, label } | null (zero is silence)
6
- * sync(v, H) after each draw of the initiative: the ✦ in the Viewer's header, and a quiet read while Claude is looking
6
+ * sync(v, H) after each draw of the initiative: the ✦ in the Viewer's header (no count; it opens pm/batch-press.js, chief-of-staff
7
+ * C4), and a quiet read while Claude is looking
7
8
  * open(v, H) the ✦'s press: "Claude proposes N" as a drill-in. Groups in order: Found elsewhere, Dates, Looks done, Names,
8
9
  * Links. ✓ in the header keeps every proposal Claude is sure of; Check these and Not placed need their own ✓.
9
10
  * Each proposal: ⌄ its items, ✓ keep, ✕ drop for good; ✕ on one item drops that item. One toast with Undo.
@@ -55,7 +56,11 @@ export function sync(v, H) {
55
56
  const cur = VW.current(), body = VW.body();
56
57
  if (!cur || !body || !body.querySelector(`[data-iv="${CSS.escape(v.id)}"]`)) return;
57
58
  const c = chipOf(v.props);
58
- VW.setChip(cur.id, c ? { ...c, on: () => open(v, H) } : null);
59
+ // chief-of-staff C4 (board CsF): the ✦ is one press for the whole initiative — it opens the commit-style summary (pm/batch-press.js), whose
60
+ // last line opens this full list; the ✦ carries no queue count (the UI grill's delete list: Your move is the one count)
61
+ const at = H && H.where ? H.where() : {};
62
+ VW.setChip(cur.id, c ? { ...c, quiet: true, label: c.looking ? c.label : 'What Claude proposes on ' + (v.title || 'this initiative') + '. Open', on: () => import('./batch-press.js').then((B) => B.openBatch({ ws: at.ws, board: at.board, ini: v.id, title: v.title || v.id, props: v.props },
63
+ { pmGet, pmPost, toast: (m) => H.toast && H.toast(m), toastUndo: (m, u) => H.toast && H.toast(m, u), reload: H.reload, full: () => open(v, H) })) } : null);
59
64
  // while Claude looks, a quiet read every few seconds; a change reads the Board again
60
65
  if (c && c.looking && !POLL.has(v.id)) {
61
66
  const t0 = v.props.t;
@@ -1310,3 +1310,17 @@ body.iv-dragging { user-select: none; -webkit-user-select: none; cursor: grabbin
1310
1310
  .iv-gfm { color: var(--cz-ink3); font-size: var(--fs-label); }
1311
1311
  .iv-gfo { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--cz-bluebg); color: var(--cz-blue); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
1312
1312
  .iv-gfo:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
1313
+
1314
+ /* one press per initiative (chief-of-staff C4, board CsF; pm/batch-press.js) */
1315
+ .bp-lead { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 12px; color: var(--cz-ink2); font-size: var(--fs-row); line-height: 1.5; }
1316
+ .bp-lead svg { color: var(--cz-blueink); flex: none; margin-top: 3px; }
1317
+ .bp-sub { margin: 0 0 6px; font-size: var(--fs-meta); color: var(--cz-ink3); }
1318
+ .bp-ln { min-height: 44px; }
1319
+ .bp-ln.out b { text-decoration: line-through; color: var(--cz-ink3); font-weight: inherit; }
1320
+ .bp-why { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 4px 0 8px 10px; }
1321
+ .bp-why small { width: 100%; font-size: var(--fs-meta); color: var(--cz-ink3); }
1322
+ .bp-chip { min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--cz-hair); background: var(--cz-card); color: var(--cz-ink2); font: inherit; font-size: var(--fs-meta); cursor: pointer; }
1323
+ .bp-chip:hover { border-color: var(--cz-blue); color: var(--cz-blueink); }
1324
+ .bp-say { flex: 1 1 100%; min-height: 40px; border-radius: 12px; border: 1px solid var(--cz-hair); background: var(--cz-card); color: var(--cz-ink); padding: 0 12px; font: inherit; }
1325
+ .bp-full { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 12px; border: 0; background: none; color: var(--cz-ink3); font: inherit; font-size: var(--fs-meta); cursor: pointer; }
1326
+ .bp-full:hover { color: var(--cz-blueink); }
@@ -16,19 +16,35 @@
16
16
  * initiative that opens its ✦; folded under Older once its newest proposal is more than 14 days old, never gone
17
17
  * The calls only the PM can make that are not ✦ (a session that asks, a decision, blocked work) follow rank 5, as before.
18
18
  *
19
+ * THE ONLY INBOX (chief-of-staff C3, board CsE on the main canvas, In development). Every ask lands here, so two more kinds join:
20
+ * 2.5 mention a conversation that waits on the PM's reply (GET /api/mentions waiting; Home's Mentions card is gone): one row each,
21
+ * Claude's gist or the real latest message, the source, "reply drafted" when there is a draft; the press opens it
22
+ * 4.5 outbox a draft Claude put in the outbox (GET /api/outbox, queued or blocked): it waits for the PM to send it
23
+ * 5.6 extra what a page hands in (o.extra): Your impact's weekly check, Claude's clean-up of "Not in an initiative"
24
+ * Lab results are ✦ on their initiative (lib/idle-lab.js files them as proposals), so they ride in that initiative's row (rank 6).
25
+ * AT MOST 5 SHOW (CAP). The rest are "Can wait", in the same order (Claude's rank), never gone. A rank 6 row is one press for the whole
26
+ * initiative (C4, board CsF): its sub counts the groups ("3 dates, 2 names, 1 done, 3 links") and its press opens pm/batch-press.js.
27
+ * EXPIRY. A filed ✦ with no answer for 14 days expires on the server (GET /api/your-move expired, lib/proposals.js staleOf): it is left as it
28
+ * was and the reason is in History, so the old "Older" fold is gone; `expired` counts the ones of the last 7 days for one quiet line.
29
+ *
19
30
  * ONE FINDING, ONE ROW. Findings of one angle on one initiative are one row with their parts (Inline login's three red-team ✦), and two
20
31
  * proposals that say the same words on one initiative count once. Each row names its age: the day Claude filed it (a verdict: the days since
21
32
  * its check date; a late task's dates: the days since the date it missed).
22
33
  *
23
34
  * o: { products: [{ ws, name, board, rows }] (Board rows: r.props from lib/proposals.js viewOf, r.track, r.status),
24
- * programs: GET /api/programs' programs, move: GET /api/your-move answers by ws ({ [ws]: { verdicts, kr } }), calls: homeList's call
25
- * rows, now }
35
+ * programs: GET /api/programs' programs, move: GET /api/your-move answers by ws ({ [ws]: { verdicts, kr, expired } }), calls: homeList's call
36
+ * rows, mentions: GET /api/mentions waiting, outbox: GET /api/outbox entries, now }
37
+ * → { rows (at most CAP), wait (Can wait, ranked), older: [] (kept for old callers), expired: [{ ini, title, why, at, name }],
38
+ * done: [{ ref, via: 'autonomy' | 'proposals', ini, board, ws, at, said, name }] (C2: what Claude finished by itself, with Undo),
39
+ * notices: [{ job, product, until, text?, ws }] (a job demoted to propose, said once), n }
26
40
  * A row: { key, rank, kind, title, sub, tag, at, age, older, ws, board, ini, program, props: [{ ws, board, ini, ids, sigs }], ms: { program,
27
41
  * keys } | null, verdict: { ini, board, verdict, text } | null, yes: label | '', alt: label | '', call } */
28
42
  import { findingOf } from './grill-words.js';
29
43
 
30
44
  const DAY = 864e5;
31
45
  export const OLDER_DAYS = 14;
46
+ /** chief-of-staff C3: Your move shows at most this many asks; the rest are Can wait. */
47
+ export const CAP = 5;
32
48
  const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
33
49
  const plural = (n, a, b) => n + ' ' + (n === 1 ? a : b);
34
50
  const clip = (s, n) => { const t = String(s || '').replace(/\s+/g, ' ').trim(); return t.length > n ? t.slice(0, n - 1).replace(/\s+\S*$/, '') + '…' : t; };
@@ -41,7 +57,19 @@ const daysSince = (t, now) => (t == null ? null : Math.max(0, Math.floor((now -
41
57
  export const ageWord = (d) => (d == null ? '' : d === 0 ? 'today' : plural(d, 'day', 'days'));
42
58
  const norm = (s) => String(s || '').toLowerCase().replace(/[^a-z0-9]+/g, ' ').trim();
43
59
  const MEET = /\b(meeting|notes?|calendar|sync|standup|stand-up|review|steering|weekly)\b/i;
44
- const OTHER_WORD = { description: 'a description', outcome: 'an expected outcome', found: 'what it found elsewhere', dates: 'new dates', status: 'work that looks done', names: 'tidy names', links: 'task links', grill: 'grill findings' };
60
+ const OTHER_WORD = { description: 'a description', outcome: 'an expected outcome', found: 'what it found elsewhere', dates: 'new dates', status: 'work that looks done', names: 'tidy names', links: 'task links', grill: 'grill findings', prototyped: 'a prototype', improved: 'an improved prototype', scanned: 'a scan finding' };
61
+ /* C4: the commit-style counts of one initiative's row ("3 dates, 2 names, 1 done, 3 links"), in CsF's order, then what needs its own ✓ */
62
+ const COUNT_WORD = { dates: ['date', 'dates'], names: ['name', 'names'], status: ['done', 'done'], links: ['link', 'links'], found: ['find', 'finds'], description: ['description', 'descriptions'], outcome: ['outcome', 'outcomes'], prototyped: ['prototype', 'prototypes'], improved: ['prototype', 'prototypes'], scanned: ['scan', 'scans'] };
63
+ const COUNT_ORDER = ['dates', 'names', 'status', 'links', 'found', 'outcome', 'description', 'prototyped', 'improved', 'scanned'];
64
+ /** The parts one proposal counts for: a dates, names, status or links proposal counts its items (one line each), the rest count once. */
65
+ const partsOf = (p) => (['dates', 'names', 'status'].includes(p.group) && (p.items || []).length ? p.items.length : 1);
66
+ export function countsOf(props) {
67
+ const n = new Map();
68
+ for (const p of props || []) { const g = p.group === 'improved' ? 'prototyped' : p.group; n.set(g, (n.get(g) || 0) + partsOf(p)); }
69
+ const parts = COUNT_ORDER.filter((g) => n.get(g)).map((g) => { const k = n.get(g), w = COUNT_WORD[g] || [g, g]; return k + ' ' + (k === 1 ? w[0] : w[1]); });
70
+ for (const [g, k] of n) if (!COUNT_ORDER.includes(g)) parts.push(k + ' ' + g);
71
+ return { parts, total: [...n.values()].reduce((a, b) => a + b, 0) };
72
+ }
45
73
 
46
74
  /** Shipped (Deliver or later, or done) or late: a grill finding on it is rank 2. */
47
75
  const shippedOrLate = (r) => !!r && (r.late || r.status === 'late' || r.status === 'done' || (r.acts && r.acts.life === 'done') || (r.track && Number.isFinite(r.track.k) && r.track.k >= 5));
@@ -109,11 +137,10 @@ export function rankMove(o = {}) {
109
137
  }
110
138
  // 6 the rest: one row per initiative, opening its ✦
111
139
  if (other.length) {
112
- const ats = other.map(atOf).filter((t) => t != null), newest = ats.length ? Math.max(...ats) : null;
113
- const kinds = [...new Set(other.map((p) => p.group))].map((g) => OTHER_WORD[g] || g);
140
+ const ats = other.map(atOf).filter((t) => t != null);
141
+ const C = countsOf(other);
114
142
  add({ key: 'ot:' + ws + ':' + r.id, rank: 6, kind: 'other', ws, board: P.board || '', ini: r.id, tag: '', at: ats.length ? Math.min(...ats) : null,
115
- title: name + ': ' + plural(other.length, 'proposal', 'proposals'), sub: 'Claude proposes ' + list(kinds) + '.',
116
- older: newest != null && daysSince(newest, now) > OLDER_DAYS, alt: 'Open what Claude proposes' });
143
+ title: name + ': ' + plural(C.total, 'change', 'changes') + ' to keep', sub: C.parts.join(', ') + '.', count: C.total, alt: 'See every change' });
117
144
  }
118
145
  }
119
146
  // 5 the first key result with no reading
@@ -147,9 +174,40 @@ export function rankMove(o = {}) {
147
174
  sub: clip(list(said.slice(0, 4)) + (said.length > 4 ? ' and ' + (said.length - 4) + ' more' : ''), 160) + (n > 1 ? '. One press confirms all ' + n + '; ✎ to pick.' : '.'),
148
175
  yes: n > 1 ? 'Confirm all ' + n : 'Confirm', alt: 'Pick one by one' });
149
176
  }
177
+ // 2.5 the conversations that wait on the PM's reply (Mentions owns them; this is where they land)
178
+ for (const m of o.mentions || []) {
179
+ if (!m || !m.id) continue;
180
+ const who = (Array.isArray(m.people) && m.people.length ? m.people : [m.who || 'Someone']).map((x) => String(x).split(/\s+/)[0]);
181
+ const name = who.length === 1 ? who[0] : who.length === 2 ? who[0] + ' and ' + who[1] : who[0] + ' and ' + (who.length - 1) + ' others';
182
+ const said = m.gist || (m.ask ? 'asks ' + String(m.ask).replace(/^[A-Z](?=[a-z])/, (c) => c.toLowerCase()).replace(/[.?!]+$/, '') : '“' + clip(m.text || '', 90) + '”');
183
+ const src = m.source ? String(m.source).charAt(0).toUpperCase() + String(m.source).slice(1) : '';
184
+ add({ key: 'mn:' + m.id, rank: 2.5, kind: 'mention', mention: m, tag: 'Mention', at: tsOf(m.since || m.at || m.last),
185
+ title: name + ': ' + clip(said, 100), sub: [src + (m.where ? ' · ' + m.where : ''), m.reply || m.draft ? 'reply drafted' : ''].filter(Boolean).join(' · '),
186
+ alt: 'Open the conversation' });
187
+ }
188
+ // 4.5 the drafts Claude put in the outbox: they leave PMOS only when the PM sends them (C6)
189
+ for (const e of o.outbox || []) {
190
+ if (!e || !e.id || (e.state !== 'queued' && e.state !== 'blocked')) continue;
191
+ const ch = String(e.channel || 'message'), to = e.recipient ? ' to ' + e.recipient : '';
192
+ add({ key: 'ob:' + e.id, rank: 4.5, kind: 'outbox', outbox: e, tag: 'Outbox', at: tsOf(e.created_at || e.at),
193
+ title: clip(e.subject || String(e.body || '').split('\n')[0] || 'A draft', 100), sub: 'Drafted' + (ch ? ' for ' + ch.charAt(0).toUpperCase() + ch.slice(1) : '') + to + (e.state === 'blocked' ? ' · a claim needs a look' : ' · waits for you to send'),
194
+ alt: 'Open the draft' });
195
+ }
196
+ // 5.6 the other asks a page hands in (o.extra): Your impact's weekly check, Claude's clean-up of "Not in an initiative". Their cards and
197
+ // chips on Home are gone (the UI grill's delete list); this is where they land. { key, title, sub, go, alt }
198
+ for (const x of o.extra || []) if (x && x.key && x.title) add({ rank: 5.6, kind: 'extra', tag: '', at: null, age: '', alt: 'Open', ...x, key: 'ex:' + x.key });
150
199
  // the calls only the PM can make that are not ✦ (Claude's milestone changes are rank 3 now: said once)
151
200
  for (const c of (o.calls || []).filter((x) => x && x.kind !== 'msreview')) add({ key: 'call:' + c.id, rank: 5.5, kind: 'call', call: c, title: c.name, sub: '', at: null, age: '' });
152
201
  rows.sort((a, b) => a.rank - b.rank || (a.at == null) - (b.at == null) || (a.at || 0) - (b.at || 0) || a.key.localeCompare(b.key));
153
- const older = rows.filter((r) => r.older), shown = rows.filter((r) => !r.older);
154
- return { rows: shown, older, n: rows.length };
202
+ // C3: at most CAP show; the rest can wait, in the same order. The expired ✦ of the last 7 days, said once.
203
+ // C2: what Claude finished by itself (lib/done-feed.js), one line per batch with its initiative's name and one Undo
204
+ const expired = [], done = [], notices = [];
205
+ for (const P of o.products || []) {
206
+ const M = (o.move && o.move[P.ws || '']) || {}, nameOf = (ini) => { const r = (P.rows || []).find((x) => x && x.id === ini); return (r && (r.title || r.id)) || ini || ''; };
207
+ for (const x of M.expired || []) expired.push({ ...x, ws: P.ws || '', name: nameOf(x.ini) });
208
+ for (const x of M.done || []) done.push({ ...x, ws: P.ws || '', board: x.board || P.board || '', name: x.ini ? nameOf(x.ini) : '' });
209
+ for (const x of M.notices || []) notices.push({ ...x, ws: P.ws || '' });
210
+ }
211
+ done.sort((a, b) => String(b.at).localeCompare(String(a.at)));
212
+ return { rows: rows.slice(0, CAP), wait: rows.slice(CAP), older: [], expired, done, notices, n: rows.length };
155
213
  }