create-pmos 0.397.0 → 0.399.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 (195) hide show
  1. package/package.json +25 -25
  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/briefing-premium-adddoc-test.js +105 -52
  8. package/workspace/briefing-premium-board-test.js +284 -128
  9. package/workspace/briefing-premium-calendar-2-test.js +135 -198
  10. package/workspace/briefing-premium-calendar-3-test.js +143 -418
  11. package/workspace/briefing-premium-calendar-test.js +85 -196
  12. package/workspace/briefing-premium-doc-edit-test.js +99 -83
  13. package/workspace/briefing-premium-initiative-test.js +175 -290
  14. package/workspace/briefing-premium-insights-test.js +414 -219
  15. package/workspace/briefing-premium-metrics-test.js +55 -97
  16. package/workspace/briefing-premium-products-test.js +44 -28
  17. package/workspace/briefing-premium-sources-test.js +70 -49
  18. package/workspace/briefing-premium-test.js +155 -648
  19. package/workspace/briefing-premium-work-test.js +88 -283
  20. package/workspace/changelog.json +24 -0
  21. package/workspace/ev-everywhere-test.js +210 -0
  22. package/workspace/fixtures/board-premium-trail.js +32 -0
  23. package/workspace/fixtures/premium-viewer-fixtures.js +187 -0
  24. package/workspace/guide/briefing-premium.md +3 -1
  25. package/workspace/guide/home.md +68 -0
  26. package/workspace/guide/index.md +1 -0
  27. package/workspace/lib/agent-roles.js +71 -0
  28. package/workspace/lib/board-grill.js +63 -0
  29. package/workspace/lib/board-premium.js +121 -24
  30. package/workspace/lib/board-trail.js +223 -0
  31. package/workspace/lib/home-work-item.js +58 -0
  32. package/workspace/lib/initiative-layout.js +77 -0
  33. package/workspace/lib/insights-goals.js +196 -0
  34. package/workspace/lib/insights-premium.js +64 -15
  35. package/workspace/lib/insights-records.js +115 -0
  36. package/workspace/lib/jira-tickets.js +1 -1
  37. package/workspace/lib/meeting-points.js +52 -0
  38. package/workspace/lib/news-for-you.js +88 -0
  39. package/workspace/lib/notes-series.js +29 -6
  40. package/workspace/lib/report-confirm.js +48 -0
  41. package/workspace/lib/route-modules.js +12 -0
  42. package/workspace/lib/routes-board-docs.js +46 -0
  43. package/workspace/lib/routes-board-grill.js +90 -0
  44. package/workspace/lib/routes-board-trail.js +33 -0
  45. package/workspace/lib/routes-home-desk.js +176 -0
  46. package/workspace/lib/routes-home-review.js +108 -0
  47. package/workspace/lib/routes-initiative-layout.js +57 -0
  48. package/workspace/lib/routes-insights-premium.js +16 -4
  49. package/workspace/lib/routes-insights-records.js +133 -0
  50. package/workspace/lib/routes-meeting-points.js +37 -0
  51. package/workspace/lib/routes-news.js +57 -0
  52. package/workspace/lib/routes-notes.js +3 -1
  53. package/workspace/lib/routes-report-confirm.js +31 -0
  54. package/workspace/lib/routes-search.js +38 -0
  55. package/workspace/lib/routes-viewer.js +108 -0
  56. package/workspace/lib/search-index.js +176 -0
  57. package/workspace/lib/transcript-steps.js +123 -0
  58. package/workspace/lib/viewer-meeting.js +205 -0
  59. package/workspace/lib/viewer-report.js +89 -0
  60. package/workspace/package-lock.json +2 -2
  61. package/workspace/package.json +1 -1
  62. package/workspace/premium-board-actions-test.js +128 -82
  63. package/workspace/premium-briefing-depth-test.js +104 -90
  64. package/workspace/premium-chat-attach-test.js +54 -63
  65. package/workspace/premium-chat-chart-tab-test.js +37 -37
  66. package/workspace/premium-chat-context-test.js +19 -18
  67. package/workspace/premium-chat-goal-view-test.js +23 -23
  68. package/workspace/premium-chat-notes-test.js +26 -31
  69. package/workspace/premium-chat-report-tab-test.js +46 -28
  70. package/workspace/premium-chat-term-test.js +16 -16
  71. package/workspace/premium-chat-viewer-test.js +60 -59
  72. package/workspace/premium-core-doc-issue-test.js +52 -43
  73. package/workspace/premium-html-viewer-test.js +14 -17
  74. package/workspace/premium-phone-card-test.js +10 -3
  75. package/workspace/premium-phone-room-test.js +41 -35
  76. package/workspace/premium-report-read-test.js +152 -197
  77. package/workspace/premium-viewer-download-test.js +19 -22
  78. package/workspace/premium-viewer-flicker-test.js +11 -16
  79. package/workspace/premium-viewer-share-test.js +6 -9
  80. package/workspace/premium-viewer-test.js +41 -60
  81. package/workspace/premium-vw-backlog-test.js +53 -33
  82. package/workspace/premium-vw-cal-test.js +97 -128
  83. package/workspace/premium-vw-copy-test.js +17 -33
  84. package/workspace/premium-vw-doc-test.js +17 -10
  85. package/workspace/premium-vw-item-test.js +50 -49
  86. package/workspace/premium-vw-jira-test.js +53 -27
  87. package/workspace/premium-vw-meet-test.js +115 -187
  88. package/workspace/premium-vw-notes-test.js +88 -109
  89. package/workspace/premium-vw-rec-test.js +71 -194
  90. package/workspace/premium-vw-slides-test.js +46 -50
  91. package/workspace/premium-welcome-test.js +3 -2
  92. package/workspace/premium-work-depth-test.js +61 -53
  93. package/workspace/public/pm/bd-acts.js +383 -0
  94. package/workspace/public/pm/bd-asks.js +261 -0
  95. package/workspace/public/pm/bd-pop.js +59 -0
  96. package/workspace/public/pm/bd-span.js +222 -82
  97. package/workspace/public/pm/bd-stages.js +25 -11
  98. package/workspace/public/pm/bd-views.js +169 -0
  99. package/workspace/public/pm/c3-doc-sheet.js +1 -1
  100. package/workspace/public/pm/c3-md.js +3 -395
  101. package/workspace/public/pm/c3-phone-detail.js +1 -1
  102. package/workspace/public/pm/c3-phone-model.js +3 -68
  103. package/workspace/public/pm/chat-term.js +3 -3
  104. package/workspace/public/pm/cozy-board.css +798 -230
  105. package/workspace/public/pm/cozy-ev.css +228 -0
  106. package/workspace/public/pm/cozy-evmodel.js +106 -0
  107. package/workspace/public/pm/cozy-evui.js +47 -0
  108. package/workspace/public/pm/cozy-home.css +570 -142
  109. package/workspace/public/pm/cozy-home.js +5 -3
  110. package/workspace/public/pm/cozy-insights.css +437 -170
  111. package/workspace/public/pm/cozy-md.js +396 -0
  112. package/workspace/public/pm/cozy-nav.js +104 -29
  113. package/workspace/public/pm/cozy-news.js +140 -0
  114. package/workspace/public/pm/cozy-placeholder.js +26 -0
  115. package/workspace/public/pm/cozy-search.js +203 -0
  116. package/workspace/public/pm/cozy-settings.js +198 -0
  117. package/workspace/public/pm/cozy-sources.js +89 -0
  118. package/workspace/public/pm/cozy-today.css +217 -0
  119. package/workspace/public/pm/cozy-viewer.css +3 -3
  120. package/workspace/public/pm/cozy-viewer.js +145 -0
  121. package/workspace/public/pm/cozy-vw-mtg.css +350 -0
  122. package/workspace/public/pm/cozy-vw-rp.css +152 -0
  123. package/workspace/public/pm/cozy-vw.css +485 -0
  124. package/workspace/public/pm/cozy.css +83 -1
  125. package/workspace/public/pm/home-adddoc.js +48 -0
  126. package/workspace/public/pm/home-app.js +1179 -0
  127. package/workspace/public/pm/home-around.js +413 -0
  128. package/workspace/public/pm/home-chat.js +512 -0
  129. package/workspace/public/pm/home-data.js +312 -0
  130. package/workspace/public/pm/home-dictate.js +54 -0
  131. package/workspace/public/pm/home-draft.js +68 -0
  132. package/workspace/public/pm/home-ini-model.js +190 -0
  133. package/workspace/public/pm/home-ini.css +171 -0
  134. package/workspace/public/pm/home-ini.js +456 -0
  135. package/workspace/public/pm/home-list.js +276 -0
  136. package/workspace/public/pm/home-more.js +132 -0
  137. package/workspace/public/pm/home-phone-card.js +109 -0
  138. package/workspace/public/pm/home-review.js +104 -0
  139. package/workspace/public/pm/home-task.js +67 -0
  140. package/workspace/public/pm/home-today.js +144 -0
  141. package/workspace/public/pm/home-work.js +547 -0
  142. package/workspace/public/pm/phone-moment.js +69 -0
  143. package/workspace/public/pm/pm-work-view.js +1 -1
  144. package/workspace/public/pm/premium-attach.js +4 -0
  145. package/workspace/public/pm/premium-board.js +548 -395
  146. package/workspace/public/pm/premium-chart-tab.js +109 -62
  147. package/workspace/public/pm/premium-deck.js +3 -3
  148. package/workspace/public/pm/premium-first.js +23 -21
  149. package/workspace/public/pm/premium-insights.js +1102 -581
  150. package/workspace/public/pm/premium-meeting.js +61 -549
  151. package/workspace/public/pm/premium-mtg-present.js +138 -0
  152. package/workspace/public/pm/premium-mtg-replay.js +142 -0
  153. package/workspace/public/pm/premium-notes.js +1 -1
  154. package/workspace/public/pm/premium-report-frame.css +20 -0
  155. package/workspace/public/pm/premium-report-read.js +669 -476
  156. package/workspace/public/pm/premium-report-tab.js +116 -67
  157. package/workspace/public/pm/premium-shell.js +76 -123
  158. package/workspace/public/pm/premium-viewer.js +22 -1
  159. package/workspace/public/pm/premium-vw-cal.js +277 -48
  160. package/workspace/public/pm/premium-vw-doc.css +6 -0
  161. package/workspace/public/pm/premium-vw-doc.js +40 -2
  162. package/workspace/public/pm/premium-vw-file.js +2 -2
  163. package/workspace/public/pm/premium-vw-meet.js +6 -83
  164. package/workspace/public/pm/premium-vw-mtg.js +958 -0
  165. package/workspace/public/pm/premium-vw-notes.js +116 -68
  166. package/workspace/public/pm/premium-vw-open.js +35 -0
  167. package/workspace/public/pm/premium-vw-page.js +16 -0
  168. package/workspace/public/pm/premium-vw-rec.js +11 -218
  169. package/workspace/public/pm/premium-vw-slides.css +5 -0
  170. package/workspace/public/pm/premium-vw-slides.js +44 -8
  171. package/workspace/public/pm/rp-parts.js +269 -0
  172. package/workspace/public/pm/term-view.js +22 -0
  173. package/workspace/public/premium-board.html +29 -70
  174. package/workspace/public/premium-initiative.html +8 -48
  175. package/workspace/public/premium-insights.html +26 -64
  176. package/workspace/public/premium-viewer.html +20 -0
  177. package/workspace/public/premium.html +18 -107
  178. package/workspace/r/m1.png +0 -0
  179. package/workspace/r/m2.png +0 -0
  180. package/workspace/r/m3.png +0 -0
  181. package/workspace/r/nl.png +0 -0
  182. package/workspace/server.js +18 -3
  183. package/workspace/test-files.json +1 -0
  184. package/workspace/test-lists/home-libs.json +9 -0
  185. package/workspace/test-lists/initiative-layout.json +9 -0
  186. package/workspace/test-lists/premium-report-read.json +1 -1
  187. package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
  188. package/workspace/test-lists/premium-uncovered-reports.json +9 -0
  189. package/workspace/test-lists/premium-vw-agreed.json +9 -0
  190. package/workspace/test-lists/premium-vw-notes.json +1 -1
  191. package/workspace/test-lists/uf-everywhere.json +15 -0
  192. package/workspace/test-lists/uf-home.json +9 -0
  193. package/workspace/test-lists/uncovered-board.json +9 -0
  194. package/workspace/public/pm/premium-work.js +0 -729
  195. package/workspace/public/pm/premium.js +0 -1146
@@ -4,7 +4,14 @@
4
4
  * rebuilt to the Agreed design (initiative premium-agreed-design: AgBoard* frames, N1 N2).
5
5
  * Serves the real page from the real server. Most checks answer GET /api/board-premium with the model lib/board-premium.js builds from a fixture
6
6
  * (fixtures/board-premium-facts.js); the last block reads this repository's own board through the real routes and presses nothing that starts a run.
7
- * B1 place · B2 reading · B3 header counts · B4 list · B5 stages · B6 timeline · B7 core documents · B8 release · B9 sprint · B10 dialog · B11 one count · B12 labels · B13 floors and fidelity */
7
+ * B1 place, the stage track and its panels · B2 reading · B3 B11 one count · B4 B5 List and By stage · B6 timeline · B7 Documents · B10 no dialog
8
+ * B12 labels · B13 floors and fidelity · B14 expand · B15 picker.
9
+ * Re-pointed to the uncovered-features designs (initiative premium-uncovered-features: BdList, BdByStage, BdDocs, BdSpans, BdAsks, BdNew, BdActions,
10
+ * BdFilter, BdSprint, BdPanel, BdPhone): List, By stage, Documents, the Sprint, Half and 2 yr spans, the asks, the sprint and release, Find, Filter,
11
+ * New initiative, the row actions and cancelled and archived are checked as designed, with no "Waiting for design" tag, through the routes the
12
+ * console presses.
13
+ * GET /api/board-trail (lib/board-trail.js) is answered with fixtures/board-premium-trail.js in the T block, and fails everywhere else, so the
14
+ * other blocks check what the page draws when the trail is not there: nothing invented. */
8
15
  const fs = require('fs');
9
16
  const path = require('path');
10
17
  const { spawn } = require('child_process');
@@ -13,6 +20,7 @@ const T = require('./test-run').configure({ name: 'briefing-premium-board' });
13
20
  const BP = require('./lib/board-premium.js');
14
21
  const F = require('./fixtures/board-premium-facts.js');
15
22
  const FJ = require('./fixtures/board-premium-jira.js');
23
+ const FT = require('./fixtures/board-premium-trail.js');
16
24
 
17
25
  const BASE = T.BASE;
18
26
  const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
@@ -41,16 +49,22 @@ const mk = (o) => BP.build(F.facts(o));
41
49
  await T.waitForServer(BASE);
42
50
  browser = await chromium.launch({ executablePath: exe });
43
51
 
44
- const open = async ({ w = 1280, h = 900, theme = 'light', model = mk(), answers = null, mode = 'popup' } = {}) => {
52
+ const open = async ({ w = 1280, h = 900, theme = 'light', model = mk(), answers = null, trail = null, qs = '' } = {}) => {
45
53
  const ctx = await browser.newContext({ viewport: { width: w, height: h } });
46
- if (mode) await ctx.addInitScript((m) => { try { if (!localStorage.getItem('pmos.premium.openAs')) localStorage.setItem('pmos.premium.openAs', m); } catch { /* none */ } }, mode); // the earlier checks read the popup; the Page default has its own checks below
47
54
  const page = await ctx.newPage();
48
55
  let current = model, calls = 0; const errors = [], posts = []; let answer = { status: 200, body: { ok: true } }; let thread = { ok: true, turns: [], working: false };
49
- page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
56
+ page.on('pageerror', (e) => errors.push(String((e && e.stack) || e)));
50
57
  await page.route('**/api/board-premium*', (r) => { calls++; if (answers) { const a = answers(calls); return r.fulfill({ status: a.status, contentType: 'application/json', body: JSON.stringify(a.body) }); } return r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: current, as_of: Date.now() }) }); });
51
58
  await page.route('**/api/core-docs/**', (r) => { const rq = r.request(); posts.push({ path: new URL(rq.url()).pathname, body: JSON.parse(rq.postData() || '{}'), headers: rq.headers() }); r.fulfill({ status: answer.status, contentType: 'application/json', body: JSON.stringify(answer.body) }); });
59
+ await page.route('**/api/board-trail*', (r) => (trail ? r.fulfill({ contentType: 'application/json', body: JSON.stringify(trail) }) : r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'not in this check' }) })));
60
+ // the writes of the plain versions (pm/bd-acts.js): captured, and answered as the routes answer
61
+ const W = { '/api/boards/anchors': { ok: true, anchors: [{ value: 'q3-2026:o1:kr1', label: 'KR 1.1 · Self-serve activation' }, { value: 'health:ci', label: 'Health budget · CI' }] }, '/api/boards/asks/add': { ok: true, ask: { id: 'n1' } }, '/api/boards/asks/accept': { ok: true, stage: 'Triage' },
62
+ '/api/board-metrics-premium': { ok: true, model: { tiles: [{ label: 'Cycle time', value: '9 days', text: 'median, last 90 days' }, { label: 'Throughput', absent: 'Not on record', why: 'No run log for this board' }] } } };
63
+ await page.route(/\/api\/(boards\/|lifecycle|board-metrics-premium)/, (r) => { const rq = r.request(), pth = new URL(rq.url()).pathname; if (rq.method() !== 'GET') posts.push({ path: pth, body: JSON.parse(rq.postData() || '{}'), headers: rq.headers() }); r.fulfill({ contentType: 'application/json', body: JSON.stringify(W[pth] || { ok: true }) }); });
64
+ await page.route('**/api/doc?**', (r) => r.fulfill({ contentType: 'text/markdown', body: '---\ntype: PRD\ntitle: Self-serve onboarding v2\n---\n\n## Problem\nNew teams stall at the invite step.' }));
65
+ await page.route('**/api/sources/refresh', (r) => { const rq = r.request(); posts.push({ path: new URL(rq.url()).pathname, body: JSON.parse(rq.postData() || '{}'), headers: rq.headers() }); r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true }) }); });
52
66
  await page.route('**/api/briefing-premium/**', (r) => { const rq = r.request(); if (rq.method() === 'GET') return r.fulfill({ contentType: 'application/json', body: JSON.stringify(thread) }); posts.push({ path: new URL(rq.url()).pathname, body: JSON.parse(rq.postData() || '{}'), headers: rq.headers() }); return r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ ok: true }) }); });
53
- await page.goto(BASE + '/premium-board.html?theme=' + theme);
67
+ await page.goto(BASE + '/premium-board.html?theme=' + theme + qs);
54
68
  const up = await until(() => page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0 || /could not be read/.test(document.querySelector('#snap').textContent)), 20000);
55
69
  return { ctx, page, errors, posts, up, calls: () => calls, setModel: (m) => { current = m; }, set: (a) => { answer = a; }, setThread: (t) => { thread = t; } };
56
70
  };
@@ -65,50 +79,101 @@ const mk = (o) => BP.build(F.facts(o));
65
79
  const spanTo = async (pg, s) => { await pg.click(`#bdSpans [data-sp="${s}"]`); await sleep(150); };
66
80
 
67
81
  /* B1 (premium-agreed-design N1 N2): the floating place menu, no page header, one toolbar */
68
- const place = await p.evaluate(() => { const f = document.querySelector('#czFab'), h1 = document.querySelector('main h1'), r = h1.getBoundingClientRect(), tb = document.querySelector('.bd-hd').getBoundingClientRect(); return { fab: f && f.getAttribute('aria-label'), w: Math.round(f.getBoundingClientRect().width), rail: getComputedStyle(document.querySelector('.rail')).display, h1: Math.round(r.width) + 'x' + Math.round(r.height), top: Math.round(tb.top), name: document.querySelector('#crBoard').textContent, sw: document.querySelector('#crSw').hidden, title: document.title }; });
69
- ok('N1 the floating menu is the one way between places: 56 px, it says Board, and the rail is not on screen', place.fab === 'Open the menu. You are in Board' && place.w === 56 && place.rail === 'none', JSON.stringify(place));
82
+ const place = await p.evaluate(() => { const f = document.querySelector('#czFab'), h1 = document.querySelector('main h1'), r = h1.getBoundingClientRect(), tb = document.querySelector('.bd-hd').getBoundingClientRect(); return { fab: f && f.getAttribute('aria-label'), w: Math.round(f.getBoundingClientRect().width), rail: document.querySelector('nav.rail') ? getComputedStyle(document.querySelector('nav.rail')).display : 'gone', h1: Math.round(r.width) + 'x' + Math.round(r.height), top: Math.round(tb.top), name: document.querySelector('#crBoard').textContent, sw: document.querySelector('#crSw').hidden, title: document.title }; });
83
+ ok('N1 the floating menu is the one way between places: 56 px, it says Board, and the old rail is gone from the page', /^Open the menu. You are in Board(\. |$)/.test(place.fab) && place.w === 56 && place.rail === 'gone', JSON.stringify(place));
70
84
  ok('N2 no page header on desktop: the heading is for screen readers only and the toolbar starts at the top', place.h1 === '1x1' && place.top < 60 && place.name === 'pmos' && place.sw, JSON.stringify(place));
71
85
  await p.click('#czFab');
72
86
  const menu = await p.evaluate(() => [...document.querySelectorAll('#czMenu a')].map((a) => a.textContent + (a.getAttribute('aria-current') ? '*' : '') + '>' + a.getAttribute('href')).join('|'));
73
87
  ok('N1 the menu opens Home, Board and Insights, and marks Board', menu === 'Home>/premium.html|Board*>/premium-board.html|Insights>/premium-insights.html', menu);
74
88
  await p.keyboard.press('Escape');
75
- { await p.click('#moreBtn'); const tc = await p.evaluate(() => { const a = document.querySelector('#toConsole'); if (!a) return null; const r = a.getBoundingClientRect(); return { href: a.getAttribute('href'), label: a.getAttribute('aria-label'), w: Math.round(r.width), h: Math.round(r.height), tab: a.tabIndex, board: ['#miSteps', '#miSpr', '#miMet', '#miGone'].every((s) => !!document.querySelector('#moreMenu ' + s)) }; }); ok('B1 the ⋯ menu links to the console and holds the Board\'s own items (steps, sprint and release, metrics, cancelled and archived)', tc && tc.href === '/console.html' && tc.label === 'Open the console' && tc.w >= 44 && tc.h >= 44 && tc.tab === 0 && tc.board, JSON.stringify(tc)); await p.keyboard.press('Escape'); }
89
+ // premium-agreed-design (shared foundation): the ⋯ menu leads nowhere in the console; its undesigned items open the Viewer on a placeholder.
90
+ // re-pointed for the Agreed Board: the Board adds none of its old items to the menu (steps, sprint and release, metrics, cancelled and archived).
91
+ { await p.click('#moreBtn'); const tc = await p.evaluate(() => { const s = document.querySelector('#settingsBtn'); if (!s) return null; const r = s.getBoundingClientRect(); return { console: document.querySelectorAll('#moreMenu a[href*="console"], #toConsole').length, w: Math.round(r.width), h: Math.round(r.height), old: ['#miSteps', '#miSpr', '#miMet', '#miGone'].filter((x) => !!document.querySelector(x)) }; }); ok('B1 the ⋯ menu has no console link and none of the Board\'s old items (steps, sprint and release, metrics, cancelled and archived)', tc && tc.console === 0 && tc.w >= 44 && tc.h >= 44 && tc.old.length === 0, JSON.stringify(tc));
92
+ await p.click('#settingsBtn'); const vw = await until(() => p.evaluate(() => { const d = document.querySelector('#evSettings:not([hidden])'); return d ? d.getAttribute('aria-label') : null; }));
93
+ ok('B1 Settings opens its dialog (premium-uncovered-features, EvSettings)', vw === 'Settings', JSON.stringify(vw)); await p.keyboard.press('Escape'); }
76
94
  ok('B1 the page is served at /premium-board and /premium-board.html', (await fetch(BASE + '/premium-board')).status === 200 && (await fetch(BASE + '/premium-board.html')).status === 200);
77
95
 
78
- /* B1 the stage track (premium-agreed-design): eight columns, two of them milestones, the board's counts, rows by stage */
79
- /* re-pointed for premium-agreed-design: the milestone mark is now a drawn diamond (.msh header holding .cz-ms, cozy.css), not a ◆ glyph in the text;
80
- * the heads read '◆ ' only where that shape is present, so the check still pins which two columns are milestones. Evaluate 21 is the fixture's own count (+20 done). */
81
- const tr = await p.evaluate(() => ({ heads: [...document.querySelectorAll('.bt-h .bt-cells > div')].map((d) => (d.classList.contains('msh') && d.querySelector('.cz-ms') ? '◆ ' : '') + d.textContent.replace(/\s+/g, ' ').trim()), rows: [...document.querySelectorAll('#ibBody .bt-l')].map((r) => ({ t: r.querySelector('.bt-nm b').textContent, cur: [...r.querySelectorAll('.bt-cells > div')].findIndex((c) => c.classList.contains('c')), out: r.querySelector('.bt-dl .t1 b').textContent, prog: r.querySelector('.bt-dl .t1 span').textContent, st: r.querySelector('.cs').textContent })), pressed: document.querySelector('#ibTabs [aria-pressed="true"]').dataset.v }));
96
+ /* the Agreed toolbar: the view toggle, Find, Filter, New initiative and ⋯; nothing of the older Board is attached (premium-agreed-design, audit section 2) */
97
+ const tools = await p.evaluate(() => ({ views: [...document.querySelectorAll('#ibTabs [data-v]')].map((b) => b.dataset.v).join(), order: [...document.querySelectorAll('.bd-hd #ibTabs, .bd-hd #bdFind, .bd-hd #bdFilter, .bd-hd #newIni, .bd-hd #moreBtn')].map((e) => e.id).join(), old: ['#modeSeg', '#iniCap', '#iniBar', '#iniNote', '#popAsks', '#popSpr', '#popMet', '#popFilter', '#stHelp', '#more', '.bam2', '.bd-foot', '#dmQ', '#docBody .dmr'].filter((q) => !!document.querySelector(q)), console: document.querySelectorAll('a[href*="console"]').length }));
98
+ ok('B1 the toolbar is the design\'s: four views, Find, Filter, New initiative and ⋯, in that order', tools.views === 'stages,track,time,list' && tools.order === 'ibTabs,bdFind,bdFilter,newIni,moreBtn', JSON.stringify(tools));
99
+ ok('B1 none of the older Board is on the page: no Page/Popup switch, header bar, note, asks, sprint, metrics or filter popover, Show more, row menu, footer or documents manager, and no console link', tools.old.length === 0 && tools.console === 0, JSON.stringify(tools));
100
+
101
+ /* B1 the stage track (premium-agreed-design): eight columns, two of them milestones, the board's counts, rows by stage.
102
+ * The milestone mark is a drawn diamond (.msh header holding .cz-ms, cozy.css), not a ◆ glyph in the text; the heads read '◆ ' only where
103
+ * that shape is present, so the check pins which two columns are milestones. Evaluate 21 is the fixture's own count (+20 done). */
104
+ const tr = await p.evaluate(() => ({ heads: [...document.querySelectorAll('.bt-h .bt-cells > div')].map((d) => (d.classList.contains('msh') && d.querySelector('.cz-ms') ? '◆ ' : '') + d.textContent.replace(/\s+/g, ' ').trim()), rows: [...document.querySelectorAll('#ibBody .bt-l')].map((r) => ({ t: r.querySelector('.bt-nm b').textContent, cur: [...r.querySelectorAll('.bt-cells > div')].findIndex((c) => c.classList.contains('c')), out: r.querySelector('.bt-dl .t1 b').textContent, prog: r.querySelector('.bt-dl .t1 span').textContent, line: r.querySelector('.bt-dl .t3').textContent, st: r.querySelector('.cs').textContent, days: (r.querySelector('.sc.c small') || {}).textContent, dt: (r.querySelector('.sc.c') || {}).title })), pressed: document.querySelector('#ibTabs [aria-pressed="true"]').dataset.v, n: document.querySelector('.bt-nmh').textContent.replace(/\s+/g, ' ').trim(), lg: document.querySelector('.bt-oh .lg').textContent, tf: document.querySelector('.bt-tf').textContent }));
82
105
  ok('B1 the default view is the stage track with six stages and two milestones, each with the board\'s count (old names count for the new ones)', tr.pressed === 'track' && tr.heads.join('|') === 'Triage0|Discover1|Plan1|Prioritize0|Build2|◆ Deliver1|Monitor1|◆ Evaluate21', JSON.stringify(tr.heads));
83
- ok('B1 one row per initiative, sorted by stage, with its current step marked', tr.rows.length === 7 && tr.rows.map((r) => r.cur).join() === '1,2,4,4,5,6,7' && tr.rows[0].t === 'Usage-based billing', JSON.stringify(tr.rows.map((r) => r.t + ':' + r.cur)));
84
- ok('B1 the Output column names what finishes the step and the progress a record holds; nothing is invented', tr.rows[0].out === 'PRD complete' && tr.rows[0].prog === 'Not counted yet' && tr.rows[1].out === 'Scope, timeline, work breakdown' && tr.rows[1].prog === '18%' && tr.rows[6].out === 'Keep, iterate or stop', JSON.stringify(tr.rows.map((r) => r.out + ':' + r.prog)));
106
+ ok('B1 one row per initiative, sorted by stage, with its current step marked; the head counts the open initiatives', tr.rows.length === 7 && tr.rows.map((r) => r.cur).join() === '1,2,4,4,5,6,7' && tr.rows[0].t === 'Usage-based billing' && tr.n === 'Initiative 9', JSON.stringify(tr.rows.map((r) => r.t + ':' + r.cur)));
107
+ ok('B1 the Output column names what finishes the step and the parts or progress a record holds; a part not on record is not counted', tr.rows[0].out === 'PRD complete' && tr.rows[0].prog === '— of 6 parts' && /Problem · users · evidence · scope · success metric · risks/.test(tr.rows[0].line) && tr.rows[1].out === 'Scope, timeline, work breakdown' && tr.rows[1].prog === '18%' && tr.rows[3].prog === 'No tickets yet' && tr.rows[6].out === 'Keep, iterate or stop', JSON.stringify(tr.rows.map((r) => r.out + ':' + r.prog)));
85
108
  ok('B1 the status line says late in days over and at risk with no owner', tr.rows.some((r) => /^\d+ days over$/.test(r.st)) && tr.rows[0].st === 'At risk · no owner', JSON.stringify(tr.rows.map((r) => r.st)));
109
+ ok('B1 days in a step are not on record, so the current step shows a dash and says so; nothing is invented', tr.rows.every((r) => r.days === '—' && /days in this step are not on record/.test(r.dt)), JSON.stringify(tr.rows.map((r) => r.days + ':' + r.dt)));
110
+ ok('B1 the legend reads Skipped, Done, Review, Doing, You and Blocked', tr.lg === 'SkippedDoneReviewDoingYouBlocked', tr.lg);
111
+ ok('B1 Monitor and Evaluate fold after the first of each: "20 more in Monitor and Evaluate", sorted by stage', /^20 more in Monitor and Evaluate/.test(tr.tf) && /Sorted by stage$/.test(tr.tf), tr.tf);
112
+ await p.click('#fold');
113
+ ok('B1 the fold opens and says how many are not loaded, and closes again', await p.evaluate(() => document.querySelector('#fold').getAttribute('aria-expanded') === 'true' && /Fold Monitor and Evaluate · 20 more are not loaded/.test(document.querySelector('#fold').textContent)));
114
+ await p.click('#fold');
86
115
  ok('M1 only the info, warning and critical dots move', await p.evaluate(() => [...document.querySelectorAll('#stage *')].filter((e) => { const a = getComputedStyle(e, '::after').animationName, b = getComputedStyle(e).animationName; return (a && a !== 'none') || (b && b !== 'none'); }).every((e) => e.matches('.cz-dot.m-info, .cz-dot.m-warn, .cz-dot.m-crit'))));
116
+ /* AgBoardStages: the step heads open "What finishes each step"; Escape closes it and gives the focus back */
117
+ await p.click('.bt-h [data-steps]');
118
+ ok('B1 what finishes each step: eight steps with their output and where the count comes from, from the step heads', await until(() => p.evaluate(() => !document.querySelector('#popSteps').hidden && /Release shipped, your sign-off/.test(document.querySelector('#popSteps').textContent) && document.querySelectorAll('#popSteps .bd-tbl .bd-tr').length === 9)));
119
+ await p.keyboard.press('Escape');
120
+ ok('B1 Escape closes it and the focus goes back to the step head', await until(() => p.evaluate(() => document.querySelector('#popSteps').hidden && document.activeElement && document.activeElement.hasAttribute('data-steps'))));
121
+ {
122
+ const f = F.facts(); f.rows = f.rows.map((r) => (r.id === 'usage-billing' ? { ...r, warnings: ['Skipped Triage'] } : r));
123
+ const R = await open({ model: BP.build(f) }), q = R.page;
124
+ const k = await q.evaluate(() => { const r = document.querySelector('.bt-l[data-row="board:usage-billing"]'); return { cls: r.querySelector('.bt-cells > div').className, n: r.querySelectorAll('.bt-cells > div.k').length }; });
125
+ ok('B1 a step the row was moved past is a hollow "Skipped" ring', /\bk\b/.test(k.cls) && k.n === 1, JSON.stringify(k));
126
+ await q.click('.bt-l[data-row="board:usage-billing"] .bt-nm');
127
+ const sk = await until(() => q.evaluate(() => { const k2 = document.querySelector('#peek'); return k2 && !k2.hidden ? { skip: (k2.querySelector('.pk-skip') || {}).textContent, lad: (k2.querySelector('.pk-lad span') || {}).className } : null; }));
128
+ ok('B1 the panel strikes the skipped step and says no reason is on record', !!sk && sk.skip === 'Triage skipped: it was moved past that step. No reason is on record.' && /\bk\b/.test(sk.lad), JSON.stringify(sk));
129
+ await R.ctx.close();
130
+ }
87
131
  {
88
132
  const R = await open({ model: BP.build(FJ.facts()) }), q = R.page;
89
- const c = await q.evaluate(() => ({ chips: [...document.querySelectorAll('#bdChipset .cz-chip')].map((b) => b.textContent.replace(/\s+/g, ' ').trim()), segs: [...document.querySelectorAll('.bt-l[data-row="board:self-serve-v2"] .seg5 .bt-tk')].map((b) => b.className.replace('bt-tk ', '')).join(), sso: document.querySelector('.bt-l[data-row="board:sso-partners"] .bt-dl').textContent }));
90
- ok('B1 the chips read Jira, the sprint and the release, the new asks, late, at risk and blocked from the records', /^Jira · read /.test(c.chips[0]) && c.chips[1] === 'Sprint 24 · v2.4 ships 4 Nov' && c.chips[2] === '1 new ask' && c.chips.includes('1 late') && c.chips.includes('3 at risk') && c.chips.includes('1 blocked') && c.chips.includes('This sprint'), JSON.stringify(c.chips));
91
- ok('B1 Build progress is the Jira tickets in points, one segment each; a blocked ticket shows in red and says why', c.segs === 'dn,dn,rv,ip,td' && /v2\.4 shipped \+ your sign-off/.test(c.sso) && /SSO-12 blocked · Waiting on PLAT-88/.test(c.sso), JSON.stringify(c));
133
+ const c = await q.evaluate(() => ({ chips: [...document.querySelectorAll('#bdChipset .bd-chip')].map((b) => b.textContent.replace(/\s+/g, ' ').trim() + (b.getAttribute('aria-pressed') === 'true' ? '*' : '')), segs: [...document.querySelectorAll('.bt-l[data-row="board:self-serve-v2"] .seg5 .bt-tk')].map((b) => b.className.replace('bt-tk ', '')).join(), sso: document.querySelector('.bt-l[data-row="board:sso-partners"] .bt-dl').textContent, st: document.querySelector('.bt-l[data-row="board:sso-partners"] .cs').textContent, ssoCount: document.querySelector('.bt-l[data-row="board:sso-partners"] .t1 span').textContent, ssCount: document.querySelector('.bt-l[data-row="board:self-serve-v2"] .t1 span').textContent }));
134
+ ok('B1 the chips read Jira, the sprint and the release, the new asks, late, at risk and blocked from the records; This sprint is on by default', /^Jira · read /.test(c.chips[0]) && c.chips[1] === 'Sprint 24 · v2.4 ships Nov 4' && c.chips[2] === '1 new ask' && c.chips.includes('1 late') && c.chips.includes('3 at risk') && c.chips.includes('1 blocked*') === false && c.chips.includes('1 blocked') && c.chips[c.chips.length - 1] === 'This sprint*', JSON.stringify(c.chips));
135
+ ok('B1 Build progress is the Jira tickets in points, one segment each; a blocked ticket shows in red and says why', c.segs === 'dn,dn,rv,ip,td' && c.ssCount === '5 of 13 pts' && c.ssoCount === '1 of 4' && /v2\.4 shipped \+ your sign-off/.test(c.sso) && /SSO-12 blocked · Waiting on PLAT-88/.test(c.sso), JSON.stringify(c));
136
+ ok('B1 a Deliver row whose release has a date says when it ships', c.st === 'Ships Nov 4', c.st);
137
+ // a metric chip opens its trend (BdPanel); its "Show only" filters
92
138
  await q.click('#bdChipset [data-f="blocked"]');
139
+ ok('B1 a metric chip opens its trend, with Show only and See in Insights', await until(() => q.evaluate(() => { const p = document.querySelector('#bdPop'); return !!p && !p.hidden && /Blocked · 1 now/.test(p.textContent) && !!p.querySelector('[data-trshow="blocked"]') && /See in Insights/.test(p.textContent); })));
140
+ await q.click('#bdPop [data-trshow="blocked"]');
93
141
  ok('B1 a chip filters the rows to what it counts', await q.evaluate(() => [...document.querySelectorAll('#ibBody .bt-l')].map((r) => r.dataset.row).join() === 'board:sso-partners'));
94
142
  await q.click('#bdChipset [data-f="blocked"]');
95
143
  await q.click('.bt-l[data-row="board:sso-partners"] .bt-nm');
96
- const pk = await until(() => q.evaluate(() => { const k = document.querySelector('#peek'); return k && !k.hidden ? { t: document.querySelector('#pkTitle').textContent, tks: [...k.querySelectorAll('.gi em')].map((e) => e.textContent).join(), lad: k.querySelectorAll('.pk-lad span').length, cur: (k.querySelector('.pk-lad span.c') || {}).textContent, sel: !!document.querySelector('.bt-l.sel[data-row="board:sso-partners"]') } : null; }));
97
- ok('B1 a row opens the initiative panel: its ladder, its output with the Jira tickets, and the row is marked', !!pk && pk.t === 'SSO for partners' && pk.tks === 'SSO-12,SSO-10,SSO-14,SSO-15' && pk.lad === 8 && pk.cur === 'Deliv' && pk.sel, JSON.stringify(pk));
98
- await q.click('#peek .gi[data-tk="SSO-12"]');
99
- const tk = await until(() => q.evaluate(() => { const t = document.querySelector('#pkTitle'); return t && /SSO-12/.test(t.textContent) ? { t: t.textContent, body: document.querySelector('#peek').textContent.replace(/\s+/g, ' '), jira: (document.querySelector('#peek a[href*="jira.example"]') || {}).href } : null; }));
100
- ok('B1 V1 a ticket opens its Jira panel: blocked and why, the sprint, the assignee as the reading holds it, when Jira was read, and a link to Jira', !!tk && /Blocked in Jira\. Waiting on PLAT-88/.test(tk.body) && /Sprint 24/.test(tk.body) && /Assignee/.test(tk.body) && /Read/.test(tk.body) && /change only in Jira/.test(tk.body) && /browse\/SSO-12/.test(tk.jira || ''), JSON.stringify(tk));
144
+ const pk = await until(() => q.evaluate(() => { const k = document.querySelector('#peek'); return k && !k.hidden ? { t: document.querySelector('#pkTitle').textContent, eye: k.querySelector('.pk-eye').textContent, st: k.querySelector('.pk-st').textContent.replace(/\s+/g, ' ').trim(), tks: [...k.querySelectorAll('.pk-jt[data-tk] .bd-pill')].map((e) => e.textContent).join(), jt: [...k.querySelectorAll('.pk-jt[data-tk]')].map((e) => e.textContent.replace(/\s+/g, ' ').trim()), rows: [...k.querySelectorAll('.pk-tks .gi')].map((e) => e.textContent.replace(/\s+/g, ' ').trim()), lad: k.querySelectorAll('.pk-lad span').length, cur: (k.querySelector('.pk-lad span.c') || {}).textContent, nb: k.querySelectorAll('.pk-nb').length, wt: k.querySelectorAll('.pk-wt').length, lk: [...k.querySelectorAll('.pk-lk .bd-chip')].map((e) => e.textContent.replace(/\s+/g, ' ').trim()), ask: k.querySelector('.pk-ask .ft').textContent.replace(/\s+/g, ' ').trim(), sel: !!document.querySelector('.bt-l.sel[data-row="board:sso-partners"]'), side: k.getBoundingClientRect().right === innerWidth || Math.round(k.getBoundingClientRect().right) >= innerWidth - 24, dlg: !!document.querySelector('#dlg.on'), record: !!k.querySelector('[data-pk="record"]') } : null; }));
145
+ ok('B1 a row opens the initiative panel in the side panel, not the old dialog, and the row is marked', !!pk && pk.t === 'SSO for partners' && pk.side && !pk.dlg && !pk.record && pk.sel, JSON.stringify(pk));
146
+ ok('B1 the panel says the KR and the owner, the status, the step and when it ships', !!pk && pk.eye === 'Feature · KR 1.1 · owner Lee' && pk.st === 'On track·Deliver·ships Nov 4 with v2.4', JSON.stringify(pk && [pk.eye, pk.st]));
147
+ ok('B1 its ladder has the eight steps; In Jira lists its tickets (blocked first) with their status, and names release notes and your sign-off (BdPanel)', !!pk && pk.lad === 8 && pk.cur === 'Deliv' && pk.tks.split(',')[0] === 'SSO-12' && pk.tks.split(',').sort().join() === 'SSO-10,SSO-12,SSO-14,SSO-15' && pk.jt.some((x) => /^SSO-10Okta configDone/.test(x)) && pk.jt.some((x) => /^SSO-12SAML errorsBlocked/.test(x)) && pk.rows.some((x) => x === 'Release notesnot on record') && pk.rows.some((x) => x === 'Your sign-offafter the tickets'), JSON.stringify(pk && [pk.tks, pk.jt, pk.rows]));
148
+ // re-pointed for the Agreed design (AgBoardPanel has no empty variants): what PMOS has no record of draws no card and no chip, rather than an empty one
149
+ ok('B1 what PMOS has no record of is not drawn: no next-action card, no PRD card, no Linked chip', !!pk && pk.nb === 0 && pk.wt === 0 && pk.lk.length === 0, JSON.stringify(pk && [pk.nb, pk.wt, pk.lk]));
150
+ ok('B1 the ask box says the answer lands in Home and when Jira was read', !!pk && /^Answer lands in HomeJira 6 days ago$/.test(pk.ask), pk && pk.ask);
151
+ const n0 = R.posts.length; await q.click('#peek [data-pk="jira"]');
152
+ ok('B1 the refresh in the ask box reads Jira again through the Jira source\'s own refresh, and says so', await until(() => R.posts.slice(n0).some((x) => x.path === '/api/sources/refresh' && x.body.source === 'jira' && x.body.ws === 'w1')) && await until(() => q.evaluate(() => /Reading Jira again/.test(document.querySelector('#bdToast').textContent))), JSON.stringify(R.posts.slice(n0)));
153
+ await q.click('#peek .pk-jt[data-tk="SSO-12"]');
154
+ const tk = await until(() => q.evaluate(() => { const t = document.querySelector('#pkTitle'); return t && /SSO-12/.test(t.textContent) ? { t: t.textContent, back: document.querySelector('#peek .pk-back').textContent, meta: document.querySelector('#peek .pk-st').textContent.replace(/\s+/g, ' '), body: document.querySelector('#peek').textContent.replace(/\s+/g, ' '), jira: (document.querySelector('#peek a[href*="jira.example"]') || {}).href } : null; }));
155
+ ok('B1 V1 a ticket opens its Jira panel: blocked and why, what it holds up (the sprint end, the release), its subtasks as the reading holds them, what it counts toward, and a link to Jira', !!tk && tk.t === 'SSO-12 · SAML errors' && tk.back === 'SSO for partners · Deliver' && tk.meta === 'Blocked·Sprint 24' && /Waiting on PLAT-88If it is not fixed by Oct 23, the end of Sprint 24, v2\.4 on Nov 4 slips\./.test(tk.body) && !/Who owns the blocker/.test(tk.body) && /No subtasks are in the Jira reading/.test(tk.body) && /Counts towardv2\.4 shipped \+ your sign-off · 1 of 4/.test(tk.body) && /change only in Jira/.test(tk.body) && /browse\/SSO-12/.test(tk.jira || ''), JSON.stringify(tk));
156
+ await q.click('#peek [data-pk="back"]');
157
+ ok('B1 the ticket\'s crumb goes back to the initiative', await until(() => q.evaluate(() => document.querySelector('#pkTitle').textContent === 'SSO for partners')));
101
158
  await q.keyboard.press('Escape');
102
159
  ok('B1 Escape closes the panel', await until(() => q.evaluate(() => document.querySelector('#peek').hidden)));
103
160
  await q.click('.bt-l[data-row="board:self-serve-v2"] .bt-tk:nth-child(3)');
104
161
  ok('B1 a deliverable segment on the row opens its Jira ticket', await until(() => q.evaluate(() => /ONB-34/.test((document.querySelector('#pkTitle') || {}).textContent || ''))));
105
162
  await q.keyboard.press('Escape');
106
- await q.click('#chAsks');
107
- ok('B1 the new asks chip opens the asks with Accept and Decline', await until(() => q.evaluate(() => !document.querySelector('#popAsks').hidden && document.querySelectorAll('#cAsks .baa').length === 1)));
108
- await q.keyboard.press('Escape');
109
- await q.click('#stHelp');
110
- ok('B1 what finishes each step: eight steps with their output and where the count comes from', await until(() => q.evaluate(() => !document.querySelector('#popSteps').hidden && /Release shipped, your sign-off/.test(document.querySelector('#popSteps').textContent) && document.querySelectorAll('#popSteps .bd-tbl:not(.bd-tbl4) .bd-tr').length === 9)));
163
+ const n1 = R.posts.length; await q.click('#chJira');
164
+ ok('B1 the Jira chip reads Jira again', await until(() => R.posts.slice(n1).some((x) => x.path === '/api/sources/refresh' && x.body.source === 'jira')));
165
+ /* the chips and tools open their designed popovers (BdAsks, BdSprint, BdFilter) and New initiative its panel (BdNew), with no "Waiting for design" tag */
166
+ const waits = [];
167
+ for (const [sel, name, body] of [['#chAsks', 'New asks', /1 new ask.*Finance wants a CSV of failed payouts.*Accept to Triage/], ['#chSprint', 'Sprints and releases', /Sprints · from Jira.*Sprint 24.*Releases.*Backlog/], ['#bdFind', 'Find', /Find stays in the Board/], ['#bdFilter', 'Filter', /Owner.*Dara.*Lee.*No owner.*Kind.*Feature.*Applies as you pick/]]) {
168
+ await q.click(sel);
169
+ waits.push(await until(() => q.evaluate(([nm, re]) => { const k = document.querySelector('#bdPop'); if (!k || k.hidden) return null; return k.getAttribute('aria-label') === nm && !k.querySelector('.bd-wtag') && new RegExp(re).test(k.textContent) ? nm : null; }, [name, body.source])) || 'missing ' + name);
170
+ await q.keyboard.press('Escape');
171
+ }
172
+ await q.click('#newIni');
173
+ waits.push(await until(() => q.evaluate(() => { const k = document.querySelector('#peek'); if (!k || k.hidden) return null; return (k.querySelector('#pkTitle') || {}).textContent === 'New initiative' && !k.querySelector('.bd-wtag') && !!k.querySelector('#nwDrop') && /Counts toward/.test(k.textContent) && !k.querySelector('select[name="lane"]') ? 'New initiative' : null; })) || 'missing New initiative');
111
174
  await q.keyboard.press('Escape');
175
+ ok('B1 the new asks, the sprint and release, Find and Filter open their popovers, and New initiative its panel with material and no lane field', waits.join() === 'New asks,Sprints and releases,Find,Filter,New initiative', waits.join());
176
+ ok('B1 none of them opened the old dialog', await q.evaluate(() => !document.querySelector('#dlg.on')));
112
177
  /* B3 Ask about this goes to Home */
113
178
  await q.route('**/premium.html?**', (r) => r.fulfill({ contentType: 'text/html', body: '<title>home</title>' }));
114
179
  await q.click('.bt-l[data-row="board:sso-partners"] .bt-nm'); await until(() => q.evaluate(() => !document.querySelector('#peek').hidden));
@@ -119,44 +184,90 @@ const mk = (o) => BP.build(F.facts(o));
119
184
  ok('0 no page error on the stage track', R.errors.length === 0, R.errors.join(' | '));
120
185
  await R.ctx.close();
121
186
  }
187
+ /* This sprint: on by default; it keeps an initiative whose tickets are in the sprint, or whose plan dates overlap it, or that has neither */
188
+ {
189
+ const f = FJ.facts(), s0 = f.sprints.sprints[0], s1 = f.sprints.sprints[1];
190
+ s1.issues = s1.issues.concat(s0.issues.filter((i) => i.initiative === 'sso-partners')); s0.issues = s0.issues.filter((i) => i.initiative !== 'sso-partners'); f.items = [];
191
+ const R = await open({ model: BP.build(f) }), q = R.page;
192
+ const rows = () => q.evaluate(() => [...document.querySelectorAll('#ibBody .bt-l')].map((r) => r.dataset.row));
193
+ const on = await rows(); await q.click('#bdChipset [data-f="sprint"]'); const off = await rows();
194
+ ok('B1 This sprint hides an initiative whose tickets are all in a later sprint, and shows it when turned off', on.length === 6 && !on.includes('board:sso-partners') && off.length === 7 && off.includes('board:sso-partners'), JSON.stringify([on, off]));
195
+ await R.ctx.close();
196
+ }
197
+ /* waiting on you: Deliver with every ticket done is the PM's sign-off, drawn in the info blue */
198
+ {
199
+ const f = FJ.facts();
200
+ f.sprints.sprints.forEach((s) => { s.issues = s.issues.map((i) => (i.initiative === 'sso-partners' ? { ...i, status: 'Done', category: 'done', flagged: false, reason: null } : i)); });
201
+ f.items = f.items.map((i) => ({ ...i, status: 'Done' }));
202
+ const R = await open({ model: BP.build(f) }), q = R.page;
203
+ const y = await q.evaluate(() => { const r = document.querySelector('.bt-l[data-row="board:sso-partners"]'); return { st: r.querySelector('.cs').textContent, dot: r.querySelector('.sc.c .cz-dot').className, tone: r.querySelector('.cs').className }; });
204
+ ok('B1 a Deliver row whose tickets are all done waits on you: "Your sign-off · v2.4", in blue', y.st === 'Your sign-off · v2.4' && /\byou\b/.test(y.dot) && /m-info/.test(y.dot) && /s-you/.test(y.tone), JSON.stringify(y));
205
+ await q.click('.bt-l[data-row="board:sso-partners"] .bt-nm');
206
+ const nb = await until(() => q.evaluate(() => { const k = document.querySelector('#peek'); return k && !k.hidden ? { nb: (k.querySelector('.pk-nb:not(.off)') || {}).textContent, last: [...k.querySelectorAll('.pk-tks .gi')].pop().textContent } : null; }));
207
+ ok('B1 the panel puts the sign-off first, and the output says it waits', !!nb && /^Sign off v2\.4/.test(nb.nb || '') && nb.last === 'Your sign-offwaiting', JSON.stringify(nb));
208
+ ok('B1 reviewing the release goes to the initiative page, where the sign-off is', await q.evaluate(() => /\/premium-initiative\.html\?id=sso-partners/.test((document.querySelector('#peek .pk-nb a.solid') || {}).href || '')));
209
+ await R.ctx.close();
210
+ }
122
211
 
123
- /* B3 + B11 */
124
- const head = await p.evaluate(() => ({ cap: document.querySelector('#iniCap').textContent, bar: document.querySelector('#iniBar').getAttribute('aria-valuenow') + '/' + document.querySelector('#iniBar').getAttribute('aria-valuemax'), w: document.querySelector('#iniBar b').style.width, dock: document.querySelector('#dN').textContent + ' ' + document.querySelector('#dLab').textContent, snap: document.querySelector('#snap').textContent, note: document.querySelector('#iniNote').textContent }));
125
- ok('B3 the header counts are the board\'s: 5 of 9 on track, 3 at risk, 1 late, with a bar', head.cap === '5 of 9 open on track · 3 at risk · 1 late' && head.bar === '5/9' && Math.abs(parseFloat(head.w) - 55.5) < 1, JSON.stringify(head));
126
- ok('B11 the dock counts at risk plus late from the same counts', head.dock === '4 need a look');
127
- ok('B12 the status says what is real, and the note says how many are loaded', /^Real data · as of 09:12$/.test(head.snap) && /7 of 9 open initiatives are loaded: late and at-risk ones first/.test(head.note), JSON.stringify(head));
212
+ /* B3 + B11 one count: the Initiatives tab, the track's head and the chips agree with the board's counts; B12 the status says what is real */
213
+ const head = await p.evaluate(() => ({ tab: document.querySelector('#nIni').textContent, n: document.querySelector('.bt-nmh span').textContent, chips: [...document.querySelectorAll('#bdChipset .bd-chip.gh')].map((b) => b.textContent.trim()).join('|'), snap: document.querySelector('#snap').textContent }));
214
+ ok('B3 B11 the counts are the board\'s, once: 9 open in the tab and the head, 1 late and 3 at risk in the chips', head.tab === '9' && head.n === '9' && head.chips === '1 late|3 at risk', JSON.stringify(head));
215
+ ok('B12 the status says what is real', /^Real data · as of 09:12$/.test(head.snap), JSON.stringify(head));
128
216
 
129
- /* B4 list (kept as a view) */
217
+ /* B4 B5 List (BdList) and By stage (BdByStage): rows and cards open the panel */
130
218
  await view(p, 'list');
131
- const list = await p.evaluate(() => ({ titles: [...document.querySelectorAll('#ibBody .ini2 .it b')].map((b) => b.textContent.replace('Do this first', '')), tags: [...document.querySelectorAll('#ibBody .tgf')].length, first: document.querySelector('#ibBody .ini2').classList.contains('first'), subs: [...document.querySelectorAll('#ibBody .ini2 .it small')].map((x) => x.textContent), stages: [...document.querySelectorAll('#ibBody .ini2 .wst em')].map((x) => x.textContent), pg: [...document.querySelectorAll('#ibBody .ini2')].map((r) => (r.querySelector('.pg b') || {}).style ? r.querySelector('.pg b').style.width : ''), rl: [...document.querySelectorAll('#ibBody .ini2 .rl')].map((x) => x.textContent), over: [...document.querySelectorAll('#ibBody .rl.over')].length }));
132
- ok('B4 the List view keeps one row per initiative in the board\'s order, with owner and lane from the record', list.titles.length === 7 && list.titles[0] === 'Self-serve onboarding v2' && list.subs[0] === 'Dara · feature · Late' && list.subs[2] === 'No owner · feature · At risk', JSON.stringify(list.subs));
133
- ok('B4 "Do this first" tags the late first row only', list.tags === 1 && list.first);
134
- ok('B4 progress and a finish date only where a record holds them; "Not planned" otherwise; a past finish is marked', list.pg[0] === '62%' && list.pg[2] === '' && list.rl[0] === '10 Oct' && list.rl[2] === 'Not planned' && list.over === 1 && /derived/.test(list.stages[0]), JSON.stringify([list.pg, list.rl, list.over]));
135
- ok('B4 no demo label, no invented owner and no estimate is drawn', !(await p.evaluate(() => /demo|~\d+ min/i.test(document.querySelector('#cIni').textContent))));
219
+ const listOf = () => p.evaluate(() => ({ tag: !!document.querySelector('#ibBody .bd-wtag'), rows: [...document.querySelectorAll('#ibBody .bd-lt[data-row] .bd-ltn b')].map((b) => b.textContent), ss: ((document.querySelector('#ibBody .bd-lt[data-row="board:self-serve-v2"]') || {}).textContent || '').replace(/\s+/g, ' '), head: [...document.querySelectorAll('#ibBody .bd-lt.h [role="columnheader"]')].map((h) => h.textContent).join('|'), foot: (document.querySelector('#ibBody .bd-lt.foot') || {}).textContent || '', v: document.querySelector('#ibTabs [aria-pressed="true"]').dataset.v }));
220
+ const lv = await listOf();
221
+ ok('B4 the List view lists the initiatives with kind, stage, status, owner, next, finish and output, sorted by need; Monitor and Evaluate fold below', !lv.tag && lv.rows.length === 5 && lv.head === 'Initiative · sorted by need|Kind|Stage|Status|Owner|Next|Finish|Output|' && /Self-serve onboarding v2.*Feature.*Build.*7 days over.*10 Oct/.test(lv.ss) && /2 more in Monitor and Evaluate/.test(lv.foot) && lv.v === 'list', JSON.stringify(lv));
222
+ await p.click('#ibBody [data-sort="title"]');
223
+ const lt = await listOf();
224
+ ok('B4 a column title sorts the list', lt.rows[0] === 'Docs search' && lt.rows.join() === lt.rows.slice().sort((a, b) => a.localeCompare(b)).join(), JSON.stringify(lt.rows));
225
+ await p.click('#ibBody [data-me]');
226
+ ok('B4 Show them unfolds Monitor and Evaluate', (await listOf()).rows.length === 7);
227
+ await p.click('#ibBody [data-sort="need"]');
228
+ await p.click('#ibBody .bd-ltn[data-key="board:partner-rate-limits"]');
229
+ ok('B4 a List row opens the initiative panel', await until(() => p.evaluate(() => (document.querySelector('#pkTitle') || {}).textContent === 'Partner API rate limits')));
230
+ await p.keyboard.press('Escape');
231
+ await view(p, 'stages');
232
+ const bs = await p.evaluate(() => ({ tag: !!document.querySelector('#ibBody .bd-wtag'), cols: [...document.querySelectorAll('#ibBody .bd-scol h3')].map((h) => h.textContent), strips: [...document.querySelectorAll('#ibBody .bd-strip')].map((h) => h.textContent), build: document.querySelector('#ibBody .bd-scol[data-step="4"]').querySelectorAll('.bd-bc').length, drag: document.querySelectorAll('#ibBody .bd-bc[draggable="true"]').length }));
233
+ ok('B5 By stage is one column per step with the board\'s counts and the cards; Monitor folds to a strip when nothing in it needs you', !bs.tag && bs.cols.join('|') === 'Triage0|Discover1|Plan1|Prioritize0|Build2|Deliver1' && bs.strips.join() === 'Monitor · 1,Evaluate · 21' && bs.build === 2 && bs.drag === 5, JSON.stringify(bs));
234
+ await p.click('#ibBody .bd-strip[data-strip="monitor"]');
235
+ ok('B5 a strip opens its column', await p.evaluate(() => !!document.querySelector('#ibBody .bd-scol[data-step="6"]') && !document.querySelector('#ibBody .bd-strip[data-strip="monitor"]')));
236
+ await view(p, 'track');
136
237
  {
137
238
  const f = F.facts(); f.rows = Array.from({ length: 30 }, (_, i) => F.row('r' + i, 'Initiative ' + i)); f.counts.open = 60;
138
239
  const R = await open({ model: BP.build(f) }), q = R.page;
139
- const n0 = await q.evaluate(() => document.querySelectorAll('#ibBody .bt-l').length);
140
- await q.click('#more'); const n1 = await q.evaluate(() => document.querySelectorAll('#ibBody .bt-l').length);
141
- ok('B4 the track shows 25 rows and "Show more" adds the rest that are loaded', n0 === 25 && n1 === 30 && !(await q.evaluate(() => !!document.querySelector('#more'))), JSON.stringify([n0, n1]));
240
+ ok('B4 the track draws every loaded row: the design has no paging', await q.evaluate(() => document.querySelectorAll('#ibBody .bt-l').length === 30 && !document.querySelector('#more')));
142
241
  await R.ctx.close();
143
242
  }
144
243
 
145
- /* B5 By stage (kept as a view): the board's own workflow columns */
146
- await view(p, 'stages');
147
- const stg = await p.evaluate(() => ({ cols: [...document.querySelectorAll('#ibBody .isc')].map((c) => c.querySelector('.label').textContent.replace(/\s+/g, ' ').trim()), cards: document.querySelectorAll('#ibBody .icd').length, pressed: document.querySelector('#ibTabs [aria-pressed="true"]').dataset.v }));
148
- ok('B5 By stage keeps one column per workflow stage with the board\'s own count', stg.cols.length === M.initiatives.stages.length && stg.cols[0] === M.initiatives.stages[0].stage + ' ' + M.initiatives.stages[0].count && stg.cards === 7 && stg.pressed === 'stages', JSON.stringify(stg));
149
-
150
- /* B6 (premium-agreed-design B2) the timeline: plan against the Jira forecast, six spans, themes at the long spans */
244
+ /* B6 (premium-agreed-design B2) the timeline: plan against the Jira forecast; Quarter, Year and 5 yr are drawn, the other spans wait for design */
151
245
  await view(p, 'time');
152
- const tl = await p.evaluate(() => ({ spans: [...document.querySelectorAll('#bdSpans button')].map((b) => b.textContent + (b.getAttribute('aria-pressed') === 'true' ? '*' : '')).join(), shown: !document.querySelector('#bdSpans').hidden, rows: [...document.querySelectorAll('#ibBody .tg-r .tg-n.ini2 b')].map((b) => b.textContent), bars: document.querySelectorAll('#ibBody .tg-bar').length, none: (document.querySelector('.tg-none') || {}).textContent || '', ask: (document.querySelector('#askDates') || {}).href || '' }));
153
- ok('B6 the timeline has six spans and starts on Quarter, one row per initiative with dates; the others are named, with an ask to propose dates', tl.shown && tl.spans === 'Sprint,Quarter*,Half,Year,2 yr,5 yr' && tl.rows.length === 3 && tl.bars === 3 && /4 have no dates/.test(tl.none) && /\/premium\.html\?ask=board%3Aw1&q=Propose/.test(tl.ask), JSON.stringify(tl));
246
+ const tl = await p.evaluate(() => ({ spans: [...document.querySelectorAll('#bdSpans button')].map((b) => b.textContent + (b.getAttribute('aria-pressed') === 'true' ? '*' : '')).join(), shown: !document.querySelector('#bdSpans').hidden, rows: [...document.querySelectorAll('#ibBody .tg-r .tg-n.ini2 b')].map((b) => b.textContent), bars: document.querySelectorAll('#ibBody .tg-bar').length, none: (document.querySelector('.tg-none') || {}).textContent || '', ask: (document.querySelector('#askDates') || {}).href || '', hid: (document.querySelector('.tg-hid') || {}).textContent || '', lgd: (document.querySelector('.tg-lgd') || {}).textContent || '', today: [...document.querySelectorAll('#ibBody .tg-axl, #ibBody .tg-ax *')].some((e) => e.textContent === 'Today') }));
247
+ ok('B6 the timeline has six spans and starts on Quarter, one row per initiative with dates; the others are named, with an ask to propose dates', tl.shown && tl.spans === 'Sprint,Quarter*,Half,Year,2 yr,5 yr' && tl.rows.length === 3 && tl.bars === 3 && /^2 have no dates: Usage-based billing, Docs search/.test(tl.none) && /\/premium\.html\?ask=board%3Aw1&q=Propose/.test(tl.ask), JSON.stringify(tl));
248
+ ok('B6 Monitor and Evaluate are hidden on the Quarter and the footer says how many; the legend and Today are drawn', tl.hid === 'Monitor and Evaluate hidden · 22' && /done in Jira/.test(tl.lgd) && /PMOS plan/.test(tl.lgd) && /Jira forecast/.test(tl.lgd) && tl.today, JSON.stringify(tl));
249
+ await p.click('#ibBody [data-rules]');
250
+ ok('B6 the timeline\'s first head opens "The longer the span, the higher the grouping", with the spans and the example themes', await until(() => p.evaluate(() => !document.querySelector('#popRules').hidden && /The longer the span, the higher the grouping/.test(document.querySelector('#popRules').textContent) && document.querySelectorAll('#popRules .bd-tbl4 .bd-tr').length === 5 && document.querySelectorAll('#popRules .bd-tbl3 .bd-tr').length === 5)));
251
+ await p.keyboard.press('Escape');
252
+ await p.click('#ibBody .tg-n[data-key="board:partner-rate-limits"]');
253
+ const tp = await until(() => p.evaluate(() => { const k = document.querySelector('#peek'); return k && !k.hidden ? { eye: k.querySelector('.pk-eye').textContent, stp: k.querySelector('.pk-stp').textContent, seg: k.querySelectorAll('.pk-seg i').length, cur: [...k.querySelectorAll('.pk-seg i')].findIndex((i) => i.classList.contains('c')), dates: k.querySelector('.pk-kv').textContent, dep: k.querySelectorAll('.pk-dep, .pk-need').length, acts: [...k.querySelectorAll('.pk-acts .bd-ib')].map((b) => b.getAttribute('aria-label')).join(), wide: Math.round(k.getBoundingClientRect().width), ft: k.querySelector('.pk-ask .ft').textContent } : null; }));
254
+ // re-pointed for AgBoardTimelinePanel: 420 px wide; no empty "nothing waits" or "no dependency" card; four actions (dates, move, hold, archive)
255
+ ok('B6 an initiative on the timeline opens its own panel: the step as one of eight, the dates, no empty cards, the tickets and the actions', !!tp && tp.eye === 'feature · KR 1.1 · no Jira epic yet' && tp.stp === 'Plan · step 3 of 8' && tp.seg === 8 && tp.cur === 2 && /PMOS planSep 20 → Nov 30/.test(tp.dates) && tp.dep === 0 && tp.wide === 420 && tp.acts === 'Change the plan dates,Move to another stage,Put on hold,Archive' && tp.ft === 'The answer lands in Home, inside Partner API rate limits.', JSON.stringify(tp));
256
+ await p.click('#peek .pk-acts [aria-label="Move to another stage"]');
257
+ ok('B6 its actions open the row menu (BdActions)', await until(() => p.evaluate(() => { const m = document.querySelector('#bdPop'); return !!m && !m.hidden && m.getAttribute('role') === 'menu' && /Move to Prioritize/.test(m.textContent) && /Hold/.test(m.textContent) && !m.querySelector('.bd-wtag'); })));
258
+ await p.keyboard.press('Escape');
259
+ ok('B6 Escape closes the menu first and leaves the panel open', await p.evaluate(() => document.querySelector('#bdPop').hidden && !document.querySelector('#peek').hidden));
260
+ await p.keyboard.press('Escape');
154
261
  await spanTo(p, 'year');
155
- ok('B6 Year groups by theme, with the initiatives as bars inside', await p.evaluate(() => document.querySelectorAll('#ibBody .tg-th').length === 1 && document.querySelectorAll('#ibBody .tg-th .tg-line').length === 3 && /O1 · q3-2026/.test(document.querySelector('#ibBody .tg-th').textContent)));
262
+ const yr = await p.evaluate(() => ({ th: document.querySelectorAll('#ibBody .tg-th').length, lines: document.querySelectorAll('#ibBody .tg-th .tg-line').length, cell: document.querySelector('#ibBody .tg-th .tg-tn').textContent.replace(/\s+/g, ' ').trim(), today: (document.querySelector('#ibBody .tg-today') || {}).textContent, group: (document.querySelector('#chGroup') || {}).textContent, jira: !!document.querySelector('#chJira') }));
263
+ ok('B6 Year groups by theme, with the initiatives as bars inside; with no trail the theme falls back to its anchor\'s objective', yr.th === 1 && yr.lines === 3 && /^Objective 1Q3 2026 objective7 initiatives · KR 1\.1 · 1 late · 2 at risk$/.test(yr.cell) && /^Today · /.test(yr.today || '') && /Group: ?Theme/.test(yr.group || '') && !yr.jira, JSON.stringify(yr));
264
+ await p.click('#ibBody [data-span-go="quarter"]');
265
+ ok('B6 "Switch to Quarter" goes back to one row per initiative', await p.evaluate(() => document.querySelector('#bdSpans [aria-pressed="true"]').dataset.sp === 'quarter' && document.querySelectorAll('#ibBody .tg-n.ini2').length === 3));
156
266
  await spanTo(p, 'y5');
157
- ok('B6 5 yr shows themes only, as phases', await p.evaluate(() => document.querySelectorAll('#ibBody .tg-phase').length === 1 && document.querySelectorAll('#ibBody .tg-line').length === 0));
158
- await spanTo(p, 'sprint');
159
- ok('B6 Sprint with no Jira read says so', await p.evaluate(() => /No sprint is on record/.test(document.querySelector('#ibBody').textContent)));
267
+ ok('B6 5 yr shows themes only, as phases, with the directional part past 18 months', await p.evaluate(() => document.querySelectorAll('#ibBody .tg-phase').length === 1 && document.querySelectorAll('#ibBody .tg-line').length === 0 && /Beyond 18 months · directional/.test(document.querySelector('#ibBody').textContent)));
268
+ const sp = [];
269
+ for (const [k, sel, re] of [['sprint', '.sp[data-span="sprint"]', /Initiative and ticket.*Backlog · \d+ not in/], ['half', '.tg-y[data-span="half"]', /Theme/], ['y2', '.tg-5y[data-span="y2"]', /Only themes and their phases/]]) { await spanTo(p, k); sp.push(await p.evaluate(([q2, r]) => { const e = document.querySelector('#ibBody ' + q2); return !!e && !document.querySelector('#ibBody .bd-wtag') && new RegExp(r).test(e.textContent); }, [sel, re.source])); }
270
+ ok('B6 Sprint (BdSpans: tickets and the backlog row), Half (the Year view) and 2 yr (themes as phases) are drawn, with no "Waiting for design" tag', sp.every(Boolean), JSON.stringify(sp));
160
271
  await spanTo(p, 'quarter');
161
272
  {
162
273
  const f = F.facts(); f.rows = f.rows.map((r) => ({ ...r, start: null, end: null }));
@@ -166,85 +277,39 @@ const mk = (o) => BP.build(F.facts(o));
166
277
  }
167
278
  await view(p, 'track');
168
279
 
169
- /* B9 B8 the sprint and the release, behind the sprint chip */
170
- ok('B9 with no Jira read the sprint card says so and draws nothing', await p.evaluate(() => /No sprint is on record/.test(document.querySelector('#sprBody').textContent) && document.querySelector('#sprCap').textContent === 'none' && !document.querySelector('#sprBody .spr')));
171
- ok('B8 with no release the card says none is on record', await p.evaluate(() => /No release is on record/.test(document.querySelector('#relBody').textContent)));
172
- {
173
- const R = await open({ model: mk({ sprints: { source: 'jira', readAt: '2026-10-16', sprints: [{ name: 'Sprint 42', state: 'active', start: '2026-10-12', end: '2026-10-23', counts: { todo: 11, doing: 9, done: 14 }, goal: 'Self-serve onboarding reaches beta' }] }, nextRelease: { id: 'r1', type: 'minor', at: '2026-10-23T00:00:00Z' } }) });
174
- await R.page.click('#chSprint');
175
- const d = await R.page.evaluate(() => ({ open: !document.querySelector('#popSpr').hidden, sp: document.querySelector('#sprBody').textContent.replace(/\s+/g, ' '), cnt: [...document.querySelectorAll('#sprBody .cnt b')].map((b) => b.textContent).join(), rel: document.querySelector('#relBody').textContent.replace(/\s+/g, ' '), cap: document.querySelector('#relCap').textContent }));
176
- ok('B9 B8 the sprint chip opens the sprint and the release, drawn from their records', d.open && d.cnt === '14,9,11' && /Goal: Self-serve onboarding reaches beta/.test(d.sp) && /Sprint review in 6 days/.test(d.sp) && /r1Next23 Oct · 6 days away/.test(d.rel), JSON.stringify(d));
177
- await R.page.click('#sprBody .spr');
178
- ok('B9 the sprint opens its dialog, as before', await until(() => R.page.evaluate(() => document.querySelector('#dlg').classList.contains('on') && document.querySelector('#dTitle').textContent === 'Sprint 42')));
179
- await R.ctx.close();
180
- }
181
-
182
- /* B7 core documents, on the Documents tab */
280
+ /* B7 the Documents tab (BdDocs): every document on the board, by kind, with its health, when it changed and by whom, and Draft it */
183
281
  await p.click('#tabDocs');
184
- ok('B7 the Documents tab shows the core documents and hides the initiatives', await p.evaluate(() => !document.querySelector('#cDocs').hidden && document.querySelector('#cIni').hidden && document.querySelector('#tabDocs').getAttribute('aria-selected') === 'true'));
185
- const docs = await p.evaluate(() => ({ cap: document.querySelector('#docCap').textContent, rows: [...document.querySelectorAll('#docBody .dmr')].map((r) => ({ t: r.querySelector('.dmn b').textContent, s: r.querySelector('.dmm .s').textContent.trim(), b: r.querySelector('.dmcta') ? r.querySelector('.dmcta').textContent.trim() : null, dis: r.querySelector('.dmcta') ? r.querySelector('.dmcta').disabled : null, kind: r.querySelector('.dmcta') ? (r.querySelector('.dmcta').dataset.draft ? 'draft' : 'go') : null })), all: document.querySelector('#cDocs').textContent }));
186
- ok('B7 the documents come from the record with their state, and the tab counts them', docs.cap === '6' && docs.rows.length === 6 && docs.rows[0].t === 'Board charter' && docs.rows[0].s === 'Not started' && docs.rows[1].s === 'Live' && docs.rows[3].s === 'Draft' && docs.rows[4].s === 'Stale', JSON.stringify(docs));
187
- ok('B7 the button is the record\'s own action: Draft it, Set it up, Open; a draft to review and a document with no action have none; a running one is off', docs.rows[0].b === 'Draft it' && docs.rows[0].kind === 'draft' && docs.rows[2].b === 'Set it up' && docs.rows[2].kind === 'go' && docs.rows[1].b === 'Open' && docs.rows[3].b === null && docs.rows[5].b === 'Drafting' && docs.rows[5].dis === true, JSON.stringify(docs.rows));
188
- ok('B7 Drop is not on the page, and the list has no Issue it press (it is in a draft\'s reader)', !/\bDrop\b/.test(docs.all) && await p.evaluate(() => !document.querySelector('#docBody [data-rd="issue"], #docBody button.dmcta')?.textContent.includes('Issue it')));
189
- A.set({ status: 200, body: { ok: true, run: 'r1' } });
190
- const g0 = A.calls();
191
- await p.locator('#docBody [data-draft="charter"]').click();
192
- ok('B7 Draft it posts the board, the scope and the key and nothing else, says what happens, and reads the board again', await until(() => A.posts.some((x) => x.path === '/api/core-docs/draft' && x.body.ws === 'w1' && x.body.scope === 'board:w1' && x.body.key === 'charter' && Object.keys(x.body).sort().join() === 'key,scope,ws')) && await until(() => p.evaluate(() => /The agent is drafting “Board charter”.*sends nothing/.test(document.querySelector('#toast').textContent))) && await until(() => A.calls() > g0), JSON.stringify(A.posts));
193
- const mint = await T.nonce(BASE);
194
- ok('B7 the press carried the launch nonce and no writer field', !!mint && A.posts.filter((x) => x.path === '/api/core-docs/draft').every((x) => x.headers['x-pmos-nonce'] === mint && !['by', 'via', 'at', 'actor', 'pm', 'nonce'].some((k) => k in x.body)));
195
- A.set({ status: 409, body: { ok: false, error: 'a run is already drafting that document' } });
196
- await p.locator('#docBody [data-draft="charter"]').click();
197
- ok('B7 a refused press shows the route\'s reason and turns the button back on', await until(() => p.evaluate(() => /already drafting/.test(document.querySelector('#toast').textContent) && !document.querySelector('#docBody [data-draft="charter"]').disabled)));
282
+ ok('B7 the Documents tab lists the documents with kind chips and hides the initiatives; the tab counts them', await p.evaluate(() => !document.querySelector('#cDocs').hidden && document.querySelector('#cIni').hidden && document.querySelector('#tabDocs').getAttribute('aria-selected') === 'true' && document.querySelector('#docCap').textContent === '6' && !document.querySelector('#docBody .bd-wtag') && document.querySelectorAll('#docBody .bd-dt[data-docrow]').length === 6 && document.querySelectorAll('#docBody [data-dkind]').length === 2 && document.querySelectorAll('#docBody [data-act="draft"]').length === 3 && /Board charter.*Not started/.test(document.querySelector('#docBody').textContent)));
283
+ { const n2 = A.posts.length; await p.click('#docBody [data-act="draft"][data-key="charter"]');
284
+ ok('B7 Draft it asks the agent to draft the document (POST /api/core-docs/draft), and says nothing is sent', await until(() => A.posts.slice(n2).some((x) => x.path === '/api/core-docs/draft' && x.body.key === 'charter' && x.body.scope === 'board:w1')) && await until(() => p.evaluate(() => /drafting it/.test(document.querySelector('#bdToast').textContent))), JSON.stringify(A.posts.slice(n2))); }
198
285
  await p.click('#tabIni');
199
286
 
200
- /* B10 the record dialog, from the panel's Record */
287
+ /* B13 focus: Escape closes the panel and gives the focus back to the row; the Board never opens the old dialog */
201
288
  await p.locator('#ibBody .bt-l[data-row="board:self-serve-v2"] .bt-nm').click(); await until(() => p.evaluate(() => !document.querySelector('#peek').hidden));
202
- await p.click('#peek [data-pk="record"]'); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(700);
203
- const dlg = await p.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, grid: [...document.querySelectorAll('#oMain .kv2 span')].map((s) => s.textContent).join('|'), path: document.querySelector('#oMain .dpath').textContent, buttons: [...document.querySelectorAll('#card button')].length, hold: document.querySelector('#holdWhy').textContent, label: document.querySelector('#oLab').textContent }));
204
- ok('B10 the panel\'s Record opens the initiative\'s record as a grid with the path of its file and no press', dlg.title === 'Self-serve onboarding v2' && /Stage\|Build \(derived\)/.test(dlg.grid) && /Progress\|62%/.test(dlg.grid) && dlg.path === 'planning/initiatives/self-serve-v2.md' && dlg.buttons === 0 && /This dialog changes nothing/.test(dlg.hold) && dlg.label === 'Initiative record', JSON.stringify(dlg));
205
- await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
206
- ok('B13 closing the dialog gives the focus back to the panel\'s Record', await until(() => p.evaluate(() => document.activeElement && document.activeElement.dataset.pk === 'record')), await p.evaluate(() => document.activeElement.tagName + '.' + document.activeElement.className + ' peek=' + document.querySelector('#peek').hidden + ' dlg=' + document.querySelector('#dlg').className));
289
+ ok('B10 the panel has no Record press and the old dialog stays shut and inert', await p.evaluate(() => !document.querySelector('#peek [data-pk="record"]') && !document.querySelector('#dlg'))); // re-pointed: the Agreed Board carries no old dialog markup at all
207
290
  await p.keyboard.press('Escape');
208
- ok('B13 Escape then closes the panel and gives the focus back to the row', await until(() => p.evaluate(() => document.querySelector('#peek').hidden && document.activeElement.classList.contains('bt-nm'))), await p.evaluate(() => document.activeElement.tagName + '.' + document.activeElement.className + ' peek=' + document.querySelector('#peek').hidden + ' bam2=' + !!document.querySelector('.bam2') + ' pops=' + [...document.querySelectorAll('.bd-pop')].filter((x) => !x.hidden).map((x) => x.id)));
291
+ ok('B13 Escape closes the panel and gives the focus back to the row', await until(() => p.evaluate(() => document.querySelector('#peek').hidden && document.activeElement.classList.contains('bt-nm'))), await p.evaluate(() => document.activeElement.tagName + '.' + document.activeElement.className + ' peek=' + document.querySelector('#peek').hidden));
209
292
  ok('0 no page error', A.errors.length === 0, A.errors.join(' | '));
210
293
  await A.ctx.close();
211
294
 
212
- /* B14 the panel's expand opens the initiative page (Page, the default) or the record dialog (Popup); the choice is kept */
295
+ /* B14 the panel's expand opens the initiative page; there is no Page/Popup switch */
213
296
  {
214
- const D = await open({ mode: null });
215
- const mode0 = await D.page.evaluate(() => [...document.querySelectorAll('#modeSeg button')].map((b) => b.dataset.m + ':' + b.getAttribute('aria-pressed')).join('|'));
216
- ok('B14 the Page setting is the default', mode0 === 'page:true|popup:false', mode0);
297
+ const D = await open();
217
298
  await D.page.route('**/premium-initiative.html*', (r) => r.fulfill({ contentType: 'text/html', body: '<title>x</title>' }));
299
+ ok('B14 there is no Page/Popup switch', await D.page.evaluate(() => !document.querySelector('#modeSeg') && !document.querySelector('#modeRow:not([hidden])')));
218
300
  await D.page.locator('#ibBody .bt-l[data-row="board:self-serve-v2"] .bt-nm').click(); await until(() => D.page.evaluate(() => !document.querySelector('#peek').hidden));
219
301
  ok('B14 a click on an initiative opens its panel and stays on the Board', new URL(D.page.url()).pathname === '/premium-board.html');
220
302
  await D.page.click('#peek [data-pk="expand"]'); await sleep(600);
221
303
  const u = new URL(D.page.url());
222
304
  ok('B14 the panel\'s expand opens the initiative page with the initiative, the workspace and the board', u.pathname === '/premium-initiative.html' && u.searchParams.get('id') === 'self-serve-v2' && u.searchParams.get('ws') === 'w1' && u.searchParams.get('board') === 'w1', D.page.url());
223
- await D.page.goBack(); await until(() => D.page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0));
224
- await D.page.click('#moreBtn'); await D.page.click('#modeSeg [data-m="popup"]'); await D.page.keyboard.press('Escape');
225
- await D.page.locator('#ibBody .bt-l[data-row="board:self-serve-v2"] .bt-nm').click(); await until(() => D.page.evaluate(() => !document.querySelector('#peek').hidden));
226
- await D.page.click('#peek [data-pk="expand"]');
227
- ok('B14 the Popup setting makes expand open the dialog and stay on the Board', await until(() => D.page.evaluate(() => document.querySelector('#dlg').classList.contains('on'))) && new URL(D.page.url()).pathname === '/premium-board.html');
228
- await D.page.keyboard.press('Escape'); await D.page.reload(); await until(() => D.page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0));
229
- ok('B14 the choice is kept after a reload', await D.page.evaluate(() => document.querySelector('#modeSeg [data-m="popup"]').getAttribute('aria-pressed') === 'true'));
230
- ok('0 no page error on the switch', D.errors.length === 0, D.errors.join(' | '));
305
+ ok('0 no page error on expand', D.errors.length === 0, D.errors.join(' | '));
231
306
  await D.ctx.close();
232
307
  }
233
308
 
234
- /* B15 the product picker and the documents manager */
309
+ /* B15 the product picker */
235
310
  {
236
- const base = F.facts(), docs3 = Object.assign({}, base.docs, { docs: base.docs.docs.concat([F.doc('intake', 'Intake log'), F.doc('roadmap', 'Roadmap note')]) });
237
- const D = await open({ model: BP.build(Object.assign({}, base, { docs: docs3 })) });
238
- const q = D.page;
239
- ok('B15 the picker names the board, has no switcher for one board, and the Board has no chat button', await q.evaluate(() => document.querySelector('#crBoard').disabled && document.querySelector('#crBoard').textContent === 'pmos' && document.querySelector('#crSw').hidden && !document.querySelector('#crAsk') && !document.querySelector('#askIn')));
240
- await q.click('#tabDocs');
241
- const dm = await q.evaluate(() => ({ cap: document.querySelector('#docCap').textContent, sum: document.querySelector('.dsum').textContent.replace(/\s+/g, ' '), bar: document.querySelectorAll('.dprog i').length, tabs: [...document.querySelectorAll('#dmF button')].map((b) => b.textContent.replace(/\s+/g, '')).join(','), link: (document.querySelector('.dsum .dlink') || {}).textContent }));
242
- ok('B15 the documents have the summary, progress bar, filter and search, from one set of counts', dm.cap === '8' && /1 draft to review/.test(dm.sum) && /5 not started/.test(dm.sum) && /1 up to date/.test(dm.sum) && dm.bar === 8 && dm.tabs === 'All8,Notstarted5,Draft1,Uptodate1' && /Draft the 3 not started/.test(dm.link || ''), JSON.stringify(dm));
243
- await q.click('#dmF [data-dmf="all"]'); await q.fill('#dmQ', 'intake'); ok('B15 the search finds a document and keeps the focus', (await q.evaluate(() => [...document.querySelectorAll('#docBody .dmn b')].map((b) => b.textContent))).join('|') === 'Intake log' && await q.evaluate(() => document.activeElement.id === 'dmQ'));
244
- await q.fill('#dmQ', 'zzz'); ok('B15 no match says so', /No document matches/.test(await q.evaluate(() => document.querySelector('#docBody').textContent))); await q.fill('#dmQ', '');
245
- D.set({ status: 200, body: { ok: true, run: 'rb' } }); const nb = D.posts.length; await q.click('.dsum .dlink');
246
- ok('B15 "Draft the 3 not started" posts one draft for each, with the board\'s scope, and nothing else', await until(() => D.posts.slice(nb).filter((x) => x.path === '/api/core-docs/draft').map((x) => x.body.key).sort().join() === 'charter,intake,roadmap' && D.posts.slice(nb).every((x) => x.path === '/api/core-docs/draft' && x.body.scope === 'board:w1' && Object.keys(x.body).sort().join() === 'key,scope,ws')));
247
- ok('0 no page error on the documents manager', D.errors.length === 0, D.errors.join(' | '));
311
+ const D = await open(); const q = D.page;
312
+ ok('B15 the picker names the board, has no switcher for one board, and the Board has no chat button', await q.evaluate(() => document.querySelector('#crBoard').disabled && document.querySelector('#crBoard').textContent === 'pmos' && document.querySelector('#crSw').hidden && getComputedStyle(document.querySelector('#crSw')).display === 'none' && !document.querySelector('#crAsk') && !document.querySelector('#askIn')));
248
313
  await D.ctx.close();
249
314
  }
250
315
 
@@ -259,31 +324,122 @@ const mk = (o) => BP.build(F.facts(o));
259
324
  const c2 = await browser.newContext({ viewport: { width: 1280, height: 900 } }), p2 = await c2.newPage();
260
325
  await p2.route('**/api/board-premium*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, state: 'error', error: 'the board could not be read' }) }));
261
326
  await p2.goto(BASE + '/premium-board.html');
262
- ok('B2 a failed read says why and draws nothing', await until(() => p2.evaluate(() => /The reason: the board could not be read/.test(document.querySelector('#brief').textContent) && document.querySelectorAll('#ibBody .ini2').length === 0), 4000));
327
+ ok('B2 a failed read says why and draws nothing', await until(() => p2.evaluate(() => /The reason: the board could not be read/.test(document.querySelector('#ibBody .bd-msg').textContent) && document.querySelectorAll('#ibBody .ini2').length === 0), 4000));
263
328
  await c2.close();
264
329
  }
265
330
 
266
- /* B13 floors: the phone */
331
+ /* B13 floors: the phone (AgBoardPhone, AgBoardPhoneSheet, AgBoardTimelinePhone) */
267
332
  for (const theme of ['light', 'dark']) {
268
333
  const R = await open({ w: 390, h: 844, theme, model: BP.build(FJ.facts()) }), q = R.page;
269
- const m = await q.evaluate(() => { const small = [...document.querySelectorAll('#ibTabs button, #ibBody .ini2, #ibBody .inim, #bdChipset .cz-chip, .cz-tab, #newIni, #bdFind')].filter((b) => !b.closest('[hidden]') && b.getBoundingClientRect().height > 0 && b.getBoundingClientRect().height < 44).map((b) => b.className + ':' + Math.round(b.getBoundingClientRect().height)); const fab = document.querySelector('#czFab').getBoundingClientRect(); return { over: document.documentElement.scrollWidth > innerWidth + 1, small, fabRight: Math.round(innerWidth - fab.right), top: Math.round(document.querySelector('.bd-hd').getBoundingClientRect().height) }; });
270
- ok(`B13 at 390 px (${theme}) the page has no sideways scroll, the top bar is one line, the menu sits bottom right, and every control is 44 px`, !m.over && m.small.length === 0 && m.fabRight < 40 && m.top <= 56, JSON.stringify(m));
271
- await view(q, 'stages'); const s1 = await q.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1);
272
- await view(q, 'time'); const s2 = await q.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1);
273
- ok(`B13 at 390 px (${theme}) the stage and timeline views do not scroll sideways`, s1 && s2);
274
- await view(q, 'track'); await q.locator('#ibBody .bt-l[data-row="board:sso-partners"] .bt-nm').click();
334
+ const m = await q.evaluate(() => { const small = [...document.querySelectorAll('#ibTabs button, #ibBody .bt-nm, #bdChipset .bd-chip, .bd-tab, #newIni, #bdFind, #bdView')].filter((b) => !b.closest('[hidden]') && b.getBoundingClientRect().height > 0 && b.getBoundingClientRect().height < 44).map((b) => b.className + ':' + Math.round(b.getBoundingClientRect().height)); const fab = document.querySelector('#czFab').getBoundingClientRect(); return { over: document.documentElement.scrollWidth > innerWidth + 1, small, fabRight: Math.round(innerWidth - fab.right), top: Math.round(document.querySelector('.bd-hd').getBoundingClientRect().height), chips: [...document.querySelectorAll('#bdChipset .bd-chip')].map((b) => b.textContent.replace(/\s+/g, ' ').trim()), title: getComputedStyle(document.querySelector('.bd-title')).display }; });
335
+ ok(`B13 at 390 px (${theme}) the page has no sideways scroll, the top bar is one line with "Board", the menu sits bottom right, and every control is 44 px`, !m.over && m.small.length === 0 && m.fabRight < 40 && m.top <= 56 && m.title !== 'none', JSON.stringify(m));
336
+ ok(`B13 at 390 px (${theme}) the chips lead with This sprint, then the Jira read time and the new asks, and end with the documents`, m.chips[0] === 'This sprint' && /^Jira \d+ days$/.test(m.chips[1]) && m.chips[2] === '1 new ask' && m.chips[m.chips.length - 1] === 'Docs 6', JSON.stringify(m.chips));
337
+ const pl = await q.evaluate(() => ({ groups: [...document.querySelectorAll('#ibBody .bd-ghd')].map((g) => g.textContent.replace(/\s+/g, ' ').trim()), seg: [...document.querySelectorAll('#ibBody [data-pv]')].map((b) => b.textContent + (b.getAttribute('aria-pressed') === 'true' ? '*' : '')).join(), note: /Timeline needs a wider screen/.test(document.querySelector('#ibBody').textContent), small: [...document.querySelectorAll('#ibBody [data-pv], #ibBody .bd-lrow')].filter((b) => b.getBoundingClientRect().height < 44).length }));
338
+ ok(`B13 at 390 px (${theme}) the phone opens on the List, grouped your turn first, with List, By stage and Track and no timeline (BdPhone)`, pl.groups.join('|') === 'At risk or late4|On track3' && pl.seg === 'List*,By stage,Track' && pl.note && pl.small === 0, JSON.stringify(pl));
339
+ await q.click('#bdView'); const s2 = await q.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1 && document.querySelectorAll('#ibBody .bd-scols.ph .bd-scol').length === 8);
340
+ ok(`B13 at 390 px (${theme}) the one view button switches to By stage, every step a column down the page, with no sideways scroll`, s2);
341
+ await q.click('#bdView'); await q.locator('#ibBody .bt-l[data-row="board:sso-partners"] .bt-nm').click();
275
342
  const g = await until(() => q.evaluate(() => { const k = document.querySelector('#peek'); if (k.hidden) return null; const r = k.getBoundingClientRect(); return { l: Math.round(r.left), w: Math.round(r.width), b: Math.round(innerHeight - r.bottom), vw: innerWidth }; }));
276
343
  ok(`B13 at 390 px (${theme}) the initiative panel is a bottom sheet across the width`, !!g && g.l === 0 && g.w === g.vw && g.b === 0, JSON.stringify(g));
277
- await q.click('#peek [data-pk="record"]'); await until(() => q.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(900);
278
- const d = await q.evaluate(() => { const r = document.querySelector('#dlg').getBoundingClientRect(); return { l: Math.round(r.left), w: Math.round(r.width), vw: innerWidth, tabs: getComputedStyle(document.querySelector('#dTabs')).display }; });
279
- ok(`B13 at 390 px (${theme}) the record dialog is full width and its Detail / Conversation switch is shown`, d.l === 0 && d.w === d.vw && d.tabs !== 'none', JSON.stringify(d));
344
+ await q.click('#peek [data-pk="acts"]');
345
+ ok(`B13 at 390 px (${theme}) the panel's ⋯ opens the row menu as a sheet across the width, with 44 px rows, and no dialog`, await until(() => q.evaluate(() => { const m = document.querySelector('#bdPop'); if (!m || m.hidden) return false; const r = m.getBoundingClientRect(); return m.classList.contains('sheet') && Math.round(r.left) === 0 && Math.round(r.width) === innerWidth && m.querySelectorAll('.bd-mi').length >= 3 && [...m.querySelectorAll('.bd-mi')].every((b) => b.getBoundingClientRect().height >= 44) && !document.querySelector('#dlg.on'); })));
346
+ await q.keyboard.press('Escape');
280
347
  ok(`0 no page error at 390 px (${theme})`, R.errors.length === 0, R.errors.join(' | '));
281
348
  await R.ctx.close();
282
349
  }
350
+
351
+ /* T the trail (GET /api/board-trail, lib/board-trail.js): what the model does not carry, drawn where a record holds it (fixtures/board-premium-trail.js) */
352
+ {
353
+ const gone = F.row('old-idea', 'Old idea', { status: 'cancelled', stopped: { reason: 'Not worth it now' } });
354
+ const R = await open({ model: BP.build(FJ.facts({ cancelled: [gone] })), trail: FT.trail() }), q = R.page;
355
+ await until(() => q.evaluate(() => /18d/.test(document.querySelector('#ibBody').textContent)));
356
+ const row = (id) => q.evaluate((k) => { const r = document.querySelector(`.bt-l[data-row="board:${k}"]`); if (!r) return null; const c = r.querySelector('.sc.c'); return { days: (c.querySelector('small') || {}).textContent, dt: c.title, st: r.querySelector('.cs').textContent, stc: r.querySelector('.cs').className, prog: r.querySelector('.bt-dl .t1 span').textContent, line: r.querySelector('.bt-dl .t3').textContent, skip: [...r.querySelectorAll('.bt-cells > div.k')].map((d) => d.title) }; }, id);
357
+ const ss = await row('self-serve-v2'), pr = await row('partner-rate-limits'), ub = await row('usage-billing'), rf = await row('refund-reason-codes'), ds = await row('docs-search');
358
+ ok('T days in the step come from the trail, with "usually N days" only from three samples on', ss.days === '18d' && ss.dt === 'Build · 18 days in this step · usually 14 days' && pr.days === '6d' && pr.dt === 'Plan · 6 days in this step', JSON.stringify([ss, pr]));
359
+ ok('T a skipped step is a ring that says why: the move\'s reason, or the lane\'s ladder', pr.skip.join() === 'Discover skipped: Moved from Triage to Plan: the PRD came with the ask.' && ds.skip.length === 3 && /The chore lane has no Triage step/.test(ds.skip[0]), JSON.stringify([pr.skip, ds.skip]));
360
+ ok('T the output counts its parts from the records and names the next one', ub.prog === '2 of 6 parts' && ub.line === 'Next: Evidence' && pr.prog === '1 of 4 parts' && pr.line === 'Next: Timeline', JSON.stringify([ub, pr]));
361
+ ok('T what waits on you comes first, in blue', rf.st === 'Your verdict' && /s-you/.test(rf.stc), JSON.stringify(rf));
362
+ await q.click('.bt-l[data-row="board:self-serve-v2"] .bt-nm');
363
+ const pk = await until(() => q.evaluate(() => { const k = document.querySelector('#peek'); if (!k || k.hidden || !/Drafted/.test(k.textContent)) return null; const sec = [...k.querySelectorAll('.pk-sec')]; return { st: k.querySelector('.pk-st').textContent.replace(/\s+/g, ' '), stt: (k.querySelector('.pk-st [title]') || {}).title, drafted: (sec.find((x) => /Drafted in PMOS/.test(x.textContent)) || {}).textContent, wt: k.querySelector('.pk-wt').textContent, wtc: k.querySelector('.pk-wt').className, lk: [...k.querySelectorAll('.pk-lk .bd-chip')].map((e) => e.textContent.replace(/\s+/g, ' ').trim()), prd: (k.querySelector('.pk-lk [data-doc]') || {}).dataset, dep: ([...k.querySelectorAll('.pk-lk .bd-chip')].find((x) => /Waits on/.test(x.textContent)) || {}).title }; }));
364
+ // re-pointed: AgBoardPanel's status is one line; the usual days stay in the step's tooltip
365
+ ok('T the panel says the day in the step, and the usual days in its tooltip', !!pk && /Build day 18/.test(pk.st) && !/usually/.test(pk.st) && pk.stt === 'Build · 18 days in this step · usually 14 days', JSON.stringify(pk && [pk.st, pk.stt]));
366
+ ok('T tickets drafted in PMOS and not in Jira are listed, and go to Jira only through your Commit', !!pk && /^Drafted in PMOS · 1V\.4Resend the invite after 48 hoursnot in JiraThey go to Jira only through your Commit\.$/.test(pk.drafted), JSON.stringify(pk && pk.drafted));
367
+ ok('T a ticket pushed from an older PRD is flagged as PRD drift', !!pk && /^Jira differs from the PRD · ONB-31 was pushed from an older PRD/.test(pk.wt) && !/off/.test(pk.wtc), JSON.stringify(pk && pk.wt));
368
+ ok('T the links are the record\'s own: PRD and rubric paths, the epic, and the dependency with where it stands', !!pk && pk.lk.join('|') === 'PRD|Rubric|Waits on SSO for partners|Epic ONB-1' && pk.prd && pk.prd.doc === 'planning/prd/self-serve-v2.md' && /SSO for partners: Deliver/.test(pk.dep || ''), JSON.stringify(pk && [pk.lk, pk.dep]));
369
+ await q.click('#peek .pk-lk [data-doc="planning/prd/self-serve-v2.md"]');
370
+ ok('T a linked document opens in the Viewer, as its text', await until(() => q.evaluate(() => { const v = document.querySelector('#czViewer'); return !!v && !v.hidden && /New teams stall at the invite step/.test(v.textContent); })));
371
+ await q.keyboard.press('Escape'); await sleep(150);
372
+ if (!(await q.evaluate(() => document.querySelector('#peek').hidden))) { await q.keyboard.press('Escape'); await sleep(150); }
373
+ await q.click('.bt-l[data-row="board:sso-partners"] .bt-nm'); await sleep(200); await q.click('#peek .pk-jt[data-tk="SSO-12"]');
374
+ ok('T the ticket panel counts its subtasks from the Jira reading', await until(() => q.evaluate(() => /Subtasks1 of 3/.test(document.querySelector('#peek').textContent) && /1 subtaskdone/.test(document.querySelector('#peek').textContent) && /2 subtasksopen/.test(document.querySelector('#peek').textContent) && !document.querySelector('#peek .pk-box .seg5'))));
375
+ await q.keyboard.press('Escape');
376
+ /* the long spans: themes from the trail, the Group control, milestones */
377
+ await view(q, 'time'); await spanTo(q, 'year');
378
+ const y1 = await q.evaluate(() => ({ cells: [...document.querySelectorAll('#ibBody .tg-tn')].map((c) => c.textContent.replace(/\s+/g, ' ').trim()), sw: getComputedStyle(document.querySelector('#ibBody .tg-sw')).backgroundColor, rel: [...document.querySelectorAll('#ibBody .tg-axl.rl')].map((e) => e.textContent).join() }));
379
+ ok('T Year groups by the trail\'s themes: the PRD\'s theme: name and theme_note:, and its colour', /^FoundationMake PMOS reliable to run6 initiatives/.test(y1.cells[0] || '') && /^Health budgetsUpkeep anchored to a health budget1 initiative/.test(y1.cells[1] || '') && y1.rel === '', JSON.stringify(y1)); // re-pointed: AgBoardTlYear draws no release flag
380
+ await q.click('#chGroup'); await q.click('#grpMenu [data-grp="lane"]');
381
+ ok('T the Group control groups the long spans by lane (and keeps the choice)', await until(() => q.evaluate(() => [...document.querySelectorAll('#ibBody .tg-tn b')].map((b) => b.textContent).join() === 'Feature,Chore' && /Group: ?Lane/.test(document.querySelector('#chGroup').textContent) && localStorage.getItem('pmos.board.group') === 'lane')));
382
+ await q.click('#chGroup'); await q.click('#grpMenu [data-grp="theme"]');
383
+ await spanTo(q, 'quarter');
384
+ ok('T the Quarter marks a release sign-off and a dependency on the bars', await q.evaluate(() => /v2\.4 sign-off/.test(document.querySelector('#ibBody').textContent) && /after SSO for partners/.test(document.querySelector('#ibBody').textContent)));
385
+ await view(q, 'track');
386
+ /* the row actions write through the console's routes, each with Undo */
387
+ await q.click('#bdChipset [data-f="sprint"]');
388
+ const n3 = R.posts.length;
389
+ await q.click('.bt-l[data-row="board:partner-rate-limits"] .bt-nm'); await sleep(150); await q.click('#peek [data-pk="acts"]');
390
+ await q.click('#bdPop [data-rowact="hold"]');
391
+ ok('T Put on hold writes one on-hold lifecycle line, with the check-back day', await until(() => R.posts.some((x) => x.path === '/api/lifecycle' && x.body.initiative_id === 'partner-rate-limits' && x.body.state === 'on-hold' && /^\d{4}-\d{2}-\d{2}$/.test(x.body.back || ''))), JSON.stringify(R.posts));
392
+ await until(() => q.evaluate(() => !!document.querySelector('#bdToast .bd-undo')));
393
+ await q.click('#bdToast .bd-undo');
394
+ ok('T Undo writes the state it had before through the same route', await until(() => R.posts.slice(n3).some((x) => x.path === '/api/lifecycle' && x.body.state === 'active' && x.body.reason === 'undo')), JSON.stringify(R.posts.slice(n3)));
395
+ await q.click('.bt-l[data-row="board:partner-rate-limits"] .bt-nm'); await sleep(150); await q.click('#peek [data-pk="acts"]');
396
+ ok('T the row menu says how much of the step is ready next to Move', await until(() => q.evaluate(() => /Move to Prioritize1 of 4 ready/.test((document.querySelector('#bdPop [data-rowact="mv:3"]') || {}).textContent || ''))), await q.evaluate(() => (document.querySelector('#bdPop') || {}).textContent));
397
+ await q.click('#bdPop [data-rowact="mv:3"]');
398
+ ok('T Move to the next stage writes a move line in the board ledger', await until(() => R.posts.some((x) => x.path === '/api/boards/move' && x.body.id === 'partner-rate-limits' && x.body.to === 'Prioritize' && x.body.board === 'w1')), JSON.stringify(R.posts.slice(-2)));
399
+ await q.click('.bt-l[data-row="board:partner-rate-limits"] .bt-nm'); await sleep(150); await q.click('#peek [data-pk="acts"]'); await q.click('#bdPop [data-rowact="cancel"]');
400
+ ok('T Cancel asks why, with the same chips as Decline', await until(() => q.evaluate(() => /Why cancel Partner API rate limits\?/.test(document.querySelector('#bdPop').textContent) && [...document.querySelectorAll('#bdPop [data-why]')].map((b) => b.textContent).join() === 'Out of scope,Already planned,Not now,Other')));
401
+ await q.click('#bdPop [data-why="Not now"]'); await q.click('#bdPop [data-rowact="cancel-go"]');
402
+ ok('T Cancel writes a cancelled lifecycle line with the reason', await until(() => R.posts.some((x) => x.path === '/api/lifecycle' && x.body.state === 'cancelled' && x.body.reason === 'Not now')), JSON.stringify(R.posts.slice(-2)));
403
+ await q.click('.bt-l[data-row="board:partner-rate-limits"] .bt-nm'); await sleep(150); await q.click('#peek [data-pk="acts"]'); await q.click('#bdPop [data-rowact="archive"]');
404
+ ok('T Archive needs no reason and writes an archive line, with Undo', await until(() => R.posts.some((x) => x.path === '/api/boards/archive' && x.body.archived === true && x.body.id === 'partner-rate-limits')) && await until(() => q.evaluate(() => !!document.querySelector('#bdToast .bd-undo'))), JSON.stringify(R.posts.slice(-2)));
405
+ /* New initiative and the new asks */
406
+ await q.keyboard.press('Escape');
407
+ if (!(await until(() => q.evaluate(() => document.querySelector('#peek').hidden), 2000))) await q.keyboard.press('Escape');
408
+ await q.click('#newIni'); await until(() => q.evaluate(() => !!document.querySelector('#peek select[name="anchor"]:not([disabled])')));
409
+ await q.fill('#peek input[name="title"]', 'Per-key API usage'); await q.fill('#peek textarea[name="why"]', 'Partners ask which key used the quota.'); await q.selectOption('#peek select[name="anchor"]', 'q3-2026:o1:kr1'); await q.click('#peek form[data-form="new2"] [type="submit"]');
410
+ ok('T New initiative records an ask and accepts it into the first stage, anchored, with the Why as its intent and a work lane', await until(() => { const i = R.posts.findIndex((x) => x.path === '/api/boards/asks/add' && x.body.line === 'Per-key API usage'); return i >= 0 && R.posts.slice(i).some((x) => x.path === '/api/boards/asks/accept' && x.body.ask === 'n1' && x.body.anchor === 'q3-2026:o1:kr1' && typeof x.body.lane === 'string' && x.body.lane.length > 0 && x.body.intent === 'Partners ask which key used the quota.'); }), JSON.stringify(R.posts.slice(-3)));
411
+ await q.keyboard.press('Escape');
412
+ await q.click('#chAsks'); await q.click('#bdPop [data-askact="accept"][data-id="a1"]');
413
+ ok('T accepting an ask with no goal yet opens New initiative from its draft', await until(() => q.evaluate(() => (document.querySelector('#peek input[name="title"]') || {}).value === 'Failed payouts CSV' && (document.querySelector('#pkTitle') || {}).textContent === 'Accept ask')));
414
+ await q.keyboard.press('Escape'); await q.click('#chAsks'); await q.click('#bdPop [data-askact="decline"][data-id="a1"]');
415
+ await q.click('#bdPop [data-whynot="Out of scope"]'); await q.fill('#bdPop input[name="why"]', 'Finance owns this report'); await q.click('#bdPop [data-askact="decline-go"]');
416
+ ok('T declining an ask takes a reason, and keeps it', await until(() => R.posts.some((x) => x.path === '/api/boards/asks/decline' && x.body.ask === 'a1' && x.body.why === 'Out of scope: Finance owns this report')), JSON.stringify(R.posts.slice(-2)));
417
+ /* Find, Filter, Metrics, cancelled and archived */
418
+ await q.click('#bdFind'); await q.fill('#bdQ', 'sso');
419
+ ok('T Find lists the initiatives and the Jira work-items that match (BdFilter)', await until(() => q.evaluate(() => [...document.querySelectorAll('#bdQr [data-findini]')].map((b) => b.dataset.findini).join() === 'board:sso-partners' && document.querySelectorAll('#bdQr [data-findtk]').length >= 2)));
420
+ await q.keyboard.press('Enter');
421
+ ok('T Enter opens the first hit\'s panel', await until(() => q.evaluate(() => (document.querySelector('#pkTitle') || {}).textContent === 'SSO for partners' && document.querySelector('#bdPop').hidden)));
422
+ await q.keyboard.press('Escape');
423
+ await q.click('#bdFilter'); await q.click('#bdPop [data-flt="owners"][data-v="Lee"]');
424
+ ok('T Filter narrows the rows by owner, and the Showing bar says so', await until(() => q.evaluate(() => [...document.querySelectorAll('#ibBody .bt-l')].map((r) => r.dataset.row).sort().join() === 'board:partner-rate-limits,board:sso-partners' && /ShowingOwner: Lee.*Clear all/.test(document.querySelector('#bdShowing').textContent))));
425
+ await q.click('#bdPop [data-fclear]'); await q.keyboard.press('Escape');
426
+ ok('T Clear takes the filter off and hides the Showing bar', await q.evaluate(() => document.querySelector('#bdShowing').hidden));
427
+ await q.click('#moreBtn'); await q.click('#bdMetrics'); // re-pointed: Metrics moved from the track's footer to the ⋯ menu
428
+ ok('T Metrics shows the board\'s tiles, and says which are not on record', await until(() => q.evaluate(() => /Cycle time9 daysmedian, last 90 days/.test(document.querySelector('#peek').textContent) && /ThroughputNot on recordNo run log/.test(document.querySelector('#peek').textContent))));
429
+ await q.keyboard.press('Escape');
430
+ await q.click('#moreBtn'); await q.click('#bdGone');
431
+ ok('T the cancelled and archived open from the ⋯ menu, with Reopen', await until(() => q.evaluate(() => /Old idea/.test(document.querySelector('#peek').textContent) && !!document.querySelector('#peek [data-rowact="reopen"]'))));
432
+ await q.click('#peek [data-rowact="reopen"]');
433
+ ok('T Reopen writes an active lifecycle line', await until(() => R.posts.some((x) => x.path === '/api/lifecycle' && x.body.initiative_id === 'old-idea' && x.body.state === 'active' && x.body.reason === 'reopened')));
434
+ ok('T every write carried the launch nonce', R.posts.filter((x) => /lifecycle|boards/.test(x.path)).every((x) => !!x.headers['x-pmos-nonce']), JSON.stringify(R.posts.map((x) => x.headers['x-pmos-nonce'])));
435
+ ok('T no old dialog opened and no page error', await q.evaluate(() => !document.querySelector('#dlg.on')) && R.errors.length === 0, R.errors.join(' | '));
436
+ await R.ctx.close();
437
+ }
438
+
439
+ /* ?focus=<initiative id>: Insights links to the Board this way, and the Board opens that initiative's panel */
283
440
  {
284
- const R = await open(); await R.page.locator('#ibBody .bt-nm').first().focus(); await R.page.keyboard.press('Enter'); await until(() => R.page.evaluate(() => !document.querySelector('#peek').hidden));
285
- await R.page.click('#peek [data-pk="record"]'); await until(() => R.page.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
286
- ok('B13 the page behind a dialog is inert', await R.page.evaluate(() => ['main.stage', '#dock'].every((s) => document.querySelector(s).inert)));
441
+ const R = await open({ qs: '&focus=partner-rate-limits' });
442
+ ok('F1 ?focus=<id> opens that initiative\'s panel on the Board', await until(() => R.page.evaluate(() => !document.querySelector('#peek').hidden && document.querySelector('#pkTitle').textContent === 'Partner API rate limits' && !!document.querySelector('.bt-l.sel[data-row="board:partner-rate-limits"]'))));
287
443
  await R.ctx.close();
288
444
  }
289
445
 
@@ -301,7 +457,7 @@ const mk = (o) => BP.build(F.facts(o));
301
457
  const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), pg = await ctx.newPage(), errs = [];
302
458
  pg.on('pageerror', (e) => errs.push(String(e)));
303
459
  await pg.goto(BASE + '/premium-board.html');
304
- ok('E5 the real page draws this repository\'s board and its counts agree with the route', await until(() => pg.evaluate((cap) => document.querySelectorAll('#ibBody .ini2').length > 0 && document.querySelector('#iniCap').textContent.replace(/\s+/g, ' ').startsWith(cap), `${m.initiatives.on} of ${m.initiatives.open} open on track`), 30000));
460
+ ok('E5 the real page draws this repository\'s board and its count agrees with the route', await until(() => pg.evaluate((n) => document.querySelectorAll('#ibBody .ini2').length > 0 && document.querySelector('#nIni').textContent === n, String(m.initiatives.open || m.initiatives.list.rows.length)), 30000));
305
461
  ok('E6 the real page has no script error', errs.length === 0, errs.join(' | '));
306
462
  await ctx.close();
307
463
  }