create-pmos 0.427.0 → 0.429.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 (147) hide show
  1. package/package.json +25 -25
  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/board-programs-test.js +16 -2
  7. package/workspace/briefing-premium-board-test.js +27 -22
  8. package/workspace/briefing-premium-insights-test.js +81 -60
  9. package/workspace/briefing-premium-metrics-test.js +5 -3
  10. package/workspace/briefing-premium-sources-test.js +5 -5
  11. package/workspace/briefing-premium-test.js +7 -5
  12. package/workspace/changelog.json +24 -0
  13. package/workspace/ev-everywhere-test.js +2 -2
  14. package/workspace/guide/briefing-premium.md +4 -2
  15. package/workspace/guide/home.md +34 -7
  16. package/workspace/guide/index.md +1 -0
  17. package/workspace/guide/metric-drafts.md +48 -0
  18. package/workspace/guide/programs.md +1 -0
  19. package/workspace/home-other-product-test.js +12 -2
  20. package/workspace/intel-report-ui-test.js +189 -0
  21. package/workspace/lib/board-metrics-premium.js +1 -1
  22. package/workspace/lib/headless.js +15 -2
  23. package/workspace/lib/insights-premium.js +5 -1
  24. package/workspace/lib/insights-records.js +14 -5
  25. package/workspace/lib/intel-report.js +419 -0
  26. package/workspace/lib/metric-draft-runs.js +193 -0
  27. package/workspace/lib/metric-drafts.js +231 -0
  28. package/workspace/lib/metrics-cli.js +104 -0
  29. package/workspace/lib/pmos-verbs.js +3 -0
  30. package/workspace/lib/report-setups.js +29 -13
  31. package/workspace/lib/route-modules.js +1 -0
  32. package/workspace/lib/routes-insights-premium.js +2 -2
  33. package/workspace/lib/routes-insights-records.js +13 -5
  34. package/workspace/lib/routes-meeting-material.js +22 -1
  35. package/workspace/lib/routes-metric-drafts.js +141 -0
  36. package/workspace/lib/routes-phone-day.js +13 -2
  37. package/workspace/lib/routes-report-setups.js +92 -3
  38. package/workspace/lib/routes-viewer.js +5 -2
  39. package/workspace/lib/settings-store.js +14 -0
  40. package/workspace/metric-drafts-ui-test.js +209 -0
  41. package/workspace/milestone-pins-test.js +13 -0
  42. package/workspace/milestone-suggest-test.js +10 -4
  43. package/workspace/package-lock.json +2 -2
  44. package/workspace/package.json +1 -1
  45. package/workspace/premium-board-actions-test.js +40 -13
  46. package/workspace/premium-phone-card-test.js +8 -5
  47. package/workspace/premium-rec-tab-test.js +8 -0
  48. package/workspace/premium-vw-item-test.js +7 -3
  49. package/workspace/premium-vw-jira-test.js +2 -1
  50. package/workspace/program-charter-test.js +1 -1
  51. package/workspace/program-leave-test.js +2 -2
  52. package/workspace/program-order-test.js +3 -2
  53. package/workspace/program-panel-test.js +2 -1
  54. package/workspace/public/pm/bd-acts.js +23 -29
  55. package/workspace/public/pm/bd-ini-panel.js +90 -32
  56. package/workspace/public/pm/bd-pin-card.css +4 -4
  57. package/workspace/public/pm/bd-pin-card.js +4 -1
  58. package/workspace/public/pm/bd-prog-panel.js +9 -4
  59. package/workspace/public/pm/bd-span.js +22 -12
  60. package/workspace/public/pm/cozy-aud.css +1 -1
  61. package/workspace/public/pm/cozy-board.css +256 -256
  62. package/workspace/public/pm/cozy-ev.css +45 -45
  63. package/workspace/public/pm/cozy-evmodel.js +1 -1
  64. package/workspace/public/pm/cozy-home-rows.css +23 -23
  65. package/workspace/public/pm/cozy-home.css +207 -207
  66. package/workspace/public/pm/cozy-insights.css +207 -108
  67. package/workspace/public/pm/cozy-live-pill.css +5 -5
  68. package/workspace/public/pm/cozy-mtg-present.css +23 -23
  69. package/workspace/public/pm/cozy-nav.js +1 -1
  70. package/workspace/public/pm/cozy-news.js +2 -2
  71. package/workspace/public/pm/cozy-panel.css +29 -29
  72. package/workspace/public/pm/cozy-pick.css +5 -5
  73. package/workspace/public/pm/cozy-rec-now.css +20 -20
  74. package/workspace/public/pm/cozy-rec-present.css +11 -11
  75. package/workspace/public/pm/cozy-rec-tab.css +13 -13
  76. package/workspace/public/pm/cozy-rec-tab.js +12 -3
  77. package/workspace/public/pm/cozy-settings.js +1 -1
  78. package/workspace/public/pm/cozy-steps.css +9 -9
  79. package/workspace/public/pm/cozy-today.css +107 -71
  80. package/workspace/public/pm/cozy-viewer.css +7 -7
  81. package/workspace/public/pm/cozy-viewer.js +157 -23
  82. package/workspace/public/pm/cozy-vw-mtg.css +81 -81
  83. package/workspace/public/pm/cozy-vw-rp.css +53 -53
  84. package/workspace/public/pm/cozy-vw-shell.css +34 -21
  85. package/workspace/public/pm/cozy-vw.css +117 -117
  86. package/workspace/public/pm/cozy-xv.css +11 -11
  87. package/workspace/public/pm/cozy.css +18 -15
  88. package/workspace/public/pm/hi-pop.css +82 -0
  89. package/workspace/public/pm/hi-pop.js +65 -0
  90. package/workspace/public/pm/home-app.js +83 -28
  91. package/workspace/public/pm/home-day.js +131 -26
  92. package/workspace/public/pm/home-ini.css +38 -108
  93. package/workspace/public/pm/home-ini.js +50 -68
  94. package/workspace/public/pm/home-line.css +7 -7
  95. package/workspace/public/pm/home-list.js +41 -4
  96. package/workspace/public/pm/home-phone-card.js +18 -15
  97. package/workspace/public/pm/home-today.js +18 -7
  98. package/workspace/public/pm/ini-more.js +67 -0
  99. package/workspace/public/pm/ini-view-model.js +3 -2
  100. package/workspace/public/pm/ini-view.css +104 -102
  101. package/workspace/public/pm/ini-view.js +16 -8
  102. package/workspace/public/pm/loose-props.css +13 -13
  103. package/workspace/public/pm/metric-drafts.css +82 -0
  104. package/workspace/public/pm/metric-drafts.js +165 -0
  105. package/workspace/public/pm/ms-suggest.css +8 -8
  106. package/workspace/public/pm/order-model.js +85 -0
  107. package/workspace/public/pm/ov-view.css +12 -12
  108. package/workspace/public/pm/premium-board.js +57 -11
  109. package/workspace/public/pm/premium-chart-tab.js +6 -6
  110. package/workspace/public/pm/premium-insights.js +306 -105
  111. package/workspace/public/pm/premium-report-intel.css +56 -0
  112. package/workspace/public/pm/premium-report-intel.js +232 -0
  113. package/workspace/public/pm/premium-shell.js +2 -2
  114. package/workspace/public/pm/premium-vw-file.js +2 -2
  115. package/workspace/public/pm/premium-vw-item.js +3 -1
  116. package/workspace/public/pm/premium-vw-jira.js +2 -0
  117. package/workspace/public/pm/premium.css +127 -128
  118. package/workspace/public/pm/prog-order.css +6 -6
  119. package/workspace/public/pm/prog-order.js +15 -2
  120. package/workspace/public/pm/program-charter.css +23 -23
  121. package/workspace/public/pm/rp-parts.js +2 -2
  122. package/workspace/public/pm/sort-order.css +17 -0
  123. package/workspace/public/pm/sort-order.js +108 -0
  124. package/workspace/public/pm/split-merge.css +15 -15
  125. package/workspace/public/pm/task-card.css +21 -21
  126. package/workspace/public/pm/tk-tasks.css +37 -37
  127. package/workspace/public/pm/tk-view.css +6 -6
  128. package/workspace/public/pm/tk-view.js +3 -2
  129. package/workspace/public/pm/wf-page.css +28 -28
  130. package/workspace/public/pm/wf-page.js +1 -1
  131. package/workspace/public/premium-board.html +1 -0
  132. package/workspace/public/premium-intelligence.html +82 -0
  133. package/workspace/server.js +38 -3
  134. package/workspace/skills/metric-draft.skill +47 -0
  135. package/workspace/sort-order-test.js +201 -0
  136. package/workspace/stage-card-test.js +1 -0
  137. package/workspace/task-card-test.js +1 -1
  138. package/workspace/test-lists/intel-report-ui.json +5 -0
  139. package/workspace/test-lists/intel-report.json +9 -0
  140. package/workspace/test-lists/metric-drafts-ui.json +5 -0
  141. package/workspace/test-lists/metric-drafts.json +9 -0
  142. package/workspace/test-lists/sort-order.json +6 -0
  143. package/workspace/test-lists/viewer-trail.json +5 -0
  144. package/workspace/test-run.js +3 -0
  145. package/workspace/tk-tasks-test.js +5 -3
  146. package/workspace/viewer-trail-test.js +145 -0
  147. package/workspace/public/premium-insights.html +0 -81
@@ -77,13 +77,15 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
77
77
  if (r.request().method() === 'POST') { pk.on = JSON.parse(r.request().postData() || '{}').on; pk.posts.push(pk.on); }
78
78
  r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, all: false, chosen: true, products: reg.map((x, i) => ({ ...x, home: false, primary: !i, initials: null, on: pk.on.includes(x.ws) })) }) });
79
79
  });
80
- await page.goto(BASE + '/premium-insights.html?theme=' + theme + q);
80
+ await page.goto(BASE + '/premium-intelligence.html?theme=' + theme + q);
81
81
  const up = await until(() => page.evaluate(() => document.querySelectorAll('#goalTbl .ins-row').length > 0 || /could not be read/.test(document.querySelector('#brief').textContent) || !!document.querySelector('#goalTbl .ins-empty')), 20000);
82
82
  return { ctx, page, errors, posts, up, pk, calls: () => calls, setModel: (m) => { current = m; } };
83
83
  };
84
84
  /* the Viewer card (pm/cozy-viewer.js): its title, and the feature its "Waiting for design" card names */
85
85
  const vw = (pg) => pg.evaluate(() => { const v = document.querySelector('#czViewer'); if (!v || v.hidden) return null; const ph = v.querySelector('[data-cz-placeholder]'); return { title: (v.querySelector('.cz-vw-title') || {}).textContent || '', wait: ph ? ph.dataset.czPlaceholder : null, text: v.querySelector('.cz-vw-body').textContent }; });
86
86
  const vwMoreItem = async (pg, label) => { await pg.click('#czViewer [data-cz-vw="more"]'); await sleep(80); await pg.click(`.cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${label}"))`); await sleep(80); };
87
+ /* Delivery trends moved to ⋯ (batch 15 item 1): its view holds the six tiles */
88
+ const toTrends = async (pg) => { await pg.click('#moreB'); await pg.click('#moreMenu [data-more="trends"]'); await until(() => pg.evaluate(() => !!document.querySelector('#bmBody [data-tile]')), 4000); };
87
89
  const vwClose = async (pg) => { await pg.evaluate(() => window.czViewer && window.czViewer.close()); await until(() => pg.evaluate(() => { const v = document.querySelector('#czViewer'); return !v || v.hidden; })); };
88
90
 
89
91
  const A = await open();
@@ -94,14 +96,14 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
94
96
 
95
97
  /* N: the place menu, no page header, nothing old */
96
98
  const nav = await p.evaluate(() => ({ fabs: document.querySelectorAll('#czFab').length, label: document.querySelector('#czFab').getAttribute('aria-label'), rail: document.querySelector('nav.rail') ? getComputedStyle(document.querySelector('nav.rail')).display : 'gone', name: document.querySelector('#prodPick').getAttribute('aria-label'), boards: document.querySelectorAll('#prodPick .ppk-t').length }));
97
- ok('N1 one floating place menu replaces the rail (gone from the page), it says you are in Insights, and the product picker names the board', nav.fabs === 1 && nav.label === 'Open the menu. You are in Insights' && nav.rail === 'gone' && nav.name === 'Products: pmos' && nav.boards === 1, JSON.stringify(nav));
99
+ ok('N1 one floating place menu replaces the rail (gone from the page), it says you are in Intelligence, and the product picker names the board', nav.fabs === 1 && nav.label === 'Open the menu. You are in Intelligence' && nav.rail === 'gone' && nav.name === 'Products: pmos' && nav.boards === 1, JSON.stringify(nav));
98
100
  { await p.click('#czFab'); const mn = await p.evaluate(() => ({ open: !document.querySelector('#czMenu').hidden, links: [...document.querySelectorAll('#czMenu a')].map((a) => a.textContent + '=' + a.getAttribute('href')), cur: (document.querySelector('#czMenu [aria-current="page"]') || {}).textContent })); await p.keyboard.press('Escape');
99
- ok('N1 the menu opens Home, Board and Insights, marks Insights, and Escape closes it', mn.open && mn.links.join() === 'Home=/premium.html,Board=/premium-board.html,Insights=/premium-insights.html' && mn.cur === 'Insights' && await p.evaluate(() => document.querySelector('#czMenu').hidden), JSON.stringify(mn)); }
101
+ ok('N1 the menu opens Home, Board and Intelligence, marks Intelligence, and Escape closes it', mn.open && mn.links.join() === 'Home=/premium.html,Board=/premium-board.html,Intelligence=/premium-intelligence.html' && mn.cur === 'Intelligence' && await p.evaluate(() => document.querySelector('#czMenu').hidden), JSON.stringify(mn)); }
100
102
  { const hd = await p.evaluate(() => { const b = document.querySelector('#insBar').getBoundingClientRect(), m = document.querySelector('main.ins').getBoundingClientRect(); return { bar: Math.round(b.top), main: Math.round(m.top), tabs: [...document.querySelectorAll('.ins-tabs [role="tab"]')].map((t) => t.textContent.replace(/\s+\d+$/, '').trim() + ':' + t.getAttribute('aria-selected')).join(), h1: [...document.querySelectorAll('h1')].filter((h) => h.getBoundingClientRect().height > 2).length }; });
101
- ok('N2 no page header: the panel starts at the top with one bar, and its tabs are Goals (open), Outcomes and Library', hd.main <= 20 && hd.bar - hd.main <= 24 && hd.h1 === 0 && hd.tabs === 'Goals:true,Outcomes:false,Library:false', JSON.stringify(hd)); }
103
+ ok('N2 no page header: the panel starts at the top with one bar, and Intelligence is one page with no tabs (batch 15 item 1)', hd.main <= 20 && hd.bar - hd.main <= 24 && hd.h1 === 0 && hd.tabs === '' && await p.evaluate(() => document.title === 'PMOS · Intelligence'), JSON.stringify(hd)); }
102
104
  ok('N1 nothing on the page links to the console or the Chat page (premium-agreed-design)', await p.evaluate(() => !document.querySelector('#toConsole, a[href*="console.html"], a[href*="premium-chat"]')));
103
105
  ok('N2 the old parts are gone: no charts card, no About footer, no help button, no bell, no Library composer', await p.evaluate(() => !document.querySelector('#dashBody, #cDash, #foot, #helpB, #helpPop, .tb-bell, [data-tb="bell"], #repAsk, #repAskIn, #repFold, #listNew, #snap')));
104
- ok('I1 the page is served at /premium-insights and /premium-insights.html', (await fetch(BASE + '/premium-insights')).status === 200 && (await fetch(BASE + '/premium-insights.html')).status === 200);
106
+ ok('I1 the page is served at /premium-intelligence and .html, and the old /premium-insights and .html still serve it', (await Promise.all(['/premium-intelligence', '/premium-intelligence.html', '/premium-insights', '/premium-insights.html'].map(async (u) => { const r = await fetch(BASE + u); return r.status === 200 && /PMOS · Intelligence/.test(await r.text()); }))).every(Boolean));
105
107
  for (const [go, re] of [['Home', /\/premium\.html$/], ['Board', /\/premium-board\.html$/]]) {
106
108
  const r2 = await open(); await r2.page.click('#czFab'); await r2.page.locator('#czMenu a', { hasText: go }).click();
107
109
  ok(`N1 the menu's ${go} opens its premium page`, await until(() => re.test(r2.page.url()), 5000), r2.page.url());
@@ -110,15 +112,17 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
110
112
 
111
113
  /* B: the bar is the design's: + with three items, a filter by objective, owner, type and lane, ⋯ with Sources, Export and About */
112
114
  {
113
- await p.click('#newB'); const nw = await p.evaluate(() => [...document.querySelectorAll('#newMenu [data-new]')].map((b) => b.dataset.new).join()); await p.keyboard.press('Escape');
114
- ok('B1 + offers New goal, New dashboard and New chart', nw === 'goal,dash,chart', nw);
115
+ await p.click('#newB'); const nw = await until(() => p.evaluate(() => !document.querySelector('#side').hidden && document.querySelector('#side').dataset.kind));
116
+ await p.click('#sideX');
117
+ await p.click('#viewChip'); const vm0 = await p.evaluate(() => ({ newdash: !!document.querySelector('#viewMenu [data-newdash]'), chart: !!document.querySelector('#viewMenu [data-newchart]'), pin: !!document.querySelector('#viewMenu [data-pin]') })); await p.keyboard.press('Escape');
118
+ ok('B1 + opens New goal at once; View holds Pin, New dashboard and Edit chart (Iq8Overview)', nw === 'goal' && vm0.newdash && vm0.chart && vm0.pin, JSON.stringify([nw, vm0]));
115
119
  await p.click('#filtB'); const fl = await p.evaluate(() => ({ heads: [...document.querySelectorAll('#filtMenu .ins-mh')].map((h) => h.textContent).join(), status: [...document.querySelectorAll('#filtMenu [data-fk="status"]')].map((b) => b.textContent).join(), owners: [...document.querySelectorAll('#filtMenu [data-fk="owner"]')].map((b) => b.dataset.fv).join(), kinds: [...document.querySelectorAll('#filtMenu [data-fk="kind"]')].map((b) => b.textContent).join(), chips: document.querySelectorAll('#filtMenu .cz-chip').length, label: document.querySelector('#filtB').getAttribute('aria-label') }));
116
120
  await p.keyboard.press('Escape');
117
121
  /* re-pointed (premium-uncovered-features, IsMenus): the filter is chips by status, owner and kind */
118
122
  ok('B1 the filter is chips by status, owner and kind; the owners are the goals\' owners and the work that moves them', fl.heads === 'Status,Owner,Kind' && fl.status === 'Off track,On track,Hit,No readings' && fl.owners === 'Dara,Lee,Mira' && fl.kinds === 'Goals,Health budgets' && /status, owner or kind/.test(fl.label), JSON.stringify(fl));
119
123
  await p.click('#moreB'); const mo = await p.evaluate(() => [...document.querySelectorAll('#moreMenu [data-more]')].map((b) => b.dataset.more + ':' + (b.disabled ? 'off' : 'on')).join()); await p.click('#moreMenu [data-more="about"]');
120
124
  const ab = await until(() => vw(p));
121
- ok('B1 ⋯ holds Sources, Export and About these numbers; About opens in the Viewer card', mo === 'sources:on,export:on,about:on' && ab && ab.title === 'About these numbers' && /straight line through the last four readings/.test(ab.text), JSON.stringify([mo, ab]));
125
+ ok('B1 ⋯ holds Reports and dashboards, Delivery trends, Sources, Export and About these numbers; About opens in the Viewer card', mo === 'library:on,trends:on,sources:on,export:on,about:on' && ab && ab.title === 'About these numbers' && /straight line through the last four readings/.test(ab.text), JSON.stringify([mo, ab]));
122
126
  await vwClose(p);
123
127
  await p.click('#moreB'); await p.click('#moreMenu [data-more="sources"]'); const so = await until(() => vw(p));
124
128
  ok('B1 Sources says what the page reads: the KR metric records, the budget registry and the page\'s own records', so && so.title === 'Sources' && /kr-metrics\.jsonl/.test(so.text) && /health-budgets\.md/.test(so.text) && /insights-records\.jsonl/.test(so.text), JSON.stringify(so));
@@ -147,7 +151,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
147
151
 
148
152
  /* G1 the Goals table */
149
153
  { const g = await p.evaluate(() => { const r = [...document.querySelectorAll('#goalTbl .ins-grp')].map((x) => x.textContent.replace(/\s+/g, ' ').trim()), a = document.querySelector('#goalTbl [data-goal="krm-act"]'); return { groups: r, title: a.querySelector('.nm b').textContent, type: a.querySelector('.ins-type').textContent, sub: a.querySelector('.ins-sub').textContent, val: a.querySelector('.val b').textContent, of: a.querySelector('.val .note').textContent, today: !!a.querySelector('.ins-bar1 .today'), spark: !!a.querySelector('svg.ins-spark .pj'), pace: a.querySelector('.pace').textContent, moves: [...a.querySelectorAll('.ins-ini')].map((m) => m.querySelector('.n').textContent + ':' + m.querySelectorAll('.ins-trk i').length + ':' + [...m.querySelectorAll('.ins-trk i')].findIndex((i) => i.classList.contains('c')) + ':' + m.querySelectorAll('.ins-trk i.m').length + ':' + ((m.querySelector('.cz-pill') || {}).textContent || '')) }; });
150
- ok('G1 goals are grouped by objective, then Health budgets, then Delivery trends', g.groups.length === 4 && /^Objective 1 · Growth Q4 2026/.test(g.groups[0]) && /3 of 3 behind/.test(g.groups[0]) && /^Objective 2 · Reliability/.test(g.groups[1]) && /^Health budgets always on, judged every week/.test(g.groups[2]) && /^Delivery trends/.test(g.groups[3]), JSON.stringify(g.groups));
154
+ ok('G1 key results are grouped by objective, then Health budgets; Delivery trends moved to ⋯ (Iq8Overview)', g.groups.length === 3 && /^Objective 1 · Growth Q4 2026/.test(g.groups[0]) && /3 of 3 behind/.test(g.groups[0]) && /^Objective 2 · Reliability/.test(g.groups[1]) && /^Health budgets always on, judged every week/.test(g.groups[2]), JSON.stringify(g.groups));
151
155
  ok('G1 a goal row has its type, direction and start, value of target with the today mark, the so-far line with its pace, and the pace said by its date', g.title === 'Partner activation' && g.type === 'Percentage' && g.sub === 'up is better · from 20% on Jul 1' && g.val === '28%' && g.of === 'of 50%' && g.today && g.spark && /^≈34% by Dec 31/.test(g.pace) && /16 pts short at this pace/.test(g.pace), JSON.stringify(g));
152
156
  ok('G1 what moves it is on the lifecycle track with its milestones, and its pill is a delivery fact (ships soon, days over)', g.moves.join() === 'SSO for partners:8:5:2:Ships in 5 days,Self-serve onboarding v2:8:4:2:8 days over', JSON.stringify(g.moves));
153
157
  const pills = await p.evaluate(() => Object.fromEntries([...document.querySelectorAll('#goalTbl .ins-ini')].map((m) => [m.querySelector('.n').textContent, (m.querySelector('.cz-pill') || {}).textContent || ''])));
@@ -189,8 +193,8 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
189
193
  * On dashboards. No primary: Add a reading and Edit chart are under ⋯. Readings opens on a press */
190
194
  await q.click('#czViewer [data-czs-fold="read"]'); await sleep(80);
191
195
  const d = await q.evaluate(() => ({ kind: (document.querySelector('#czViewer .cz-vw-kind') || {}).textContent, tabs: [...document.querySelectorAll('#czViewer .czs-row b')].map((t) => t.textContent).join(), more: !!document.querySelector('#czViewer [data-cz-vw="more"]'), line: (document.querySelector('#czViewer .czs-line > span:not(.czs-dot):not(.czs-r)') || {}).textContent, right: (document.querySelector('#czViewer .czs-line .czs-r') || {}).textContent, sumText: (document.querySelector('#czViewer .czs-p') || {}).textContent, big: (document.querySelector('#czViewer .ins-gnum') || {}).textContent, pri: (document.querySelector('#czViewer .czs-pri') || {}).textContent, tg: (document.querySelector('#czViewer .ins-gch .tgl') || {}).textContent, ship: (document.querySelector('#czViewer .ins-gch .shipl') || {}).textContent, ms: [...document.querySelectorAll('#czViewer .ins-gch .msl')].map((x) => x.textContent).join('|'), now: document.querySelectorAll('#czViewer .ins-gch .pt.now').length, rows: document.querySelectorAll('#czViewer .ins-rd3').length, all: (document.querySelector('#czViewer [data-gx="all"]') || {}).textContent, moved: (document.querySelector('#czViewer .ins-mvh span') || {}).textContent, mv: [...document.querySelectorAll('#czViewer .ins-mvr')].map((a) => a.textContent.replace(/\s+/g, ' ').trim()), sw: [...document.querySelectorAll('#czViewer [data-gx="dash"]')].map((b) => b.getAttribute('aria-label') + ':' + b.getAttribute('aria-checked')).join(), dlg: !!document.querySelector('#dlg') }));
192
- ok('G1 on All goals a goal press opens its detail: the state line with where the reading comes from and how fresh, the words, the folds Readings and On dashboards, and ⋯; no primary; no "Waiting for design" (OvViewers "Goal")', v && v.title === 'KR 1.1 · Partner activation' && !v.wait && d.kind === 'Goal' && d.tabs === 'Readings,On dashboards' && d.more && d.line === 'Off course' && /^Insights · read /.test(d.right || '') && /^28% now, 50% by Dec 31\. Up 8 points since July\. ≈34% by Dec 31, 16 pts short at this pace\.$/.test(d.sumText || '') && !d.pri && !d.dlg, JSON.stringify([v, d]));
193
- ok('G1 the big number and its target sit over the chart; the chart draws the target with its value, the ship date of the work that moves it and the latest reading', d.big === '28%target 50% by Dec 31' && d.tg === 'Target 50%' && d.ship === 'SSO for partners shipped' && d.now === 1 && d.ms === 'Evaluate, Oct 23|Deliver, Oct 10', JSON.stringify(d));
196
+ ok('G1 on All goals a goal press opens its detail: the state line with where the reading comes from and how fresh, the words, the folds Readings and On dashboards, and ⋯; no primary; no "Waiting for design" (OvViewers "Goal")', v && v.title === 'KR 1.1 · Partner activation' && !v.wait && d.kind === 'Goal' && d.tabs === 'Readings,On dashboards' && d.more && d.line === 'Off course' && /^Intelligence · read /.test(d.right || '') && /^28% now, 50% by Dec 31\. Up 8 points since July\. ≈34% by Dec 31, 16 pts short at this pace\.$/.test(d.sumText || '') && !d.pri && !d.dlg, JSON.stringify([v, d]));
197
+ ok('G1 the big number, its target and where it lands by its date sit over the chart (Iq8Overview: Now, Target, By its date); the chart draws the target with its value, the ship date of the work that moves it and the latest reading', d.big === '28%target 50% by Dec 31By its date ≈34% by Dec 31' && d.tg === 'Target 50%' && d.ship === 'SSO for partners shipped' && d.now === 1 && d.ms === 'Evaluate, Oct 23|Deliver, Oct 10', JSON.stringify(d));
194
198
  ok('G1 the newest three readings show with their source, then All 4 readings; Moved by is open and counts the work, each with its milestone or stage and plan date', d.rows === 3 && d.all === 'All 4 readings' && d.moved === '2' && d.mv.join('|') === 'SSO for partnersEvaluate, plan Oct 23|Self-serve onboarding v2Deliver, plan Oct 10', JSON.stringify(d));
195
199
  await four(q, 'goal');
196
200
  await q.click('#czViewer [data-czs-fold="dash"]'); await sleep(80);
@@ -219,13 +223,12 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
219
223
  const chip = await p.evaluate(() => ({ name: document.querySelector('#perName').textContent, sub: document.querySelector('#perSub').textContent }));
220
224
  await p.click('#perChip'); const pm = await p.evaluate(() => ({ items: [...document.querySelectorAll('#perMenu [data-per]')].map((b) => b.dataset.per + ':' + b.getAttribute('aria-checked')).join(), lq: document.querySelector('#perMenu [data-per="lq"] small').textContent, note: document.querySelector('#perMenu .ins-mnote').textContent }));
221
225
  await p.click('#perMenu [data-per="lq"]'); await sleep(150);
222
- const lq = await p.evaluate(() => ({ chip: document.querySelector('#perName').textContent, rows: document.querySelectorAll('#goalTbl [data-goal]').length, n: document.querySelector('#nGoals').textContent, budgets: document.querySelectorAll('#goalTbl [data-budget]').length }));
226
+ const lq = await p.evaluate(() => ({ chip: document.querySelector('#perName').textContent, rows: document.querySelectorAll('#goalTbl [data-goal]').length, budgets: document.querySelectorAll('#goalTbl [data-budget]').length }));
223
227
  ok('G1 the chip names the quarter, its dates and the day of it', chip.name === 'Q4 2026' && chip.sub === 'Oct 1 – Dec 31 · day 18 of 92', JSON.stringify(chip));
224
228
  ok('G1 the period picker offers this quarter, last quarter (closed, with its count), this half, this year and custom, and says budgets always show', pm.items === 'q:true,lq:false,h:false,y:false,c:false' && pm.lq === 'Closed · 3 goals, none due in it' && /Health budgets have no end/.test(pm.note), JSON.stringify(pm));
225
- ok('G1 last quarter keeps the goals whose time overlaps it, and the budgets', lq.chip === 'Q3 2026' && lq.rows === 3 && lq.n === '3' && lq.budgets === 2, JSON.stringify(lq));
229
+ ok('G1 last quarter keeps the goals whose time overlaps it, and the budgets', lq.chip === 'Q3 2026' && lq.rows === 3 && lq.budgets === 2, JSON.stringify(lq));
226
230
  await p.click('#perChip'); await p.click('#perMenu [data-per="q"]'); await sleep(100);
227
- await p.click('#tabOutcomes'); const os1 = await txt('#perSub'); await p.click('#tabGoals'); const os2 = await txt('#perSub');
228
- ok('G1 changing tab redraws the period chip: Outcomes says shipped or judged this quarter, Goals the day of it', os1 === 'shipped or judged this quarter' && /day 18 of 92/.test(os2), JSON.stringify([os1, os2]));
231
+ ok('G1 back on this quarter the chip says the day of it', /day 18 of 92/.test(await txt('#perSub')));
229
232
  }
230
233
  /* G1 the filter */
231
234
  {
@@ -237,12 +240,15 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
237
240
  }
238
241
  /* G1 Delivery trends: six compact tiles from the Board's measures, honest where a measure is not counted */
239
242
  {
243
+ await toTrends(p);
240
244
  const t = await until(async () => { const x = await p.evaluate(() => [...document.querySelectorAll('#bmBody [data-tile]')].map((e) => e.dataset.tile + '=' + e.querySelector('.l').textContent + '=' + e.querySelector('.v').textContent + '=' + (e.querySelector('.s') ? e.querySelector('.s').textContent : e.querySelector('svg') ? 'line' : '') + (e.classList.contains('warn') ? '!' : ''))); return x.length === 6 && !x.some((y) => /=Reading=/.test(y)) ? x : null; }, 8000);
241
245
  /* re-pointed (insights fix, AgInsGoals): every tile is a label, a value and its line, with no sub-text; a measure with no series has no line */
242
246
  ok('G1 Delivery trends has six compact tiles in the design\'s order: the Board\'s measures, the late initiatives and the scope added this week', !!t && t.join('|') === 'blocked=Blocked tickets=2=line!|late=Late initiatives=1=line!|idle=Idle 30+ days=Not read=|scope=Scope added=0=line|merges=Merged a week=174=line|corrections=Corrections / 100 runs=2.6=line', JSON.stringify(t));
247
+ await p.click('#viewChip'); await p.click('#viewMenu [data-view="all"]'); await sleep(120);
243
248
  }
244
249
  {
245
250
  const R = await open(), q = R.page, sent = [];
251
+ await toTrends(q);
246
252
  await q.route(/\/api\/(board-metric-targets\/save|insights-records\/target|insights-records\/tile)/, (r) => { sent.push([new URL(r.request().url()).pathname, JSON.parse(r.request().postData() || '{}')]); r.fulfill({ contentType: 'application/json', body: '{"ok":true,"targets":{}}' }); });
247
253
  await q.click('#bmBody [data-tile="merges"]'); await until(() => q.evaluate(() => !!document.querySelector('#tgPop')));
248
254
  const pop = await q.evaluate(() => ({ h: document.querySelector('#tgPop .ins-h3').textContent, dirs: [...document.querySelectorAll('#tgPop [data-v]')].map((b) => b.textContent + ':' + b.getAttribute('aria-pressed')).join(), range: document.querySelector('#tgPop p.note').textContent, chip: document.querySelector('#tgChip').getAttribute('aria-checked'), tile: document.querySelector('#bmBody [data-tile="merges"]').getAttribute('aria-expanded'), say: document.querySelector('#bmBody [data-tile="merges"] .tg').textContent, viewer: !!document.querySelector('#czViewer:not([hidden])') }));
@@ -263,6 +269,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
263
269
  }
264
270
  {
265
271
  const R = await open({ model: mk({ ins: { charts: {}, verdicts: {}, targets: { late: 0 } }, initiatives: F.INITIATIVES.map((r, i) => Object.assign({}, r, i < 2 ? { start: '2026-10-15' } : {})) }) });
272
+ await toTrends(R.page);
266
273
  const t = await until(async () => { const x = await R.page.evaluate(() => ['late', 'scope'].map((k) => { const e = document.querySelector(`#bmBody [data-tile="${k}"]`); return e && e.querySelector('.v').textContent + ':' + (e.getAttribute('aria-label') || '').replace(/^[^,]+, [^,]+, /, '') + ':' + e.classList.contains('warn'); })); return x[0] ? x : null; });
267
274
  /* re-pointed (insights fix): the target is said in the tile's label and title, not as a line under the value */
268
275
  ok('G1 Late shows its target and is marked when over it; Scope added counts the initiatives that start this week, with its line', t && t[0] === '1:late today, Target: at most 0:true' && /^2:/.test(t[1]) && await R.page.evaluate(() => !!document.querySelector('#bmBody [data-tile="scope"] svg')), JSON.stringify(t));
@@ -270,6 +277,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
270
277
  }
271
278
  {
272
279
  const R = await open({ bm: { ok: false, state: 'error', error: 'boom' } });
280
+ await toTrends(R.page);
273
281
  const t = await until(async () => { const x = await R.page.evaluate(() => [...document.querySelectorAll('#bmBody [data-tile]')].map((e) => e.querySelector('.v').textContent)); return x.length === 6 && x[0] !== 'Reading' ? x : null; }, 8000);
274
282
  ok('G1 when the Board\'s measures cannot be read, their tiles say Not read and draw no number', !!t && t.join() === 'Not read,1,Not read,0,Not read,Not read', JSON.stringify(t));
275
283
  await R.ctx.close();
@@ -277,7 +285,10 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
277
285
 
278
286
  /* L1 the strip */
279
287
  { const hero = await p.evaluate(() => ({ eye: document.querySelector('#insEye').textContent, head: document.querySelector('#brief').textContent, why: document.querySelector('#insWhy').textContent, ask: document.querySelector('#askWhy').getAttribute('href') }));
280
- ok('L1 the strip leads Goals: the days gone, the strongest finding and its reason; Ask why opens Home with the question', hero.eye === '18 of 92 days gone in Q4.' && hero.head === 'Time to first call will miss its 3 days target on 31 Dec unless it turns.' && /Over its last 4 readings it went from 8 days to 9 days/.test(hero.why) && /^\/premium\.html\?ws=w1&ask=insights&q=Why/.test(hero.ask), JSON.stringify(hero));
288
+ const pg = await p.evaluate(() => [...document.querySelectorAll('#insPg [data-ins]')].map((b) => b.getAttribute('aria-pressed')).join());
289
+ ok('L1 the ✦ strip leads the page: the strongest finding and its reason (the period chip says the day, so the strip does not); Ask why opens Home with the question; the dots page through the findings', hero.eye === '' && pg.split(',').length >= 2 && pg.split(',')[0] === 'true' && hero.head === 'Time to first call will miss its 3 days target on 31 Dec unless it turns.' && /Over its last 4 readings it went from 8 days to 9 days/.test(hero.why) && /^\/premium\.html\?ws=w1&ask=insights&q=Why/.test(hero.ask), JSON.stringify(hero));
290
+ await p.click('#insNo'); const h2 = await txt('#brief');
291
+ ok('L1 Not now moves the strip on to the next finding', h2 && h2 !== hero.head, h2);
281
292
  ok('I9 no demo label, and the page makes no write request on its own', !(await p.evaluate(() => /demo/i.test(document.querySelector('main.stage').textContent))) && A.posts.length === 0, A.posts.join());
282
293
  }
283
294
 
@@ -288,7 +299,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
288
299
  : /dashboard$/.test(u) ? { ok: true, id: 'pd-9', dashboard: { id: 'pd-9' }, pinned: b.pin ? 'pd-9' : null } : { ok: true });
289
300
  await q.route(/\/api\/(insights-records|premium-dashboards)\//, (r) => { const u = new URL(r.request().url()).pathname, b = JSON.parse(r.request().postData() || '{}'); sent.push([u, b]); r.fulfill({ contentType: 'application/json', body: JSON.stringify(answer(u, b)) }); });
290
301
  const last = () => sent[sent.length - 1] || [null, {}];
291
- await q.click('#newB'); await q.click('#newMenu [data-new="dash"]'); await sleep(150);
302
+ await q.click('#viewChip'); await q.click('#viewMenu [data-newdash]'); await sleep(150);
292
303
  const s0 = await q.evaluate(() => ({ side: !document.querySelector('#side').hidden, kind: document.querySelector('#side').dataset.kind, eye: document.querySelector('#sideEye').textContent, desc: document.querySelector('#ndAsk button[type="submit"]').disabled, ns: document.querySelectorAll('#sideBody .ins-ns').length }));
293
304
  ok('D1 New dashboard opens beside Goals, with the describe box working and nothing marked "Not saved yet"', s0.side && s0.kind === 'dash' && /New dashboard/.test(s0.eye) && !s0.desc && s0.ns === 0, JSON.stringify(s0));
294
305
  await q.fill('#ndAskIn', 'Are partners getting value? activation and uptime over 8 weeks'); await q.press('#ndAskIn', 'Enter'); await sleep(300);
@@ -330,43 +341,51 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
330
341
  await R.ctx.close();
331
342
  }
332
343
 
333
- /* O: Outcomes (AgInsOutcomes) and the verdict (AgInsVerdict) */
344
+ /* O: Did it work? (Iq8Overview), the drafted verdict with ✓ Keep and Undo, and the full verdict (AgInsVerdict) */
334
345
  {
335
- const R = await open(), q = R.page, sent = [];
336
- await q.route('**/api/insights-records/verdict', (r) => { sent.push(JSON.parse(r.request().postData() || '{}')); r.fulfill({ contentType: 'application/json', body: '{"ok":true}' }); });
337
- await q.click('#tabOutcomes');
338
- const o = await q.evaluate(() => ({ cols: [...document.querySelectorAll('#outTbl .ins-th [role="columnheader"]')].map((c) => c.textContent).join('|'), groups: [...document.querySelectorAll('#outTbl .ins-grp')].map((g) => g.textContent.replace(/\s+/g, ' ').trim()), rows: [...document.querySelectorAll('#outTbl [data-ini]')].map((r) => r.dataset.ini), strip: document.querySelector('#outText').textContent, sso: document.querySelector('#outTbl [data-ini="sso-partners"]').textContent.replace(/\s+/g, ' '), audit: document.querySelector('#outTbl [data-ini="audit-log-export"]').textContent.replace(/\s+/g, ' '), decide: document.querySelectorAll('#outTbl [data-verdict]').length, decideTxt: (document.querySelector('#outTbl [data-verdict]') || {}).textContent || '', view: document.querySelector('#viewChip').offsetParent === null }));
339
- ok('O1 Outcomes has the design\'s columns: shipped initiative, what it promised and what happened, guardrail and overlap, window, verdict', o.cols === 'Shipped initiative|What it promised · and what happened so far|Guardrail and overlap|Window|Verdict', o.cols);
340
- ok('O1 the shipped work is grouped by what it needs: a verdict, still in its window; the strip counts the promises', o.groups.join() === 'Needs your verdict 1,In their window 2' && o.rows.join() === 'refund-reason-codes,sso-partners,audit-log-export' && /^Refund reason codes needs your verdict by Dec 31\./.test(o.strip) && /Of 3 promises this quarter, 0 are met, 2 are partly met and 2 are still in their window\./.test(o.strip) && o.decide === 1 && o.view, JSON.stringify(o));
341
- ok('O1 a row says what its goal promised and what happened, the work it shares the goal with, and its window from the ship date to the promise\'s date', /Partner activation \+30 pts by Dec 31/.test(o.sso) && /\+8 pts of \+30 pts/.test(o.sso) && /Shares partner activation/.test(o.sso) && /with Self-serve onboarding v2/.test(o.sso) && /No guardrail set\./.test(o.sso) && /Judged Dec 31/.test(o.sso) && /Judged Dec 31/.test(o.audit) && /Opens Dec 31/.test(o.audit) && /Decide · due Dec 31/.test(o.decideTxt), JSON.stringify([o.sso, o.audit, o.decideTxt])); // re-pointed (insights fix): the design's window words
346
+ const R = await open(), q = R.page;
347
+ const o = await q.evaluate(() => ({ cols: [...document.querySelectorAll('#outTbl .ins-th [role="columnheader"]')].map((c) => c.textContent).join('|'), rows: [...document.querySelectorAll('#outTbl [data-ini]')].map((r) => r.dataset.ini), sso: document.querySelector('#outTbl [data-ini="sso-partners"]').textContent.replace(/\s+/g, ' '), decide: document.querySelectorAll('#outTbl [data-verdict]').length, keep: document.querySelectorAll('#outTbl [data-keep]').length, shown: !document.querySelector('#pOutcomes').hidden }));
348
+ ok('O1 Did it work? sits under the key results with the columns Promised, Got and Verdict, and counts what is to judge and in window', o.shown && o.cols === 'Did it work? 1 to judge · 2 in window|Promised|Got|Verdict', o.cols);
349
+ ok('O1 it lists only the work to judge and in its window; a row says what its goal promised and what it got, and its date', o.rows.join() === 'refund-reason-codes,sso-partners,audit-log-export' && /Partner activation \+30 pts/.test(o.sso) && /\+8 pts/.test(o.sso) && /Judged Dec 31/.test(o.sso) && /shipped Oct 23/.test(o.sso), JSON.stringify(o));
350
+ ok('O1 a promise with no reading has no drafted verdict: Decide only, no ✓', o.decide === 1 && o.keep === 0, JSON.stringify(o));
342
351
  await R.ctx.close();
343
352
  const R2 = await open({ model: mk({ goalMeta: { 'krm-up': { guardrail: 'Partner activation must not get worse' } } }) });
344
- await R2.page.click('#tabOutcomes');
345
- ok('O1 a guardrail is read from the readings: since Audit log export shipped, partner activation held or got worse', /Partner activation worse by 2 pts/.test(await txt('#outTbl [data-ini="audit-log-export"] .ins-guard', R2.page)), await txt('#outTbl [data-ini="audit-log-export"] .ins-guard', R2.page));
353
+ ok('O1 a guardrail is read from the readings: since Audit log export shipped, partner activation held or got worse', /Partner activation: worse by 2 pts/.test(await txt('#outTbl [data-ini="audit-log-export"]', R2.page)), await txt('#outTbl [data-ini="audit-log-export"]', R2.page));
346
354
  await R2.ctx.close();
347
- const R3 = await open(), q3 = R3.page;
348
- await q3.route('**/api/insights-records/verdict', (r) => { sent.push(JSON.parse(r.request().postData() || '{}')); r.fulfill({ contentType: 'application/json', body: '{"ok":true}' }); });
349
- await q3.click('#tabOutcomes'); await q3.click('#outTbl [data-verdict]'); await sleep(150);
350
- const v = await q3.evaluate(() => { const go = document.querySelector('#sideGo'); return { kind: document.querySelector('#side').dataset.kind, title: document.querySelector('#sideTitle').textContent, opts: [...document.querySelectorAll('#sideBody .ins-opt')].map((b) => b.dataset.vd + ':' + b.getAttribute('aria-checked')).join(), go: go.textContent, off: go.disabled, note: document.querySelector('#sideNote').textContent, ev: document.querySelector('#sideBody').textContent, home: document.querySelector('#sideAct a').getAttribute('href'), board: [...document.querySelectorAll('#sideTools a')].map((a) => a.getAttribute('href')).join(' ') }; });
351
- ok('O2 the verdict offers Keep, Iterate (the default) or Stop, with its evidence said from the readings, and Home and the Board one press away', v.kind === 'verdict' && v.title === 'Refund reason codes' && v.opts === 'Keep:false,Iterate:true,Stop:false' && /Evidence 0/.test(v.ev) && /No reading of Monthly churn is recorded/.test(v.ev) && /^\/premium\.html\?ws=w1&ask=verdict&q=/.test(v.home) && /premium-board\.html\?ws=w1&focus=refund-reason-codes/.test(v.board), JSON.stringify(v));
352
- const u0 = q3.url(); await q3.click('#sideBody [data-vd="Keep"]'); await q3.click('#sideGo'); const need = await txt('#sideMsg', q3);
353
- await q3.fill('#vdLearn', 'Codes work.'); await q3.click('#sideGo'); await until(() => sent.length > 0, 4000); await sleep(200);
354
- ok('O2 Record verdict needs a learning, then records Keep with it on Insights and stays on the page (it never sends you to Home)', v.go === 'Record verdict' && !v.off && v.note === 'Records the evaluation. Nothing is sent.' && /what you learned/.test(need) && sent.length === 1 && sent[0].ini === 'refund-reason-codes' && sent[0].verdict === 'Keep' && sent[0].learned === 'Codes work.' && sent[0].goal === 'krm-churn' && sent[0].board === 'w1' && q3.url() === u0 && R3.posts.every((x) => x === 'POST /api/insights-records/verdict'), JSON.stringify([need, sent, R3.posts]));
355
+ /* churn met its promise (4% down to 1.8%): Claude drafts Keep, one ✓ records it with the drafted line, and Undo takes it back */
356
+ const met = F.facts({ pinned: 'all', budgets: BUDGETS }); met.outcomes.find((x) => x.id === 'krm-churn').readings = [{ at: '2026-09-01', v: 4 }, { at: '2026-10-15', v: 1.8 }];
357
+ const R3 = await open({ model: IP.build(met) }), q3 = R3.page, sent = [];
358
+ await q3.route(/\/api\/insights-records\/verdict(-undo)?$/, (r) => { sent.push([new URL(r.request().url()).pathname, JSON.parse(r.request().postData() || '{}')]); r.fulfill({ contentType: 'application/json', body: '{"ok":true}' }); });
359
+ const dv = await q3.evaluate(() => ({ text: document.querySelector('#outTbl [data-ini="refund-reason-codes"]').textContent.replace(/\s+/g, ' '), keep: (document.querySelector('#outTbl [data-keep]') || {}).getAttribute && document.querySelector('#outTbl [data-keep]').getAttribute('aria-label') }));
360
+ ok('O2 a met promise gets a drafted verdict said from the readings, with ✓ Record the verdict: Keep', /Keep\. It beat the promise: −2\.2 pts against −2 pts\./.test(dv.text) && dv.keep === 'Record the verdict: Keep', JSON.stringify(dv));
361
+ await q3.click('#outTbl [data-keep]'); await until(() => sent.length > 0, 4000);
362
+ ok('O2 ✓ Keep records Keep with the drafted line, marked drafted, without opening a panel', sent[0][0] === '/api/insights-records/verdict' && sent[0][1].verdict === 'Keep' && sent[0][1].drafted === true && /beat the promise/.test(sent[0][1].learned) && sent[0][1].ini === 'refund-reason-codes' && sent[0][1].board === 'w1' && await q3.evaluate(() => document.querySelector('#side').hidden), JSON.stringify(sent));
363
+ await q3.click('#toast .cta'); await until(() => sent.length > 1, 4000);
364
+ ok('O2 Undo in the toast takes the verdict back', sent[1] && sent[1][0] === '/api/insights-records/verdict-undo' && sent[1][1].ini === 'refund-reason-codes', JSON.stringify(sent));
355
365
  await R3.ctx.close();
366
+ const R5 = await open(), q5 = R5.page, sent5 = [];
367
+ await q5.route('**/api/insights-records/verdict', (r) => { sent5.push(JSON.parse(r.request().postData() || '{}')); r.fulfill({ contentType: 'application/json', body: '{"ok":true}' }); });
368
+ await q5.click('#outTbl [data-verdict]'); await sleep(150);
369
+ const v = await q5.evaluate(() => { const go = document.querySelector('#sideGo'); return { kind: document.querySelector('#side').dataset.kind, title: document.querySelector('#sideTitle').textContent, opts: [...document.querySelectorAll('#sideBody .ins-opt')].map((b) => b.dataset.vd + ':' + b.getAttribute('aria-checked')).join(), go: go.textContent, ev: document.querySelector('#sideBody').textContent }; });
370
+ ok('O2 Decide opens the full verdict: Keep, Iterate (the default) or Stop, with its evidence said from the readings', v.kind === 'verdict' && v.title === 'Refund reason codes' && v.opts === 'Keep:false,Iterate:true,Stop:false' && /No reading of Monthly churn is recorded/.test(v.ev) && v.go === 'Record verdict', JSON.stringify(v));
371
+ await q5.click('#sideBody [data-vd="Stop"]'); await q5.fill('#vdLearn', 'Nobody used them.'); await q5.click('#sideGo'); await until(() => sent5.length > 0, 4000);
372
+ ok('O2 Record verdict records the pick with what was learned', sent5[0] && sent5[0].verdict === 'Stop' && sent5[0].learned === 'Nobody used them.' && !sent5[0].drafted, JSON.stringify(sent5));
373
+ await R5.ctx.close();
356
374
  const R4 = await open({ model: mk({ ins: { charts: {}, verdicts: { w1: { 'refund-reason-codes': { verdict: 'Keep', learned: 'Codes work.', at: '2026-10-18T09:00:00Z' } } }, targets: {} } }) });
357
- await R4.page.click('#tabOutcomes');
358
- const dc = await R4.page.evaluate(() => ({ groups: [...document.querySelectorAll('#outTbl .ins-grp')].map((g) => g.textContent.replace(/\s+/g, ' ').trim()).join(), row: document.querySelector('#outTbl [data-ini="refund-reason-codes"]').textContent.replace(/\s+/g, ' ') }));
359
- ok('O2 a recorded verdict moves the row to Decided, with Kept and what was learned, and its window says judged', /Decided this quarter 1/.test(dc.groups) && /Kept/.test(dc.row) && /Codes work\./.test(dc.row) && /Judged/.test(dc.row), JSON.stringify(dc));
375
+ const dc0 = await R4.page.evaluate(() => ({ rows: [...document.querySelectorAll('#outTbl [data-ini]')].map((r) => r.dataset.ini).join(), foot: (document.querySelector('#decFold') || {}).textContent }));
376
+ await R4.page.click('#decFold'); await sleep(80);
377
+ const dc = await R4.page.evaluate(() => (document.querySelector('#outTbl [data-ini="refund-reason-codes"]') || {}).textContent || '');
378
+ ok('O2 a decided row folds under one line that counts the verdicts; opened, it says Kept and what was learned', !/refund-reason-codes/.test(dc0.rows) && /^Decided 1 · 1 kept, 0 changed, 0 stopped/.test(dc0.foot || '') && /Kept/.test(dc) && /Codes work\./.test(dc), JSON.stringify([dc0, dc]));
360
379
  await R4.ctx.close();
361
380
  }
362
381
 
363
382
  /* L: Library (AgInsLibrary) and the report reader */
364
383
  {
365
384
  const R = await open(), q = R.page;
366
- await q.click('#tabLibrary');
385
+ await q.click('#moreB'); await q.click('#moreMenu [data-more=\"library\"]');
367
386
  /* re-pointed (premium-uncovered-features, IsLibrary): the bar hands New report to Home, Found in your work is cards, the reports are Report · Next · Status */
368
- const lb = await q.evaluate(() => ({ note: document.querySelector('#pLibrary .ins-lnote').textContent, nr: document.querySelector('#newRep').getAttribute('href'), found: document.querySelector('#listRows .ins-fdh b').textContent, fcards: [...document.querySelectorAll('#listRows .ins-fcard')].map((c) => c.dataset.f + ':' + [...c.querySelectorAll('.ins-btn[data-fx]')].map((b) => b.textContent).join('/')).join(), heads: [...document.querySelectorAll('#repAsks .ins-rlh span')].map((s) => s.textContent).join('|'), rows: [...document.querySelectorAll('#listRows .ins-rl:not(.ins-rlh)')].map((r) => r.querySelector('.nm b').textContent + '|' + r.querySelector('.nx').textContent + '|' + r.querySelector('.st').textContent).join(' / '), setups: document.querySelectorAll('#listRows [data-setup]').length, asks: document.querySelectorAll('#listRows [data-ask]').length, cards: [...document.querySelectorAll('#listRows .ins-dcard')].map((c) => c.dataset.d + (c.querySelector('.ins-pinned') ? '*' : '')).join(), cap: document.querySelector('#repCap').textContent, old: !!document.querySelector('#listSeg, #sugB') }));
369
- ok('L1 Library: reports are made in Home, New report in Home hands off there, and Found in your work holds the finding as a card', /Reports are made in Home/.test(lb.note) && /^\/premium\.html\?ws=w1&ask=insights&q=Make%20a%20new%20report/.test(lb.nr) && lb.found === 'Found in your work · 1' && lb.fcards === 'f-1:Set it up/Not a report' && lb.cap === '9' && !lb.old, JSON.stringify(lb));
387
+ const lb = await q.evaluate(() => ({ side: !document.querySelector('#libSide').hidden, nr: document.querySelector('#newRep').getAttribute('href'), found: document.querySelector('#listRows .ins-fdh b').textContent, fcards: [...document.querySelectorAll('#listRows .ins-fcard')].map((c) => c.dataset.f + ':' + [...c.querySelectorAll('.ins-btn[data-fx]')].map((b) => b.textContent).join('/')).join(), heads: [...document.querySelectorAll('#repAsks .ins-rlh span')].map((s) => s.textContent).join('|'), rows: [...document.querySelectorAll('#listRows .ins-rl:not(.ins-rlh)')].map((r) => r.querySelector('.nm b').textContent + '|' + r.querySelector('.nx').textContent + '|' + r.querySelector('.st').textContent).join(' / '), setups: document.querySelectorAll('#listRows [data-setup]').length, asks: document.querySelectorAll('#listRows [data-ask]').length, cards: [...document.querySelectorAll('#listRows .ins-dcard')].map((c) => c.dataset.d + (c.querySelector('.ins-pinned') ? '*' : '')).join(), cap: document.querySelector('#repCap').textContent, old: !!document.querySelector('#listSeg, #sugB') }));
388
+ ok('L1 Reports and dashboards opens as a side panel from ⋯; New report in Home hands off there, and Found in your work holds the finding as a card', lb.side && /^\/premium\.html\?ws=w1&ask=insights&q=Make%20a%20new%20report/.test(lb.nr) && lb.found === 'Found in your work · 1' && lb.fcards === 'f-1:Set it up/Not a report' && lb.cap === '9' && !lb.old, JSON.stringify(lb));
370
389
  ok('L1 the reports table is Report, Next and Status; a draft says "Draft ready for" its date; a request says Proposal or Working', lb.heads === 'Report|Next|Status' && /Draft ready for Oct 14/.test(lb.rows) && /Partner update\|First draft [^|]+\|Runs every other monday/i.test(lb.rows) && /Churn for finance\|—\|Proposal/.test(lb.rows) && lb.setups === 1 && lb.asks === 2, JSON.stringify(lb.rows));
371
390
  ok('L1 dashboards are cards; only the pinned one carries the pin', lb.cards === 'all*,pd-1,p:Growth,p:Reliability', lb.cards);
372
391
  const rs = []; await q.route('**/api/report-setups/*', (r) => { rs.push([new URL(r.request().url()).pathname.replace('/api/report-setups/', ''), JSON.parse(r.request().postData() || '{}')]); r.fulfill({ contentType: 'application/json', body: '{"ok":true,"drafted":{"slot":"2026-10-23","path":"planning/reports/x/2026-10-23.md"}}' }); });
@@ -394,14 +413,14 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
394
413
  await vwClose(q);
395
414
  ok('L2 every Library press went to a report-setups route', R.posts.every((x) => /^POST \/api\/report-setups\/(setup|pause|change)$/.test(x)), R.posts.join());
396
415
  await q.click('#listRows [data-d="p:Reliability"]'); await sleep(150);
397
- ok('L3 a dashboard card opens Goals on that view', (await txt('#viewName', q)) === 'Reliability' && (await q.evaluate(() => document.querySelector('#tabGoals').getAttribute('aria-selected'))) === 'true' && (await q.evaluate(() => [...document.querySelectorAll('#goalTbl [data-goal]')].map((r) => r.dataset.goal).join())) === 'krm-up,krm-churn');
398
- await q.click('#tabLibrary'); await q.locator('#listRows [data-rpt]').first().click(); // a report file with no setup opens straight in the reader
399
- ok('L4 a report opens in the page\'s reader, not the console (premium-report-read R1; re-pointed by premium-agreed-design: the reader is the report panel in the Viewer card)', await until(() => q.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) .vz-rp0')), 5000) && /premium-insights\.html/.test(q.url()), q.url());
416
+ ok('L3 a dashboard card closes the panel and opens the key results on that view', (await txt('#viewName', q)) === 'Reliability' && (await q.evaluate(() => document.querySelector('#libSide').hidden)) && (await q.evaluate(() => [...document.querySelectorAll('#goalTbl [data-goal]')].map((r) => r.dataset.goal).join())) === 'krm-up,krm-churn');
417
+ await q.click('#moreB'); await q.click('#moreMenu [data-more=\"library\"]'); await q.locator('#listRows [data-rpt]').first().click(); // a report file with no setup opens straight in the reader
418
+ ok('L4 a report opens in the page\'s reader, not the console (premium-report-read R1; re-pointed by premium-agreed-design: the reader is the report panel in the Viewer card)', await until(() => q.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) .vz-rp0')), 5000) && /premium-intelligence\.html/.test(q.url()), q.url());
400
419
  ok('L4 a draft report has Issue it in the reader, so nothing sends you to the console to issue it', await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vz-rp0 .rp-sum [data-r="issue"]')), 8000) && await q.evaluate(() => !document.querySelector('#czViewer a[href*="console.html"]')));
401
420
  await R.ctx.close();
402
421
  const lead = { 'planning/reports/biweekly/2026-10-14.md': 'Activation slipped to 28% this fortnight.' };
403
422
  const R2 = await open({ model: mk({ leads: lead }) });
404
- await R2.page.click('#tabLibrary'); const ln = await R2.page.evaluate(() => ({ dash: [...document.querySelectorAll('#listRows [data-d] .ins-mini small')].map((e) => e.textContent), rep: [...document.querySelectorAll('#listRows [data-rpt] .nm small')].map((e) => e.textContent), su: document.querySelector('#listRows [data-setup] .nm small').textContent }));
423
+ await R2.page.click('#moreB'); await R2.page.click('#moreMenu [data-more=\"library\"]'); const ln = await R2.page.evaluate(() => ({ dash: [...document.querySelectorAll('#listRows [data-d] .ins-mini small')].map((e) => e.textContent), rep: [...document.querySelectorAll('#listRows [data-rpt] .nm small')].map((e) => e.textContent), su: document.querySelector('#listRows [data-setup] .nm small').textContent }));
405
424
  ok('L5 each dashboard card draws its first goals, a report row quotes its file, a setup with no file says no draft is written yet', ln.dash[0] === 'Partner activation' && /“Activation slipped to 28% this fortnight\.”/.test(ln.rep[0]) && /No draft is written yet/.test(ln.su), JSON.stringify(ln));
406
425
  await R2.ctx.close();
407
426
  }
@@ -411,7 +430,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
411
430
  const R = await open(), q = R.page, sent = [];
412
431
  let answer = { ok: true, rid: 'krm-new' };
413
432
  await q.route('**/api/insights-records/goal', (r) => { sent.push(JSON.parse(r.request().postData() || '{}')); r.fulfill({ status: answer.ok ? 200 : 400, contentType: 'application/json', body: JSON.stringify(answer) }); });
414
- await q.click('#newB'); await q.click('#newMenu [data-new="goal"]'); await sleep(100);
433
+ await q.click('#newB'); await sleep(100);
415
434
  const vis = () => q.evaluate(() => [...document.querySelectorAll('#sideBody [data-for]')].filter((x) => !x.hidden).map((x) => x.dataset.for).join('|'));
416
435
  const f = await q.evaluate(() => ({ eye: document.querySelector('#sideEye').textContent.replace(/\s+/g, ' '), obj: document.querySelector('#ngObj').value, titleIn: !!document.querySelector('#sideTitle #ngName'), types: [...document.querySelectorAll('#sideBody [data-seg="Type"] [data-v]')].map((b) => b.dataset.v).join(), better: [...document.querySelectorAll('#sideBody [data-seg="Better is"] [data-v]')].map((b) => b.dataset.v).join(), per: [...document.querySelectorAll('#sideBody [data-seg="Period"] [data-v]')].map((b) => b.dataset.v).join(), src: document.querySelectorAll('#sideBody [data-src]').length, ns: document.querySelectorAll('#sideBody .ins-ns').length }));
417
436
  const v0 = await vis();
@@ -429,7 +448,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
429
448
  const b = sent[1] || {};
430
449
  ok('W1 a refusal from the route is said in the panel and the panel stays open', /target must be above/.test(refused), refused);
431
450
  ok('W1 Save posts every field: name, type, direction, numbers, date, period, objective, source, owner and guardrail', b.ws === 'w1' && b.name === 'Weekly active partners' && b.type === 'Count' && b.direction === 'Up' && b.baseline === '10' && b.target === '40' && b.due === '2026-12-31' && b.period_kind === 'Year' && b.period_label === '2026' && b.objective === 'Growth' && b.source === 'jira' && b.owner === 'Lee' && b.guardrail === 'Partner activation must not get worse' && await q.evaluate(() => document.querySelector('#side').hidden), JSON.stringify(b));
432
- await q.click('#newB'); await q.click('#newMenu [data-new="goal"]'); await q.fill('#ngName', 'SOC 2 report delivered'); await q.click('#sideBody [data-seg="Type"] [data-v="Done or not"]'); await q.fill('#ngSteps', 'Scope\nEvidence\n\nAudit'); await q.click('#sideGo'); await until(() => sent.length > 2, 4000);
451
+ await q.click('#newB'); await q.fill('#ngName', 'SOC 2 report delivered'); await q.click('#sideBody [data-seg="Type"] [data-v="Done or not"]'); await q.fill('#ngSteps', 'Scope\nEvidence\n\nAudit'); await q.click('#sideGo'); await until(() => sent.length > 2, 4000);
433
452
  ok('W1 a Done-or-not goal posts its steps', JSON.stringify(sent[2].steps) === JSON.stringify(['Scope', 'Evidence', 'Audit']) && sent[2].type === 'Done or not', JSON.stringify(sent[2]));
434
453
  await R.ctx.close();
435
454
  }
@@ -437,10 +456,10 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
437
456
  /* I10 empty and unread */
438
457
  {
439
458
  const R = await open({ model: mk({ outcomes: [] }) });
440
- ok('I10 with no KR metric the page says there is no insight yet and draws no goal; Library still holds the report files', await R.page.evaluate(() => /No KR metric is recorded/.test(document.querySelector('#brief').textContent) && /No goal is recorded for this workspace/.test(document.querySelector('#goalTbl').textContent) && document.querySelectorAll('#goalTbl [data-goal]').length === 0 && document.querySelectorAll('#listRows [data-rpt]').length === 2 && document.querySelector('#insWhy').textContent === ''));
459
+ ok('I10 with no KR metric the page says there is no insight yet and draws no goal; Library still holds the report files', await R.page.evaluate(() => /No KR metric is recorded/.test(document.querySelector('#brief').textContent) && /No key result is recorded for this workspace/.test(document.querySelector('#goalTbl').textContent) && document.querySelectorAll('#goalTbl [data-goal]').length === 0 && document.querySelectorAll('#listRows [data-rpt]').length === 2 && /draws an insight from the readings/.test(document.querySelector('#insWhy').textContent) && !document.querySelector('#goalTbl .ins-th')));
441
460
  await R.ctx.close();
442
461
  const R2 = await open({ model: mk({ reportsOk: false, reports: [], missing: ['reports'] }) });
443
- await R2.page.click('#tabLibrary');
462
+ await R2.page.click('#moreB'); await R2.page.click('#moreMenu [data-more=\"library\"]');
444
463
  ok('I10 reports that could not be read are said to be unread, not empty', /report files could not be read/.test(await txt('#repBody', R2.page)));
445
464
  await R2.ctx.close();
446
465
  }
@@ -474,7 +493,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
474
493
  const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), pg = await ctx.newPage(), errs = [];
475
494
  pg.on('pageerror', (e) => errs.push(String(e)));
476
495
  await pg.goto(BASE + '/premium-insights.html');
477
- ok('E4 the real page says there is no goal, and has no script error', await until(() => pg.evaluate(() => /No KR metric is recorded/.test(document.querySelector('#brief').textContent) && /No goal is recorded/.test(document.querySelector('#goalTbl').textContent)), 20000) && errs.length === 0, errs.join(' | '));
496
+ ok('E4 the real page says there is no goal, and has no script error', await until(() => pg.evaluate(() => /No KR metric is recorded/.test(document.querySelector('#brief').textContent) && /No key result is recorded/.test(document.querySelector('#goalTbl').textContent)), 20000) && errs.length === 0, errs.join(' | '));
478
497
  await ctx.close();
479
498
  }
480
499
  {
@@ -509,7 +528,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
509
528
  const unknown = await fetch(base2 + '/api/premium-dashboards/save', { method: 'POST', headers: H, body: JSON.stringify({ ws: m.board.ws, board: m.board.id, name: 'Other', purpose: 'x', charts: ['krm-none'] }) }).then((x) => x.status);
510
529
  ok('E9 the real save route refuses a press without the nonce (403) and a chart no record holds (400); an agent session saves (D98)', asAgent === 200 && noNonce === 403 && unknown === 400, [asAgent, noNonce, unknown].join());
511
530
  /* New goal against the real route: the record lands in the scratch repository with every field the page sent */
512
- await pg.click('#newB'); await pg.click('#newMenu [data-new="goal"]'); await pg.fill('#ngName', 'Weekly partners'); await pg.fill('#ngBase', '5'); await pg.fill('#ngTgt', '9');
531
+ await pg.click('#newB'); await pg.fill('#ngName', 'Weekly partners'); await pg.fill('#ngBase', '5'); await pg.fill('#ngTgt', '9');
513
532
  await pg.click('#sideBody [data-seg="Type"] [data-v="Count"]'); await pg.fill('#ngOwner', 'Lee'); await pg.click('#sideBody [data-src="file"]'); await pg.click('#sideGo');
514
533
  const krFile = path.join(dir, 'planning', 'records', 'kr-metrics.jsonl'), recs = () => fs.readFileSync(krFile, 'utf8').trim().split('\n').map((x) => JSON.parse(x));
515
534
  const landed = await until(() => /Weekly partners/.test(fs.readFileSync(krFile, 'utf8')), 8000);
@@ -551,10 +570,9 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
551
570
  await q.click('#goalTbl [data-goal="w2~krm-inv"] .nm'); const gv = await until(() => vw(q));
552
571
  ok('M1 a goal of another product opens its detail, named with its product and not on this product\'s dashboards', gv && /Invoices paid on time$/.test(gv.title) && /Billing/.test(gv.text) && !(await q.evaluate(() => document.querySelector('#czViewer [data-gx="dash"], #czViewer [data-gx="chart"]'))), JSON.stringify(gv));
553
572
  await vwClose(q);
554
- await q.click('#tabOutcomes'); await sleep(100);
573
+ await sleep(100);
555
574
  ok('M1 several ticked: Outcomes says it shows the first product only', /Shows pmos only/.test(await q.evaluate(() => (document.querySelector('#outTbl .ins-onenote') || {}).textContent || '')));
556
- await q.click('#tabGoals');
557
- await q.click('#prodPick'); await q.click('#ppMenu [data-pp="w2"]');
575
+ await q.click('#prodPick'); await q.click('#ppMenu [data-pp="w2"]');
558
576
  await Promise.all([q.waitForNavigation(), q.keyboard.press('Escape')]);
559
577
  await until(() => q.evaluate(() => document.querySelectorAll('#goalTbl [data-goal]').length === 5), 8000);
560
578
  ok('M1 unticking the other product saves the pick and leaves Portfolio', JSON.stringify(R.pk.posts) === '[["w1"]]' && (await q.evaluate(() => document.querySelector('#prodPick').getAttribute('aria-label'))) === 'Products: pmos' && (await q.evaluate(() => document.querySelectorAll('#goalTbl .ins-grp').length === 0 || ![...document.querySelectorAll('#goalTbl .ins-grp')].some((g) => /Billing/.test(g.textContent)))), JSON.stringify(R.pk.posts));
@@ -570,7 +588,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
570
588
  await q.click('#czViewer [data-czs-fold="dash"]'); await sleep(80);
571
589
  ok('P1 the On your dashboards row holds the switches', (await q.evaluate(() => document.querySelectorAll('#czViewer [data-czs-id="dash"] [data-gx="dash"]').length)) === 1);
572
590
  await vwClose(q);
573
- await q.click('#tabLibrary'); await q.click('#listRows [data-setup]');
591
+ await q.click('#moreB'); await q.click('#moreMenu [data-more=\"library\"]'); await q.click('#listRows [data-setup]');
574
592
  const sh = await until(() => q.evaluate(() => { const s = document.querySelector('#repSheet'); return s ? { title: s.querySelector('.ins-h3').textContent, btns: [...s.querySelectorAll('button, a')].map((b) => b.textContent).join(','), viewer: !!document.querySelector('#czViewer:not([hidden])'), bottom: Math.round(innerHeight - s.getBoundingClientRect().bottom) } : null; }), 4000);
575
593
  ok('P1 on a phone a report setup opens as a sheet: Draft it now, Pause, Change the setup in Home', !!sh && sh.title === 'Partner update' && sh.btns === 'Draft it now,Pause,Change the setup in Home' && !sh.viewer && sh.bottom === 0, JSON.stringify(sh));
576
594
  await q.keyboard.press('Escape');
@@ -581,12 +599,15 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
581
599
  /* I11 fidelity to the Agreed design (AgInsGoals, AgInsPhone): Nunito, the cozy panel, the pill tabs, the table, the strip and the six tiles */
582
600
  for (const [w, h] of [[1440, 900], [390, 844]]) {
583
601
  const R = await open({ w, h }); await sleep(300);
584
- const f = await R.page.evaluate(() => { const cs = (s) => getComputedStyle(document.querySelector(s)); const main = cs('main.ins'), tab = cs('#tabGoals'), strip = cs('#insHero'), row = document.querySelector('#goalTbl .ins-row').getBoundingClientRect();
585
- const tiles = [...document.querySelectorAll('#bmBody [data-tile]')].map((t) => t.getBoundingClientRect());
586
- return { font: cs('body').fontFamily, radius: main.borderTopLeftRadius, bg: main.backgroundColor, tabBg: tab.backgroundColor, tabR: tab.borderTopLeftRadius, tabW: tab.fontWeight, stripR: strip.borderTopLeftRadius, stripBg: strip.backgroundColor, rowH: Math.round(row.height), over: document.documentElement.scrollWidth > innerWidth, fab: document.querySelector('#czFab').getBoundingClientRect().width, fabX: Math.round(document.querySelector('#czFab').getBoundingClientRect().left), tileRow: tiles.length === 6 && tiles.every((t) => Math.abs(t.top - tiles[0].top) < 2), tileH: tiles.length ? Math.round(tiles[0].height) : 0 }; });
602
+ const f = await R.page.evaluate(() => { const cs = (s) => getComputedStyle(document.querySelector(s)); const main = cs('main.ins'), tab = cs('#viewChip'), strip = cs('#insHero'), row = document.querySelector('#goalTbl .ins-row').getBoundingClientRect();
603
+ return { font: cs('body').fontFamily, radius: main.borderTopLeftRadius, bg: main.backgroundColor, tabBg: tab.backgroundColor, tabR: tab.borderTopLeftRadius, tabW: tab.fontWeight, stripR: strip.borderTopLeftRadius, stripBg: strip.backgroundColor, rowH: Math.round(row.height), over: document.documentElement.scrollWidth > innerWidth, fab: document.querySelector('#czFab').getBoundingClientRect().width, fabX: Math.round(document.querySelector('#czFab').getBoundingClientRect().left) }; });
587
604
  const phone = w < 720;
588
- ok(`I11 the page wears the Agreed design at ${w} px: Nunito, the white panel, pill tabs, the well strip, 56 px floating button`, /^Nunito/.test(f.font) && f.radius === (phone ? '0px' : '28px') && (phone || f.bg === 'rgb(255, 255, 255)') && f.tabBg === 'rgb(244, 243, 240)' && f.tabR === '999px' && f.tabW === '700' && (phone || (f.stripR === '16px' && f.stripBg === 'rgb(244, 243, 240)' && f.rowH >= 60)) && !f.over && f.fab === 56 && (phone ? f.fabX > 300 : f.fabX === 36), JSON.stringify(f));
589
- if (!phone) ok('I11 at 1440 px the six Delivery trends tiles sit in one compact row', f.tileRow && f.tileH > 0 && f.tileH <= 90, JSON.stringify(f));
605
+ ok(`I11 the page wears the Agreed design at ${w} px: Nunito, the white panel, the pill View chip, the well strip, 56 px floating button`, /^Nunito/.test(f.font) && f.radius === (phone ? '0px' : '28px') && (phone || f.bg === 'rgb(255, 255, 255)') && f.tabBg === 'rgb(244, 243, 240)' && f.tabR === '999px' && +f.tabW >= 700 && (phone || (f.stripR === '16px' && f.stripBg === 'rgb(244, 243, 240)' && f.rowH >= 60)) && !f.over && f.fab === 56 && (phone ? f.fabX > 300 : f.fabX === 36), JSON.stringify(f));
606
+ if (!phone) {
607
+ await toTrends(R.page);
608
+ const t = await R.page.evaluate(() => { const tiles = [...document.querySelectorAll('#bmBody [data-tile]')].map((x) => x.getBoundingClientRect()); return { n: tiles.length, tileH: tiles.length ? Math.round(tiles[0].height) : 0, over: document.documentElement.scrollWidth > innerWidth }; });
609
+ ok('I11 at 1440 px ⋯ Delivery trends opens its own view with the six tiles, no sideways scroll', t.n === 6 && t.tileH > 0 && !t.over, JSON.stringify(t));
610
+ }
590
611
  await R.ctx.close();
591
612
  }
592
613
  return finish();
@@ -68,8 +68,8 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
68
68
  const shown = await until(async () => { const t = await tilesOf(p); return t.length === 4 ? t : null; });
69
69
  ok('C1 the Metrics link under the track opens the board\'s four measures in the side panel', !!shown);
70
70
  if (!shown) return finish(1);
71
- const place = await p.evaluate(() => ({ t: document.querySelector('#czViewer .cz-vw-title').textContent, cap: document.querySelector('#metW .bd-amut').textContent, ins: (document.querySelector('#metW a[href^="/premium-insights.html"]') || {}).textContent, dlg: !!document.querySelector('#dlg.on') }));
72
- ok('C1 it is a side panel that says which repository it counts and links to Insights; no old dialog', place.t === 'Metrics' && /^counted from idpf/.test(place.cap) && /Targets and longer ranges are on Insights/.test(place.ins || '') && !place.dlg, JSON.stringify(place));
71
+ const place = await p.evaluate(() => ({ t: document.querySelector('#czViewer .cz-vw-title').textContent, cap: document.querySelector('#metW .bd-amut').textContent, ins: (document.querySelector('#metW a[href^="/premium-intelligence.html"]') || {}).textContent, dlg: !!document.querySelector('#dlg.on') }));
72
+ ok('C1 it is a side panel that says which repository it counts and links to Insights; no old dialog', place.t === 'Metrics' && /^counted from idpf/.test(place.cap) && /Targets and longer ranges are on Intelligence/.test(place.ins || '') && !place.dlg, JSON.stringify(place));
73
73
 
74
74
  /* C2 */
75
75
  const t0 = shown;
@@ -147,7 +147,9 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
147
147
  await q.route('**/api/board-metrics-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify(ready(metrics()).body) }));
148
148
  await q.route('**/api/board-metric-targets/save', (r) => { saves.push(JSON.parse(r.request().postData() || '{}')); return r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, targets: {} }) }); });
149
149
  await q.route('**/api/briefing-premium/**', (r) => r.fulfill({ contentType: 'application/json', body: '{"ok":true,"turns":[],"working":false}' }));
150
- await q.goto(BASE + '/premium-insights.html');
150
+ await q.goto(BASE + '/premium-intelligence.html');
151
+ // Delivery trends moved to ⋯ on Intelligence (batch 15 item 1)
152
+ await until(() => q.evaluate(() => !!document.querySelector('#moreB')), 20000); await q.click('#moreB'); await q.click('#moreMenu [data-more="trends"]');
151
153
  const v = await until(async () => { const x = await q.evaluate(() => Object.fromEntries([...document.querySelectorAll('#bmBody [data-tile]')].map((e) => [e.dataset.tile, e.querySelector('.v').textContent]))); return x.corrections && x.corrections !== 'Reading' ? x : null; }, 20000);
152
154
  ok('C10 Insights\' Delivery trends show the Board\'s measures with the same values', !!v && v.corrections === '10.0' && v.merges === '3' && v.idle === '1', JSON.stringify(v));
153
155
  // premium-uncovered-features (IsTarget): a tile opens the target popover under it, and the number goes to the Board's target route.
@@ -179,7 +179,7 @@ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
179
179
  {
180
180
  // re-pointed again for the Agreed design's Home: the source row is a Needs-you row of Home's list, and the digest is a row of New for you.
181
181
  // Re-pointed for Home A + C (HvAC, HvACDesk): a row is one line, its mark and its title; the subject moved to the row's tooltip and
182
- // accessible name, and the title is 14.5 px on a desktop, 15 px on a phone, weight 600
182
+ // accessible name, and the title is 14 px on a desktop, 16 px on a phone, weight 600 (the type scale, feedback batch 15 item 2)
183
183
  const ROWS = [['row', '.hm-rm'], ['number', '.hv-d'], ['title', '.hm-rt b']];
184
184
  const DIGS = [['event', ''], ['eventTime', '.ev-tx .ev-mut'], ['eventTitle', '.ev-tx b']];
185
185
  const SANS = 'var(--cz-sans)';
@@ -187,10 +187,10 @@ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
187
187
  const WANT = {
188
188
  row: { fontFamily: SANS, color: 'var(--cz-ink)', backgroundColor: 'transparent' },
189
189
  number: { backgroundColor: 'var(--cz-blue)', borderRadius: '50%', width: '8px', height: '8px' }, // the row's dot is blue: it waits on you (HvAC .d)
190
- title: { fontFamily: SANS, fontSize: '14.5px', fontWeight: '600', color: 'var(--cz-ink)' }, // HvACDesk .t; 15px on a phone (HvAC .t b)
190
+ title: { fontFamily: SANS, fontSize: '14px', fontWeight: '600', color: 'var(--cz-ink)' }, // HvACDesk .t; 16px on a phone (HvAC .t b)
191
191
  event: { fontFamily: SANS, color: 'var(--cz-ink)', backgroundColor: 'transparent' }, // a row of New for you's table (cozy-ev.css)
192
- eventTime: { fontSize: '12.5px', color: 'var(--cz-ink3)' },
193
- eventTitle: { fontFamily: SANS, fontSize: '13.5px', fontWeight: '700', color: 'var(--cz-ink)' },
192
+ eventTime: { fontSize: '12px', color: 'var(--cz-ink3)' },
193
+ eventTitle: { fontFamily: SANS, fontSize: '14px', fontWeight: '700', color: 'var(--cz-ink)' },
194
194
  };
195
195
  const grab = (pg, pairs, base, col) => pg.evaluate(([pairs, want, base, col]) => {
196
196
  const o = {};
@@ -221,7 +221,7 @@ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
221
221
  await allNeeds(R.page);
222
222
  // on a phone "Not in an initiative" starts folded (HvAC): open it to reach the source row
223
223
  if (w === 390) { const lh = await R.page.$('#hmList .hv-lh[aria-expanded="false"]'); if (lh) await lh.click(); }
224
- WANT.title.fontSize = w === 390 ? '15px' : '14.5px';
224
+ WANT.title.fontSize = w === 390 ? '16px' : '14px';
225
225
  await sleep(500);
226
226
  const rowSel = '#hmList .hm-r[data-id^="n:src:"]';
227
227
  const diffs = diff(await grab(R.page, ROWS, rowSel, '.hm-pg'), ROWS, 4); // the row fills its group (the group's own inset aside)
@@ -85,7 +85,7 @@ const vw = () => { const v = document.querySelector('#czViewer:not([hidden])');
85
85
  ok('R1 /console.html and /classic.html go to Home: the console and the classic page are deleted', gone.every((r) => r.status === 302 && /\/premium\.html$/.test(r.headers.get('location') || '')), gone.map((r) => r.status).join());
86
86
  const old = await fetch(BASE + '/c3.html', { redirect: 'manual' }); ok('R1 /c3.html with no query goes to Home', old.status === 302 && /\/premium\.html$/.test(old.headers.get('location') || ''));
87
87
  const rail = await p.evaluate(() => ({ gone: !document.querySelector('nav.rail, .rail [data-go], #dlg'), places: [...document.querySelectorAll('#czMenu a')].map((a) => a.textContent.trim() + '>' + a.getAttribute('href')), cur: (document.querySelector('#czMenu [aria-current="page"]') || {}).textContent || '' }));
88
- ok('R1 no old rail and no old dialog; the place menu names Home, Board and Insights and Home is current', rail.gone && rail.places.join() === 'Home>/premium.html,Board>/premium-board.html,Insights>/premium-insights.html' && /Home/.test(rail.cur), JSON.stringify(rail));
88
+ ok('R1 no old rail and no old dialog; the place menu names Home, Board and Intelligence and Home is current', rail.gone && rail.places.join() === 'Home>/premium.html,Board>/premium-board.html,Intelligence>/premium-intelligence.html' && /Home/.test(rail.cur), JSON.stringify(rail));
89
89
  ok('R1 nothing on Home links to the console', await p.evaluate(() => !document.querySelector('a[href*="console"], a[href*="c3.html"], [data-href*="console"]')));
90
90
  // premium-uncovered-features (EvSettings): Settings is its own dialog, opened from the place menu
91
91
  await p.click('#czFab'); await p.click('[data-cz-settings]');
@@ -105,7 +105,8 @@ const vw = () => { const v = document.querySelector('#czViewer:not([hidden])');
105
105
  /* R2 */
106
106
  { await p.click('[data-hm-new]');
107
107
  const nw = await until(() => p.evaluate(() => { const m = document.querySelector('#hmMenu:not([hidden])'); return m ? [...m.querySelectorAll('[role=menuitem], button')].map((b) => b.textContent.trim()).filter(Boolean) : null; }));
108
- ok('R2 the list head is the greeting (Home A + C, HvAC), and New offers its six choices (A task first since the testing fixes, Record a note now last)', await p.evaluate(() => /^Good (morning|afternoon|evening)$/.test(document.querySelector('#hmList .hm-hd [data-hm-day] b').textContent)) && !!nw && nw.length === 6 && /^A task/.test(nw[0]) && /^Record a note now/.test(nw[5]), JSON.stringify(nw));
108
+ ok('R2 the list head is the greeting (Home A + C, HvAC), and New offers its four kinds, one word each (batch 14 item 10, canvas PmAHome)', await p.evaluate(() => /^Good (morning|afternoon|evening)$/.test(document.querySelector('#hmList .hm-hd [data-hm-day] b').textContent)) && !!nw && nw.length === 4 && /^Task/.test(nw[0]) && /^Chat/.test(nw[1]) && /^Recording/.test(nw[2]) && /^Initiative/.test(nw[3]), JSON.stringify(nw));
109
+ ok('R2 New is headed New and has no sub lines (no "What is it for?")', await p.evaluate(() => { const m = document.querySelector('#hmMenu:not([hidden])'); return !!m && m.querySelector('.hm-ml').textContent === 'New' && !m.querySelector('em'); }));
109
110
  await p.keyboard.press('Escape');
110
111
  ok('R2 the list head has no fold button (no header chrome, canvas HmMyWork)', await p.evaluate(() => !document.querySelector('[data-hm-fold]'))); }
111
112
 
@@ -124,7 +125,7 @@ const vw = () => { const v = document.querySelector('#czViewer:not([hidden])');
124
125
  const selBg = await p.evaluate(() => getComputedStyle(document.querySelector('.hm-r.sel')).backgroundColor);
125
126
  ok('R12 the selected row is tinted (HvACDesk .sel)', selBg && !/rgba\(0, 0, 0, 0\)|transparent/.test(selBg), selBg);
126
127
  const hd = await p.evaluate(() => { const h = document.querySelector('#hmCh'); return h && !h.hidden ? { t: (h.querySelector('.hm-chb') || {}).textContent || '', mark: !!h.querySelector('.hv-mk .hv-d, .hv-mk .hv-ck'), y: Math.round(h.getBoundingClientRect().top), size: getComputedStyle(h.querySelector('.hm-chb')).fontSize } : null; });
127
- ok('R12 the chat\'s header line names the open row: its mark and its title, 17 px, at the top of the chat card (HvACDesk .ch)', !!hd && hd.t === r0.t && hd.mark && hd.y === 32 && hd.size === '17px', JSON.stringify(hd)); }
128
+ ok('R12 the chat\'s header line names the open row: its mark and its title, 16 px (the type scale, batch 15), at the top of the chat card (HvACDesk .ch)', !!hd && hd.t === r0.t && hd.mark && hd.y === 32 && hd.size === '16px', JSON.stringify(hd)); }
128
129
 
129
130
  /* R10 */
130
131
  ok('R10 a page where nothing was pressed to record sends no POST', A.posts.filter((x) => /briefing-premium\/(decide|put-off|return|start)/.test(x.path)).length === 0, JSON.stringify(A.posts.map((x) => x.path)));
@@ -227,9 +228,10 @@ const vw = () => { const v = document.querySelector('#czViewer:not([hidden])');
227
228
  // Home A + C (HvAC, XvAPhDay): the list folds "Not in an initiative" on a phone; every next step is in Your day, which "Good morning" opens
228
229
  await until(() => P.page.evaluate(() => { const l = document.querySelector('#hmList'); return l && getComputedStyle(l).display !== 'none' && !!document.querySelector('#hmList .hv-sub'); }));
229
230
  const top = await P.page.evaluate(() => (document.querySelector('#hmList .hv-sub') || {}).textContent || '');
230
- // Your day is an item in the Viewer, full screen on a phone (XvAPhDay): Your move lists the same rows
231
+ // Your day is an item in the Viewer, full screen on a phone (XvAPhDay): the same rows, split since batch 15 item 3 (design E) into the
232
+ // calls of Your move, Drafted for you and Can wait
231
233
  await P.page.click('#hmList [data-hm-day]');
232
- const rows = await until(() => P.page.evaluate((sel) => document.querySelectorAll('#czViewer:not([hidden]) .hd-move ' + sel.replace('#hmList ', '')).length, NEEDS));
234
+ const rows = await until(() => P.page.evaluate(() => document.querySelectorAll('#czViewer:not([hidden]) .yd [data-id^="n:"]').length));
233
235
  await P.page.evaluate(() => window.czViewer.close());
234
236
  const tn = /(\d+) (?:is|are) yours/.exec(top);
235
237
  ok(`R8 (${theme}) on a phone the list is the page; "N are yours" counts the next steps Your day lists`, rows >= MODEL.list.rows.length && !!tn && +tn[1] >= rows && await P.page.evaluate(() => document.body.classList.contains('hm-plist')), JSON.stringify({ top, rows }));
@@ -1,4 +1,28 @@
1
1
  [
2
+ {
3
+ "v": "0.429.0",
4
+ "at": "2026-10-27T18:29:21.690Z",
5
+ "f": 2,
6
+ "prs": [
7
+ {
8
+ "n": 1072,
9
+ "t": "Feedback batch 15",
10
+ "s": "Feedback batch 15"
11
+ }
12
+ ]
13
+ },
14
+ {
15
+ "v": "0.428.0",
16
+ "at": "2026-10-27T09:47:36.220Z",
17
+ "f": 2,
18
+ "prs": [
19
+ {
20
+ "n": 1071,
21
+ "t": "Feedback batch 14",
22
+ "s": "Feedback batch 14"
23
+ }
24
+ ]
25
+ },
2
26
  {
3
27
  "v": "0.427.0",
4
28
  "at": "2026-10-27T04:17:38.420Z",