create-pmos 0.397.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 (145) hide show
  1. package/package.json +13 -13
  2. package/payload/KIT-VERSION +2 -2
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/payload/state/log.md +1 -1
  7. package/workspace/briefing-premium-adddoc-test.js +101 -52
  8. package/workspace/briefing-premium-board-test.js +252 -128
  9. package/workspace/briefing-premium-calendar-2-test.js +135 -198
  10. package/workspace/briefing-premium-calendar-3-test.js +143 -418
  11. package/workspace/briefing-premium-calendar-test.js +86 -196
  12. package/workspace/briefing-premium-doc-edit-test.js +95 -83
  13. package/workspace/briefing-premium-initiative-test.js +159 -296
  14. package/workspace/briefing-premium-insights-test.js +337 -219
  15. package/workspace/briefing-premium-metrics-test.js +53 -97
  16. package/workspace/briefing-premium-products-test.js +40 -27
  17. package/workspace/briefing-premium-sources-test.js +66 -48
  18. package/workspace/briefing-premium-test.js +150 -647
  19. package/workspace/briefing-premium-work-test.js +88 -283
  20. package/workspace/changelog.json +12 -0
  21. package/workspace/fixtures/board-premium-trail.js +32 -0
  22. package/workspace/fixtures/premium-viewer-fixtures.js +182 -0
  23. package/workspace/guide/briefing-premium.md +3 -1
  24. package/workspace/guide/home.md +47 -0
  25. package/workspace/guide/index.md +1 -0
  26. package/workspace/lib/agent-roles.js +71 -0
  27. package/workspace/lib/board-premium.js +85 -19
  28. package/workspace/lib/board-trail.js +223 -0
  29. package/workspace/lib/home-work-item.js +58 -0
  30. package/workspace/lib/insights-goals.js +196 -0
  31. package/workspace/lib/insights-premium.js +62 -14
  32. package/workspace/lib/insights-records.js +101 -0
  33. package/workspace/lib/jira-tickets.js +1 -1
  34. package/workspace/lib/route-modules.js +4 -0
  35. package/workspace/lib/routes-board-trail.js +33 -0
  36. package/workspace/lib/routes-home-desk.js +176 -0
  37. package/workspace/lib/routes-insights-premium.js +12 -3
  38. package/workspace/lib/routes-insights-records.js +129 -0
  39. package/workspace/lib/routes-notes.js +1 -0
  40. package/workspace/lib/routes-viewer.js +108 -0
  41. package/workspace/lib/transcript-steps.js +123 -0
  42. package/workspace/lib/viewer-meeting.js +205 -0
  43. package/workspace/lib/viewer-report.js +89 -0
  44. package/workspace/package-lock.json +2 -2
  45. package/workspace/package.json +1 -1
  46. package/workspace/premium-board-actions-test.js +85 -75
  47. package/workspace/premium-briefing-depth-test.js +66 -53
  48. package/workspace/premium-chat-attach-test.js +54 -63
  49. package/workspace/premium-chat-chart-tab-test.js +35 -37
  50. package/workspace/premium-chat-context-test.js +19 -18
  51. package/workspace/premium-chat-goal-view-test.js +23 -23
  52. package/workspace/premium-chat-notes-test.js +26 -31
  53. package/workspace/premium-chat-report-tab-test.js +32 -28
  54. package/workspace/premium-chat-term-test.js +16 -16
  55. package/workspace/premium-chat-viewer-test.js +60 -59
  56. package/workspace/premium-core-doc-issue-test.js +50 -43
  57. package/workspace/premium-html-viewer-test.js +14 -17
  58. package/workspace/premium-phone-card-test.js +7 -2
  59. package/workspace/premium-phone-room-test.js +41 -35
  60. package/workspace/premium-report-read-test.js +115 -197
  61. package/workspace/premium-viewer-download-test.js +19 -22
  62. package/workspace/premium-viewer-flicker-test.js +11 -16
  63. package/workspace/premium-viewer-share-test.js +6 -9
  64. package/workspace/premium-viewer-test.js +41 -60
  65. package/workspace/premium-vw-backlog-test.js +53 -33
  66. package/workspace/premium-vw-cal-test.js +82 -128
  67. package/workspace/premium-vw-copy-test.js +17 -33
  68. package/workspace/premium-vw-doc-test.js +11 -10
  69. package/workspace/premium-vw-item-test.js +50 -49
  70. package/workspace/premium-vw-jira-test.js +53 -27
  71. package/workspace/premium-vw-meet-test.js +118 -187
  72. package/workspace/premium-vw-notes-test.js +85 -108
  73. package/workspace/premium-vw-rec-test.js +72 -194
  74. package/workspace/premium-vw-slides-test.js +46 -50
  75. package/workspace/premium-welcome-test.js +3 -2
  76. package/workspace/premium-work-depth-test.js +61 -53
  77. package/workspace/public/pm/bd-acts.js +305 -0
  78. package/workspace/public/pm/bd-span.js +186 -82
  79. package/workspace/public/pm/bd-stages.js +25 -11
  80. package/workspace/public/pm/c3-doc-sheet.js +1 -1
  81. package/workspace/public/pm/c3-md.js +3 -395
  82. package/workspace/public/pm/c3-phone-detail.js +1 -1
  83. package/workspace/public/pm/c3-phone-model.js +3 -68
  84. package/workspace/public/pm/chat-term.js +3 -3
  85. package/workspace/public/pm/cozy-board.css +497 -230
  86. package/workspace/public/pm/cozy-home.css +570 -142
  87. package/workspace/public/pm/cozy-home.js +5 -3
  88. package/workspace/public/pm/cozy-insights.css +296 -167
  89. package/workspace/public/pm/cozy-md.js +396 -0
  90. package/workspace/public/pm/cozy-nav.js +17 -6
  91. package/workspace/public/pm/cozy-placeholder.js +26 -0
  92. package/workspace/public/pm/cozy-viewer.css +3 -3
  93. package/workspace/public/pm/cozy-viewer.js +144 -0
  94. package/workspace/public/pm/cozy-vw.css +485 -0
  95. package/workspace/public/pm/cozy.css +83 -1
  96. package/workspace/public/pm/home-adddoc.js +48 -0
  97. package/workspace/public/pm/home-app.js +905 -0
  98. package/workspace/public/pm/home-around.js +515 -0
  99. package/workspace/public/pm/home-chat.js +459 -0
  100. package/workspace/public/pm/home-data.js +312 -0
  101. package/workspace/public/pm/home-draft.js +68 -0
  102. package/workspace/public/pm/home-more.js +249 -0
  103. package/workspace/public/pm/home-phone-card.js +109 -0
  104. package/workspace/public/pm/home-work.js +519 -0
  105. package/workspace/public/pm/phone-moment.js +69 -0
  106. package/workspace/public/pm/pm-work-view.js +1 -1
  107. package/workspace/public/pm/premium-attach.js +4 -0
  108. package/workspace/public/pm/premium-board.js +423 -394
  109. package/workspace/public/pm/premium-chart-tab.js +110 -62
  110. package/workspace/public/pm/premium-deck.js +3 -3
  111. package/workspace/public/pm/premium-first.js +25 -21
  112. package/workspace/public/pm/premium-insights.js +792 -568
  113. package/workspace/public/pm/premium-meeting.js +61 -549
  114. package/workspace/public/pm/premium-notes.js +1 -1
  115. package/workspace/public/pm/premium-report-frame.css +20 -0
  116. package/workspace/public/pm/premium-report-read.js +509 -480
  117. package/workspace/public/pm/premium-report-tab.js +87 -63
  118. package/workspace/public/pm/premium-shell.js +72 -119
  119. package/workspace/public/pm/premium-viewer.js +22 -1
  120. package/workspace/public/pm/premium-vw-cal.js +187 -48
  121. package/workspace/public/pm/premium-vw-doc.css +6 -0
  122. package/workspace/public/pm/premium-vw-doc.js +40 -2
  123. package/workspace/public/pm/premium-vw-file.js +2 -2
  124. package/workspace/public/pm/premium-vw-meet.js +6 -83
  125. package/workspace/public/pm/premium-vw-mtg.js +731 -0
  126. package/workspace/public/pm/premium-vw-notes.js +56 -69
  127. package/workspace/public/pm/premium-vw-open.js +35 -0
  128. package/workspace/public/pm/premium-vw-page.js +16 -0
  129. package/workspace/public/pm/premium-vw-rec.js +11 -218
  130. package/workspace/public/pm/premium-vw-slides.css +5 -0
  131. package/workspace/public/pm/premium-vw-slides.js +44 -8
  132. package/workspace/public/pm/term-view.js +22 -0
  133. package/workspace/public/premium-board.html +28 -70
  134. package/workspace/public/premium-initiative.html +8 -48
  135. package/workspace/public/premium-insights.html +22 -60
  136. package/workspace/public/premium-viewer.html +20 -0
  137. package/workspace/public/premium.html +16 -107
  138. package/workspace/server.js +18 -3
  139. package/workspace/test-files.json +1 -0
  140. package/workspace/test-lists/home-libs.json +9 -0
  141. package/workspace/test-lists/premium-report-read.json +1 -1
  142. package/workspace/test-lists/premium-vw-agreed.json +9 -0
  143. package/workspace/test-lists/premium-vw-notes.json +1 -1
  144. package/workspace/public/pm/premium-work.js +0 -729
  145. package/workspace/public/pm/premium.js +0 -1146
@@ -4,7 +4,13 @@
4
4
  * rebuilt to the Agreed design (initiative premium-agreed-design: AgBoard* frames, N1 N2).
5
5
  * Serves the real page from the real server. Most checks answer GET /api/board-premium with the model lib/board-premium.js builds from a fixture
6
6
  * (fixtures/board-premium-facts.js); the last block reads this repository's own board through the real routes and presses nothing that starts a run.
7
- * B1 place · B2 reading · B3 header counts · B4 list · B5 stages · B6 timeline · B7 core documents · B8 release · B9 sprint · B10 dialog · B11 one count · B12 labels · B13 floors and fidelity */
7
+ * B1 place, the stage track and its panels · B2 reading · B3 B11 one count · B4 B5 List and By stage · B6 timeline · B7 Documents · B10 no dialog
8
+ * B12 labels · B13 floors and fidelity · B14 expand · B15 picker.
9
+ * Re-pointed to the 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. */
8
14
  const fs = require('fs');
9
15
  const path = require('path');
10
16
  const { spawn } = require('child_process');
@@ -13,6 +19,7 @@ const T = require('./test-run').configure({ name: 'briefing-premium-board' });
13
19
  const BP = require('./lib/board-premium.js');
14
20
  const F = require('./fixtures/board-premium-facts.js');
15
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));
@@ -41,16 +48,22 @@ const mk = (o) => BP.build(F.facts(o));
41
48
  await T.waitForServer(BASE);
42
49
  browser = await chromium.launch({ executablePath: exe });
43
50
 
44
- 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 = '' } = {}) => {
45
52
  const ctx = await browser.newContext({ viewport: { width: w, height: h } });
46
- if (mode) await ctx.addInitScript((m) => { try { if (!localStorage.getItem('pmos.premium.openAs')) localStorage.setItem('pmos.premium.openAs', m); } catch { /* none */ } }, mode); // the earlier checks read the popup; the Page default has its own checks below
47
53
  const page = await ctx.newPage();
48
54
  let current = model, calls = 0; const errors = [], posts = []; let answer = { status: 200, body: { ok: true } }; let thread = { ok: true, turns: [], working: false };
49
- page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
55
+ page.on('pageerror', (e) => errors.push(String((e && e.stack) || e)));
50
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() }) }); });
51
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 }) }); });
52
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 }) }); });
53
- await page.goto(BASE + '/premium-board.html?theme=' + theme);
66
+ await page.goto(BASE + '/premium-board.html?theme=' + theme + qs);
54
67
  const up = await until(() => page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0 || /could not be read/.test(document.querySelector('#snap').textContent)), 20000);
55
68
  return { ctx, page, errors, posts, up, calls: () => calls, setModel: (m) => { current = m; }, set: (a) => { answer = a; }, setThread: (t) => { thread = t; } };
56
69
  };
@@ -65,50 +78,95 @@ const mk = (o) => BP.build(F.facts(o));
65
78
  const spanTo = async (pg, s) => { await pg.click(`#bdSpans [data-sp="${s}"]`); await sleep(150); };
66
79
 
67
80
  /* B1 (premium-agreed-design N1 N2): the floating place menu, no page header, one toolbar */
68
- const place = await p.evaluate(() => { const f = document.querySelector('#czFab'), h1 = document.querySelector('main h1'), r = h1.getBoundingClientRect(), tb = document.querySelector('.bd-hd').getBoundingClientRect(); return { fab: f && f.getAttribute('aria-label'), w: Math.round(f.getBoundingClientRect().width), rail: getComputedStyle(document.querySelector('.rail')).display, h1: Math.round(r.width) + 'x' + Math.round(r.height), top: Math.round(tb.top), name: document.querySelector('#crBoard').textContent, sw: document.querySelector('#crSw').hidden, title: document.title }; });
69
- ok('N1 the floating menu is the one way between places: 56 px, it says Board, and the rail is not on screen', place.fab === 'Open the menu. You are in Board' && place.w === 56 && place.rail === 'none', JSON.stringify(place));
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));
70
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));
71
84
  await p.click('#czFab');
72
85
  const menu = await p.evaluate(() => [...document.querySelectorAll('#czMenu a')].map((a) => a.textContent + (a.getAttribute('aria-current') ? '*' : '') + '>' + a.getAttribute('href')).join('|'));
73
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);
74
87
  await p.keyboard.press('Escape');
75
- { await p.click('#moreBtn'); const tc = await p.evaluate(() => { const a = document.querySelector('#toConsole'); if (!a) return null; const r = a.getBoundingClientRect(); return { href: a.getAttribute('href'), label: a.getAttribute('aria-label'), w: Math.round(r.width), h: Math.round(r.height), tab: a.tabIndex, board: ['#miSteps', '#miSpr', '#miMet', '#miGone'].every((s) => !!document.querySelector('#moreMenu ' + s)) }; }); ok('B1 the ⋯ menu links to the console and holds the Board\'s own items (steps, sprint and release, metrics, cancelled and archived)', tc && tc.href === '/console.html' && tc.label === 'Open the console' && tc.w >= 44 && tc.h >= 44 && tc.tab === 0 && tc.board, JSON.stringify(tc)); await p.keyboard.press('Escape'); }
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'); }
76
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);
77
94
 
78
- /* B1 the stage track (premium-agreed-design): eight columns, two of them milestones, the board's counts, rows by stage */
79
- /* re-pointed for premium-agreed-design: the milestone mark is now a drawn diamond (.msh header holding .cz-ms, cozy.css), not a ◆ glyph in the text;
80
- * the heads read '◆ ' only where that shape is present, so the check still pins which two columns are milestones. Evaluate 21 is the fixture's own count (+20 done). */
81
- const tr = await p.evaluate(() => ({ heads: [...document.querySelectorAll('.bt-h .bt-cells > div')].map((d) => (d.classList.contains('msh') && d.querySelector('.cz-ms') ? '◆ ' : '') + d.textContent.replace(/\s+/g, ' ').trim()), rows: [...document.querySelectorAll('#ibBody .bt-l')].map((r) => ({ t: r.querySelector('.bt-nm b').textContent, cur: [...r.querySelectorAll('.bt-cells > div')].findIndex((c) => c.classList.contains('c')), out: r.querySelector('.bt-dl .t1 b').textContent, prog: r.querySelector('.bt-dl .t1 span').textContent, st: r.querySelector('.cs').textContent })), pressed: document.querySelector('#ibTabs [aria-pressed="true"]').dataset.v }));
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));
99
+
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 }));
82
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));
83
- ok('B1 one row per initiative, sorted by stage, with its current step marked', tr.rows.length === 7 && tr.rows.map((r) => r.cur).join() === '1,2,4,4,5,6,7' && tr.rows[0].t === 'Usage-based billing', JSON.stringify(tr.rows.map((r) => r.t + ':' + r.cur)));
84
- ok('B1 the Output column names what finishes the step and the progress a record holds; nothing is invented', tr.rows[0].out === 'PRD complete' && tr.rows[0].prog === 'Not counted yet' && tr.rows[1].out === 'Scope, timeline, work breakdown' && tr.rows[1].prog === '18%' && tr.rows[6].out === 'Keep, iterate or stop', JSON.stringify(tr.rows.map((r) => r.out + ':' + r.prog)));
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)));
85
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');
86
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'))));
120
+ {
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
+ }
87
130
  {
88
131
  const R = await open({ model: BP.build(FJ.facts()) }), q = R.page;
89
- const c = await q.evaluate(() => ({ chips: [...document.querySelectorAll('#bdChipset .cz-chip')].map((b) => b.textContent.replace(/\s+/g, ' ').trim()), segs: [...document.querySelectorAll('.bt-l[data-row="board:self-serve-v2"] .seg5 .bt-tk')].map((b) => b.className.replace('bt-tk ', '')).join(), sso: document.querySelector('.bt-l[data-row="board:sso-partners"] .bt-dl').textContent }));
90
- ok('B1 the chips read Jira, the sprint and the release, the new asks, late, at risk and blocked from the records', /^Jira · read /.test(c.chips[0]) && c.chips[1] === 'Sprint 24 · v2.4 ships 4 Nov' && c.chips[2] === '1 new ask' && c.chips.includes('1 late') && c.chips.includes('3 at risk') && c.chips.includes('1 blocked') && c.chips.includes('This sprint'), JSON.stringify(c.chips));
91
- ok('B1 Build progress is the Jira tickets in points, one segment each; a blocked ticket shows in red and says why', c.segs === 'dn,dn,rv,ip,td' && /v2\.4 shipped \+ your sign-off/.test(c.sso) && /SSO-12 blocked · Waiting on PLAT-88/.test(c.sso), JSON.stringify(c));
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);
92
136
  await q.click('#bdChipset [data-f="blocked"]');
93
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'));
94
138
  await q.click('#bdChipset [data-f="blocked"]');
95
139
  await q.click('.bt-l[data-row="board:sso-partners"] .bt-nm');
96
- const pk = await until(() => q.evaluate(() => { const k = document.querySelector('#peek'); return k && !k.hidden ? { t: document.querySelector('#pkTitle').textContent, tks: [...k.querySelectorAll('.gi em')].map((e) => e.textContent).join(), lad: k.querySelectorAll('.pk-lad span').length, cur: (k.querySelector('.pk-lad span.c') || {}).textContent, sel: !!document.querySelector('.bt-l.sel[data-row="board:sso-partners"]') } : null; }));
97
- ok('B1 a row opens the initiative panel: its ladder, its output with the Jira tickets, and the row is marked', !!pk && pk.t === 'SSO for partners' && pk.tks === 'SSO-12,SSO-10,SSO-14,SSO-15' && pk.lad === 8 && pk.cur === 'Deliv' && pk.sel, JSON.stringify(pk));
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)));
98
149
  await q.click('#peek .gi[data-tk="SSO-12"]');
99
- const tk = await until(() => q.evaluate(() => { const t = document.querySelector('#pkTitle'); return t && /SSO-12/.test(t.textContent) ? { t: t.textContent, body: document.querySelector('#peek').textContent.replace(/\s+/g, ' '), jira: (document.querySelector('#peek a[href*="jira.example"]') || {}).href } : null; }));
100
- ok('B1 V1 a ticket opens its Jira panel: blocked and why, the sprint, the assignee as the reading holds it, when Jira was read, and a link to Jira', !!tk && /Blocked in Jira\. Waiting on PLAT-88/.test(tk.body) && /Sprint 24/.test(tk.body) && /Assignee/.test(tk.body) && /Read/.test(tk.body) && /change only in Jira/.test(tk.body) && /browse\/SSO-12/.test(tk.jira || ''), JSON.stringify(tk));
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')));
101
154
  await q.keyboard.press('Escape');
102
155
  ok('B1 Escape closes the panel', await until(() => q.evaluate(() => document.querySelector('#peek').hidden)));
103
156
  await q.click('.bt-l[data-row="board:self-serve-v2"] .bt-tk:nth-child(3)');
104
157
  ok('B1 a deliverable segment on the row opens its Jira ticket', await until(() => q.evaluate(() => /ONB-34/.test((document.querySelector('#pkTitle') || {}).textContent || ''))));
105
158
  await q.keyboard.press('Escape');
106
- await q.click('#chAsks');
107
- ok('B1 the new asks chip opens the asks with Accept and Decline', await until(() => q.evaluate(() => !document.querySelector('#popAsks').hidden && document.querySelectorAll('#cAsks .baa').length === 1)));
108
- await q.keyboard.press('Escape');
109
- await q.click('#stHelp');
110
- ok('B1 what finishes each step: eight steps with their output and where the count comes from', await until(() => q.evaluate(() => !document.querySelector('#popSteps').hidden && /Release shipped, your sign-off/.test(document.querySelector('#popSteps').textContent) && document.querySelectorAll('#popSteps .bd-tbl:not(.bd-tbl4) .bd-tr').length === 9)));
111
- 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')));
112
170
  /* B3 Ask about this goes to Home */
113
171
  await q.route('**/premium.html?**', (r) => r.fulfill({ contentType: 'text/html', body: '<title>home</title>' }));
114
172
  await q.click('.bt-l[data-row="board:sso-partners"] .bt-nm'); await until(() => q.evaluate(() => !document.querySelector('#peek').hidden));
@@ -119,44 +177,79 @@ const mk = (o) => BP.build(F.facts(o));
119
177
  ok('0 no page error on the stage track', R.errors.length === 0, R.errors.join(' | '));
120
178
  await R.ctx.close();
121
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' }));
195
+ const R = await open({ model: BP.build(f) }), q = R.page;
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 || '')));
202
+ await R.ctx.close();
203
+ }
122
204
 
123
- /* B3 + B11 */
124
- const head = await p.evaluate(() => ({ cap: document.querySelector('#iniCap').textContent, bar: document.querySelector('#iniBar').getAttribute('aria-valuenow') + '/' + document.querySelector('#iniBar').getAttribute('aria-valuemax'), w: document.querySelector('#iniBar b').style.width, dock: document.querySelector('#dN').textContent + ' ' + document.querySelector('#dLab').textContent, snap: document.querySelector('#snap').textContent, note: document.querySelector('#iniNote').textContent }));
125
- ok('B3 the header counts are the board\'s: 5 of 9 on track, 3 at risk, 1 late, with a bar', head.cap === '5 of 9 open on track · 3 at risk · 1 late' && head.bar === '5/9' && Math.abs(parseFloat(head.w) - 55.5) < 1, JSON.stringify(head));
126
- ok('B11 the dock counts at risk plus late from the same counts', head.dock === '4 need a look');
127
- ok('B12 the status says what is real, and the note says how many are loaded', /^Real data · as of 09:12$/.test(head.snap) && /7 of 9 open initiatives are loaded: late and at-risk ones first/.test(head.note), JSON.stringify(head));
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));
128
209
 
129
- /* B4 list (kept as a view) */
210
+ /* B4 B5 List and By stage have no Agreed design: plain versions, tagged, whose rows open the panel */
130
211
  await view(p, 'list');
131
- const list = await p.evaluate(() => ({ titles: [...document.querySelectorAll('#ibBody .ini2 .it b')].map((b) => b.textContent.replace('Do this first', '')), tags: [...document.querySelectorAll('#ibBody .tgf')].length, first: document.querySelector('#ibBody .ini2').classList.contains('first'), subs: [...document.querySelectorAll('#ibBody .ini2 .it small')].map((x) => x.textContent), stages: [...document.querySelectorAll('#ibBody .ini2 .wst em')].map((x) => x.textContent), pg: [...document.querySelectorAll('#ibBody .ini2')].map((r) => (r.querySelector('.pg b') || {}).style ? r.querySelector('.pg b').style.width : ''), rl: [...document.querySelectorAll('#ibBody .ini2 .rl')].map((x) => x.textContent), over: [...document.querySelectorAll('#ibBody .rl.over')].length }));
132
- ok('B4 the List view keeps one row per initiative in the board\'s order, with owner and lane from the record', list.titles.length === 7 && list.titles[0] === 'Self-serve onboarding v2' && list.subs[0] === 'Dara · feature · Late' && list.subs[2] === 'No owner · feature · At risk', JSON.stringify(list.subs));
133
- ok('B4 "Do this first" tags the late first row only', list.tags === 1 && list.first);
134
- ok('B4 progress and a finish date only where a record holds them; "Not planned" otherwise; a past finish is marked', list.pg[0] === '62%' && list.pg[2] === '' && list.rl[0] === '10 Oct' && list.rl[2] === 'Not planned' && list.over === 1 && /derived/.test(list.stages[0]), JSON.stringify([list.pg, list.rl, list.over]));
135
- ok('B4 no demo label, no invented owner and no estimate is drawn', !(await p.evaluate(() => /demo|~\d+ min/i.test(document.querySelector('#cIni').textContent))));
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');
136
221
  {
137
222
  const f = F.facts(); f.rows = Array.from({ length: 30 }, (_, i) => F.row('r' + i, 'Initiative ' + i)); f.counts.open = 60;
138
223
  const R = await open({ model: BP.build(f) }), q = R.page;
139
- const n0 = await q.evaluate(() => document.querySelectorAll('#ibBody .bt-l').length);
140
- await q.click('#more'); const n1 = await q.evaluate(() => document.querySelectorAll('#ibBody .bt-l').length);
141
- ok('B4 the track shows 25 rows and "Show more" adds the rest that are loaded', n0 === 25 && n1 === 30 && !(await q.evaluate(() => !!document.querySelector('#more'))), JSON.stringify([n0, n1]));
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')));
142
225
  await R.ctx.close();
143
226
  }
144
227
 
145
- /* B5 By stage (kept as a view): the board's own workflow columns */
146
- await view(p, 'stages');
147
- const stg = await p.evaluate(() => ({ cols: [...document.querySelectorAll('#ibBody .isc')].map((c) => c.querySelector('.label').textContent.replace(/\s+/g, ' ').trim()), cards: document.querySelectorAll('#ibBody .icd').length, pressed: document.querySelector('#ibTabs [aria-pressed="true"]').dataset.v }));
148
- ok('B5 By stage keeps one column per workflow stage with the board\'s own count', stg.cols.length === M.initiatives.stages.length && stg.cols[0] === M.initiatives.stages[0].stage + ' ' + M.initiatives.stages[0].count && stg.cards === 7 && stg.pressed === 'stages', JSON.stringify(stg));
149
-
150
- /* B6 (premium-agreed-design B2) the timeline: plan against the Jira forecast, six spans, themes at the long spans */
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 */
151
229
  await view(p, 'time');
152
- const tl = await p.evaluate(() => ({ spans: [...document.querySelectorAll('#bdSpans button')].map((b) => b.textContent + (b.getAttribute('aria-pressed') === 'true' ? '*' : '')).join(), shown: !document.querySelector('#bdSpans').hidden, rows: [...document.querySelectorAll('#ibBody .tg-r .tg-n.ini2 b')].map((b) => b.textContent), bars: document.querySelectorAll('#ibBody .tg-bar').length, none: (document.querySelector('.tg-none') || {}).textContent || '', ask: (document.querySelector('#askDates') || {}).href || '' }));
153
- ok('B6 the timeline has six spans and starts on Quarter, one row per initiative with dates; the others are named, with an ask to propose dates', tl.shown && tl.spans === 'Sprint,Quarter*,Half,Year,2 yr,5 yr' && tl.rows.length === 3 && tl.bars === 3 && /4 have no dates/.test(tl.none) && /\/premium\.html\?ask=board%3Aw1&q=Propose/.test(tl.ask), JSON.stringify(tl));
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');
154
243
  await spanTo(p, 'year');
155
- ok('B6 Year groups by theme, with the initiatives as bars inside', await p.evaluate(() => document.querySelectorAll('#ibBody .tg-th').length === 1 && document.querySelectorAll('#ibBody .tg-th .tg-line').length === 3 && /O1 · q3-2026/.test(document.querySelector('#ibBody .tg-th').textContent)));
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));
156
248
  await spanTo(p, 'y5');
157
- ok('B6 5 yr shows themes only, as phases', await p.evaluate(() => document.querySelectorAll('#ibBody .tg-phase').length === 1 && document.querySelectorAll('#ibBody .tg-line').length === 0));
158
- await spanTo(p, 'sprint');
159
- ok('B6 Sprint with no Jira read says so', await p.evaluate(() => /No sprint is on record/.test(document.querySelector('#ibBody').textContent)));
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));
160
253
  await spanTo(p, 'quarter');
161
254
  {
162
255
  const f = F.facts(); f.rows = f.rows.map((r) => ({ ...r, start: null, end: null }));
@@ -166,85 +259,39 @@ const mk = (o) => BP.build(F.facts(o));
166
259
  }
167
260
  await view(p, 'track');
168
261
 
169
- /* B9 B8 the sprint and the release, behind the sprint chip */
170
- ok('B9 with no Jira read the sprint card says so and draws nothing', await p.evaluate(() => /No sprint is on record/.test(document.querySelector('#sprBody').textContent) && document.querySelector('#sprCap').textContent === 'none' && !document.querySelector('#sprBody .spr')));
171
- ok('B8 with no release the card says none is on record', await p.evaluate(() => /No release is on record/.test(document.querySelector('#relBody').textContent)));
172
- {
173
- const R = await open({ model: mk({ sprints: { source: 'jira', readAt: '2026-10-16', sprints: [{ name: 'Sprint 42', state: 'active', start: '2026-10-12', end: '2026-10-23', counts: { todo: 11, doing: 9, done: 14 }, goal: 'Self-serve onboarding reaches beta' }] }, nextRelease: { id: 'r1', type: 'minor', at: '2026-10-23T00:00:00Z' } }) });
174
- await R.page.click('#chSprint');
175
- const d = await R.page.evaluate(() => ({ open: !document.querySelector('#popSpr').hidden, sp: document.querySelector('#sprBody').textContent.replace(/\s+/g, ' '), cnt: [...document.querySelectorAll('#sprBody .cnt b')].map((b) => b.textContent).join(), rel: document.querySelector('#relBody').textContent.replace(/\s+/g, ' '), cap: document.querySelector('#relCap').textContent }));
176
- ok('B9 B8 the sprint chip opens the sprint and the release, drawn from their records', d.open && d.cnt === '14,9,11' && /Goal: Self-serve onboarding reaches beta/.test(d.sp) && /Sprint review in 6 days/.test(d.sp) && /r1Next23 Oct · 6 days away/.test(d.rel), JSON.stringify(d));
177
- await R.page.click('#sprBody .spr');
178
- ok('B9 the sprint opens its dialog, as before', await until(() => R.page.evaluate(() => document.querySelector('#dlg').classList.contains('on') && document.querySelector('#dTitle').textContent === 'Sprint 42')));
179
- await R.ctx.close();
180
- }
181
-
182
- /* B7 core documents, on the Documents tab */
262
+ /* B7 the Documents tab has no Agreed frame: a plain list of the board's core documents, tagged, with Draft it */
183
263
  await p.click('#tabDocs');
184
- ok('B7 the Documents tab shows the core documents and hides the initiatives', await p.evaluate(() => !document.querySelector('#cDocs').hidden && document.querySelector('#cIni').hidden && document.querySelector('#tabDocs').getAttribute('aria-selected') === 'true'));
185
- const docs = await p.evaluate(() => ({ cap: document.querySelector('#docCap').textContent, rows: [...document.querySelectorAll('#docBody .dmr')].map((r) => ({ t: r.querySelector('.dmn b').textContent, s: r.querySelector('.dmm .s').textContent.trim(), b: r.querySelector('.dmcta') ? r.querySelector('.dmcta').textContent.trim() : null, dis: r.querySelector('.dmcta') ? r.querySelector('.dmcta').disabled : null, kind: r.querySelector('.dmcta') ? (r.querySelector('.dmcta').dataset.draft ? 'draft' : 'go') : null })), all: document.querySelector('#cDocs').textContent }));
186
- ok('B7 the documents come from the record with their state, and the tab counts them', docs.cap === '6' && docs.rows.length === 6 && docs.rows[0].t === 'Board charter' && docs.rows[0].s === 'Not started' && docs.rows[1].s === 'Live' && docs.rows[3].s === 'Draft' && docs.rows[4].s === 'Stale', JSON.stringify(docs));
187
- ok('B7 the button is the record\'s own action: Draft it, Set it up, Open; a draft to review and a document with no action have none; a running one is off', docs.rows[0].b === 'Draft it' && docs.rows[0].kind === 'draft' && docs.rows[2].b === 'Set it up' && docs.rows[2].kind === 'go' && docs.rows[1].b === 'Open' && docs.rows[3].b === null && docs.rows[5].b === 'Drafting' && docs.rows[5].dis === true, JSON.stringify(docs.rows));
188
- ok('B7 Drop is not on the page, and the list has no Issue it press (it is in a draft\'s reader)', !/\bDrop\b/.test(docs.all) && await p.evaluate(() => !document.querySelector('#docBody [data-rd="issue"], #docBody button.dmcta')?.textContent.includes('Issue it')));
189
- A.set({ status: 200, body: { ok: true, run: 'r1' } });
190
- const g0 = A.calls();
191
- await p.locator('#docBody [data-draft="charter"]').click();
192
- ok('B7 Draft it posts the board, the scope and the key and nothing else, says what happens, and reads the board again', await until(() => A.posts.some((x) => x.path === '/api/core-docs/draft' && x.body.ws === 'w1' && x.body.scope === 'board:w1' && x.body.key === 'charter' && Object.keys(x.body).sort().join() === 'key,scope,ws')) && await until(() => p.evaluate(() => /The agent is drafting “Board charter”.*sends nothing/.test(document.querySelector('#toast').textContent))) && await until(() => A.calls() > g0), JSON.stringify(A.posts));
193
- const mint = await T.nonce(BASE);
194
- ok('B7 the press carried the launch nonce and no writer field', !!mint && A.posts.filter((x) => x.path === '/api/core-docs/draft').every((x) => x.headers['x-pmos-nonce'] === mint && !['by', 'via', 'at', 'actor', 'pm', 'nonce'].some((k) => k in x.body)));
195
- A.set({ status: 409, body: { ok: false, error: 'a run is already drafting that document' } });
196
- await p.locator('#docBody [data-draft="charter"]').click();
197
- ok('B7 a refused press shows the route\'s reason and turns the button back on', await until(() => p.evaluate(() => /already drafting/.test(document.querySelector('#toast').textContent) && !document.querySelector('#docBody [data-draft="charter"]').disabled)));
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))); }
198
267
  await p.click('#tabIni');
199
268
 
200
- /* B10 the record dialog, from the panel's Record */
269
+ /* B13 focus: Escape closes the panel and gives the focus back to the row; the Board never opens the old dialog */
201
270
  await p.locator('#ibBody .bt-l[data-row="board:self-serve-v2"] .bt-nm').click(); await until(() => p.evaluate(() => !document.querySelector('#peek').hidden));
202
- await p.click('#peek [data-pk="record"]'); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(700);
203
- const dlg = await p.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, grid: [...document.querySelectorAll('#oMain .kv2 span')].map((s) => s.textContent).join('|'), path: document.querySelector('#oMain .dpath').textContent, buttons: [...document.querySelectorAll('#card button')].length, hold: document.querySelector('#holdWhy').textContent, label: document.querySelector('#oLab').textContent }));
204
- ok('B10 the panel\'s Record opens the initiative\'s record as a grid with the path of its file and no press', dlg.title === 'Self-serve onboarding v2' && /Stage\|Build \(derived\)/.test(dlg.grid) && /Progress\|62%/.test(dlg.grid) && dlg.path === 'planning/initiatives/self-serve-v2.md' && dlg.buttons === 0 && /This dialog changes nothing/.test(dlg.hold) && dlg.label === 'Initiative record', JSON.stringify(dlg));
205
- await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
206
- ok('B13 closing the dialog gives the focus back to the panel\'s Record', await until(() => p.evaluate(() => document.activeElement && document.activeElement.dataset.pk === 'record')), await p.evaluate(() => document.activeElement.tagName + '.' + document.activeElement.className + ' peek=' + document.querySelector('#peek').hidden + ' dlg=' + document.querySelector('#dlg').className));
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
207
272
  await p.keyboard.press('Escape');
208
- ok('B13 Escape then closes the panel and gives the focus back to the row', await until(() => p.evaluate(() => document.querySelector('#peek').hidden && document.activeElement.classList.contains('bt-nm'))), await p.evaluate(() => document.activeElement.tagName + '.' + document.activeElement.className + ' peek=' + document.querySelector('#peek').hidden + ' bam2=' + !!document.querySelector('.bam2') + ' pops=' + [...document.querySelectorAll('.bd-pop')].filter((x) => !x.hidden).map((x) => x.id)));
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));
209
274
  ok('0 no page error', A.errors.length === 0, A.errors.join(' | '));
210
275
  await A.ctx.close();
211
276
 
212
- /* B14 the panel's expand opens the initiative page (Page, the default) or the record dialog (Popup); the choice is kept */
277
+ /* B14 the panel's expand opens the initiative page; there is no Page/Popup switch */
213
278
  {
214
- const D = await open({ mode: null });
215
- const mode0 = await D.page.evaluate(() => [...document.querySelectorAll('#modeSeg button')].map((b) => b.dataset.m + ':' + b.getAttribute('aria-pressed')).join('|'));
216
- ok('B14 the Page setting is the default', mode0 === 'page:true|popup:false', mode0);
279
+ const D = await open();
217
280
  await D.page.route('**/premium-initiative.html*', (r) => r.fulfill({ contentType: 'text/html', body: '<title>x</title>' }));
281
+ ok('B14 there is no Page/Popup switch', await D.page.evaluate(() => !document.querySelector('#modeSeg') && !document.querySelector('#modeRow:not([hidden])')));
218
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));
219
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');
220
284
  await D.page.click('#peek [data-pk="expand"]'); await sleep(600);
221
285
  const u = new URL(D.page.url());
222
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());
223
- await D.page.goBack(); await until(() => D.page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0));
224
- await D.page.click('#moreBtn'); await D.page.click('#modeSeg [data-m="popup"]'); await D.page.keyboard.press('Escape');
225
- await D.page.locator('#ibBody .bt-l[data-row="board:self-serve-v2"] .bt-nm').click(); await until(() => D.page.evaluate(() => !document.querySelector('#peek').hidden));
226
- await D.page.click('#peek [data-pk="expand"]');
227
- ok('B14 the Popup setting makes expand open the dialog and stay on the Board', await until(() => D.page.evaluate(() => document.querySelector('#dlg').classList.contains('on'))) && new URL(D.page.url()).pathname === '/premium-board.html');
228
- await D.page.keyboard.press('Escape'); await D.page.reload(); await until(() => D.page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0));
229
- ok('B14 the choice is kept after a reload', await D.page.evaluate(() => document.querySelector('#modeSeg [data-m="popup"]').getAttribute('aria-pressed') === 'true'));
230
- ok('0 no page error on the switch', D.errors.length === 0, D.errors.join(' | '));
287
+ ok('0 no page error on expand', D.errors.length === 0, D.errors.join(' | '));
231
288
  await D.ctx.close();
232
289
  }
233
290
 
234
- /* B15 the product picker and the documents manager */
291
+ /* B15 the product picker */
235
292
  {
236
- const base = F.facts(), docs3 = Object.assign({}, base.docs, { docs: base.docs.docs.concat([F.doc('intake', 'Intake log'), F.doc('roadmap', 'Roadmap note')]) });
237
- const D = await open({ model: BP.build(Object.assign({}, base, { docs: docs3 })) });
238
- const q = D.page;
239
- ok('B15 the picker names the board, has no switcher for one board, and the Board has no chat button', await q.evaluate(() => document.querySelector('#crBoard').disabled && document.querySelector('#crBoard').textContent === 'pmos' && document.querySelector('#crSw').hidden && !document.querySelector('#crAsk') && !document.querySelector('#askIn')));
240
- await q.click('#tabDocs');
241
- const dm = await q.evaluate(() => ({ cap: document.querySelector('#docCap').textContent, sum: document.querySelector('.dsum').textContent.replace(/\s+/g, ' '), bar: document.querySelectorAll('.dprog i').length, tabs: [...document.querySelectorAll('#dmF button')].map((b) => b.textContent.replace(/\s+/g, '')).join(','), link: (document.querySelector('.dsum .dlink') || {}).textContent }));
242
- ok('B15 the documents have the summary, progress bar, filter and search, from one set of counts', dm.cap === '8' && /1 draft to review/.test(dm.sum) && /5 not started/.test(dm.sum) && /1 up to date/.test(dm.sum) && dm.bar === 8 && dm.tabs === 'All8,Notstarted5,Draft1,Uptodate1' && /Draft the 3 not started/.test(dm.link || ''), JSON.stringify(dm));
243
- await q.click('#dmF [data-dmf="all"]'); await q.fill('#dmQ', 'intake'); ok('B15 the search finds a document and keeps the focus', (await q.evaluate(() => [...document.querySelectorAll('#docBody .dmn b')].map((b) => b.textContent))).join('|') === 'Intake log' && await q.evaluate(() => document.activeElement.id === 'dmQ'));
244
- await q.fill('#dmQ', 'zzz'); ok('B15 no match says so', /No document matches/.test(await q.evaluate(() => document.querySelector('#docBody').textContent))); await q.fill('#dmQ', '');
245
- D.set({ status: 200, body: { ok: true, run: 'rb' } }); const nb = D.posts.length; await q.click('.dsum .dlink');
246
- ok('B15 "Draft the 3 not started" posts one draft for each, with the board\'s scope, and nothing else', await until(() => D.posts.slice(nb).filter((x) => x.path === '/api/core-docs/draft').map((x) => x.body.key).sort().join() === 'charter,intake,roadmap' && D.posts.slice(nb).every((x) => x.path === '/api/core-docs/draft' && x.body.scope === 'board:w1' && Object.keys(x.body).sort().join() === 'key,scope,ws')));
247
- ok('0 no page error on the documents manager', D.errors.length === 0, D.errors.join(' | '));
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')));
248
295
  await D.ctx.close();
249
296
  }
250
297
 
@@ -259,31 +306,108 @@ const mk = (o) => BP.build(F.facts(o));
259
306
  const c2 = await browser.newContext({ viewport: { width: 1280, height: 900 } }), p2 = await c2.newPage();
260
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' }) }));
261
308
  await p2.goto(BASE + '/premium-board.html');
262
- ok('B2 a failed read says why and draws nothing', await until(() => p2.evaluate(() => /The reason: the board could not be read/.test(document.querySelector('#brief').textContent) && document.querySelectorAll('#ibBody .ini2').length === 0), 4000));
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));
263
310
  await c2.close();
264
311
  }
265
312
 
266
- /* B13 floors: the phone */
313
+ /* B13 floors: the phone (AgBoardPhone, AgBoardPhoneSheet, AgBoardTimelinePhone) */
267
314
  for (const theme of ['light', 'dark']) {
268
315
  const R = await open({ w: 390, h: 844, theme, model: BP.build(FJ.facts()) }), q = R.page;
269
- const m = await q.evaluate(() => { const small = [...document.querySelectorAll('#ibTabs button, #ibBody .ini2, #ibBody .inim, #bdChipset .cz-chip, .cz-tab, #newIni, #bdFind')].filter((b) => !b.closest('[hidden]') && b.getBoundingClientRect().height > 0 && b.getBoundingClientRect().height < 44).map((b) => b.className + ':' + Math.round(b.getBoundingClientRect().height)); const fab = document.querySelector('#czFab').getBoundingClientRect(); return { over: document.documentElement.scrollWidth > innerWidth + 1, small, fabRight: Math.round(innerWidth - fab.right), top: Math.round(document.querySelector('.bd-hd').getBoundingClientRect().height) }; });
270
- ok(`B13 at 390 px (${theme}) the page has no sideways scroll, the top bar is one line, the menu sits bottom right, and every control is 44 px`, !m.over && m.small.length === 0 && m.fabRight < 40 && m.top <= 56, JSON.stringify(m));
271
- await view(q, 'stages'); const s1 = await q.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1);
272
- await view(q, 'time'); const s2 = await q.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1);
273
- ok(`B13 at 390 px (${theme}) the stage and timeline views do not scroll sideways`, s1 && s2);
274
- await view(q, 'track'); await q.locator('#ibBody .bt-l[data-row="board:sso-partners"] .bt-nm').click();
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();
275
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 }; }));
276
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));
277
- await q.click('#peek [data-pk="record"]'); await until(() => q.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(900);
278
- const d = await q.evaluate(() => { const r = document.querySelector('#dlg').getBoundingClientRect(); return { l: Math.round(r.left), w: Math.round(r.width), vw: innerWidth, tabs: getComputedStyle(document.querySelector('#dTabs')).display }; });
279
- ok(`B13 at 390 px (${theme}) the record dialog is full width and its Detail / Conversation switch is shown`, d.l === 0 && d.w === d.vw && d.tabs !== 'none', JSON.stringify(d));
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'))));
280
326
  ok(`0 no page error at 390 px (${theme})`, R.errors.length === 0, R.errors.join(' | '));
281
327
  await R.ctx.close();
282
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) */
331
+ {
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 */
283
408
  {
284
- const R = await open(); await R.page.locator('#ibBody .bt-nm').first().focus(); await R.page.keyboard.press('Enter'); await until(() => R.page.evaluate(() => !document.querySelector('#peek').hidden));
285
- await R.page.click('#peek [data-pk="record"]'); await until(() => R.page.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
286
- ok('B13 the page behind a dialog is inert', await R.page.evaluate(() => ['main.stage', '#dock'].every((s) => document.querySelector(s).inert)));
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"]'))));
287
411
  await R.ctx.close();
288
412
  }
289
413
 
@@ -301,7 +425,7 @@ const mk = (o) => BP.build(F.facts(o));
301
425
  const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), pg = await ctx.newPage(), errs = [];
302
426
  pg.on('pageerror', (e) => errs.push(String(e)));
303
427
  await pg.goto(BASE + '/premium-board.html');
304
- ok('E5 the real page draws this repository\'s board and its counts agree with the route', await until(() => pg.evaluate((cap) => document.querySelectorAll('#ibBody .ini2').length > 0 && document.querySelector('#iniCap').textContent.replace(/\s+/g, ' ').startsWith(cap), `${m.initiatives.on} of ${m.initiatives.open} open on track`), 30000));
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));
305
429
  ok('E6 the real page has no script error', errs.length === 0, errs.join(' | '));
306
430
  await ctx.close();
307
431
  }