create-pmos 0.401.0 → 0.403.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 (127) hide show
  1. package/package.json +25 -30
  2. package/payload/KIT-VERSION +2 -2
  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/payload/state/log.md +1 -1
  7. package/workspace/board-programs-test.js +227 -0
  8. package/workspace/board-shot.js +54 -0
  9. package/workspace/briefing-premium-adddoc-test.js +28 -22
  10. package/workspace/briefing-premium-board-test.js +107 -82
  11. package/workspace/briefing-premium-calendar-2-test.js +23 -10
  12. package/workspace/briefing-premium-calendar-3-test.js +23 -19
  13. package/workspace/briefing-premium-calendar-test.js +20 -15
  14. package/workspace/briefing-premium-initiative-test.js +25 -12
  15. package/workspace/briefing-premium-insights-test.js +31 -18
  16. package/workspace/briefing-premium-metrics-test.js +8 -8
  17. package/workspace/briefing-premium-sources-test.js +15 -10
  18. package/workspace/briefing-premium-test.js +39 -16
  19. package/workspace/changelog.json +24 -0
  20. package/workspace/fixtures/board-premium-facts.js +20 -3
  21. package/workspace/fixtures/briefing-premium-facts.js +18 -2
  22. package/workspace/fixtures/premium-viewer-fixtures.js +24 -2
  23. package/workspace/fixtures/program-ascent.js +101 -0
  24. package/workspace/guide/home.md +11 -7
  25. package/workspace/guide/index.md +1 -0
  26. package/workspace/guide/jira.md +38 -6
  27. package/workspace/guide/programs.md +37 -0
  28. package/workspace/home-rows-test.js +184 -0
  29. package/workspace/lib/briefing-premium-products.js +4 -4
  30. package/workspace/lib/briefing-premium.js +2 -2
  31. package/workspace/lib/calendar-layers.js +8 -4
  32. package/workspace/lib/initiative-layout.js +4 -3
  33. package/workspace/lib/jira-cli.js +17 -12
  34. package/workspace/lib/jira-status.js +1 -1
  35. package/workspace/lib/jira-tickets.js +126 -24
  36. package/workspace/lib/meeting-files.js +58 -0
  37. package/workspace/lib/meeting-learn.js +139 -0
  38. package/workspace/lib/meeting-material.js +12 -5
  39. package/workspace/lib/notes.js +3 -0
  40. package/workspace/lib/programs.js +129 -0
  41. package/workspace/lib/route-modules.js +1 -0
  42. package/workspace/lib/routes-brief-page.js +8 -1
  43. package/workspace/lib/routes-briefing-premium.js +1 -1
  44. package/workspace/lib/routes-calendar-views.js +24 -3
  45. package/workspace/lib/routes-meeting-material.js +38 -0
  46. package/workspace/lib/routes-meeting-points.js +23 -3
  47. package/workspace/lib/routes-programs.js +122 -0
  48. package/workspace/package-lock.json +2 -2
  49. package/workspace/package.json +1 -1
  50. package/workspace/premium-board-actions-test.js +31 -25
  51. package/workspace/premium-chat-context-test.js +1 -1
  52. package/workspace/premium-chat-goal-view-test.js +1 -1
  53. package/workspace/premium-chat-viewer-test.js +1 -1
  54. package/workspace/premium-core-doc-issue-test.js +13 -7
  55. package/workspace/premium-discuss-landing-test.js +83 -0
  56. package/workspace/premium-link-suggest-test.js +103 -0
  57. package/workspace/premium-report-read-test.js +86 -82
  58. package/workspace/premium-vw-backlog-test.js +6 -5
  59. package/workspace/premium-vw-cal-test.js +45 -19
  60. package/workspace/premium-vw-item-test.js +8 -6
  61. package/workspace/premium-vw-jira-test.js +3 -2
  62. package/workspace/premium-vw-meet-test.js +122 -66
  63. package/workspace/premium-vw-notes-test.js +7 -6
  64. package/workspace/premium-vw-rec-test.js +14 -13
  65. package/workspace/premium-vw-slides-test.js +11 -5
  66. package/workspace/program-panel-test.js +152 -0
  67. package/workspace/public/pm/bd-acts.js +24 -15
  68. package/workspace/public/pm/bd-asks.js +111 -30
  69. package/workspace/public/pm/bd-ini-panel.js +229 -0
  70. package/workspace/public/pm/bd-pop.js +2 -2
  71. package/workspace/public/pm/bd-prog-panel.js +436 -0
  72. package/workspace/public/pm/bd-prog.js +191 -0
  73. package/workspace/public/pm/bd-span.js +98 -15
  74. package/workspace/public/pm/bd-views.js +93 -29
  75. package/workspace/public/pm/cozy-board.css +214 -20
  76. package/workspace/public/pm/cozy-evui.js +4 -2
  77. package/workspace/public/pm/cozy-home-rows.css +54 -0
  78. package/workspace/public/pm/cozy-home.css +35 -0
  79. package/workspace/public/pm/cozy-insights.css +1 -2
  80. package/workspace/public/pm/cozy-mtg-present.css +160 -0
  81. package/workspace/public/pm/cozy-panel.css +155 -0
  82. package/workspace/public/pm/cozy-rec-pill.css +12 -0
  83. package/workspace/public/pm/cozy-rec-pill.js +46 -0
  84. package/workspace/public/pm/cozy-today.css +189 -0
  85. package/workspace/public/pm/cozy-viewer.js +307 -43
  86. package/workspace/public/pm/cozy-vw-mtg.css +96 -94
  87. package/workspace/public/pm/cozy-vw-rp.css +40 -25
  88. package/workspace/public/pm/cozy-vw-shell.css +127 -0
  89. package/workspace/public/pm/cozy-xv.css +51 -0
  90. package/workspace/public/pm/cozy-xv.js +34 -0
  91. package/workspace/public/pm/home-app.js +192 -72
  92. package/workspace/public/pm/home-chat.js +17 -4
  93. package/workspace/public/pm/home-data.js +1 -1
  94. package/workspace/public/pm/home-day.js +64 -0
  95. package/workspace/public/pm/home-ini-model.js +1 -1
  96. package/workspace/public/pm/home-ini.js +197 -54
  97. package/workspace/public/pm/home-list.js +100 -27
  98. package/workspace/public/pm/home-mentions.js +187 -0
  99. package/workspace/public/pm/home-rec-row.js +67 -0
  100. package/workspace/public/pm/home-review.js +20 -10
  101. package/workspace/public/pm/home-task.js +19 -18
  102. package/workspace/public/pm/home-today.js +137 -59
  103. package/workspace/public/pm/premium-board.js +294 -288
  104. package/workspace/public/pm/premium-insights.js +118 -82
  105. package/workspace/public/pm/premium-mtg-present.js +408 -100
  106. package/workspace/public/pm/premium-mtg-replay.js +70 -10
  107. package/workspace/public/pm/premium-report-read.js +118 -63
  108. package/workspace/public/pm/premium-vw-cal.js +62 -34
  109. package/workspace/public/pm/premium-vw-mtg.js +348 -192
  110. package/workspace/public/pm/program-model.js +192 -0
  111. package/workspace/public/pm/rec-state.js +63 -0
  112. package/workspace/public/pm/rp-parts.js +33 -8
  113. package/workspace/public/pm/tk-draft.js +107 -0
  114. package/workspace/public/pm/tk-model.js +134 -0
  115. package/workspace/public/pm/tk-send.js +124 -0
  116. package/workspace/public/pm/tk-tasks.css +120 -0
  117. package/workspace/public/premium-board.html +4 -2
  118. package/workspace/server.js +4 -2
  119. package/workspace/skills/jira-push.skill +3 -3
  120. package/workspace/test-lists/board-programs.json +9 -0
  121. package/workspace/test-lists/prd-to-jira.json +6 -0
  122. package/workspace/test-lists/program-hierarchy.json +11 -0
  123. package/workspace/test-lists/program-panel.json +9 -0
  124. package/workspace/test-lists/viewer-home-rows.json +9 -0
  125. package/workspace/test-lists/viewer-meetings.json +9 -0
  126. package/workspace/test-lists/viewer-shell-a.json +15 -0
  127. package/workspace/tk-tasks-test.js +199 -0
@@ -0,0 +1,184 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* home-rows-test.js — the two rows at the top of Home and the Mentions Viewer (Viewer kit; canvas XvANew, XvAMention, XvAMentionJira,
4
+ * XvAMentionDoc, XvAMentionMail, XvARecHome; public/pm/home-mentions.js, home-rec-row.js).
5
+ * Serves the real page from the real server. GET /api/briefing-premium answers the fixture model (as briefing-premium-test.js does),
6
+ * GET /api/brief-page is the server's own answer with today's mentions put in, and GET /api/notes says whether a meeting records.
7
+ * M1 @Mentions is the first row of the list with "N new"; with none new the row stays, quiet, with no count
8
+ * M2 no mention is a row under an initiative or under Not in an initiative any more (say it once)
9
+ * M3 the row opens the Mentions Viewer: the summary (N new, ONE primary Reply to <first>), New open, Earlier folded with its count
10
+ * M4 a mention drills in: ← returns to Mentions; the summary, the excerpt with the mention outlined, What I checked only when checked,
11
+ * Open in <source> and the initiative; ⋯ holds Make it a task and Mark read, and Mark read posts the mark
12
+ * R1 a recording pins a row above @Mentions with its title and a ticking clock; paused is quieter and still; none: no row
13
+ * F a phone (390 px): the rows, and the Viewer full screen; no page error anywhere
14
+ * Screenshots (1440x900, 390x844) go to PMOS_SHOTS when it is set. Every wait polls the page. */
15
+ const fs = require('fs');
16
+ const path = require('path');
17
+ const { spawn } = require('child_process');
18
+ const { findBrowser } = require('./lib/find-browser');
19
+ const T = require('./test-run').configure({ name: 'home-rows' });
20
+ const B = require('./lib/briefing-premium.js');
21
+ const F = require('./fixtures/briefing-premium-facts.js');
22
+
23
+ const BASE = T.BASE;
24
+ const SHOTS = process.env.PMOS_SHOTS || '';
25
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
26
+ const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { let v; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
27
+ const results = [];
28
+ const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 600) : ''}`); };
29
+ let srv = null; let browser = null;
30
+ const finish = async (code) => {
31
+ if (browser) await browser.close().catch(() => {});
32
+ if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
33
+ T.killTmux();
34
+ const bad = results.filter((x) => !x.cond).length;
35
+ console.log(`\n${results.length - bad}/${results.length} home-rows assertions passed`);
36
+ process.exit(code !== undefined ? code : (bad ? 1 : 0));
37
+ };
38
+ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
39
+ const MODEL = B.build(F.facts());
40
+
41
+ const ago = (min) => new Date(Date.now() - min * 60000).toISOString();
42
+ const MENTIONS = (ini) => [
43
+ { id: 'aaaaaaaaaaa1', source: 'slack', who: 'Dita', where: '#product', text: '@wawan can we cut search from v2.4 and ship it in v2.5?', reply: true, in_needs: false, read: false, at: ago(120),
44
+ link: 'https://slack.example/1', initiative: ini, checks: ['Search is 3 of 8 tickets in v2.4. Moving it keeps Nov 4.'],
45
+ thread: [{ who: 'Bima', at: ago(132), text: 'QA found 2 more search bugs.' }, { who: 'Dita', at: ago(120), text: '@wawan can we cut search from v2.4 and ship it in v2.5?' }, { who: 'Rudi', at: ago(114), text: 'The bugs are in ranking.' }] },
46
+ { id: 'aaaaaaaaaaa2', source: 'confluence', who: 'Ana', where: 'PRD v3', text: 'Is the calendar in or out of this scope?', reply: true, in_needs: false, read: false, at: ago(40) },
47
+ { id: 'aaaaaaaaaaa3', source: 'mail', who: 'Bima', where: 'Partners in the v2.4 beta?', text: 'Can we add two partners to the beta?', reply: false, in_needs: false, read: true, at: ago(300) },
48
+ ];
49
+
50
+ (async () => {
51
+ const exe = findBrowser();
52
+ if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the home-rows suite cannot run'); return finish(1); }
53
+ let chromium;
54
+ try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed — the home-rows suite cannot run'); return finish(1); }
55
+ srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
56
+ await T.waitForServer(BASE);
57
+ browser = await chromium.launch({ executablePath: exe });
58
+
59
+ // the fixture's first initiative, so a mention names one Home shows
60
+ const board = await until(async () => { const r = await fetch(BASE + '/api/board-premium').then((x) => x.json()).catch(() => null); return r && r.ok && r.model ? r.model : null; }, 20000, 500);
61
+ const INI = (((board && board.initiatives && board.initiatives.list && board.initiatives.list.rows) || []).find((r) => r && r.id) || {}).id || '';
62
+ ok('0 the board has an initiative for a mention to name', !!INI);
63
+
64
+ const open = async ({ w = 1440, h = 900, mentions = MENTIONS(INI), rec = null } = {}) => {
65
+ const ctx = await browser.newContext({ viewport: { width: w, height: h }, hasTouch: w < 500 });
66
+ const page = await ctx.newPage();
67
+ const errors = [], posts = [];
68
+ page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
69
+ page.on('request', (r) => { if (r.method() === 'POST' && r.url().startsWith(BASE)) posts.push({ path: new URL(r.url()).pathname, body: (() => { try { return JSON.parse(r.postData() || 'null'); } catch { return null; } })() }); });
70
+ const json = (body, status = 200) => (r) => r.fulfill({ status, contentType: 'application/json', body: JSON.stringify(body) });
71
+ await page.route(/\/api\/briefing-premium(\?.*)?$/, json({ ok: true, state: 'ready', model: MODEL, as_of: Date.now() }));
72
+ await page.route(/\/api\/brief-page(\?.*)?$/, async (r) => {
73
+ try { // a read still in flight when the context closes is dropped, not a failure of the suite
74
+ const res = await r.fetch(); let b = {}; try { b = await res.json(); } catch { /* none */ }
75
+ await r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ ...b, ok: true, mentions: JSON.parse(JSON.stringify(mentions)) }) });
76
+ } catch { /* the context closed */ }
77
+ });
78
+ const notes = { cur: rec };
79
+ await page.route(/\/api\/notes(\?.*)?$/, (r) => r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ ok: true, notes: notes.cur ? [notes.cur] : [] }) }));
80
+ await page.route('**/api/mentions/read', json({ ok: true }));
81
+ await page.route('**/api/pm-items/add', json({ ok: true, id: 'x' }));
82
+ await page.goto(BASE + '/premium.html');
83
+ const up = await until(() => page.evaluate(() => !!document.querySelector('#hmList [data-hr-mentions]')), 20000);
84
+ const close = async () => { await ctx.unrouteAll({ behavior: 'ignoreErrors' }).catch(() => {}); await ctx.close().catch(() => {}); };
85
+ return { ctx, page, errors, posts, up, notes, close };
86
+ };
87
+ const shot = async (page, name) => { if (!SHOTS) return; fs.mkdirSync(SHOTS, { recursive: true }); await page.screenshot({ path: path.join(SHOTS, name + '.png') }); };
88
+ const vw = (page) => page.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); return v ? { title: (v.querySelector('#czVwTitle') || {}).textContent || '', text: v.textContent, back: !!v.querySelector('[data-cz-vw="back"]') } : null; });
89
+
90
+ /* M1, M2 */
91
+ const A = await open();
92
+ ok('0 the page draws the list with the Mentions row', !!A.up);
93
+ if (!A.up) return finish(1);
94
+ const p = A.page;
95
+ const top = await p.evaluate(() => { const b = document.querySelector('#hmList .hv-body'); const f = b && b.firstElementChild; return { first: f ? f.className : '', text: f ? f.textContent.replace(/\s+/g, ' ').trim() : '' }; });
96
+ ok('M1 @Mentions is the first row of the list, with "2 new"', /hr-men-card/.test(top.first) && /^@ ?Mentions ?2 new$/.test(top.text), JSON.stringify(top));
97
+ ok('M2 no mention is a row under an initiative or under Not in an initiative', await p.evaluate(() => !document.querySelector('#hmList [data-id^="men:"]')));
98
+ await shot(p, 'home-1440');
99
+
100
+ /* M3 */
101
+ await p.click('#hmList [data-hr-mentions]');
102
+ const L1 = await until(() => vw(p).then((v) => (v && v.title === 'Mentions' ? v : null)));
103
+ ok('M3 the row opens the Mentions Viewer', !!L1, JSON.stringify(L1));
104
+ const sum = await p.evaluate(() => { const v = document.querySelector('#czViewer'); const s = v.querySelector('.czs-sum'); return { line: (s.querySelector('.czs-line') || {}).textContent || '', pri: [...s.querySelectorAll('.czs-pri')].map((b) => b.textContent), secs: [...v.querySelectorAll('.czs-sec')].map((x) => [x.querySelector('.czs-row b').textContent, (x.querySelector('.czs-n') || {}).textContent || '', x.querySelector('.czs-row').getAttribute('aria-expanded')]), items: v.querySelectorAll('.czs-body:not([hidden]) [data-hr-mi]').length, sel: !!document.querySelector('#hmList .hr-men.sel') }; });
105
+ ok('M3 the summary says 2 new and has ONE primary, Reply to Dita', /2 new since this morning/.test(sum.line) && sum.pri.length === 1 && sum.pri[0] === 'Reply to Dita', JSON.stringify(sum));
106
+ ok('M3 New is open with 2 mentions; Earlier is folded with its count', JSON.stringify(sum.secs) === JSON.stringify([['New', '2', 'true'], ['Earlier', '1', 'false']]) && sum.items === 2, JSON.stringify(sum));
107
+ ok('M3 the Mentions row is the selected row', sum.sel);
108
+ await shot(p, 'mentions-1440');
109
+
110
+ /* M4 */
111
+ await p.click('#czViewer [data-hr-mi="aaaaaaaaaaa1"]');
112
+ const D1 = await until(() => vw(p).then((v) => (v && /^Dita/.test(v.title) ? v : null)));
113
+ ok('M4 the Slack mention\'s tile is the @ icon', await p.evaluate(() => /M12 8a4 4/.test((document.querySelector('#czViewer .cz-vw-tile path') || { getAttribute: () => '' }).getAttribute('d'))));
114
+ ok('M4 a mention drills in, titled who and where, with ←', !!D1 && D1.title === 'Dita · Slack #product' && D1.back, JSON.stringify(D1));
115
+ const one = await p.evaluate(() => { const v = document.querySelector('#czViewer'); return { line: (v.querySelector('.czs-line') || {}).textContent || '', warn: !!v.querySelector('.czs-line.warn'), pri: [...v.querySelectorAll('.czs-pri')].map((b) => b.textContent), me: [...v.querySelectorAll('.hr-msg.me')].map((x) => x.textContent), msgs: v.querySelectorAll('.hr-msg').length, chk: !!v.querySelector('.hr-chk'), rows: [...v.querySelectorAll('.czs-row b')].map((b) => b.textContent) }; });
116
+ ok('M4 the summary waits on the PM (amber) with ONE primary, Draft a reply', /^Waiting on you · 2 h/.test(one.line) && one.warn && one.pri.join() === 'Draft a reply', JSON.stringify(one));
117
+ ok('M4 the thread shows with the mention outlined, once', one.msgs === 3 && one.me.length === 1 && /cut search/.test(one.me[0]), JSON.stringify(one));
118
+ ok('M4 What I checked shows the brief\'s check; Open in Slack and the initiative are rows', one.chk && one.rows[0] === 'Open in Slack' && one.rows.length === (INI ? 2 : 1), JSON.stringify(one));
119
+ await shot(p, 'mention-slack-1440');
120
+ await p.click('#czViewer [data-cz-vw="more"]');
121
+ const menu = await until(() => p.evaluate(() => [...document.querySelectorAll('.cz-vw-menu button')].map((b) => b.textContent)));
122
+ ok('M4 ⋯ holds Make it a task and Mark read', JSON.stringify(menu) === JSON.stringify(['Make it a task', 'Mark read']), JSON.stringify(menu));
123
+ await p.click('.cz-vw-menu button:has-text("Mark read")');
124
+ const mark = await until(() => A.posts.find((x) => x.path === '/api/mentions/read'));
125
+ ok('M4 Mark read posts the mark for that mention', !!mark && mark.body.id === 'aaaaaaaaaaa1' && mark.body.read === true, JSON.stringify(mark));
126
+ const still = await until(() => vw(p).then((v) => (v && /^Dita/.test(v.title) && v.back ? v : null)));
127
+ ok('M4 after Mark read the mention stays shown, and ← still goes back', !!still);
128
+ await p.click('#czViewer [data-cz-vw="back"]');
129
+ const L2 = await until(() => vw(p).then((v) => (v && v.title === 'Mentions' ? v : null)));
130
+ ok('M4 ← returns to the Mentions list', !!L2);
131
+ await p.click('#czViewer [data-hr-mi="aaaaaaaaaaa2"]');
132
+ const D2 = await until(() => p.evaluate(() => { const v = document.querySelector('#czViewer'); const t = (v.querySelector('#czVwTitle') || {}).textContent; return /^Ana/.test(t) ? { t, chk: !!v.querySelector('.hr-chk'), me: v.querySelectorAll('.hr-msg.me').length, rows: [...v.querySelectorAll('.czs-row b')].map((b) => b.textContent) } : null; }));
133
+ ok('M4 a mention with no check claims none (honest state); a document comment shows its words outlined', !!D2 && D2.t === 'Ana · comment on PRD v3' && !D2.chk && D2.me === 1 && D2.rows.length === 0, JSON.stringify(D2));
134
+ await shot(p, 'mention-doc-1440');
135
+ ok('M no page error', !A.errors.length, A.errors.join(' | '));
136
+ await A.close();
137
+
138
+ /* M1 at zero */
139
+ const Z = await open({ mentions: MENTIONS(INI).map((m) => ({ ...m, read: true })) });
140
+ const z = await Z.page.evaluate(() => { const r = document.querySelector('#hmList [data-hr-mentions]'); return r ? { t: r.textContent.replace(/\s+/g, ' ').trim(), n: !!r.querySelector('.hr-new') } : null; });
141
+ ok('M1 with none new the row stays, quiet, with no count', !!z && /^@ ?Mentions$/.test(z.t) && !z.n, JSON.stringify(z));
142
+ await Z.close();
143
+
144
+ /* R1 */
145
+ const note = { id: 'n-rec-1', state: 'recording', title: 'Viewer sync', meeting_ms: (12 * 60 + 40) * 1000 };
146
+ const R = await open({ rec: note });
147
+ const r1 = await until(() => R.page.evaluate(() => { const b = document.querySelector('#hmList .hv-body'); const f = b && b.firstElementChild; return f && /hr-rec-card/.test(f.className) ? { t: f.textContent.replace(/\s+/g, ' ').trim(), next: (f.nextElementSibling || {}).className || '', paused: f.classList.contains('paused') } : null; }), 15000);
148
+ ok('R1 a recording pins a row above @Mentions: its title and Recording · 12:4x', !!r1 && /^Viewer sync ?Recording · 12:4\d$/.test(r1.t) && /hr-men-card/.test(r1.next) && !r1.paused, JSON.stringify(r1));
149
+ ok('R1 the Today card does not say the recording again (say it once)', await R.page.evaluate(() => !/not on the calendar/.test((document.querySelector('#hmList') || {}).textContent || '')));
150
+ const c0 = await R.page.textContent('#hmList [data-hr-clock]');
151
+ const c1 = await until(async () => { const t = await R.page.textContent('#hmList [data-hr-clock]'); return t !== c0 ? t : null; }, 4000);
152
+ ok('R1 the clock ticks', !!c1, c0 + ' → ' + c1);
153
+ await shot(R.page, 'rec-1440');
154
+ await R.page.click('#hmList [data-hr-mentions]');
155
+ await until(() => vw(R.page));
156
+ ok('R1 the row stays while another item is open', await R.page.evaluate(() => !!document.querySelector('#hmList .hr-rec-card')));
157
+ R.notes.cur = { ...note, state: 'paused' };
158
+ // the page reads the notes again within 10 s (rec-state.js, or Home's own notes while that is not on the page)
159
+ const r2 = await until(() => R.page.evaluate(() => { const f = document.querySelector('#hmList .hr-rec-card'); return f && f.classList.contains('paused') ? f.textContent.replace(/\s+/g, ' ').trim() : null; }), 16000, 500);
160
+ ok('R1 paused: "Paused · 12:40", quieter', !!r2 && /Paused · 12:40$/.test(r2), String(r2));
161
+ const s0 = await R.page.textContent('#hmList [data-hr-clock]'); await sleep(1300);
162
+ ok('R1 a paused clock stands still', s0 === await R.page.textContent('#hmList [data-hr-clock]'));
163
+ await shot(R.page, 'rec-paused-1440');
164
+ ok('R no page error', !R.errors.length, R.errors.join(' | '));
165
+ await R.close();
166
+
167
+ /* F */
168
+ const P = await open({ w: 390, h: 844, rec: note });
169
+ const ph = await until(() => P.page.evaluate(() => !!document.querySelector('#hmList .hr-rec-card') && !!document.querySelector('#hmList [data-hr-mentions]')), 15000);
170
+ ok('F on a phone both rows show', !!ph);
171
+ await shot(P.page, 'home-390');
172
+ await P.page.click('#hmList [data-hr-mentions]');
173
+ const pv = await until(() => P.page.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); if (!v) return null; const r = v.getBoundingClientRect(); return { w: Math.round(r.width), back: !!v.querySelector('[data-cz-vw="back"]') }; }));
174
+ ok('F the Mentions Viewer is full screen on a phone, with ←', !!pv && pv.w >= 380 && pv.back, JSON.stringify(pv));
175
+ await shot(P.page, 'mentions-390');
176
+ await P.page.click('#czViewer [data-hr-mi="aaaaaaaaaaa1"]');
177
+ await until(() => vw(P.page).then((v) => (v && /^Dita/.test(v.title) ? v : null)));
178
+ await shot(P.page, 'mention-slack-390');
179
+ const sx = await P.page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1);
180
+ ok('F no sideways scroll at 390 px', sx);
181
+ ok('F no page error', !P.errors.length, P.errors.join(' | '));
182
+ await P.close();
183
+ return finish();
184
+ })();
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  /* lib/briefing-premium-products.js — the premium Briefing across products (initiative briefing-premium-products).
3
3
  *
4
- * choose({ workspaces, include }) → { available[{ ws, name, root, home, on }], ignored[] } PURE. Which workspaces the Briefing reads.
4
+ * choose({ workspaces, include }) → { available[{ ws, name, root, home, initials?, on }], ignored[] } PURE. Which workspaces the Briefing reads.
5
5
  * splitKey(key) → { base, ws } | null PURE. A merged row's key is kind:id:ws.
6
6
  * modelOfMany({ available, engine, runtimeDir }) → { state, model, as_of, ... } the route's answer, one workspace read and kept at a time.
7
7
  * rebuildOne({ root, runtimeDir }) after a write: that workspace's quick facts again, without the slow read.
@@ -22,12 +22,12 @@ const W = require('./briefing-premium-writes.js');
22
22
  const STALE_MS = 5 * 60 * 1000;
23
23
  const RETRY_AFTER_ERROR_MS = 2 * 60 * 1000;
24
24
 
25
- /** workspaces: [{ id, name, root, home }]. include: an array of ids, or null for the default. */
25
+ /** workspaces: [{ id, name, root, home, initials? }] (initials: the workspace's own abbreviation, set in Settings; Home's product tile shows it). include: an array of ids, or null for the default. */
26
26
  function choose({ workspaces, include, only }) {
27
27
  const list = (workspaces || []).filter((w) => w && w.id && w.root);
28
28
  const ids = new Set(list.map((w) => w.id));
29
29
  const pick = Array.isArray(include) ? new Set(include) : null;
30
- const available = list.map((w) => ({ ws: w.id, name: w.name || w.id, root: w.root, home: !!w.home, on: only ? w.id === only : pick ? pick.has(w.id) : !w.home }));
30
+ const available = list.map((w) => ({ ws: w.id, name: w.name || w.id, root: w.root, home: !!w.home, ...(w.initials ? { initials: String(w.initials) } : {}), on: only ? w.id === only : pick ? pick.has(w.id) : !w.home }));
31
31
  return { available, ignored: Array.isArray(include) ? include.filter((x) => !ids.has(x)) : [] };
32
32
  }
33
33
 
@@ -98,7 +98,7 @@ async function modelOfMany({ available, engine, runtimeDir, sources, agent, agen
98
98
  const settled = parts.filter((p) => p.state === 'ready').length;
99
99
  if (on.length && !settled && parts.every((p) => p.state === 'reading')) return { state: 'reading', elapsed_ms: elapsed };
100
100
  if (on.length && !settled && parts.every((p) => p.state === 'error')) return { state: 'error', error: parts.map((p) => p.product.name + ': ' + p.error).join('; ').slice(0, 300) };
101
- const model = BP.buildMany({ now, asOf: asOf || now, meetings: BP.readMeetings(runtimeDir, now), defers: Object.fromEntries(W.readDefers(runtimeDir, now)), available: (available || []).map((a) => ({ ws: a.ws, name: a.name, home: a.home, on: a.on })), parts, sources, agent, agentAside });
101
+ const model = BP.buildMany({ now, asOf: asOf || now, meetings: BP.readMeetings(runtimeDir, now), defers: Object.fromEntries(W.readDefers(runtimeDir, now)), available: (available || []).map((a) => ({ ws: a.ws, name: a.name, home: a.home, on: a.on, ...(a.initials ? { initials: a.initials } : {}) })), parts, sources, agent, agentAside });
102
102
  last = model;
103
103
  return { state: 'ready', model, as_of: asOf || now, refreshing, pending: model.pending, ...(error ? { error } : {}) };
104
104
  }
@@ -397,7 +397,7 @@ const KIND_RANK = { blocked: 0, decision: 1, waited: 2 };
397
397
  const longest = (r) => { const d = (r.detail && r.detail.days) || []; return d.length ? d[d.length - 1] : 0; };
398
398
 
399
399
  /** Several products' facts → ONE model, in the same shape build() makes.
400
- * g = { now, asOf, meetings (shared, or null), defers { key: until }, available: [{ ws, name, home, on }],
400
+ * g = { now, asOf, meetings (shared, or null), defers { key: until }, available: [{ ws, name, home, on, initials? }],
401
401
  * parts: [{ product: { ws, name }, f (that product's facts) | null, state: 'ready' | 'reading' | 'error', error? }] }
402
402
  * A row belongs to one product (its key ends with the workspace id) and the rows are put in one order: blocked first, then decisions, then reviews.
403
403
  * A count is never summed across products: each product gets its own failed-review row. The hero and Today read the merged facts. */
@@ -451,7 +451,7 @@ function buildMany(g) {
451
451
  list: { title: 'What you need to do', rows, more, count: rows.length + more, pendingNote: pending ? 'Blocked work, prototypes waiting for you and failed reviews appear when the initiative state has been read.' : null, putOff: putOff.map((x) => ({ key: x.key, title: x.title, ...(x.product ? { product: x.product } : {}), until: x.until, text: (x.product ? x.product + ': ' : '') + x.title + ' · back ' + backAt(x.until, now) })), order: 'In this order: blocked work first, then decisions only you can make, then what has waited longest.' },
452
452
  today: todayOf(cf),
453
453
  dock: { needs: pending ? null : rows.length + more, label: plural(rows.length + more, 'needs you', 'need you'), next: rows[0] ? rows[0].title : null },
454
- products: { available: available.map((a) => ({ ws: a.ws, name: a.name, home: !!a.home, on: !!a.on })), none },
454
+ products: { available: available.map((a) => ({ ws: a.ws, name: a.name, home: !!a.home, on: !!a.on, ...(a.initials ? { initials: a.initials } : {}) })), none },
455
455
  ...(g.agentAside ? { agent: { rows: dx, goals: [] } } : {}),
456
456
  };
457
457
  }
@@ -361,11 +361,12 @@ function contextFrom(events, range, src, opts = {}) {
361
361
  if (past) {
362
362
  for (const n of notes) {
363
363
  if (n.private) continue; // a private note shows its title and nothing of its content
364
- for (const d of n.decisions || []) if (str(d && d.text)) items.push({ kind: 'decision', text: str(d.text), ref: { type: 'note', id: n.id } });
364
+ // a point the PM has not confirmed is not a fact: it is kept, marked confirmed: false, so a reader can say "to confirm"
365
+ for (const d of n.decisions || []) if (str(d && d.text)) items.push({ kind: 'decision', text: str(d.text), ref: { type: 'note', id: n.id }, ...(d.confirmed === false ? { confirmed: false } : {}) });
365
366
  for (const a of n.actions || []) {
366
367
  if (!str(a && a.text)) continue;
367
368
  const tail = [a.owner && `owner: ${a.owner}`, a.due && `due: ${a.due}`].filter(Boolean).join(', ');
368
- items.push({ kind: 'action', text: str(a.text) + (tail ? ` (${tail})` : ''), ref: { type: 'note', id: n.id } });
369
+ items.push({ kind: 'action', text: str(a.text) + (tail ? ` (${tail})` : ''), ref: { type: 'note', id: n.id }, ...(a.confirmed === false ? { confirmed: false } : {}) });
369
370
  }
370
371
  }
371
372
  const moved = movedBy({ ...e, initiative: e.initiative || (notes.find((n) => n.initiative) || {}).initiative || null }, endMs, s);
@@ -464,8 +465,11 @@ function briefOf(e, current, s, { today, inis, links: meetingLinks, boards } = {
464
465
  last = { id: lastNote.id, title: str(lastNote.title) || str(lastNote.meeting.title), at: lastNote.meeting.start, private: !!lastNote.private };
465
466
  if (!lastNote.private) {
466
467
  last.overview = str(lastNote.overview) || null;
467
- last.decisions = (lastNote.decisions || []).map((d) => str(d && d.text)).filter(Boolean).slice(0, 4);
468
- last.actions = (lastNote.actions || []).filter((a) => str(a && a.text)).slice(0, 5).map((a) => ({ text: str(a.text), owner: str(a.owner) || null, due: str(a.due) || null }));
468
+ // only what the PM confirmed counts as decided; the rest is counted as to confirm (Viewer kit: unconfirmed captures are never facts)
469
+ last.decisions = (lastNote.decisions || []).filter((d) => d && d.confirmed !== false).map((d) => str(d && d.text)).filter(Boolean).slice(0, 4);
470
+ last.actions = (lastNote.actions || []).filter((a) => str(a && a.text)).slice(0, 5).map((a) => ({ text: str(a.text), owner: str(a.owner) || null, due: str(a.due) || null, ...(a.confirmed === false ? { confirmed: false } : {}) }));
471
+ const toConfirm = (lastNote.decisions || []).filter((d) => d && d.confirmed === false && str(d.text)).length;
472
+ if (toConfirm) last.to_confirm = toConfirm;
469
473
  }
470
474
  }
471
475
  const links = (Array.isArray(e.links) ? e.links : []).filter((l) => l && str(l.url) && /^https?:\/\//.test(l.url)).slice(0, 5).map((l) => ({ label: str(l.label) || str(l.url), url: str(l.url) }));
@@ -9,7 +9,8 @@
9
9
  * What it holds:
10
10
  * auto "Moves on by itself": true unless the PM turned it off (default on)
11
11
  * held the stages the PM undid a move by itself out of: the page does not move out of them by itself again
12
- * by how the Tasks card groups: 'stage' | 'mine' (the groups the PM names) | 'owner' | 'status' | 'none'
12
+ * by how the Tasks card groups: 'stage' | 'epic' (the Jira epics of the drafted tickets) | 'mine' (the groups the PM names) | 'owner' | 'status' | 'none'
13
+ * picked true once the PM chose `by`; until then the page may default to 'epic' when tickets are drafted
13
14
  * names the PM's group names, in order
14
15
  * of task key → the PM's group name
15
16
  * stage task key → the stage the task belongs to (a task records none of its own)
@@ -17,7 +18,7 @@
17
18
 
18
19
  const ID_RE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,80}$/;
19
20
  const TASK_RE = /^(task|req):[A-Za-z0-9][A-Za-z0-9._:#/-]{0,120}$/;
20
- const BY = ['stage', 'mine', 'owner', 'status', 'none'];
21
+ const BY = ['stage', 'epic', 'mine', 'owner', 'status', 'none']; // epic: the Jira epics of the drafted tickets (T1)
21
22
  const KINDS = ['auto', 'hold', 'by', 'groups', 'rename', 'place', 'stage', 'set', 'unset'];
22
23
  const name = (v, n = 40) => String(v == null ? '' : v).replace(/[\u0000-\u001f]+/g, ' ').replace(/\s+/g, ' ').trim().slice(0, n);
23
24
  const names = (v) => { const out = []; for (const x of Array.isArray(v) ? v : []) { const s = name(x); if (s && !out.some((y) => y.toLowerCase() === s.toLowerCase())) out.push(s); } return out.slice(0, 12); };
@@ -30,7 +31,7 @@ function fold(lines, initiative) {
30
31
  if (!l || l.initiative !== initiative) continue;
31
32
  if (l.kind === 'auto') { o.auto = l.on !== false; if (o.auto) o.held = []; }
32
33
  else if (l.kind === 'hold' && l.stage && !o.held.includes(l.stage)) o.held.push(l.stage);
33
- else if (l.kind === 'by' && BY.includes(l.by)) o.by = l.by;
34
+ else if (l.kind === 'by' && BY.includes(l.by)) { o.by = l.by; o.picked = true; } // picked: the PM chose it, so no default replaces it
34
35
  else if (l.kind === 'groups') {
35
36
  o.names = names(l.names);
36
37
  for (const k of Object.keys(o.of)) if (!o.names.includes(o.of[k])) delete o.of[k]; // a deleted group lets its tasks go
@@ -4,10 +4,10 @@
4
4
  *
5
5
  * pmos jira draft <initiative> [--dry-run] the PRD's items → the ticket draft (lib/jira-tickets.js)
6
6
  * pmos jira show <initiative> every ticket, its flags and its status in Jira
7
- * pmos jira epic <initiative> new|<KEY or link> create a new epic, or use an existing one
7
+ * pmos jira epic <initiative> new|<KEY or link> [--group <g>] create a new epic, or use an existing one (of one epic group)
8
8
  * pmos jira approve <initiative> <ID> … the PM selects tickets to push, in their own terminal
9
9
  * pmos jira pending <initiative> what the agent creates or updates in Jira (approved only)
10
- * pmos jira record <initiative> [ID=KEY …] [--epic KEY] [--updated ID,ID] the keys the agent created
10
+ * pmos jira record <initiative> [ID=KEY …] [--epic KEY [--group <g>]] [--updated ID,ID] the keys the agent created
11
11
  * pmos jira query [<initiative>] the Jira search for the tickets an initiative pushed
12
12
  * pmos jira sync <initiative> --from <file|-> [--query "<jql>"] [--dry-run] a saved search → the status snapshot
13
13
  * pmos jira query --sprints the Jira search for every issue in the sprints the tickets are in
@@ -33,10 +33,10 @@ const USAGE = [
33
33
  'usage: pmos jira draft|show|epic|approve|pending|record|query|sync|summary|which — Jira tickets from the PRD, and their status',
34
34
  ' pmos jira draft <initiative> [--dry-run] draft one ticket per PRD item, in the ticket template',
35
35
  ' pmos jira show <initiative> every ticket, what needs you, and its status in Jira',
36
- ' pmos jira epic <initiative> new|<KEY or link> create a new epic at the first push, or use an existing one',
36
+ ' pmos jira epic <initiative> new|<KEY or link> [--group <g>] create a new epic at the first push, or use an existing one',
37
37
  ' pmos jira approve <initiative> <ID> … select tickets to push (you, in your own terminal)',
38
38
  ' pmos jira pending <initiative> what the push creates or updates in Jira',
39
- ' pmos jira record <initiative> [ID=KEY …] [--epic KEY] [--updated ID,ID] the keys created in Jira',
39
+ ' pmos jira record <initiative> [ID=KEY …] [--epic KEY [--group <g>]] [--updated ID,ID] the keys created in Jira',
40
40
  ' pmos jira query [<initiative>] the Jira search for the pushed tickets',
41
41
  ' pmos jira sync <initiative> --from <file|-> [--query "<jql>"] [--dry-run] save the status read from Jira',
42
42
  ' pmos jira query --sprints the Jira search for every issue in those tickets\' sprints',
@@ -48,7 +48,7 @@ const USAGE = [
48
48
  'This command never calls Jira. Your agent reads and writes Jira with your own connection.',
49
49
  ];
50
50
  const BOOL = new Set(['json', 'dry-run', 'help', 'sprints']);
51
- const VALUE = new Set(['from', 'query', 'root', 'epic', 'updated']);
51
+ const VALUE = new Set(['from', 'query', 'root', 'epic', 'updated', 'group']);
52
52
  const FLAG_TEXT = { 'prd-changed': 'PRD changed', removed: 'Removed from PRD', blocked: 'Blocked', incomplete: 'Missing text', pushing: 'Selected, waiting for the push', edited: 'Edited, not in Jira yet' };
53
53
 
54
54
  function parse(argv) {
@@ -166,7 +166,9 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
166
166
  if (verb === 'show') {
167
167
  const r = jiraTickets.view(root, initiative, { snapshot: jiraStatus.readSnapshot(root, initiative) });
168
168
  if (!r.ok) return fail(r.error);
169
- const lines = [`${initiative} · ${r.inJira} of ${r.tickets.length} in Jira · ${r.checkedAt ? `checked ${r.checkedAt}` : 'not checked yet'} · epic ${r.epic.key || (r.epic.mode === 'new' ? 'new, created at the first push' : 'not chosen')}`];
169
+ const epicWord = (e) => e.key || (e.mode === 'new' ? 'new, created at the first push' : 'not chosen');
170
+ const lines = [`${initiative} · ${r.inJira} of ${r.tickets.length} in Jira · ${r.checkedAt ? `checked ${r.checkedAt}` : 'not checked yet'} · ${r.groups.length ? `${r.groups.length} epics` : `epic ${epicWord(r.epic)}`}`];
171
+ for (const g of r.groups) lines.push(` epic ${g.id} · ${g.name} · ${epicWord(g)}`);
170
172
  if (!r.gate.open) lines.push(` The Jira tickets tab opens when the handoff is done (${r.gate.why}).`);
171
173
  for (const t of r.tickets) {
172
174
  lines.push(` ${t.id} · ${t.summary} · ${[t.type, t.priority, t.estimate].filter(Boolean).join(' · ')}`);
@@ -179,9 +181,11 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
179
181
  if (verb === 'epic') {
180
182
  const v = pos[1];
181
183
  if (!v) return need('<initiative> new|<KEY or link>');
182
- const r = jiraTickets.setEpic(root, initiative, v === 'new' ? { mode: 'new' } : { mode: 'existing', key: v }, { now });
184
+ const r = jiraTickets.setEpic(root, initiative, { ...(v === 'new' ? { mode: 'new' } : { mode: 'existing', key: v }), group: flags.group || null }, { now });
183
185
  if (!r.ok) return fail(r.error);
184
- return out(r, [r.epic.mode === 'new' ? `${initiative} · a new epic is created at the first push` : `${initiative} · tickets go under ${r.epic.key}`]);
186
+ const e = r.group || r.epic;
187
+ const who = r.group ? `${initiative} · ${r.group.name}` : initiative;
188
+ return out(r, [e.mode === 'new' ? `${who} · a new epic is created at the first push` : `${who} · tickets go under ${e.key}`]);
185
189
  }
186
190
  if (verb === 'approve') {
187
191
  const ids = pos.slice(1);
@@ -197,7 +201,8 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
197
201
  const r = jiraTickets.pushPlan(root, initiative);
198
202
  if (!r.ok) return fail(r.error);
199
203
  const lines = [`${initiative} · ${r.create.length} to create · ${r.update.length} to update · ${r.unchanged} unchanged · ${r.notApproved} not selected`];
200
- lines.push(r.epic.key ? ` epic ${r.epic.key}` : ` epic create "${r.epic.create.summary}"`);
204
+ if (r.epic) lines.push(r.epic.key ? ` epic ${r.epic.key}` : ` epic create "${r.epic.create.summary}"`);
205
+ for (const e of r.epics) lines.push(e.key ? ` epic ${e.group} · ${e.key}` : ` epic ${e.group} · create "${e.create.summary}"`);
201
206
  for (const t of r.create) lines.push(` create ${t.ticket} · ${t.summary} · ${t.issuetype} · ${t.priority}`);
202
207
  for (const t of r.update) lines.push(` update ${t.ticket} ${t.key} · ${t.summary}`);
203
208
  return out(r, lines);
@@ -210,10 +215,10 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
210
215
  tickets[m[1]] = m[2];
211
216
  }
212
217
  const updated = flags.updated ? String(flags.updated).split(',').map((s) => s.trim()).filter(Boolean) : [];
213
- if (!Object.keys(tickets).length && !updated.length && !flags.epic) return need('<initiative> [ID=KEY …] [--epic KEY] [--updated ID,ID]');
214
- const r = jiraTickets.record(root, initiative, { epic: flags.epic || null, tickets, pushed: updated }, { now });
218
+ if (!Object.keys(tickets).length && !updated.length && !flags.epic) return need('<initiative> [ID=KEY …] [--epic KEY [--group <g>]] [--updated ID,ID]');
219
+ const r = jiraTickets.record(root, initiative, { epic: flags.epic || null, group: flags.group || null, tickets, pushed: updated }, { now });
215
220
  if (!r.ok) return fail(r.error);
216
- return out(r, [`${initiative}${r.epic ? ` · epic ${r.epic}` : ''} · recorded ${r.recorded.length}`, ...r.recorded.map((x) => ` ${x.what} ${x.ticket} ${x.key}`)]);
221
+ return out(r, [`${initiative}${r.epic ? ` · epic ${r.group ? r.group + ' ' : ''}${r.epic}` : ''} · recorded ${r.recorded.length}`, ...r.recorded.map((x) => ` ${x.what} ${x.ticket} ${x.key}`)]);
217
222
  }
218
223
  if (verb === 'sync') {
219
224
  if (!flags.from) return need('<initiative> --from <file|->');
@@ -522,7 +522,7 @@ function which(root, key) {
522
522
  const hits = [];
523
523
  for (const id of jiraTickets.draftedInitiatives(root)) {
524
524
  const p = jiraTickets.pushedTickets(root, id);
525
- if (p.epic === k) hits.push({ initiative: id, role: 'epic' });
525
+ if (p.epic === k || (p.epics || []).includes(k)) hits.push({ initiative: id, role: 'epic' });
526
526
  else if (p.tickets.has(k)) hits.push({ initiative: id, role: 'ticket', ticket: p.tickets.get(k).id, summary: p.tickets.get(k).summary });
527
527
  }
528
528
  return { ok: true, key: k, initiatives: hits };