create-pmos 0.396.0 → 0.398.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 (177) 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/scripts/nine-stages.js +49 -20
  6. package/payload/state/discoveries.md +1 -1
  7. package/payload/state/log.md +1 -1
  8. package/workspace/briefing-premium-adddoc-test.js +103 -74
  9. package/workspace/briefing-premium-board-test.js +316 -154
  10. package/workspace/briefing-premium-calendar-2-test.js +135 -195
  11. package/workspace/briefing-premium-calendar-3-test.js +143 -413
  12. package/workspace/briefing-premium-calendar-test.js +86 -185
  13. package/workspace/briefing-premium-doc-edit-test.js +95 -83
  14. package/workspace/briefing-premium-initiative-test.js +166 -294
  15. package/workspace/briefing-premium-insights-test.js +351 -214
  16. package/workspace/briefing-premium-metrics-test.js +53 -118
  17. package/workspace/briefing-premium-products-test.js +40 -27
  18. package/workspace/briefing-premium-sources-test.js +91 -52
  19. package/workspace/briefing-premium-test.js +150 -633
  20. package/workspace/briefing-premium-work-test.js +88 -269
  21. package/workspace/changelog.json +24 -0
  22. package/workspace/fixtures/board-premium-facts.js +2 -1
  23. package/workspace/fixtures/board-premium-jira.js +28 -0
  24. package/workspace/fixtures/board-premium-trail.js +32 -0
  25. package/workspace/fixtures/initiative-premium-facts.js +2 -1
  26. package/workspace/fixtures/initiatives-api/list.json +30 -42
  27. package/workspace/fixtures/initiatives-api/roadmap.json +40 -56
  28. package/workspace/fixtures/initiatives-api/sheet.json +10 -14
  29. package/workspace/fixtures/insights-premium-facts.js +11 -2
  30. package/workspace/fixtures/premium-viewer-fixtures.js +182 -0
  31. package/workspace/guide/briefing-premium.md +3 -1
  32. package/workspace/guide/home.md +47 -0
  33. package/workspace/guide/index.md +2 -0
  34. package/workspace/guide/lifecycle.md +51 -0
  35. package/workspace/home-shot.js +38 -0
  36. package/workspace/lib/agent-roles.js +71 -0
  37. package/workspace/lib/board-premium.js +160 -3
  38. package/workspace/lib/board-trail.js +223 -0
  39. package/workspace/lib/engine/boards.js +15 -14
  40. package/workspace/lib/engine/nine-stages.js +49 -20
  41. package/workspace/lib/engine/signals/detectors.js +13 -11
  42. package/workspace/lib/home-work-item.js +58 -0
  43. package/workspace/lib/insights-goals.js +196 -0
  44. package/workspace/lib/insights-premium.js +126 -1
  45. package/workspace/lib/insights-records.js +101 -0
  46. package/workspace/lib/jira-tickets.js +1 -1
  47. package/workspace/lib/route-modules.js +4 -0
  48. package/workspace/lib/routes-board-premium.js +3 -2
  49. package/workspace/lib/routes-board-trail.js +33 -0
  50. package/workspace/lib/routes-home-desk.js +176 -0
  51. package/workspace/lib/routes-initiatives.js +1 -1
  52. package/workspace/lib/routes-insights-premium.js +19 -3
  53. package/workspace/lib/routes-insights-records.js +129 -0
  54. package/workspace/lib/routes-notes.js +1 -0
  55. package/workspace/lib/routes-viewer.js +108 -0
  56. package/workspace/lib/transcript-steps.js +123 -0
  57. package/workspace/lib/vendor/scripts/nine-stages.js +49 -20
  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-agreed-viewer-shots.js +76 -0
  63. package/workspace/premium-board-actions-test.js +85 -73
  64. package/workspace/premium-briefing-depth-test.js +66 -53
  65. package/workspace/premium-chat-attach-test.js +54 -63
  66. package/workspace/premium-chat-chart-tab-test.js +35 -36
  67. package/workspace/premium-chat-context-test.js +22 -19
  68. package/workspace/premium-chat-goal-view-test.js +28 -26
  69. package/workspace/premium-chat-notes-test.js +29 -33
  70. package/workspace/premium-chat-report-tab-test.js +35 -25
  71. package/workspace/premium-chat-term-test.js +16 -14
  72. package/workspace/premium-chat-viewer-test.js +60 -53
  73. package/workspace/premium-core-doc-issue-test.js +50 -41
  74. package/workspace/premium-html-viewer-test.js +17 -18
  75. package/workspace/premium-phone-card-test.js +8 -2
  76. package/workspace/premium-phone-room-test.js +42 -31
  77. package/workspace/premium-report-read-test.js +115 -197
  78. package/workspace/premium-viewer-download-test.js +19 -22
  79. package/workspace/premium-viewer-flicker-test.js +11 -16
  80. package/workspace/premium-viewer-share-test.js +6 -9
  81. package/workspace/premium-viewer-test.js +41 -60
  82. package/workspace/premium-vw-backlog-test.js +53 -31
  83. package/workspace/premium-vw-cal-test.js +82 -123
  84. package/workspace/premium-vw-copy-test.js +17 -33
  85. package/workspace/premium-vw-doc-test.js +12 -11
  86. package/workspace/premium-vw-item-test.js +50 -48
  87. package/workspace/premium-vw-jira-test.js +55 -26
  88. package/workspace/premium-vw-meet-test.js +118 -187
  89. package/workspace/premium-vw-notes-test.js +85 -107
  90. package/workspace/premium-vw-rec-test.js +72 -193
  91. package/workspace/premium-vw-slides-test.js +46 -50
  92. package/workspace/premium-welcome-test.js +3 -2
  93. package/workspace/premium-work-depth-test.js +63 -51
  94. package/workspace/public/pm/bd-acts.js +305 -0
  95. package/workspace/public/pm/bd-span.js +224 -0
  96. package/workspace/public/pm/bd-stages.js +47 -0
  97. package/workspace/public/pm/c3-doc-sheet.js +1 -1
  98. package/workspace/public/pm/c3-md.js +3 -395
  99. package/workspace/public/pm/c3-phone-detail.js +1 -1
  100. package/workspace/public/pm/c3-phone-model.js +3 -68
  101. package/workspace/public/pm/chat-term.js +3 -3
  102. package/workspace/public/pm/cozy-board.css +640 -0
  103. package/workspace/public/pm/cozy-home.css +580 -0
  104. package/workspace/public/pm/cozy-home.js +172 -0
  105. package/workspace/public/pm/cozy-initiative.css +138 -0
  106. package/workspace/public/pm/cozy-insights.css +421 -0
  107. package/workspace/public/pm/cozy-md.js +396 -0
  108. package/workspace/public/pm/cozy-nav.js +65 -0
  109. package/workspace/public/pm/cozy-placeholder.js +26 -0
  110. package/workspace/public/pm/cozy-viewer.css +143 -0
  111. package/workspace/public/pm/cozy-viewer.js +144 -0
  112. package/workspace/public/pm/cozy-vw.css +485 -0
  113. package/workspace/public/pm/cozy.css +254 -0
  114. package/workspace/public/pm/home-adddoc.js +48 -0
  115. package/workspace/public/pm/home-app.js +905 -0
  116. package/workspace/public/pm/home-around.js +515 -0
  117. package/workspace/public/pm/home-chat.js +459 -0
  118. package/workspace/public/pm/home-data.js +312 -0
  119. package/workspace/public/pm/home-draft.js +68 -0
  120. package/workspace/public/pm/home-more.js +249 -0
  121. package/workspace/public/pm/home-phone-card.js +109 -0
  122. package/workspace/public/pm/home-work.js +519 -0
  123. package/workspace/public/pm/lifecycle-lens-model.js +45 -27
  124. package/workspace/public/pm/lifecycle-lens.js +22 -11
  125. package/workspace/public/pm/phone-moment.js +69 -0
  126. package/workspace/public/pm/pm-work-view.js +1 -1
  127. package/workspace/public/pm/premium-attach.js +4 -0
  128. package/workspace/public/pm/premium-board.js +544 -253
  129. package/workspace/public/pm/premium-brief.js +1 -1
  130. package/workspace/public/pm/premium-chart-tab.js +110 -62
  131. package/workspace/public/pm/premium-chat.js +17 -10
  132. package/workspace/public/pm/premium-deck.js +3 -3
  133. package/workspace/public/pm/premium-first.js +25 -21
  134. package/workspace/public/pm/premium-initiative-head.js +138 -0
  135. package/workspace/public/pm/premium-initiative.js +28 -4
  136. package/workspace/public/pm/premium-insights.js +950 -440
  137. package/workspace/public/pm/premium-meeting.js +61 -549
  138. package/workspace/public/pm/premium-notes.js +1 -1
  139. package/workspace/public/pm/premium-report-frame.css +20 -0
  140. package/workspace/public/pm/premium-report-read.js +509 -480
  141. package/workspace/public/pm/premium-report-tab.js +87 -63
  142. package/workspace/public/pm/premium-shell.js +107 -124
  143. package/workspace/public/pm/premium-viewer.js +27 -1
  144. package/workspace/public/pm/premium-vw-cal.js +187 -48
  145. package/workspace/public/pm/premium-vw-doc.css +6 -0
  146. package/workspace/public/pm/premium-vw-doc.js +40 -2
  147. package/workspace/public/pm/premium-vw-file.js +2 -2
  148. package/workspace/public/pm/premium-vw-jira-model.js +22 -5
  149. package/workspace/public/pm/premium-vw-jira.css +11 -0
  150. package/workspace/public/pm/premium-vw-jira.js +11 -4
  151. package/workspace/public/pm/premium-vw-meet.js +6 -83
  152. package/workspace/public/pm/premium-vw-mtg.js +731 -0
  153. package/workspace/public/pm/premium-vw-notes.js +56 -69
  154. package/workspace/public/pm/premium-vw-open.js +35 -0
  155. package/workspace/public/pm/premium-vw-page.js +16 -0
  156. package/workspace/public/pm/premium-vw-rec.js +11 -215
  157. package/workspace/public/pm/premium-vw-slides.css +5 -0
  158. package/workspace/public/pm/premium-vw-slides.js +44 -8
  159. package/workspace/public/pm/term-view.js +22 -0
  160. package/workspace/public/premium-board.html +57 -64
  161. package/workspace/public/premium-chat.html +7 -33
  162. package/workspace/public/premium-initiative.html +8 -41
  163. package/workspace/public/premium-insights.html +63 -62
  164. package/workspace/public/premium-viewer.html +20 -0
  165. package/workspace/public/premium-work.html +6 -72
  166. package/workspace/public/premium.html +21 -66
  167. package/workspace/public/vendor/nunito-var.woff2 +0 -0
  168. package/workspace/server.js +25 -3
  169. package/workspace/test-files.json +1 -0
  170. package/workspace/test-lists/home-libs.json +9 -0
  171. package/workspace/test-lists/premium-agreed-viewer.json +9 -0
  172. package/workspace/test-lists/premium-report-read.json +1 -1
  173. package/workspace/test-lists/premium-vw-agreed.json +9 -0
  174. package/workspace/test-lists/premium-vw-notes.json +1 -1
  175. package/workspace/third-party/README.md +1 -0
  176. package/workspace/public/pm/premium-work.js +0 -719
  177. package/workspace/public/pm/premium.js +0 -1133
@@ -1,18 +1,25 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
- /* briefing-premium-board-test.js — the premium Board page (initiative briefing-premium-board; planning/prd/briefing-premium-board-prd.md B1 to B13).
3
+ /* briefing-premium-board-test.js — the premium Board page (initiative briefing-premium-board; planning/prd/briefing-premium-board-prd.md B1 to B13),
4
+ * rebuilt to the Agreed design (initiative premium-agreed-design: AgBoard* frames, N1 N2).
4
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
5
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.
6
- * 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 Agreed design (audit agreed-design-audit/board.md): what the design has no frame for (List, By stage, Documents, the Sprint,
10
+ * Half and 2 yr spans, the asks, the sprint and release, Find, Filter, New initiative, Metrics, the row actions, cancelled and archived) is checked
11
+ * to WORK as a plain version (pm/bd-acts.js) with a "Waiting for design" tag, through the routes the console presses, and with no older UI.
12
+ * 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
13
+ * other blocks check what the page draws when the trail is not there: nothing invented. */
7
14
  const fs = require('fs');
8
15
  const path = require('path');
9
16
  const { spawn } = require('child_process');
10
17
  const { findBrowser } = require('./lib/find-browser');
11
- const CT = require('./lib/premium-console-type'); // the mockup is read with the console's type (PM, 2026-10-19), as premium.css is
12
- const CT_VENDOR = 'file://' + path.join(__dirname, 'public', 'vendor') + '/';
13
18
  const T = require('./test-run').configure({ name: 'briefing-premium-board' });
14
19
  const BP = require('./lib/board-premium.js');
15
20
  const F = require('./fixtures/board-premium-facts.js');
21
+ const FJ = require('./fixtures/board-premium-jira.js');
22
+ const FT = require('./fixtures/board-premium-trail.js');
16
23
 
17
24
  const BASE = T.BASE;
18
25
  const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
@@ -31,7 +38,6 @@ const finish = async (code) => {
31
38
  process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
32
39
 
33
40
  const mk = (o) => BP.build(F.facts(o));
34
- const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'briefing-artifact.html');
35
41
 
36
42
  (async () => {
37
43
  const exe = findBrowser();
@@ -42,16 +48,22 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
42
48
  await T.waitForServer(BASE);
43
49
  browser = await chromium.launch({ executablePath: exe });
44
50
 
45
- const open = async ({ w = 1280, h = 900, theme = 'light', model = mk(), answers = null, mode = 'popup' } = {}) => {
51
+ const open = async ({ w = 1280, h = 900, theme = 'light', model = mk(), answers = null, trail = null, qs = '' } = {}) => {
46
52
  const ctx = await browser.newContext({ viewport: { width: w, height: h } });
47
- 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
48
53
  const page = await ctx.newPage();
49
54
  let current = model, calls = 0; const errors = [], posts = []; let answer = { status: 200, body: { ok: true } }; let thread = { ok: true, turns: [], working: false };
50
- page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
55
+ page.on('pageerror', (e) => errors.push(String((e && e.stack) || e)));
51
56
  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() }) }); });
52
57
  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) }); });
58
+ 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' }) })));
59
+ // the writes of the plain versions (pm/bd-acts.js): captured, and answered as the routes answer
60
+ 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' },
61
+ '/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' }] } } };
62
+ 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 }) }); });
63
+ 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.' }));
64
+ 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 }) }); });
53
65
  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 }) }); });
54
- await page.goto(BASE + '/premium-board.html?theme=' + theme);
66
+ await page.goto(BASE + '/premium-board.html?theme=' + theme + qs);
55
67
  const up = await until(() => page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0 || /could not be read/.test(document.querySelector('#snap').textContent)), 20000);
56
68
  return { ctx, page, errors, posts, up, calls: () => calls, setModel: (m) => { current = m; }, set: (a) => { answer = a; }, setThread: (t) => { thread = t; } };
57
69
  };
@@ -62,171 +74,340 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
62
74
  const p = A.page, M = mk();
63
75
  const txt = (s) => p.evaluate((q) => (document.querySelector(q) || {}).textContent || '', s);
64
76
 
65
- /* B1 */
66
- const rail = await p.evaluate(() => ({ names: [...document.querySelectorAll('.rail .pl')].map((b) => b.textContent.trim()), cur: document.querySelector('.rail [aria-current="page"]').textContent.trim(), pi: getComputedStyle(document.querySelector('.rail')).getPropertyValue('--pi').trim(), title: document.title, name: document.querySelector('#crBoard').textContent, sw: document.querySelector('#crSw').hidden }));
67
- ok('B1 the rail names five places, Board is current, the board is named and has no switcher for one board', rail.names.join() === 'Briefing,My work,Chat,Board,Insights' && rail.cur === 'Board' && rail.pi === '3' && rail.name === 'pmos' && rail.sw, JSON.stringify(rail));
68
- { 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 }; }); ok('B1 the ⋯ menu links to the console (premium-console-link, premium-topbar)', tc && tc.href === '/console.html' && tc.label === 'Open the console' && tc.w >= 44 && tc.h >= 44 && tc.tab === 0, JSON.stringify(tc)); await p.keyboard.press('Escape'); }
77
+ const view = async (pg, v) => { await pg.evaluate((x) => document.querySelector(`#ibTabs [data-v="${x}"]`).click(), v); await sleep(150); };
78
+ const spanTo = async (pg, s) => { await pg.click(`#bdSpans [data-sp="${s}"]`); await sleep(150); };
79
+
80
+ /* B1 (premium-agreed-design N1 N2): the floating place menu, no page header, one toolbar */
81
+ 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 }; });
82
+ 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', place.fab === 'Open the menu. You are in Board' && place.w === 56 && place.rail === 'gone', JSON.stringify(place));
83
+ 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));
84
+ await p.click('#czFab');
85
+ const menu = await p.evaluate(() => [...document.querySelectorAll('#czMenu a')].map((a) => a.textContent + (a.getAttribute('aria-current') ? '*' : '') + '>' + a.getAttribute('href')).join('|'));
86
+ 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);
87
+ await p.keyboard.press('Escape');
88
+ // premium-agreed-design (shared foundation): the ⋯ menu leads nowhere in the console; its undesigned items open the Viewer on a placeholder.
89
+ // 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).
90
+ { 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));
91
+ await p.click('#settingsBtn'); const vw = await until(() => p.evaluate(() => { const v = document.querySelector('#czViewer'); return v && !v.hidden ? { kind: v.querySelector('.cz-vw-kind').textContent, ph: (v.querySelector('.cz-ph-l') || {}).textContent } : null; }));
92
+ ok('B1 Settings opens the Viewer on its placeholder', vw && vw.kind === 'Settings' && vw.ph === 'Settings · Waiting for design', JSON.stringify(vw)); await p.keyboard.press('Escape'); }
69
93
  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);
70
- for (const [go, re] of [['brief', /\/premium\.html$/], ['work', /\/premium-work\.html$/]]) {
71
- const r2 = await open(); await r2.page.locator(`.rail [data-go="${go}"]`).click();
72
- ok(`B1 the ${go === 'brief' ? 'Briefing' : 'My work'} button opens its premium page`, await until(() => re.test(r2.page.url()), 5000), r2.page.url());
73
- await r2.ctx.close();
74
- }
75
94
 
76
- /* B3 + B11 */
77
- 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 }));
78
- 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));
79
- ok('B11 the dock counts at risk plus late from the same counts', head.dock === '4 need a look');
80
- ok('B12 the header 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));
95
+ /* the Agreed toolbar: the view toggle, Find, Filter, New initiative and ⋯; nothing of the older Board is attached (premium-agreed-design, audit section 2) */
96
+ 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 }));
97
+ 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));
98
+ 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));
81
99
 
82
- /* B4 list */
83
- 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), segs: [...document.querySelectorAll('#ibBody .ini2')].map((r) => [...r.querySelectorAll('.sg2 i')].map((i) => i.className || '-').join('')), 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 }));
84
- ok('B4 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));
85
- ok('B4 "Do this first" tags the late first row only, and the row carries the ember bar', list.tags === 1 && list.first);
86
- ok('B4 the workflow bar fills to the stage, and the stage says it is derived', list.segs[0] === 'pppppn---'.replace(/-/g, '') + '' || list.segs[0].length === 9, list.segs[0]);
87
- 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]));
88
- 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))));
89
- // show more
100
+ /* B1 the stage track (premium-agreed-design): eight columns, two of them milestones, the board's counts, rows by stage.
101
+ * 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
102
+ * that shape is present, so the check pins which two columns are milestones. Evaluate 21 is the fixture's own count (+20 done). */
103
+ 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 }));
104
+ 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));
105
+ 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)));
106
+ 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)));
107
+ 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)));
108
+ 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)));
109
+ ok('B1 the legend reads Skipped, Done, Review, Doing, You and Blocked', tr.lg === 'SkippedDoneReviewDoingYouBlocked', tr.lg);
110
+ 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);
111
+ await p.click('#fold');
112
+ 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)));
113
+ await p.click('#fold');
114
+ 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'))));
115
+ /* AgBoardStages: the step heads open "What finishes each step"; Escape closes it and gives the focus back */
116
+ await p.click('.bt-h [data-steps]');
117
+ 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)));
118
+ await p.keyboard.press('Escape');
119
+ 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'))));
90
120
  {
91
- const f = F.facts(); f.rows = Array.from({ length: 30 }, (_, i) => F.row('r' + i, 'Initiative ' + i)); f.counts.open = 60;
121
+ const f = F.facts(); f.rows = f.rows.map((r) => (r.id === 'usage-billing' ? { ...r, warnings: ['Skipped Triage'] } : r));
122
+ const R = await open({ model: BP.build(f) }), q = R.page;
123
+ 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 }; });
124
+ 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));
125
+ await q.click('.bt-l[data-row="board:usage-billing"] .bt-nm');
126
+ 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; }));
127
+ 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));
128
+ await R.ctx.close();
129
+ }
130
+ {
131
+ const R = await open({ model: BP.build(FJ.facts()) }), q = R.page;
132
+ 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 }));
133
+ 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));
134
+ 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));
135
+ ok('B1 a Deliver row whose release has a date says when it ships', c.st === 'Ships Nov 4', c.st);
136
+ await q.click('#bdChipset [data-f="blocked"]');
137
+ 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'));
138
+ await q.click('#bdChipset [data-f="blocked"]');
139
+ await q.click('.bt-l[data-row="board:sso-partners"] .bt-nm');
140
+ 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('.gi em')].map((e) => e.textContent).join(), 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; }));
141
+ 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));
142
+ 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]));
143
+ ok('B1 its ladder has the eight steps; its output lists the open tickets (blocked first), folds the done ones, and names release notes and your sign-off', !!pk && pk.lad === 8 && pk.cur === 'Deliv' && pk.tks === 'SSO-12,SSO-14,SSO-15' && pk.rows.some((x) => x === '1 ticket done · okta config') && pk.rows.some((x) => x === 'Release notesnot on record') && pk.rows.some((x) => x === 'Your sign-offafter the tickets'), JSON.stringify(pk && pk.rows));
144
+ // 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
145
+ 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]));
146
+ 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);
147
+ const n0 = R.posts.length; await q.click('#peek [data-pk="jira"]');
148
+ 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)));
149
+ await q.click('#peek .gi[data-tk="SSO-12"]');
150
+ 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; }));
151
+ 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));
152
+ await q.click('#peek [data-pk="back"]');
153
+ ok('B1 the ticket\'s crumb goes back to the initiative', await until(() => q.evaluate(() => document.querySelector('#pkTitle').textContent === 'SSO for partners')));
154
+ await q.keyboard.press('Escape');
155
+ ok('B1 Escape closes the panel', await until(() => q.evaluate(() => document.querySelector('#peek').hidden)));
156
+ await q.click('.bt-l[data-row="board:self-serve-v2"] .bt-tk:nth-child(3)');
157
+ ok('B1 a deliverable segment on the row opens its Jira ticket', await until(() => q.evaluate(() => /ONB-34/.test((document.querySelector('#pkTitle') || {}).textContent || ''))));
158
+ await q.keyboard.press('Escape');
159
+ const n1 = R.posts.length; await q.click('#chJira');
160
+ 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')));
161
+ /* the chips and tools the design draws with no frame behind them open a plain version with a "Waiting for design" tag, never older UI */
162
+ const waits = [];
163
+ for (const [sel, name, body] of [['#chAsks', 'New asks', /Finance wants a CSV of failed payouts/], ['#chSprint', 'Sprint and release', /Sprint 24/], ['#bdFind', 'Find', /Find an initiative by its title/], ['#bdFilter', 'Filter', /OwnerDaraLeeNo owner/], ['#newIni', 'New initiative', /Every initiative anchors to a KR or a declared health budget/]]) {
164
+ await q.click(sel);
165
+ waits.push(await until(() => q.evaluate(([nm, re]) => { const k = document.querySelector('#peek'); if (!k || k.hidden) return null; const t = (k.querySelector('#pkTitle') || {}).textContent, tag = (k.querySelector('.pk-eye .bd-wtag') || {}).textContent; return t === nm && tag === 'Waiting for design' && new RegExp(re).test(k.textContent) ? nm : null; }, [name, body.source])) || 'missing ' + name);
166
+ await q.keyboard.press('Escape');
167
+ }
168
+ ok('B1 the new asks, the sprint and release, Find, Filter and New initiative open a plain version in the side panel, tagged "Waiting for design"', waits.join() === 'New asks,Sprint and release,Find,Filter,New initiative', waits.join());
169
+ ok('B1 none of them opened the old dialog', await q.evaluate(() => !document.querySelector('#dlg.on')));
170
+ /* B3 Ask about this goes to Home */
171
+ await q.route('**/premium.html?**', (r) => r.fulfill({ contentType: 'text/html', body: '<title>home</title>' }));
172
+ await q.click('.bt-l[data-row="board:sso-partners"] .bt-nm'); await until(() => q.evaluate(() => !document.querySelector('#peek').hidden));
173
+ await q.fill('#peek .pk-ask input', 'When does SSO ship?'); await q.press('#peek .pk-ask input', 'Enter');
174
+ await until(() => /premium\.html/.test(q.url()), 5000);
175
+ const u = new URL(q.url());
176
+ ok('B3 the Board has no chat: Ask about this opens Home with the question as a quick ask in that initiative', u.pathname === '/premium.html' && u.searchParams.get('ask') === 'sso-partners' && u.searchParams.get('q') === 'When does SSO ship?' && u.searchParams.get('ws') === 'w1', q.url());
177
+ ok('0 no page error on the stage track', R.errors.length === 0, R.errors.join(' | '));
178
+ await R.ctx.close();
179
+ }
180
+ /* 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 */
181
+ {
182
+ const f = FJ.facts(), s0 = f.sprints.sprints[0], s1 = f.sprints.sprints[1];
183
+ 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 = [];
184
+ const R = await open({ model: BP.build(f) }), q = R.page;
185
+ const rows = () => q.evaluate(() => [...document.querySelectorAll('#ibBody .bt-l')].map((r) => r.dataset.row));
186
+ const on = await rows(); await q.click('#bdChipset [data-f="sprint"]'); const off = await rows();
187
+ 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]));
188
+ await R.ctx.close();
189
+ }
190
+ /* waiting on you: Deliver with every ticket done is the PM's sign-off, drawn in the info blue */
191
+ {
192
+ const f = FJ.facts();
193
+ 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)); });
194
+ f.items = f.items.map((i) => ({ ...i, status: 'Done' }));
92
195
  const R = await open({ model: BP.build(f) }), q = R.page;
93
- const n0 = await q.evaluate(() => document.querySelectorAll('#ibBody .ini2').length);
94
- await q.click('#more'); const n1 = await q.evaluate(() => document.querySelectorAll('#ibBody .ini2').length);
95
- ok('B4 the list 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]));
196
+ 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 }; });
197
+ 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));
198
+ await q.click('.bt-l[data-row="board:sso-partners"] .bt-nm');
199
+ 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; }));
200
+ 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));
201
+ 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 || '')));
96
202
  await R.ctx.close();
97
203
  }
98
204
 
99
- /* B5 stages */
100
- ok('B3 the view is one chip in the Initiatives head that says List, and its menu (List, By stage, Timeline) starts shut (premium-calmer-first-screen)', await p.evaluate(() => document.querySelector('#ibF').textContent.trim() === 'List' && document.querySelector('#ibTabs').hidden && document.querySelector('#ibF').getAttribute('aria-expanded') === 'false' && [...document.querySelectorAll('#ibTabs button')].map((b) => b.textContent).join() === 'List,By stage,Timeline' && !!document.querySelector('#cIni .ch #ibF')));
101
- await (async (pg, v) => { if (await pg.locator('#ibTabs').isHidden()) await pg.click('#ibF'); await pg.click(`#ibTabs [data-v="${v}"]`); })(p, 'stages');
102
- 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, none: [...document.querySelectorAll('#ibBody .isc')].filter((c) => /None/.test(c.textContent)).length, pressed: document.querySelector('#ibTabs [aria-pressed="true"]').textContent }));
103
- ok('B5 one column per workflow stage with the board\'s own count; a stage with none says so', stg.cols.length === 9 && stg.cols[0] === 'Discover 1' && stg.cols.includes('Build 2') && stg.cols.includes('Evaluate 21') && stg.cols.includes('Ideate 0') && stg.none === 3 && stg.cards === 7 && stg.pressed === 'By stage', JSON.stringify(stg));
104
- /* B6 timeline */
105
- await (async (pg, v) => { if (await pg.locator('#ibTabs').isHidden()) await pg.click('#ibF'); await pg.click(`#ibTabs [data-v="${v}"]`); })(p, 'time');
106
- const tl = await p.evaluate(() => ({ rows: [...document.querySelectorAll('#ibBody .tlr')].map((r) => ({ t: r.querySelector('.tlt b').textContent, n: r.querySelector('.tln b').textContent, w: r.querySelector('.tln small').textContent, l: r.querySelector('.tlb').style.getPropertyValue('--l'), ww: r.querySelector('.tlb').style.getPropertyValue('--w'), bd: r.classList.contains('bd') })), today: !!document.querySelector('#ibBody .tlplot .td'), none: document.querySelector('#ibBody .tlnone').textContent }));
107
- ok('B6 a bar for each initiative with both dates, with days left or over; the others are counted and not drawn', tl.rows.length === 3 && tl.rows[0].t === 'Self-serve onboarding v2' && tl.rows[0].n === '7' && tl.rows[0].w === 'days over' && tl.rows[2].w === 'days left' && /4 initiatives have no dates on record/.test(tl.none) && tl.today, JSON.stringify(tl));
108
- ok('B6 each bar sits inside the scale', tl.rows.every((r) => parseFloat(r.l) >= 0 && parseFloat(r.l) + parseFloat(r.ww) <= 100.01) && tl.rows[0].bd);
205
+ /* 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 */
206
+ 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 }));
207
+ 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));
208
+ ok('B12 the status says what is real', /^Real data · as of 09:12$/.test(head.snap), JSON.stringify(head));
209
+
210
+ /* B4 B5 List and By stage have no Agreed design: plain versions, tagged, whose rows open the panel */
211
+ await view(p, 'list');
212
+ const lv = await p.evaluate(() => ({ tag: (document.querySelector('#ibBody .bd-whead .bd-wtag') || {}).textContent, rows: [...document.querySelectorAll('#ibBody .bd-lr')].map((r) => r.querySelector('b').textContent), first: (document.querySelector('#ibBody .bd-lr') || {}).textContent, v: document.querySelector('#ibTabs [aria-pressed="true"]').dataset.v }));
213
+ ok('B4 the List view lists the initiatives with owner, lane, step, status and finish, tagged "Waiting for design"', lv.tag === 'Waiting for design' && lv.rows.length === 7 && lv.rows[0] === 'Self-serve onboarding v2' && /DaraBuild7 days over10 Oct/.test((lv.first || '').replace(/ · feature/, '')) && lv.v === 'list', JSON.stringify(lv));
214
+ await p.click('#ibBody .bd-lr[data-key="board:partner-rate-limits"]');
215
+ ok('B4 a List row opens the initiative panel', await until(() => p.evaluate(() => (document.querySelector('#pkTitle') || {}).textContent === 'Partner API rate limits')));
216
+ await p.keyboard.press('Escape');
217
+ await view(p, 'stages');
218
+ const bs = await p.evaluate(() => ({ tag: (document.querySelector('#ibBody .bd-whead .bd-wtag') || {}).textContent, cols: [...document.querySelectorAll('#ibBody .bd-col h3')].map((h) => h.textContent), build: [...document.querySelectorAll('#ibBody .bd-col')][4].querySelectorAll('.bd-card').length }));
219
+ ok('B5 By stage is one column per step with the board\'s counts and the initiatives as cards, tagged "Waiting for design"', bs.tag === 'Waiting for design' && bs.cols.join('|') === 'Triage 0|Discover 1|Plan 1|Prioritize 0|Build 2|Deliver 1|Monitor 1|Evaluate 21' && bs.build === 2, JSON.stringify(bs));
220
+ await view(p, 'track');
109
221
  {
110
- const f = F.facts(); f.rows = f.rows.map((r) => ({ ...r, start: null, end: null }));
111
- const R = await open({ model: BP.build(f) }); await (async (pg, v) => { if (await pg.locator('#ibTabs').isHidden()) await pg.click('#ibF'); await pg.click(`#ibTabs [data-v="${v}"]`); })(R.page, 'time');
112
- ok('B6 with no dates anywhere it draws nothing and says so', await R.page.evaluate(() => document.querySelectorAll('#ibBody .tlr').length === 0 && /No initiative has both a start and an end date on record/.test(document.querySelector('#ibBody').textContent)));
222
+ const f = F.facts(); f.rows = Array.from({ length: 30 }, (_, i) => F.row('r' + i, 'Initiative ' + i)); f.counts.open = 60;
223
+ const R = await open({ model: BP.build(f) }), q = R.page;
224
+ 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')));
113
225
  await R.ctx.close();
114
226
  }
115
- await (async (pg, v) => { if (await pg.locator('#ibTabs').isHidden()) await pg.click('#ibF'); await pg.click(`#ibTabs [data-v="${v}"]`); })(p, 'list');
116
227
 
117
- /* B9 B8 */
118
- 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')));
119
- 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)));
228
+ /* 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 */
229
+ await view(p, 'time');
230
+ 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') }));
231
+ 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));
232
+ 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));
233
+ await p.click('#ibBody [data-rules]');
234
+ 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)));
235
+ await p.keyboard.press('Escape');
236
+ await p.click('#ibBody .tg-n[data-key="board:partner-rate-limits"]');
237
+ 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; }));
238
+ // re-pointed for AgBoardTimelinePanel: 420 px wide; no empty "nothing waits" or "no dependency" card; four actions (dates, move, hold, archive)
239
+ 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));
240
+ await p.click('#peek .pk-acts [aria-label="Move to another stage"]');
241
+ ok('B6 its actions open the plain initiative actions, tagged "Waiting for design"', await until(() => p.evaluate(() => (document.querySelector('#pkTitle') || {}).textContent === 'Initiative actions' && /Move to Prioritize/.test(document.querySelector('#peek').textContent) && !!document.querySelector('#peek .bd-wtag'))));
242
+ await p.keyboard.press('Escape');
243
+ await spanTo(p, 'year');
244
+ 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') }));
245
+ 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));
246
+ await p.click('#ibBody [data-span-go="quarter"]');
247
+ 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));
248
+ await spanTo(p, 'y5');
249
+ 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)));
250
+ const sp = [];
251
+ for (const [k, nm, sel] of [['sprint', 'The Sprint span', '.tg-q[data-span="sprint"]'], ['half', 'The Half span', '.tg-y[data-span="half"]'], ['y2', 'The 2 yr span', '.tg-y[data-span="y2"]']]) { await spanTo(p, k); sp.push(await p.evaluate(([n, q2]) => { const h = document.querySelector('#ibBody .bd-whead'); return !!h && h.querySelector('.bd-wtag').textContent === 'Waiting for design' && h.textContent.includes(n) && !!document.querySelector('#ibBody ' + q2); }, [nm, sel])); }
252
+ ok('B6 Sprint, Half and 2 yr have no Agreed frame: they draw as plain Quarter and Year versions, tagged "Waiting for design"', sp.every(Boolean), JSON.stringify(sp));
253
+ await spanTo(p, 'quarter');
120
254
  {
121
- 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' } }) });
122
- const d = await R.page.evaluate(() => ({ 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 }));
123
- ok('B9 B8 a sprint read and a release are drawn from their records', 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));
255
+ const f = F.facts(); f.rows = f.rows.map((r) => ({ ...r, start: null, end: null }));
256
+ const R = await open({ model: BP.build(f) }); await view(R.page, 'time');
257
+ ok('B6 with no dates anywhere it draws nothing and says so', await R.page.evaluate(() => document.querySelectorAll('#ibBody .tg-bar').length === 0 && /No initiative on screen has a date on record/.test(document.querySelector('#ibBody').textContent)));
124
258
  await R.ctx.close();
125
259
  }
260
+ await view(p, 'track');
126
261
 
127
- /* B7 core documents */
128
- 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 }));
129
- ok('B7 the documents come from the record with their state, and the summary 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));
130
- 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));
131
- 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')));
132
- A.set({ status: 200, body: { ok: true, run: 'r1' } });
133
- const g0 = A.calls();
134
- await p.locator('#docBody [data-draft="charter"]').click();
135
- 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));
136
- const mint = await T.nonce(BASE);
137
- 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)));
138
- A.set({ status: 409, body: { ok: false, error: 'a run is already drafting that document' } });
139
- await p.locator('#docBody [data-draft="charter"]').click();
140
- 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)));
262
+ /* B7 the Documents tab has no Agreed frame: a plain list of the board's core documents, tagged, with Draft it */
263
+ await p.click('#tabDocs');
264
+ ok('B7 the Documents tab shows "Waiting for design" and hides the initiatives; the tab keeps the record\'s count', 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') || {}).textContent === 'Waiting for design' && document.querySelectorAll('#docBody .bd-lr').length === 6 && document.querySelectorAll('#docBody [data-act="draft"]').length === 3 && /Board charter.*Not started/.test(document.querySelector('#docBody').textContent)));
265
+ { const n2 = A.posts.length; await p.click('#docBody [data-act="draft"][data-key="charter"]');
266
+ 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))); }
267
+ await p.click('#tabIni');
141
268
 
142
- /* B10 dialog */
143
- await p.locator('#ibBody .ini2').first().click(); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(700);
144
- const dlg = await p.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, sub: document.querySelector('#dSub').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, ask: !!document.querySelector('#askGo'), label: document.querySelector('#oLab').textContent }));
145
- ok('B10 an initiative opens its record as a grid with the path of its file, the read-only agent beside it 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 && dlg.ask && /This dialog changes nothing/.test(dlg.hold) && dlg.label === 'Initiative record', JSON.stringify(dlg));
146
- A.setThread({ ok: true, working: false, turns: [] });
147
- await p.fill('#askIn', 'Why is this late?'); const nA = A.posts.length; await p.press('#askIn', 'Enter');
148
- ok('B10 a question posts the initiative key and the text', await until(() => A.posts.length > nA && A.posts[A.posts.length - 1].path === '/api/briefing-premium/ask' && A.posts[A.posts.length - 1].body.key === 'board:self-serve-v2' && A.posts[A.posts.length - 1].body.text === 'Why is this late?'));
149
- await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
269
+ /* B13 focus: Escape closes the panel and gives the focus back to the row; the Board never opens the old dialog */
270
+ await p.locator('#ibBody .bt-l[data-row="board:self-serve-v2"] .bt-nm').click(); await until(() => p.evaluate(() => !document.querySelector('#peek').hidden));
271
+ 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
272
+ await p.keyboard.press('Escape');
273
+ 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));
150
274
  ok('0 no page error', A.errors.length === 0, A.errors.join(' | '));
151
275
  await A.ctx.close();
152
276
 
153
- /* B14 a click opens the initiative page; the switch makes it a popup and the choice is kept */
277
+ /* B14 the panel's expand opens the initiative page; there is no Page/Popup switch */
154
278
  {
155
- const D = await open({ mode: null });
156
- const mode0 = await D.page.evaluate(() => [...document.querySelectorAll('#modeSeg button')].map((b) => b.dataset.m + ':' + b.getAttribute('aria-pressed')).join('|'));
157
- ok('B14 the Page setting is the default', mode0 === 'page:true|popup:false', mode0);
279
+ const D = await open();
158
280
  await D.page.route('**/premium-initiative.html*', (r) => r.fulfill({ contentType: 'text/html', body: '<title>x</title>' }));
159
- await D.page.locator('#ibBody .ini2').first().click(); await sleep(600);
281
+ ok('B14 there is no Page/Popup switch', await D.page.evaluate(() => !document.querySelector('#modeSeg') && !document.querySelector('#modeRow:not([hidden])')));
282
+ 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));
283
+ ok('B14 a click on an initiative opens its panel and stays on the Board', new URL(D.page.url()).pathname === '/premium-board.html');
284
+ await D.page.click('#peek [data-pk="expand"]'); await sleep(600);
160
285
  const u = new URL(D.page.url());
161
- ok('B14 a click on an initiative opens its 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());
162
- await D.page.goBack(); await until(() => D.page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0));
163
- await D.page.click('#moreBtn'); await D.page.click('#modeSeg [data-m="popup"]'); await D.page.keyboard.press('Escape'); // premium-topbar: the switch is in the Board's ⋯ menu
164
- await D.page.locator('#ibBody .ini2').first().click();
165
- ok('B14 the Popup setting opens the dialog and stays on the Board', await until(() => D.page.evaluate(() => document.querySelector('#dlg').classList.contains('on'))) && new URL(D.page.url()).pathname === '/premium-board.html');
166
- await D.page.keyboard.press('Escape'); await D.page.reload(); await until(() => D.page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0));
167
- ok('B14 the choice is kept after a reload', await D.page.evaluate(() => document.querySelector('#modeSeg [data-m="popup"]').getAttribute('aria-pressed') === 'true'));
168
- ok('0 no page error on the switch', D.errors.length === 0, D.errors.join(' | '));
286
+ 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());
287
+ ok('0 no page error on expand', D.errors.length === 0, D.errors.join(' | '));
169
288
  await D.ctx.close();
170
289
  }
171
290
 
172
- /* B15 the crumb, "Coming up" and the documents manager, as the mockup draws them */
291
+ /* B15 the product picker */
173
292
  {
174
- const base = F.facts(), docs3 = Object.assign({}, base.docs, { docs: base.docs.docs.concat([F.doc('intake', 'Intake log'), F.doc('roadmap', 'Roadmap note')]) });
175
- const D = await open({ model: BP.build(Object.assign({}, base, { docs: docs3 })) });
176
- const q = D.page;
177
- ok('B15 the third card is "Next release", as the mockup names it', await q.evaluate(() => document.querySelector('#hRel').textContent === 'Next release'));
178
- ok('B15 the header is the crumb: the board\'s name, no switcher for one board, and no chat button (Chat is in the rail)', await q.evaluate(() => document.querySelector('#crBoard').disabled && document.querySelector('#crBoard').textContent === 'pmos' && document.querySelector('#crSw').hidden && !document.querySelector('#crAsk') && !document.querySelector('#bsw')));
179
- await q.click('.rail [data-go="chat"]'); await until(() => q.evaluate(() => /premium-chat\.html/.test(location.pathname) && document.querySelector('#dlg').classList.contains('on')), 10000); await sleep(500);
180
- const bd = await q.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, ask: document.querySelector('#askF').hidden }));
181
- ok('B15 Chat opens the Chat page on the board\'s conversation (premium-chat-page)', /about=board%3Athis-board/.test(q.url()) && bd.title === 'Ask about the pmos board' && bd.ask === false, JSON.stringify({ ...bd, url: q.url() }));
182
- D.setThread({ ok: true, working: false, turns: [] }); await q.fill('#askIn', 'What is late?'); const nq = D.posts.length; await q.press('#askIn', 'Enter');
183
- ok('B15 a question about the board posts the board key and the text', await until(() => D.posts.length > nq && D.posts[D.posts.length - 1].path === '/api/briefing-premium/ask' && D.posts[D.posts.length - 1].body.key === 'board:this-board' && D.posts[D.posts.length - 1].body.text === 'What is late?'));
184
- await q.goBack(); await until(() => q.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 20000);
185
- 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 }));
186
- ok('B15 the documents have the mockup\'s 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));
187
- await q.click('#dmF [data-dmf="none"]'); ok('B15 the filter shows the documents not started', (await q.evaluate(() => [...document.querySelectorAll('#docBody .dmn b')].map((b) => b.textContent))).join('|') === 'Board charter|Board status report|Board risks|Intake log|Roadmap note'.replace('|Board risks', '') || true);
188
- 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'));
189
- 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', '');
190
- D.set({ status: 200, body: { ok: true, run: 'rb' } }); const nb = D.posts.length; await q.click('.dsum .dlink');
191
- 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')));
192
- ok('0 no page error on the documents manager', D.errors.length === 0, D.errors.join(' | '));
293
+ const D = await open(); const q = D.page;
294
+ 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')));
193
295
  await D.ctx.close();
194
296
  }
195
297
 
196
298
  /* B2 reading and failure */
197
299
  {
198
- let n = 0;
199
- const R = await open({ answers: (c) => (c < 3 ? { status: 202, body: { ok: true, state: 'reading' } } : { status: 200, body: { ok: true, state: 'ready', model: mk(), as_of: Date.now() } }) });
200
- // open() waits for the list; check what the page said on the way by reading it after the fact through a second page
201
- await R.ctx.close();
202
300
  const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), pg = await ctx.newPage(); let calls = 0;
203
301
  await pg.route('**/api/board-premium*', (r) => { calls++; if (calls < 2) return r.fulfill({ status: 202, contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'reading' }) }); return r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: mk(), as_of: Date.now() }) }); });
204
302
  await pg.goto(BASE + '/premium-board.html');
205
- ok('B2 while the board is read the page says so, with the seconds, and shows no list instead of a guess', await until(() => pg.evaluate(() => /Reading the board · \d+ s so far/.test(document.querySelector('#snap').textContent) && document.querySelectorAll('#ibBody .ini2').length === 0 && /shows nothing until it has read/.test(document.querySelector('#ibBody').textContent)), 4000));
303
+ ok('B2 while the board is read the page says so, with the seconds, and shows no row instead of a guess', await until(() => pg.evaluate(() => /Reading the board · \d+ s so far/.test(document.querySelector('#snap').textContent) && document.querySelectorAll('#ibBody .ini2').length === 0 && /shows nothing until it has read/.test(document.querySelector('#ibBody').textContent)), 4000));
206
304
  ok('B2 it asks again and draws when the answer is ready', await until(() => pg.evaluate(() => document.querySelectorAll('#ibBody .ini2').length === 7 && /^Real data/.test(document.querySelector('#snap').textContent)), 9000));
207
305
  await ctx.close();
208
306
  const c2 = await browser.newContext({ viewport: { width: 1280, height: 900 } }), p2 = await c2.newPage();
209
307
  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' }) }));
210
308
  await p2.goto(BASE + '/premium-board.html');
211
- 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));
309
+ 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));
212
310
  await c2.close();
213
311
  }
214
312
 
215
- /* B13 floors */
313
+ /* B13 floors: the phone (AgBoardPhone, AgBoardPhoneSheet, AgBoardTimelinePhone) */
216
314
  for (const theme of ['light', 'dark']) {
217
- const R = await open({ w: 390, h: 844, theme }), q = R.page;
218
- const m = await q.evaluate(() => { const small = [...document.querySelectorAll('#ibTabs button, #ibBody .ini2, #docBody .dmcta, #bsw')].filter((b) => !b.closest('[hidden]') && b.getBoundingClientRect().height > 0 && b.getBoundingClientRect().height < 44).map((b) => b.className + ':' + Math.round(b.getBoundingClientRect().height)); return { over: document.documentElement.scrollWidth > innerWidth + 1, small }; });
219
- ok(`B13 at 390 px (${theme}) the page has no sideways scroll and every control is 44 px`, !m.over && m.small.length === 0, JSON.stringify(m));
220
- await (async (pg, v) => { if (await pg.locator('#ibTabs').isHidden()) await pg.click('#ibF'); await pg.click(`#ibTabs [data-v="${v}"]`); })(q, 'stages'); await (async (pg, v) => { if (await pg.locator('#ibTabs').isHidden()) await pg.click('#ibF'); await pg.click(`#ibTabs [data-v="${v}"]`); })(q, 'time');
221
- ok(`B13 at 390 px (${theme}) the stage and timeline views do not scroll sideways`, await q.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1));
222
- await (async (pg, v) => { if (await pg.locator('#ibTabs').isHidden()) await pg.click('#ibF'); await pg.click(`#ibTabs [data-v="${v}"]`); })(q, 'list'); await q.locator('#ibBody .ini2').first().click(); await until(() => q.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(900);
223
- const g = 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 }; });
224
- ok(`B13 at 390 px (${theme}) the dialog is full width and its Detail / Conversation switch is shown`, g.l === 0 && g.w === g.vw && g.tabs !== 'none', JSON.stringify(g));
315
+ const R = await open({ w: 390, h: 844, theme, model: BP.build(FJ.facts()) }), q = R.page;
316
+ 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 }; });
317
+ 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));
318
+ 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));
319
+ await q.click('#bdView'); const s2 = await q.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1 && !!document.querySelector('#ibBody .tgp') && document.querySelectorAll('#ibBody .tgp-r').length === 3);
320
+ ok(`B13 at 390 px (${theme}) the one view button switches to the phone timeline, which does not scroll sideways`, s2);
321
+ await q.click('#bdView'); await q.locator('#ibBody .bt-l[data-row="board:sso-partners"] .bt-nm').click();
322
+ 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 }; }));
323
+ 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));
324
+ await q.click('#peek [data-pk="acts"]');
325
+ ok(`B13 at 390 px (${theme}) the panel's ⋯ opens the plain initiative actions in the sheet, tagged, with 44 px rows, and no dialog`, await until(() => q.evaluate(() => (document.querySelector('#pkTitle') || {}).textContent === 'Initiative actions' && !!document.querySelector('#peek .bd-wtag') && [...document.querySelectorAll('#peek .bd-ai')].every((b) => b.getBoundingClientRect().height >= 44) && !document.querySelector('#dlg.on'))));
326
+ ok(`0 no page error at 390 px (${theme})`, R.errors.length === 0, R.errors.join(' | '));
225
327
  await R.ctx.close();
226
328
  }
329
+
330
+ /* 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) */
227
331
  {
228
- const R = await open(); await R.page.locator('#ibBody .ini2').first().focus(); await R.page.keyboard.press('Enter'); await until(() => R.page.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
229
- ok('B13 the page behind a dialog is inert, Escape closes it and focus returns to the row', await R.page.evaluate(() => ['.rail', 'main.stage', '#dock'].every((s) => document.querySelector(s).inert)) && (await R.page.keyboard.press('Escape'), await until(() => R.page.evaluate(() => !document.querySelector('#dlg').classList.contains('on') && document.activeElement.classList.contains('ini2')))));
332
+ const gone = F.row('old-idea', 'Old idea', { status: 'cancelled', stopped: { reason: 'Not worth it now' } });
333
+ const R = await open({ model: BP.build(FJ.facts({ cancelled: [gone] })), trail: FT.trail() }), q = R.page;
334
+ await until(() => q.evaluate(() => /18d/.test(document.querySelector('#ibBody').textContent)));
335
+ 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);
336
+ 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');
337
+ 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]));
338
+ 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]));
339
+ 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]));
340
+ ok('T what waits on you comes first, in blue', rf.st === 'Your verdict' && /s-you/.test(rf.stc), JSON.stringify(rf));
341
+ await q.click('.bt-l[data-row="board:self-serve-v2"] .bt-nm');
342
+ 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 }; }));
343
+ // re-pointed: AgBoardPanel's status is one line; the usual days stay in the step's tooltip
344
+ 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]));
345
+ 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));
346
+ 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));
347
+ 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]));
348
+ await q.click('#peek .pk-lk [data-doc="planning/prd/self-serve-v2.md"]');
349
+ 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); })));
350
+ await q.keyboard.press('Escape'); await sleep(150);
351
+ if (!(await q.evaluate(() => document.querySelector('#peek').hidden))) { await q.keyboard.press('Escape'); await sleep(150); }
352
+ await q.click('.bt-l[data-row="board:sso-partners"] .bt-nm'); await sleep(200); await q.click('#peek .gi[data-tk="SSO-12"]');
353
+ 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'))));
354
+ await q.keyboard.press('Escape');
355
+ /* the long spans: themes from the trail, the Group control, milestones */
356
+ await view(q, 'time'); await spanTo(q, 'year');
357
+ 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() }));
358
+ 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
359
+ await q.click('#chGroup'); await q.click('#grpMenu [data-grp="lane"]');
360
+ 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')));
361
+ await q.click('#chGroup'); await q.click('#grpMenu [data-grp="theme"]');
362
+ await spanTo(q, 'quarter');
363
+ 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)));
364
+ await view(q, 'track');
365
+ /* the row actions write through the console's routes, each with Undo */
366
+ await q.click('#bdChipset [data-f="sprint"]');
367
+ await q.click('.bt-l[data-row="board:partner-rate-limits"] .bt-nm'); await sleep(150); await q.click('#peek [data-pk="acts"]');
368
+ await q.click('#peek .bd-ai[data-k="hold"]'); await q.click('#peek form[data-form="hold"] [type="submit"]');
369
+ const n3 = R.posts.length;
370
+ 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));
371
+ await until(() => q.evaluate(() => !!document.querySelector('#bdToast .bd-undo')));
372
+ await q.click('#bdToast .bd-undo');
373
+ 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)));
374
+ 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('#peek .bd-ai[data-k="mv:3"]');
375
+ 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)));
376
+ 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('#peek .bd-ai[data-k="archive"]');
377
+ await q.click('#peek form[data-form="archive"] [type="submit"]');
378
+ ok('T Archive asks for a reason and writes an archive line', await until(() => R.posts.some((x) => x.path === '/api/boards/archive' && x.body.archived === true && x.body.reason === 'Not related to this board')), JSON.stringify(R.posts.slice(-2)));
379
+ /* New initiative and the new asks */
380
+ await q.click('#newIni'); await until(() => q.evaluate(() => !!document.querySelector('#peek select[name="anchor"]:not([disabled])')));
381
+ await q.fill('#peek input[name="title"]', 'Per-key API usage'); await q.selectOption('#peek select[name="anchor"]', 'q3-2026:o1:kr1'); await q.click('#peek form[data-form="new"] [type="submit"]');
382
+ ok('T New initiative records an ask and accepts it into the first stage, anchored', 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' && x.body.lane === 'feature'); }), JSON.stringify(R.posts.slice(-3)));
383
+ await q.click('#chAsks'); await q.click('#peek [data-act="accept"][data-id="a1"]');
384
+ ok('T accepting an ask starts from its draft', await until(() => q.evaluate(() => (document.querySelector('#peek input[name="title"]') || {}).value === 'Failed payouts CSV')));
385
+ await q.keyboard.press('Escape'); await q.click('#chAsks'); await q.click('#peek [data-act="decline"][data-id="a1"]');
386
+ await q.fill('#peek textarea[name="why"]', 'Finance owns this report'); await q.click('#peek form[data-form="decline"] [type="submit"]');
387
+ ok('T declining an ask needs a reason, and keeps it', await until(() => R.posts.some((x) => x.path === '/api/boards/asks/decline' && x.body.ask === 'a1' && x.body.why === 'Finance owns this report')));
388
+ /* Find, Filter, Metrics, cancelled and archived */
389
+ await q.click('#bdFind'); await q.fill('#bdQ', 'sso');
390
+ ok('T Find narrows the rows by title', await until(() => q.evaluate(() => [...document.querySelectorAll('#ibBody .bt-l')].map((r) => r.dataset.row).join() === 'board:sso-partners')));
391
+ await q.fill('#bdQ', ''); await q.keyboard.press('Escape');
392
+ await q.click('#bdFilter'); await q.click('#peek [data-flt="owners"][value="Lee"]');
393
+ ok('T Filter narrows the rows by owner', await until(() => q.evaluate(() => [...document.querySelectorAll('#ibBody .bt-l')].map((r) => r.dataset.row).sort().join() === 'board:partner-rate-limits,board:sso-partners')));
394
+ await q.click('#peek [data-act="fclear"]'); await q.keyboard.press('Escape');
395
+ await q.click('#moreBtn'); await q.click('#bdMetrics'); // re-pointed: Metrics moved from the track's footer to the ⋯ menu
396
+ 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))));
397
+ await q.keyboard.press('Escape');
398
+ await q.click('#moreBtn'); await q.click('#bdGone');
399
+ 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-act="reopen"]'))));
400
+ await q.click('#peek [data-act="reopen"]');
401
+ 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')));
402
+ 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'])));
403
+ ok('T no old dialog opened and no page error', await q.evaluate(() => !document.querySelector('#dlg.on')) && R.errors.length === 0, R.errors.join(' | '));
404
+ await R.ctx.close();
405
+ }
406
+
407
+ /* ?focus=<initiative id>: Insights links to the Board this way, and the Board opens that initiative's panel */
408
+ {
409
+ const R = await open({ qs: '&focus=partner-rate-limits' });
410
+ 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"]'))));
230
411
  await R.ctx.close();
231
412
  }
232
413
 
@@ -238,42 +419,23 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
238
419
  const m = j && j.model;
239
420
  ok('E2 the real model\'s counts agree with each other: the header, the dock and the late and at-risk rows', !!m && m.dock.needs === m.initiatives.risk + m.initiatives.late && m.initiatives.on + m.initiatives.risk + m.initiatives.late + m.initiatives.hold === m.initiatives.open && m.initiatives.list.rows.slice(0, 5).every((r) => r.bad || m.initiatives.risk + m.initiatives.late === 0), m ? JSON.stringify(m.initiatives).slice(0, 200) : '');
240
421
  ok('E3 the real model draws no sprint and no release without a source, and no demo data', !!m && !m.sprint.name && !m.release.at && !/demo/i.test(JSON.stringify({ h: m.header, s: m.sprint, r: m.release, d: m.docs, b: m.board })));
422
+ ok('E3 the real model has the eight steps and a track on every row', !!m && m.steps.length === 8 && m.initiatives.list.rows.every((r) => r.track && typeof r.track.k === 'number'));
241
423
  const post = await fetch(BASE + '/api/board-premium', { method: 'POST', headers: await T.pressHeaders(BASE), body: '{}' }).then((r) => r.status);
242
424
  ok('E4 the model route is read-only', post === 405, String(post));
243
425
  const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), pg = await ctx.newPage(), errs = [];
244
426
  pg.on('pageerror', (e) => errs.push(String(e)));
245
427
  await pg.goto(BASE + '/premium-board.html');
246
- ok('E5 the real page draws this repository\'s board and its header agrees 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));
428
+ 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));
247
429
  ok('E6 the real page has no script error', errs.length === 0, errs.join(' | '));
248
430
  await ctx.close();
249
431
  }
250
432
 
251
- /* B13 fidelity against the mockup */
252
- if (!fs.existsSync(MOCKUP)) ok('B13 the mockup is in the repository', false, MOCKUP);
253
- else {
254
- const PAIRS = [['rail', '.rail'], ['card', '#cIni'], ['heading', '#hIni'], ['inih', '.inih'], ['row', '.ini2'], ['title', '.ini2 .it b'], ['subtitle', '.ini2 .it small'], ['stage', '.ini2 .wst em'], ['segs', '.ini2 .sg2'], ['progress', '.ini2 .pg i'], ['finish', '.ini2 .rl'], ['tag', '.tgf'], ['docs', '#cDocs'], ['dmr', '.dmr'], ['dmi', '.dmi'], ['dmt', '.dmn b'], ['dmd', '.dmn>small'], ['cta', '.dmcta.alt'], ['dock', '.dock']];
255
- const SKIP_W = ['row', 'title', 'subtitle', 'stage', 'finish', 'tag', 'dmr', 'dmt', 'dmd', 'cta', 'segs', 'progress', 'spr', 'docs', 'card', 'heading', 'inih'];
256
- const PROPS = ['fontSize', 'fontWeight', 'fontFamily', 'color', 'backgroundColor', 'borderRadius', 'paddingTop', 'paddingLeft', 'letterSpacing', 'lineHeight', 'boxShadow', 'backdropFilter', 'borderTopColor'];
257
- const grab = (pg) => pg.evaluate(([pairs, props]) => { const o = {}; for (const [n, s0] of pairs) { const s = (n === 'rail' || n === 'dock') ? s0 : 'main.stage:not([hidden]) ' + s0; const e = document.querySelector(s); if (!e) { o[n] = null; continue; } const cs = getComputedStyle(e), r = e.getBoundingClientRect(), v = { left: Math.round(r.left), width: Math.round(r.width) }; props.forEach((k) => { v[k] = cs[k]; }); o[n] = v; } return o; }, [PAIRS, PROPS]);
258
- for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
259
- const m = await (await browser.newContext({ viewport: { width: w, height: h } })).newPage();
260
- await m.goto('file://' + MOCKUP); await CT.applyToPage(m, CT_VENDOR);
261
- await until(() => m.evaluate(() => document.querySelectorAll('#rank .rr').length > 0));
262
- await m.evaluate((t) => { document.documentElement.dataset.theme = t; document.querySelector('.pl[data-p="init"]').click(); }, th);
263
- await until(() => m.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0)); await sleep(900);
264
- const R = await open({ w, h, theme: th }); await sleep(500);
265
- const a = await grab(m), c = await grab(R.page), diffs = [];
266
- for (const [n] of PAIRS) {
267
- if (!a[n] || !c[n]) { diffs.push(n + ' missing'); continue; }
268
- for (const k of Object.keys(a[n])) {
269
- const geom = k === 'left' || k === 'width';
270
- if (geom && (SKIP_W.includes(n) && k === 'width' || ['title', 'subtitle', 'stage', 'finish', 'tag', 'dmt', 'dmd', 'cta', 'segs', 'progress'].includes(n) && k === 'left')) continue;
271
- if (geom ? Math.abs(a[n][k] - c[n][k]) > 2 : a[n][k] !== c[n][k]) diffs.push(`${n}.${k} ${a[n][k]} | ${c[n][k]}`);
272
- }
273
- }
274
- ok(`B13 styles and geometry match the mockup at ${w} px, ${th}`, diffs.length === 0, diffs.join(' ; '));
275
- await m.context().close(); await R.ctx.close();
276
- }
433
+ /* B13 the Agreed design's look: Nunito, the soft panel, the chips and the track's rows */
434
+ for (const th of ['light', 'dark']) {
435
+ const R = await open({ w: 1440, h: 900, theme: th }), q = R.page;
436
+ const s = await q.evaluate(() => { const cs = (sel) => getComputedStyle(document.querySelector(sel)); const main = cs('main.bd-main'), row = document.querySelector('.bt-l').getBoundingClientRect(); return { font: cs('body').fontFamily, rad: main.borderTopLeftRadius, bg: main.backgroundColor, chip: Math.round(document.querySelector('#chJira').getBoundingClientRect().height), row: Math.round(row.height), tab: cs('#tabIni').fontWeight, fab: cs('#czFab').borderTopLeftRadius }; });
437
+ ok(`B13 the look of the Agreed design at 1440 px, ${th}: Nunito, a 28 px panel, 30 px chips, 54 px rows`, /^"?Nunito/.test(s.font) && s.rad === '28px' && s.chip === 30 && s.row >= 54 && s.row <= 62 && s.tab === '700' && (th === 'light' ? s.bg === 'rgb(255, 255, 255)' : s.bg !== 'rgb(255, 255, 255)'), JSON.stringify(s));
438
+ await R.ctx.close();
277
439
  }
278
440
  return finish();
279
441
  })().catch((e) => { console.error(e); finish(1); });