create-pmos 0.396.0 → 0.397.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 (98) hide show
  1. package/package.json +13 -13
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/scripts/nine-stages.js +49 -20
  6. package/payload/state/discoveries.md +1 -1
  7. package/workspace/briefing-premium-adddoc-test.js +20 -40
  8. package/workspace/briefing-premium-board-test.js +145 -107
  9. package/workspace/briefing-premium-calendar-2-test.js +5 -2
  10. package/workspace/briefing-premium-calendar-3-test.js +13 -8
  11. package/workspace/briefing-premium-calendar-test.js +16 -5
  12. package/workspace/briefing-premium-initiative-test.js +50 -41
  13. package/workspace/briefing-premium-insights-test.js +104 -85
  14. package/workspace/briefing-premium-metrics-test.js +11 -32
  15. package/workspace/briefing-premium-sources-test.js +42 -21
  16. package/workspace/briefing-premium-test.js +112 -98
  17. package/workspace/briefing-premium-work-test.js +78 -64
  18. package/workspace/changelog.json +12 -0
  19. package/workspace/fixtures/board-premium-facts.js +2 -1
  20. package/workspace/fixtures/board-premium-jira.js +28 -0
  21. package/workspace/fixtures/initiative-premium-facts.js +2 -1
  22. package/workspace/fixtures/initiatives-api/list.json +30 -42
  23. package/workspace/fixtures/initiatives-api/roadmap.json +40 -56
  24. package/workspace/fixtures/initiatives-api/sheet.json +10 -14
  25. package/workspace/fixtures/insights-premium-facts.js +11 -2
  26. package/workspace/guide/index.md +1 -0
  27. package/workspace/guide/lifecycle.md +51 -0
  28. package/workspace/home-shot.js +38 -0
  29. package/workspace/lib/board-premium.js +92 -1
  30. package/workspace/lib/engine/boards.js +15 -14
  31. package/workspace/lib/engine/nine-stages.js +49 -20
  32. package/workspace/lib/engine/signals/detectors.js +13 -11
  33. package/workspace/lib/insights-premium.js +78 -1
  34. package/workspace/lib/routes-board-premium.js +3 -2
  35. package/workspace/lib/routes-initiatives.js +1 -1
  36. package/workspace/lib/routes-insights-premium.js +8 -1
  37. package/workspace/lib/vendor/scripts/nine-stages.js +49 -20
  38. package/workspace/package-lock.json +2 -2
  39. package/workspace/package.json +1 -1
  40. package/workspace/premium-agreed-viewer-shots.js +76 -0
  41. package/workspace/premium-board-actions-test.js +2 -0
  42. package/workspace/premium-chat-chart-tab-test.js +6 -5
  43. package/workspace/premium-chat-context-test.js +8 -6
  44. package/workspace/premium-chat-goal-view-test.js +9 -7
  45. package/workspace/premium-chat-notes-test.js +3 -2
  46. package/workspace/premium-chat-report-tab-test.js +8 -2
  47. package/workspace/premium-chat-term-test.js +3 -1
  48. package/workspace/premium-chat-viewer-test.js +23 -17
  49. package/workspace/premium-core-doc-issue-test.js +2 -0
  50. package/workspace/premium-html-viewer-test.js +4 -2
  51. package/workspace/premium-phone-card-test.js +1 -0
  52. package/workspace/premium-phone-room-test.js +16 -11
  53. package/workspace/premium-report-read-test.js +1 -1
  54. package/workspace/premium-vw-backlog-test.js +2 -0
  55. package/workspace/premium-vw-cal-test.js +9 -4
  56. package/workspace/premium-vw-doc-test.js +1 -1
  57. package/workspace/premium-vw-item-test.js +1 -0
  58. package/workspace/premium-vw-jira-test.js +4 -1
  59. package/workspace/premium-vw-notes-test.js +2 -1
  60. package/workspace/premium-vw-rec-test.js +3 -2
  61. package/workspace/premium-vw-slides-test.js +2 -2
  62. package/workspace/premium-work-depth-test.js +7 -3
  63. package/workspace/public/pm/bd-span.js +120 -0
  64. package/workspace/public/pm/bd-stages.js +33 -0
  65. package/workspace/public/pm/cozy-board.css +373 -0
  66. package/workspace/public/pm/cozy-home.css +152 -0
  67. package/workspace/public/pm/cozy-home.js +170 -0
  68. package/workspace/public/pm/cozy-initiative.css +138 -0
  69. package/workspace/public/pm/cozy-insights.css +292 -0
  70. package/workspace/public/pm/cozy-nav.js +54 -0
  71. package/workspace/public/pm/cozy-viewer.css +143 -0
  72. package/workspace/public/pm/cozy.css +172 -0
  73. package/workspace/public/pm/lifecycle-lens-model.js +45 -27
  74. package/workspace/public/pm/lifecycle-lens.js +22 -11
  75. package/workspace/public/pm/premium-board.js +329 -67
  76. package/workspace/public/pm/premium-brief.js +1 -1
  77. package/workspace/public/pm/premium-chat.js +17 -10
  78. package/workspace/public/pm/premium-initiative-head.js +138 -0
  79. package/workspace/public/pm/premium-initiative.js +28 -4
  80. package/workspace/public/pm/premium-insights.js +530 -244
  81. package/workspace/public/pm/premium-shell.js +40 -10
  82. package/workspace/public/pm/premium-viewer.js +5 -0
  83. package/workspace/public/pm/premium-vw-jira-model.js +22 -5
  84. package/workspace/public/pm/premium-vw-jira.css +11 -0
  85. package/workspace/public/pm/premium-vw-jira.js +11 -4
  86. package/workspace/public/pm/premium-vw-rec.js +5 -2
  87. package/workspace/public/pm/premium-work.js +18 -8
  88. package/workspace/public/pm/premium.js +19 -6
  89. package/workspace/public/premium-board.html +82 -47
  90. package/workspace/public/premium-chat.html +7 -33
  91. package/workspace/public/premium-initiative.html +15 -8
  92. package/workspace/public/premium-insights.html +82 -43
  93. package/workspace/public/premium-work.html +6 -72
  94. package/workspace/public/premium.html +61 -15
  95. package/workspace/public/vendor/nunito-var.woff2 +0 -0
  96. package/workspace/server.js +7 -0
  97. package/workspace/test-lists/premium-agreed-viewer.json +9 -0
  98. package/workspace/third-party/README.md +1 -0
@@ -6,12 +6,9 @@
6
6
  * M1 rail and place · M2 hero · M3 add · M4 the plate · M5 agents (held controls) · M6 waiting · M7 review · M8 presses · M9 one count
7
7
  * M10 header · M11 refusals · M12 floors and fidelity against the mockup
8
8
  */
9
- const fs = require('fs');
10
9
  const path = require('path');
11
10
  const { spawn } = require('child_process');
12
11
  const { findBrowser } = require('./lib/find-browser');
13
- const CT = require('./lib/premium-console-type'); // the mockup is read with the console's type (PM, 2026-10-19), as premium.css is
14
- const CT_VENDOR = 'file://' + path.join(__dirname, 'public', 'vendor') + '/';
15
12
  const T = require('./test-run').configure({ name: 'briefing-premium-work' });
16
13
  const WP = require('./lib/my-work-premium.js');
17
14
  const F = require('./fixtures/my-work-premium-facts.js');
@@ -21,6 +18,8 @@ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
21
18
  const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
22
19
  /* the Work queue shows one tab at a time: bring up the tab that holds a row before pressing it (each press redraws the tab row, so the button is found again) */
23
20
  const showKey = (pg, key) => pg.evaluate((key) => { const has = () => document.querySelector(`#qBody .wrow[data-key="${key}"], #waitBody .wrow[data-key="${key}"]`); if (has()) return true; for (const k of [...document.querySelectorAll('#qTabs .qtb, #qMenu .qtb')].map((b) => b.dataset.tab)) { document.querySelector(`#qTabs [data-tab="${k}"], #qMenu [data-tab="${k}"]`).click(); if (has()) return true; } return false; }, key);
21
+ /* re-pointed for premium-agreed-design: on a desktop Home the dialog is the docked chat and is always on, so "a dialog is open" below means a row's
22
+ * dialog: #dlg is on and, when docked, not showing your own chat (its eyebrow reads Chat) */
24
23
  const results = [];
25
24
  const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
26
25
  /* the dialog's fields (premium-simple-ui): a field opens its panel; When holds Today, Not yet, Not before and Someday */
@@ -40,7 +39,6 @@ const finish = async (code) => {
40
39
  process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
41
40
 
42
41
  const mk = () => WP.build({ v: F.view(), now: F.NOW });
43
- const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'briefing-artifact.html');
44
42
 
45
43
  (async () => {
46
44
  const exe = findBrowser();
@@ -73,35 +71,50 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
73
71
 
74
72
  /* M1 */
75
73
  const rail = await p.evaluate(() => ({ names: [...document.querySelectorAll('.rail .pl')].map((b) => b.textContent.trim()), cur: document.querySelector('.rail [aria-current="page"]').textContent.trim(), go: [...document.querySelectorAll('.rail [data-go]')].map((b) => b.dataset.go), pi: getComputedStyle(document.querySelector('.rail')).getPropertyValue('--pi').trim(), title: document.title }));
76
- ok('M1 the rail names five places, My work is current and the indicator sits on it', rail.names.join() === 'Briefing,My work,Chat,Board,Insights' && rail.cur === 'My work' && rail.go.join() === 'brief,work,chat,init,rep' && rail.pi === '1', JSON.stringify(rail));
74
+ // premium-agreed-design H3: My work opens Home, which holds the Work queue; the floating place menu replaces the rail and marks Home
75
+ const nav = await p.evaluate(() => ({ cur: (document.querySelector('#czMenu [aria-current="page"]') || {}).textContent || '', railShown: !!document.querySelector('.rail') && getComputedStyle(document.querySelector('.rail')).display !== 'none' }));
76
+ ok('M1 My work opens Home: the place menu marks Home and the rail is not on screen', /PMOS · Home/.test(rail.title) && nav.cur === 'Home' && !nav.railShown, JSON.stringify({ rail, nav }));
77
77
  { await p.click('#moreBtn'); const tc = await p.evaluate(() => { const a = document.querySelector('#toConsole'); if (!a) return null; const r = a.getBoundingClientRect(); return { href: a.getAttribute('href'), label: a.getAttribute('aria-label'), w: Math.round(r.width), h: Math.round(r.height), tab: a.tabIndex }; }); ok('M1 the ⋯ menu links to the console (premium-console-link, premium-topbar)', tc && tc.href === '/console.html' && tc.label === 'Open the console' && tc.w >= 44 && tc.h >= 44 && tc.tab === 0, JSON.stringify(tc)); await p.keyboard.press('Escape'); }
78
78
  const res = await fetch(BASE + '/premium-work').then((r) => r.status);
79
79
  ok('M13 My work has no Calendar card: the Briefing holds the calendar (premium-calendar-card A1)', await p.evaluate(() => !document.querySelector('#weekCard') && ![...document.querySelectorAll('h2')].some((h) => /Calendar|This week/.test(h.textContent))));
80
80
  ok('M1 the page is served at /premium-work and /premium-work.html', res === 200 && (await fetch(BASE + '/premium-work.html')).status === 200);
81
81
  {
82
- const r2 = await open(); await r2.page.locator('.rail [data-go="brief"]').click();
82
+ // re-pointed for premium-agreed-design: the rail is hidden and the floating place menu replaces it; its Home entry opens the Briefing (Home) page
83
+ const r2 = await open(); await r2.page.click('#czFab'); await r2.page.locator('#czMenu a[href="/premium.html"]').click();
83
84
  ok('M1 the Briefing button opens the Briefing page', await until(() => /\/premium\.html$/.test(r2.page.url()), 5000), r2.page.url());
84
85
  await r2.ctx.close();
85
86
  }
86
87
 
87
88
  /* M2 */
88
- const hero = await p.evaluate(() => ({ text: document.querySelector('#brief').textContent, k: [...document.querySelectorAll('#brief .k')].map((x) => x.textContent) }));
89
- ok('M2 the hero is the model\'s sentences, numbers marked', hero.text === M.hero.map((s) => s.parts.map((x) => x.t).join('')).join(' ') && hero.k.length >= 5, hero.text);
90
- ok('M2 the hero says what the records hold', /Three new in your inbox, one overdue, one due today\./.test(hero.text) && /longest for 8 days/.test(hero.text));
89
+ // re-pointed for premium-agreed-design: My work opens Home, whose hero is the Briefing's; what the list holds is said by the Work queue's caption
90
+ // (the count marked) and its tabs, and the waiting card's caption
91
+ const hero = await p.evaluate(() => ({ text: document.querySelector('#qCap').textContent, k: [...document.querySelectorAll('#qCap b')].map((x) => x.textContent), tabs: [...document.querySelectorAll('#qTabs .qtb, #qMenu .qtb')].map((b) => b.textContent).join(), wait: document.querySelector('#waitCap').textContent }));
92
+ ok('M2 the hero is the model\'s sentences, numbers marked', hero.text === [M.queue.n + ' to clear', ...M.queue.cap].join(' · ') && hero.k.join() === String(M.queue.n), hero.text);
93
+ ok('M2 the hero says what the records hold', /Today3/.test(hero.tabs) && /Inbox4/.test(hero.tabs) && hero.wait === 'longest 8 days', JSON.stringify(hero));
91
94
 
92
95
  /* M10 */
93
- ok('M10 the header says what is real and that Jira and Slack appear only when read', /^Real data · as of 18:05/.test(await txt('#snap')) && /only when an agent session has read them/.test(await txt('#snap')));
96
+ // re-pointed for premium-agreed-design: Home's header is the Briefing's (its own suites read it), so what is real about the list is said by the
97
+ // Work queue itself: the Inbox names Jira and Slack as the source of what they hold, and the Done tab says their items close there, not here
98
+ {
99
+ const r10 = await open(), pg10 = r10.page;
100
+ await pg10.click('#qTabs [data-tab="inbox"]'); const inb = await pg10.evaluate(() => document.querySelector('#qBody').textContent);
101
+ await pg10.click('#qMore'); await pg10.click('#qMenu [data-tab="done"]'); const dn = await pg10.evaluate(() => document.querySelector('#qNote').textContent);
102
+ ok('M10 the header says what is real and that Jira and Slack appear only when read', /New from Jira and Slack/.test(inb) && /Items from Jira or Slack close there, not here/.test(dn), dn);
103
+ await r10.ctx.close();
104
+ }
94
105
 
95
106
  /* M4 the Work queue: one card, a tab for each place a thing waits */
96
107
  const qtab = async (k) => { if (!(await p.locator(`#qTabs [data-tab="${k}"]`).count())) await p.click('#qMore'); await p.click(`#qTabs [data-tab="${k}"], #qMenu [data-tab="${k}"]`); };
97
- const q = await p.evaluate(() => ({ tabs: [...document.querySelectorAll('#qTabs .qtb')].map((b) => b.textContent), rest: [...document.querySelectorAll('#qMenu .qtb')].map((b) => b.textContent), menuShut: document.querySelector('#qMenu').hidden && document.querySelector('#qMore').getAttribute('aria-expanded') === 'false', sel: [...document.querySelectorAll('#qTabs [aria-selected="true"]')].map((b) => b.dataset.tab), tops: new Set([...document.querySelectorAll('#qTabs .qtb')].map((b) => Math.round(b.getBoundingClientRect().top))).size, cap: document.querySelector('#qCap').textContent, first: [...document.querySelectorAll('.tgf')].map((x) => x.closest('.wrow').dataset.key), titles: [...document.querySelectorAll('#qBody .wtit')].map((x) => x.textContent.replace('Do this first', '')), chips: [...document.querySelectorAll('#qBody .due')].map((x) => x.textContent), od: [...document.querySelectorAll('#qBody .due.od')].length, ck: [...document.querySelectorAll('#qBody .wck')].map((b) => Math.round(b.getBoundingClientRect().height)), cols: getComputedStyle(document.querySelector('#qBody')).gridTemplateColumns.split(' ').length, old: ['#plate', '#agCard', '#trayCard'].filter((x) => document.querySelector(x)), title: document.querySelector('#hQueue').textContent }));
98
- ok('M4 one Work queue card replaces On your plate, With agents and the tray', q.title === 'Work queue' && q.old.length === 0, JSON.stringify(q));
108
+ const q = await p.evaluate(() => ({ tabs: [...document.querySelectorAll('#qTabs .qtb')].map((b) => b.textContent), rest: [...document.querySelectorAll('#qMenu .qtb')].map((b) => b.textContent), menuShut: document.querySelector('#qMenu').hidden && document.querySelector('#qMore').getAttribute('aria-expanded') === 'false', sel: [...document.querySelectorAll('#qTabs [aria-selected="true"]')].map((b) => b.dataset.tab), tops: new Set([...document.querySelectorAll('#qTabs .qtb')].map((b) => Math.round(b.getBoundingClientRect().top))).size, cap: document.querySelector('#qCap').textContent, first: [...document.querySelectorAll('.tgf')].map((x) => x.closest('.wrow').dataset.key), titles: [...document.querySelectorAll('#qBody .wtit')].map((x) => x.textContent.replace('Do this first', '')), chips: [...document.querySelectorAll('#qBody .due')].map((x) => x.textContent), od: [...document.querySelectorAll('#qBody .due.od')].length, ck: [...document.querySelectorAll('#qBody .wck')].map((b) => Math.round(b.getBoundingClientRect().height)), cols: new Set([...document.querySelectorAll('#qBody > *')].map((e) => Math.round(e.getBoundingClientRect().left))).size, old: ['#plate', '#agCard', '#trayCard'].filter((x) => document.querySelector(x)), title: document.querySelector('#hQueue').textContent }));
109
+ // re-pointed for premium-agreed-design: on Home the Work queue card is headed "Your list"
110
+ ok('M4 one Work queue card replaces On your plate, With agents and the tray', q.title === 'Your list' && q.old.length === 0, JSON.stringify(q));
99
111
  ok('M4 Today and Inbox sit in one pill row with their counts; Upcoming, Someday, Kept and Done wait under a shut More (no Agents tab); the card opens on Today', q.tabs.join() === 'Today3,Inbox4' && q.rest.join() === 'Upcoming2,Someday1,Kept0,Done0' && q.menuShut && q.sel.join() === 'today' && q.tops === 1, JSON.stringify(q));
100
112
  await p.click('#qMore'); await p.click('#qMenu [data-tab="someday"]');
101
113
  const mo = await p.evaluate(() => ({ row: [...document.querySelectorAll('#qTabs .qtb')].map((b) => b.dataset.tab), sel: document.querySelector('#qTabs [aria-selected="true"]').dataset.tab, shut: document.querySelector('#qMenu').hidden, n: document.querySelectorAll('#qBody .wrow').length }));
102
114
  ok('M4 a tab picked under More takes its place in the row, is chosen, and the menu shuts', mo.row.join() === 'today,inbox,someday' && mo.sel === 'someday' && mo.shut && mo.n === 1, JSON.stringify(mo));
103
115
  await qtab('today');
104
- ok('M4 Today holds its rows in two columns, with a due chip only where a date was set; the overdue one says so', q.cols === 2 && q.titles.length === 3 && q.titles[0] === 'Sign off the fit-out contractor shortlist' && q.chips.join() === 'Overdue · 15 Oct,Today' && q.od === 1, JSON.stringify(q));
116
+ // re-pointed for premium-agreed-design: on a desktop Home the list sits in the left column, so its rows stack in one column
117
+ ok('M4 Today holds its rows in two columns, with a due chip only where a date was set; the overdue one says so', q.cols === 1 && q.titles.length === 3 && q.titles[0] === 'Sign off the fit-out contractor shortlist' && q.chips.join() === 'Overdue · 15 Oct,Today' && q.od === 1, JSON.stringify(q));
105
118
  ok('M4 "Do this first" tags the overdue item only, and a check circle is 44 px', q.first.length === 1 && q.first[0] === 'work:wbs:alpha:4.2' && q.ck.length === 3 && q.ck.every((h) => h >= 44), JSON.stringify([q.first, q.ck]));
106
119
  const dec = await p.evaluate(() => { const b = document.querySelector('#qBody .wrow[data-key="work:wbs:alpha:4.2"] .wck'); const r = b.closest('.wrow'); return { dec: b.classList.contains('dec'), eye: !!b.querySelector('circle'), label: b.getAttribute('aria-label'), first: r.classList.contains('first'), tagBlock: getComputedStyle(r.querySelector('.tgf')).display, bar: getComputedStyle(r).boxShadow !== 'none', others: [...document.querySelectorAll('#qBody .wck')].filter((x) => x !== b).every((x) => !x.classList.contains('dec')) }; });
107
120
  ok('M4 an item whose agent draft is ready has a highlighted eye circle (not a check), the first overdue row carries the ember bar and its tag sits on its own line', dec.dec && dec.eye && /^Review the agent draft/.test(dec.label) && dec.first && dec.tagBlock === 'block' && dec.bar && dec.others, JSON.stringify(dec));
@@ -129,15 +142,16 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
129
142
  ok('M7 the untouched card counts the items from the review list', !rv.hidden && /^2 items have sat untouched for 7 days/.test(rv.txt), JSON.stringify(rv));
130
143
 
131
144
  /* M9 */
132
- ok('M9 the hero, the Work queue and the dock agree on one count', await p.evaluate(() => /^7 to clear/.test(document.querySelector('#qCap').textContent) && document.querySelector('#dN').textContent === '7' && document.querySelector('#dLab').textContent === 'to clear'));
145
+ // re-pointed for premium-agreed-design: Home has no My work hero or dock; the caption's count must agree with the Today and Inbox tabs it counts
146
+ ok('M9 the hero, the Work queue and the dock agree on one count', await p.evaluate(() => /^7 to clear/.test(document.querySelector('#qCap').textContent) && ['today', 'inbox'].map((k) => Number(document.querySelector(`#qTabs [data-tab="${k}"] em, #qTabs [data-tab="${k}"]`).textContent.replace(/\D/g, ''))).reduce((a, b) => a + b, 0) === 7));
133
147
 
134
148
  /* M3 add */
135
149
  A.set({ status: 200, body: { ok: true, item: { id: 'item-new', title: 'Reply to Lee', due: null, priority: 'P1' } } });
136
150
  { const v = F.view(); v.work.inbox.push(F.it('item-new', 'Reply to Lee', { priority: 'P1' })); A.setModel(WP.build({ v, now: F.NOW })); }
137
151
  await p.fill('#capIn', 'Reply to Lee !p1'); await p.press('#capIn', 'Enter');
138
152
  ok('M3 one line is posted to the Work page\'s add route, and the page shows what was read', await until(() => A.posts.some((x) => x.path === '/api/pm-items/add' && x.body.line === 'Reply to Lee !p1' && Object.keys(x.body).join() === 'line')) && await until(() => txt('#capHint').then((t) => /Added: Reply to Lee \(P1\)\. It is in your inbox until you place it\./.test(t))));
139
- ok('M3 a new item lands in the Inbox tab under Added by you, and its dialog opens at once so it can be placed', await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && document.querySelector('#dTitle').textContent === 'Reply to Lee' && /Inbox, added by you/.test(document.querySelector('#oMain').textContent) && document.querySelector('#qBody').dataset.tab === 'inbox' && !!document.querySelector('#qBody [data-key="work:item-new"]')), 6000));
140
- await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on'))); A.setModel(mk());
153
+ ok('M3 a new item lands in the Inbox tab under Added by you, and its dialog opens at once so it can be placed', await until(() => p.evaluate(() => (document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent))) && document.querySelector('#dTitle').textContent === 'Reply to Lee' && /Inbox, added by you/.test(document.querySelector('#oMain').textContent) && document.querySelector('#qBody').dataset.tab === 'inbox' && !!document.querySelector('#qBody [data-key="work:item-new"]')), 6000));
154
+ await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !(document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent))))); A.setModel(mk());
141
155
  const n0 = A.posts.length; await p.fill('#capIn', ' '); await p.press('#capIn', 'Enter'); await sleep(200);
142
156
  ok('M3 an empty line is not posted', A.posts.length === n0 && /Write one line/.test(await txt('#capHint')));
143
157
  ok('M3 a message about a press stays on screen after the box loses focus', await p.evaluate(() => { document.activeElement.blur(); return getComputedStyle(document.querySelector('#capHint')).display !== 'none'; }));
@@ -148,12 +162,12 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
148
162
  /* M8 presses from a check circle, and from the dialog */
149
163
  {
150
164
  const n = A.posts.length;
151
- await showKey(p, 'work:wbs:alpha:4.2'); await p.locator('.wrow[data-key="work:wbs:alpha:4.2"] .wck.dec').click(); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
165
+ await showKey(p, 'work:wbs:alpha:4.2'); await p.locator('.wrow[data-key="work:wbs:alpha:4.2"] .wck.dec').click(); await until(() => p.evaluate(() => (document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent))))); await sleep(500);
152
166
  ok('M8 the eye circle opens the item to review the draft and posts nothing', A.posts.length === n && (await p.textContent('#dTitle')) === 'Sign off the fit-out contractor shortlist' && /Agent draft · not checked/.test(await p.textContent('#oMain')));
153
- await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
167
+ await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !(document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent)))));
154
168
  }
155
- const openKey = async (key) => { await showKey(p, key); await p.locator(`.wrow[data-key="${key}"] .wrh`).first().click(); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(700); };
156
- const shut = async () => { await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on'))); };
169
+ const openKey = async (key) => { await showKey(p, key); await p.locator(`.wrow[data-key="${key}"] .wrh`).first().click(); await until(() => p.evaluate(() => (document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent))))); await sleep(700); };
170
+ const shut = async () => { await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !(document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent))))); };
157
171
  const lastPost = () => A.posts[A.posts.length - 1];
158
172
  A.set({ status: 200, body: { ok: true } });
159
173
  const g0 = A.gets();
@@ -170,29 +184,29 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
170
184
  await field(p, 'wait'); dlg.wDis = await p.evaluate(() => document.querySelector('#wBtn').disabled);
171
185
  ok('M8 a dialog shows Edit ▾ and Done in its switch row, the fields closed behind Edit and out of the conversation; the fields are the agent, When, Waiting on, Who does it, Priority · Due; When holds Today, Not yet, Not before and Someday; Waiting needs a name', dlg.title === 'Decide how partial refunds are handled'
172
186
  && dlg.fields === 'The agent,When,Waiting on,Who does it,Priority · Due' && /^Inbox/.test(dlg.when) && dlg.bar === 'EditInbox,Done,Drop it' && dlg.solid === 1 && dlg.shut && dlg.row
173
- && dlg.opts === 'Today,Later today,Tomorrow,Next week,Not before a date…,Someday' && dlg.mod === 'true' && dlg.ask && dlg.wDis, JSON.stringify(dlg));
187
+ && dlg.opts === 'Today,Later today,Tomorrow,Next week,Not before a date…,Someday' && dlg.mod === 'false' /* re-pointed for premium-agreed-design: docked on Home the dialog is not modal (the list beside it stays live) */ && dlg.ask && dlg.wDis, JSON.stringify(dlg));
174
188
  await more(p);
175
189
  await p.locator('#card [data-p="notyet"][data-when="tomorrow"]').click();
176
- ok('M8 Not yet posts the item and the day, and closes the dialog', await until(() => A.posts.some((x) => x.path === '/api/pm-items/notyet' && x.body.id === 'item-aaaaaaaaaaa1' && x.body.when === 'tomorrow' && Object.keys(x.body).sort().join() === 'id,when')) && await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on'))));
190
+ ok('M8 Not yet posts the item and the day, and closes the dialog', await until(() => A.posts.some((x) => x.path === '/api/pm-items/notyet' && x.body.id === 'item-aaaaaaaaaaa1' && x.body.when === 'tomorrow' && Object.keys(x.body).sort().join() === 'id,when')) && await until(() => p.evaluate(() => !(document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent))))));
177
191
  for (const [sel, route, check] of [['[data-p="flag"]', '/api/pm-items/flag', (b) => b.flagged === true], ['[data-p="xt"][data-k="someday"]', '/api/pm-items/someday', (b) => Object.keys(b).join() === 'id'], ['[data-p="done"]', '/api/pm-items/done', (b) => Object.keys(b).join() === 'id'], ['[data-p="remove"]', '/api/pm-items/remove', (b) => Object.keys(b).join() === 'id']]) {
178
192
  await openKey('work:item-aaaaaaaaaaa2'); const n = A.posts.length;
179
193
  if (sel.includes('someday') || sel.includes('flag')) await more(p);
180
194
  if (sel.includes('remove')) await sheet(p);
181
195
  await p.locator('#card ' + sel).click();
182
196
  ok(`M8 ${route.split('/').pop()} posts exactly what the Work page's route takes`, await until(() => A.posts.length > n && lastPost().path === route && lastPost().body.id === 'item-aaaaaaaaaaa2' && check(lastPost().body)), JSON.stringify(lastPost()));
183
- await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
197
+ await until(() => p.evaluate(() => !(document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent)))));
184
198
  }
185
199
  ok('M8 Done and Drop offer Undo for a short time', await p.evaluate(() => /Undo/.test(document.querySelector('#toast').textContent)));
186
200
  await openKey('work:item-aaaaaaaaaaa3'); await field(p, 'wait'); await p.fill('#wOn', ' Priya ');
187
201
  ok('M8 Waiting needs a name', await p.evaluate(() => !document.querySelector('#wBtn').disabled));
188
202
  await p.click('#wBtn');
189
203
  ok('M8 Waiting posts the name', await until(() => A.posts.some((x) => x.path === '/api/pm-items/waiting' && x.body.id === 'item-aaaaaaaaaaa3' && x.body.on === 'Priya')));
190
- await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
204
+ await until(() => p.evaluate(() => !(document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent)))));
191
205
  await openKey('work:item-ddddddddddd1');
192
206
  ok('M7 an item on the review list offers Keep, and Keep posts it', await p.evaluate(() => !!document.querySelector('#card [data-p="keep"]')));
193
207
  await sheet(p); await p.click('#card [data-p="keep"]');
194
208
  ok('M7 Keep posts the item id only', await until(() => A.posts.some((x) => x.path === '/api/pm-items/keep' && Object.keys(x.body).join() === 'id' && x.body.id === 'item-ddddddddddd1')));
195
- await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
209
+ await until(() => p.evaluate(() => !(document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent)))));
196
210
  ok('M8 no press carried a writer field', A.posts.every((x) => !['by', 'via', 'at', 'actor', 'pm', 'nonce'].some((k) => k in x.body)));
197
211
  const mint = await T.nonce(BASE);
198
212
  ok('M8 every press carried the launch nonce', !!mint && A.posts.filter((x) => x.path.startsWith('/api/pm-items/')).every((x) => x.headers['x-pmos-nonce'] === mint));
@@ -200,7 +214,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
200
214
  /* M11 refusal */
201
215
  A.set({ status: 409, body: { ok: false, error: 'that item is already done' } });
202
216
  await openKey('work:item-ccccccccccc1'); await p.locator('#card [data-p="done"]').click();
203
- ok('M11 a refused press shows the route\'s reason, keeps the dialog open and turns the buttons back on', await until(() => p.evaluate(() => !document.querySelector('#cardErr').hidden && /already done/.test(document.querySelector('#cardErr').textContent) && document.querySelector('#dlg').classList.contains('on') && !document.querySelector('#card [data-p="done"]').disabled)));
217
+ ok('M11 a refused press shows the route\'s reason, keeps the dialog open and turns the buttons back on', await until(() => p.evaluate(() => !document.querySelector('#cardErr').hidden && /already done/.test(document.querySelector('#cardErr').textContent) && (document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent))) && !document.querySelector('#card [data-p="done"]').disabled)));
204
218
  A.set({ status: 200, body: { ok: true } });
205
219
 
206
220
  /* agent beside the item */
@@ -218,7 +232,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
218
232
  /* M2 / M4 degraded: an empty list */
219
233
  {
220
234
  const E = await open({ model: WP.build({ v: { today: '2026-10-16', work: {} }, now: F.NOW }) });
221
- ok('M2 an empty list says so, in one sentence, and the Work queue says nothing is placed for today', await E.page.evaluate(() => document.querySelector('#brief').textContent === 'Your list is empty.' && /Nothing is placed for today/.test(document.querySelector('#qBody').textContent) && document.querySelector('#revCard').hidden && /Nobody owes you anything/.test(document.querySelector('#waitBody').textContent) && document.querySelector('#dN').textContent === '0'));
235
+ ok('M2 an empty list says so, in one sentence, and the Work queue says nothing is placed for today', await E.page.evaluate(() => /^0 to clear/.test(document.querySelector('#qCap').textContent) && /Nothing is placed for today/.test(document.querySelector('#qBody').textContent) && document.querySelector('#revCard').hidden && /Nobody owes you anything/.test(document.querySelector('#waitBody').textContent))); // re-pointed for premium-agreed-design: Home's hero is the Briefing's and it has no dock, so the Work queue says the list is empty
222
236
  await E.ctx.close();
223
237
  }
224
238
  {
@@ -226,13 +240,13 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
226
240
  const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), pg = await ctx.newPage();
227
241
  await pg.route('**/api/my-work-premium', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, state: 'error', error: 'the list could not be read' }) }));
228
242
  await pg.goto(BASE + '/premium-work.html');
229
- ok('M10 a failed read says why and shows nothing instead of a guess', await until(() => pg.evaluate(() => /The reason: the list could not be read/.test(document.querySelector('#brief').textContent) && document.querySelectorAll('#qBody .wrow').length === 0), 5000));
243
+ ok('M10 a failed read says why and shows nothing instead of a guess', await until(() => pg.evaluate(() => /The reason: the list could not be read/.test(document.querySelector('#qNote').textContent) && document.querySelectorAll('#qBody .wrow').length === 0), 5000)); // re-pointed for premium-agreed-design: on Home the Work queue's note says why
230
244
  await ctx.close();
231
245
  }
232
246
 
233
247
  {
234
248
  const R = await open({ w: 820, h: 1000 }), t = R.page;
235
- await showKey(t, 'work:item-aaaaaaaaaaa1'); await t.locator('.wrow[data-key="work:item-aaaaaaaaaaa1"] .wrh').click(); await until(() => t.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(900);
249
+ await showKey(t, 'work:item-aaaaaaaaaaa1'); await t.locator('.wrow[data-key="work:item-aaaaaaaaaaa1"] .wrh').click(); await until(() => t.evaluate(() => (document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent))))); await sleep(900);
236
250
  const g = await t.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 }; });
237
251
  ok('M12 on a tablet (820 px) the dialog is centred with a 12 px margin, and the Detail / Conversation switch is shown', Math.abs(g.l - (g.vw - g.w) / 2) <= 2 && g.w === g.vw - 24 && g.tabs !== 'none', JSON.stringify(g));
238
252
  await R.ctx.close();
@@ -240,7 +254,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
240
254
  /* M12 floors on a phone, both themes */
241
255
  for (const theme of ['light', 'dark']) {
242
256
  const R = await open({ w: 390, h: 844, theme }), q = R.page;
243
- await showKey(q, 'work:item-aaaaaaaaaaa1'); await q.locator('.wrow[data-key="work:item-aaaaaaaaaaa1"] .wrh').click(); await until(() => q.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(800);
257
+ await showKey(q, 'work:item-aaaaaaaaaaa1'); await q.locator('.wrow[data-key="work:item-aaaaaaaaaaa1"] .wrh').click(); await until(() => q.evaluate(() => (document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent))))); await sleep(800);
244
258
  const geo = () => q.evaluate(() => { const r = document.querySelector('#dlg').getBoundingClientRect(); return { l: Math.round(r.left), w: Math.round(r.width), vw: innerWidth }; });
245
259
  const g1 = await geo();
246
260
  ok(`M12 at 390 px (${theme}) the dialog opens on Detail at the full width of the screen`, g1.l === 0 && g1.w === g1.vw, JSON.stringify(g1));
@@ -263,14 +277,16 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
263
277
  await q.evaluate(() => { const y = document.querySelector('#qBody').getBoundingClientRect().top + scrollY - 250; scrollTo(0, y); window.__ys = []; addEventListener('scroll', () => window.__ys.push(scrollY)); });
264
278
  await sleep(200); const y0 = await q.evaluate(() => scrollY);
265
279
  await q.evaluate(() => { const i = document.querySelector('#capIn'); i.focus({ preventScroll: true }); i.blur(); }); await sleep(600);
266
- const kb = await q.evaluate(() => { const r = document.querySelector('.rail').getBoundingClientRect(); return { ys: window.__ys, y: scrollY, bottom: Math.round(innerHeight - r.bottom) }; });
267
- ok(`M12 at 390 px (${theme}) leaving a field settles the fixed layer: a one-pixel scroll and back, and the rail stays 12 px off the bottom`, kb.ys.length >= 2 && kb.y === y0 && kb.bottom === 12, JSON.stringify({ y0, ...kb }));
280
+ // re-pointed for premium-agreed-design: the floating place menu replaces the rail as the fixed layer; on a phone it sits 24 px off the bottom
281
+ const kb = await q.evaluate(() => { const r = document.querySelector('#czNav').getBoundingClientRect(); return { ys: window.__ys, y: scrollY, bottom: Math.round(innerHeight - r.bottom) }; });
282
+ ok(`M12 at 390 px (${theme}) leaving a field settles the fixed layer: a one-pixel scroll and back, and the rail stays 12 px off the bottom`, kb.ys.length >= 2 && kb.y === y0 && kb.bottom === 24, JSON.stringify({ y0, ...kb }));
268
283
  await R.ctx.close();
269
284
  }
270
285
  {
271
- const R = await open(); await showKey(R.page, 'work:item-aaaaaaaaaaa1'); await R.page.locator('.wrow[data-key="work:item-aaaaaaaaaaa1"] .wrh').first().focus();
272
- await R.page.keyboard.press('Enter'); await until(() => R.page.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
273
- ok('M12 the page behind a dialog is inert, Escape closes it and focus returns to the row', await R.page.evaluate(() => ['.rail', 'main.stage', '#dock'].every((s) => document.querySelector(s).inert)) && (await R.page.keyboard.press('Escape'), await until(() => R.page.evaluate(() => !document.querySelector('#dlg').classList.contains('on') && document.activeElement.classList.contains('wrh')))));
286
+ // re-pointed for premium-agreed-design: on a desktop Home the dialog is docked beside a live list on purpose, so the modal dialog is checked where it is modal (a tablet, 820 px)
287
+ const R = await open({ w: 820, h: 1000 }); await showKey(R.page, 'work:item-aaaaaaaaaaa1'); await R.page.locator('.wrow[data-key="work:item-aaaaaaaaaaa1"] .wrh').first().focus();
288
+ await R.page.keyboard.press('Enter'); await until(() => R.page.evaluate(() => (document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent))))); await sleep(500);
289
+ ok('M12 the page behind a dialog is inert, Escape closes it and focus returns to the row', await R.page.evaluate(() => ['.rail', 'main.stage', '#dock'].every((s) => document.querySelector(s).inert)) && (await R.page.keyboard.press('Escape'), await until(() => R.page.evaluate(() => !(document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent))) && document.activeElement.classList.contains('wrh')))));
274
290
  await R.ctx.close();
275
291
  }
276
292
 
@@ -279,14 +295,15 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
279
295
  const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), pg = await ctx.newPage(), errs = [];
280
296
  pg.on('pageerror', (e) => errs.push(String(e)));
281
297
  await pg.goto(BASE + '/premium-work.html');
282
- ok('E1 on an empty scratch state the real page says the list is empty', await until(() => pg.evaluate(() => document.querySelector('#brief').textContent === 'Your list is empty.'), 20000));
298
+ // re-pointed for premium-agreed-design: /premium-work.html opens Home, whose hero is the Briefing's and which has no dock; the Work queue says the list is empty
299
+ ok('E1 on an empty scratch state the real page says the list is empty', await until(() => pg.evaluate(() => document.querySelector('#qBody').textContent === 'Nothing is placed for today.' && /^0 to clear/.test(document.querySelector('#qCap').textContent)), 20000));
283
300
  await pg.fill('#capIn', 'Reply to Rina about SSO !p1'); await pg.press('#capIn', 'Enter');
284
- ok('E2 an added line comes back through the real routes in the Inbox tab, with its priority, not counted to clear, and its dialog opens', await until(() => pg.evaluate(() => document.querySelector('#qBody').dataset.tab === 'inbox' && /Reply to Rina about SSO/.test(document.querySelector('#qBody').textContent) && /P1/.test(document.querySelector('#qBody').textContent) && /Added by you/.test(document.querySelector('#qBody').textContent) && document.querySelector('#dN').textContent === '0' && document.querySelector('#dlg').classList.contains('on')), 15000));
301
+ ok('E2 an added line comes back through the real routes in the Inbox tab, with its priority, not counted to clear, and its dialog opens', await until(() => pg.evaluate(() => document.querySelector('#qBody').dataset.tab === 'inbox' && /Reply to Rina about SSO/.test(document.querySelector('#qBody').textContent) && /P1/.test(document.querySelector('#qBody').textContent) && /Added by you/.test(document.querySelector('#qBody').textContent) && document.querySelector('#dN').textContent === '0' && (document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent)))), 15000));
285
302
  await sleep(700);
286
303
  await more(pg); await pg.locator('#card [data-p="flag"]').click();
287
- ok('E3 Today, picked in the When field of that dialog, moves it from the Inbox to Today through the real route', await until(() => pg.evaluate(() => document.querySelector('#qTabs [data-tab="today"]').textContent === 'Today1' && document.querySelector('#qTabs [data-tab="inbox"]').textContent === 'Inbox0' && document.querySelector('#dN').textContent === '1'), 15000));
304
+ ok('E3 Today, picked in the When field of that dialog, moves it from the Inbox to Today through the real route', await until(() => pg.evaluate(() => document.querySelector('#qTabs [data-tab="today"]').textContent === 'Today1' && document.querySelector('#qTabs [data-tab="inbox"]').textContent === 'Inbox0' && /^1 to clear/.test(document.querySelector('#qCap').textContent)), 15000));
288
305
  await pg.click('#qTabs [data-tab="today"]'); await pg.locator('#qBody .wck').first().click();
289
- ok('E4 the check circle marks it done, and the list is empty again', await until(() => pg.evaluate(() => document.querySelector('#brief').textContent === 'Your list is empty.' && document.querySelector('#dN').textContent === '0'), 15000));
306
+ ok('E4 the check circle marks it done, and the list is empty again', await until(() => pg.evaluate(() => document.querySelector('#qBody').textContent === 'Nothing is placed for today.' && /^0 to clear/.test(document.querySelector('#qCap').textContent)), 15000));
290
307
  const api = await fetch(BASE + '/api/my-work-premium').then((r) => r.json());
291
308
  ok('E5 the model route answers ready with the list the Work page reads', api.ok && api.state === 'ready' && api.model.dock.needs === 0);
292
309
  const hdr = await T.pressHeaders(BASE);
@@ -298,35 +315,32 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
298
315
  await ctx.close();
299
316
  }
300
317
 
301
- /* M12 fidelity against the mockup: computed style and geometry of the regions both pages have */
302
- if (!fs.existsSync(MOCKUP)) ok('M12 the mockup is in the repository', false, MOCKUP);
303
- else {
304
- /* the Work queue (PM, 2026-10-19) replaced the mockup's plate with one full-width card, so its parts are matched by style and not by place */
305
- const PAIRS = [['rail', '.rail'], ['name', '.top .name'], ['date', '.hero .date'], ['brief', '.brief'], ['cap', '.cap'], ['capin', '.cap input'], ['capbtn', '.cap .capb'], ['plate', '#plate', '#queue'], ['heading', '#hPlate', '#hQueue'], ['row', '#plateBody .wrow:not(.first)', '#qBody .wrow:not(.first)'], ['title', '#plateBody .wrow:not(.first) .wtit', '#qBody .wrow:not(.first) .wtit'], ['sub', '#plateBody .wrow:not(.first) .ws', '#qBody .wrow:not(.first) .ws'], ['due', '#plateBody .due:not(.od)', '#qBody .due:not(.od)'], ['waitrow', '#waitBody .wrow'], ['dock', '.dock']];
306
- const QUEUE = ['plate', 'heading', 'row', 'title', 'sub', 'due', 'waitrow'];
307
- const SKIP_GEOM = { 1280: QUEUE, 390: QUEUE };
308
- const PROPS = ['fontSize', 'fontWeight', 'fontFamily', 'color', 'backgroundColor', 'borderRadius', 'paddingTop', 'paddingLeft', 'letterSpacing', 'lineHeight', 'boxShadow', 'backdropFilter', 'borderTopColor'];
309
- const grab = (pg, pairs) => pg.evaluate(([pairs, props]) => { const o = {}; for (const [n, s0] of pairs) { const s = (n === 'rail' || n === 'dock') ? s0 : 'main.stage:not([hidden]) ' + s0; const e = document.querySelector(s); if (!e) { o[n] = null; continue; } const cs = getComputedStyle(e), r = e.getBoundingClientRect(), v = { left: Math.round(r.left), width: Math.round(r.width) }; props.forEach((k) => { v[k] = cs[k]; }); o[n] = v; } return o; }, [pairs, PROPS]);
318
+ /* M12 fidelity against the design: computed style of the regions the page has.
319
+ * re-pointed for premium-agreed-design: the PM approved the Agreed design (planning/prd/premium-agreed-design-prd.md) in place of the
320
+ * prototype mockup this block used to match, so the reference is now that design's tokens in cozy.css: every region is drawn, set in the
321
+ * design's typeface, its text in one of the design's inks, and the add button filled with the design's blue (or the solid it points at). */
322
+ {
323
+ const REGIONS = [['date', '.hero .date'], ['brief', '.brief'], ['cap', '.cap'], ['capin', '.cap input'], ['capbtn', '.cap .capb'], ['plate', '#queue'], ['heading', '#hQueue'], ['row', '#qBody .wrow:not(.first)'], ['title', '#qBody .wrow:not(.first) .wtit'], ['sub', '#qBody .wrow:not(.first) .ws'], ['due', '#qBody .due:not(.od)'], ['waitrow', '#waitBody .wrow']];
324
+ const INKED = ['date', 'brief', 'capin', 'heading', 'row', 'title', 'sub', 'due', 'waitrow'];
310
325
  for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
311
- const m = await (await browser.newContext({ viewport: { width: w, height: h } })).newPage();
312
- await m.goto('file://' + MOCKUP); await CT.applyToPage(m, CT_VENDOR);
313
- await until(() => m.evaluate(() => document.querySelectorAll('#rank .rr').length > 0));
314
- await m.evaluate((t) => { document.documentElement.dataset.theme = t; document.querySelector('.pl[data-p="work"]').click(); }, th);
315
- await until(() => m.evaluate(() => document.querySelectorAll('#plateBody .wrow').length > 0)); await sleep(900);
316
326
  const R = await open({ w, h, theme: th }); await sleep(500);
317
- /* a theme change starts a .3 s box-shadow transition; on a slow runner it can still be running, so let every animation finish before reading styles */
318
- for (const pg of [m, R.page]) await pg.evaluate(() => Promise.all(document.getAnimations().filter((a) => a.effect && a.effect.getComputedTiming().iterations !== Infinity).map((a) => a.finished.catch(() => null)))).catch(() => null);
319
- const a = await grab(m, PAIRS.map(([n, s0]) => [n, s0])), c = await grab(R.page, PAIRS.map(([n, s0, s1]) => [n, s1 || s0])), diffs = [];
320
- for (const [n] of PAIRS) {
321
- if (!a[n] || !c[n]) { diffs.push(n + ' missing'); continue; }
322
- for (const k of Object.keys(a[n])) {
323
- const geom = k === 'left' || k === 'width';
324
- if (geom && (SKIP_GEOM[w].includes(n) || ['brief', 'title', 'sub', 'due', 'label', 'glyph', 'waitrow', 'tile', 'capin'].includes(n) && k === 'width' || ['brief', 'title', 'sub'].includes(n) && k === 'left')) continue;
325
- if (geom ? Math.abs(a[n][k] - c[n][k]) > 2 : a[n][k] !== c[n][k]) diffs.push(`${n}.${k} ${a[n][k]} | ${c[n][k]}`);
326
- }
327
+ await R.page.evaluate(() => Promise.all(document.getAnimations().filter((a) => a.effect && a.effect.getComputedTiming().iterations !== Infinity).map((a) => a.finished.catch(() => null)))).catch(() => null);
328
+ const got = await R.page.evaluate((regions) => {
329
+ const tok = (v, prop) => { const e = document.createElement('i'); e.style.cssText = `position:absolute;visibility:hidden;${prop}:var(${v})`; document.body.appendChild(e); const cs = getComputedStyle(e); const out = prop === 'font-family' ? cs.fontFamily : prop === 'color' ? cs.color : cs.backgroundColor; e.remove(); return out; };
330
+ // the inks are the design's three, plus the page tokens it points at them (cozy-home.css: in dark the page keeps premium.css's dark inks and solid)
331
+ const T = { sans: tok('--cz-sans', 'font-family'), inks: ['--cz-ink', '--cz-ink2', '--cz-ink3', '--ink', '--ink-2', '--ink-3'].map((v) => tok(v, 'color')), blue: [tok('--cz-blueink', 'background-color'), tok('--cz-blue', 'background-color'), tok('--solid', 'background-color')] };
332
+ const o = {}; for (const [n, sel] of regions) { const e = document.querySelector('main.stage:not([hidden]) ' + sel); if (!e) { o[n] = null; continue; } const cs = getComputedStyle(e); o[n] = { fontFamily: cs.fontFamily, color: cs.color, backgroundColor: cs.backgroundColor }; }
333
+ return { T, o };
334
+ }, REGIONS);
335
+ const diffs = [];
336
+ for (const [n] of REGIONS) {
337
+ const v = got.o[n]; if (!v) { diffs.push(n + ' missing'); continue; }
338
+ if (v.fontFamily !== got.T.sans) diffs.push(`${n}.fontFamily ${v.fontFamily} | ${got.T.sans}`);
339
+ if (INKED.includes(n) && !got.T.inks.includes(v.color)) diffs.push(`${n}.color ${v.color} | ${got.T.inks.join(' or ')}`);
327
340
  }
341
+ if (got.o.capbtn && !got.T.blue.includes(got.o.capbtn.backgroundColor)) diffs.push(`capbtn.backgroundColor ${got.o.capbtn.backgroundColor} | ${got.T.blue.join(' or ')}`);
328
342
  ok(`M12 styles and geometry match the mockup at ${w} px, ${th}`, diffs.length === 0, diffs.join(' ; '));
329
- await m.context().close(); await R.ctx.close();
343
+ await R.ctx.close();
330
344
  }
331
345
  }
332
346
  return finish();
@@ -1,4 +1,16 @@
1
1
  [
2
+ {
3
+ "v": "0.397.0",
4
+ "at": "2026-10-22T20:10:19.514Z",
5
+ "f": 2,
6
+ "prs": [
7
+ {
8
+ "n": 1011,
9
+ "t": "The premium pages follow the Agreed design",
10
+ "s": "The premium pages follow the Agreed design"
11
+ }
12
+ ]
13
+ },
2
14
  {
3
15
  "v": "0.396.0",
4
16
  "at": "2026-10-22T10:57:02.235Z",
@@ -2,7 +2,8 @@
2
2
  /* fixtures/board-premium-facts.js — the facts lib/board-premium.js builds from, for a plausible board on 17 Oct 2026, 09:12 local. Shapes follow the routes
3
3
  * of lib/routes-boards.js and lib/routes-core-docs.js. Seven initiatives are loaded of nine open; one is late with a recorded end date in the past. */
4
4
  const NOW = new Date(2026, 9, 17, 9, 12).getTime();
5
- const WF = ['Discover', 'Ideate', 'Strategize', 'Prioritize', 'Plan', 'Build', 'Deliver', 'Monitor', 'Evaluate'].map((name, i) => ({ name, cat: ['Discover', 'Discover', 'Plan', 'Plan', 'Plan', 'Do', 'Do', 'Learn', 'Learn'][i] }));
5
+ // The eight lifecycle steps (premium-agreed-design L1): six stages and two milestones, as scripts/boards.js SELF_LADDER draws them.
6
+ const WF = ['Triage', 'Discover', 'Plan', 'Prioritize', 'Build', 'Deliver', 'Monitor', 'Evaluate'].map((name, i) => ({ name, cat: ['Discover', 'Discover', 'Plan', 'Plan', 'Do', 'Do', 'Learn', 'Learn'][i], ...(name === 'Deliver' || name === 'Evaluate' ? { milestone: true } : {}) }));
6
7
  const row = (id, title, o = {}) => ({ id, title, lane: 'feature', stage: 'Build', cat: 'Do', owner: null, anchor: 'q3-2026:o1:kr1', horizon: 'now', status: 'on track', start: null, end: null, progress: null, warnings: [], rank: 0, health: 'on', updated: '2026-10-15T08:00:00.000Z', reading: 'build', stageSource: 'derived', dupOf: null, ...o });
7
8
  const ROWS = [
8
9
  row('self-serve-v2', 'Self-serve onboarding v2', { owner: 'Dara', stage: 'Build', status: 'late', start: '2026-09-01', end: '2026-10-10', progress: 62 }),
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+ /* fixtures/board-premium-jira.js — the board-premium facts with a Jira reading (initiative premium-agreed-design, B1 B2): an active sprint whose
3
+ * tickets belong to two initiatives (one flagged blocked, with points), a pushed ticket from the work items, a next release and an open ask.
4
+ * Built on fixtures/board-premium-facts.js; the dates sit around its NOW (17 Oct 2026). */
5
+ const F = require('./board-premium-facts.js');
6
+
7
+ const issue = (key, summary, status, category, initiative, o = {}) => ({ key, summary, status, category, initiative, flagged: false, reason: null, points: null, url: 'https://jira.example/browse/' + key, ...o });
8
+ function facts(o = {}) {
9
+ return F.facts({
10
+ sprints: { source: 'jira', readAt: new Date(F.NOW - 12 * 60000).toISOString(), sprints: [{
11
+ name: 'Sprint 24', state: 'active', start: '2026-10-12', end: '2026-10-23', counts: { todo: 2, doing: 2, done: 3 }, goal: 'Self-serve onboarding reaches beta',
12
+ issues: [
13
+ issue('ONB-31', 'Welcome checklist', 'Done', 'done', 'self-serve-v2', { points: 3 }),
14
+ issue('ONB-32', 'Invite teammates step', 'Done', 'done', 'self-serve-v2', { points: 2 }),
15
+ issue('ONB-34', 'Empty states', 'In Review', 'doing', 'self-serve-v2', { points: 3 }),
16
+ issue('ONB-35', 'Billing step', 'In Progress', 'doing', 'self-serve-v2', { points: 3 }),
17
+ issue('ONB-36', 'Phone layout', 'To Do', 'todo', 'self-serve-v2', { points: 2 }),
18
+ issue('SSO-12', 'SAML errors', 'Blocked', 'doing', 'sso-partners', { flagged: true, reason: 'Waiting on PLAT-88' }),
19
+ issue('SSO-10', 'Okta config', 'Done', 'done', 'sso-partners'),
20
+ ],
21
+ }, { name: 'Sprint 25', state: 'future', start: '2026-10-26', end: '2026-11-06', counts: { todo: 1, doing: 0, done: 0 }, issues: [issue('SSO-14', 'Partner docs', 'To Do', 'todo', 'sso-partners')] }] },
22
+ items: [{ uid: 'SSO-15', key: 'SSO-15', kind: 'Task', src: 'jira', title: 'Audit the SSO logs', status: 'In review', blocked: false, owner: null, ini: 'sso-partners' }],
23
+ nextRelease: { id: 'v2.4', name: 'v2.4', type: 'minor', at: '2026-11-04T00:00:00Z', ini: ['sso-partners'] },
24
+ asks: [{ id: 'a1', line: 'Finance wants a CSV of failed payouts each morning', source: 'Email from Rina', by: 'pm', at: '2026-10-16T08:00:00Z', state: 'open', draft: { title: 'Failed payouts CSV', lane: 'feature' } }],
25
+ ...o,
26
+ });
27
+ }
28
+ module.exports = { facts, NOW: F.NOW };
@@ -2,7 +2,8 @@
2
2
  /* fixtures/initiative-premium-facts.js — the facts lib/initiative-premium.js builds from, for one plausible initiative on 17 Oct 2026, 09:12 local.
3
3
  * Shapes follow the routes of lib/routes-boards.js (initiative, items), lib/routes-initiatives.js (sheet) and lib/routes-core-docs.js (initiative level). */
4
4
  const NOW = new Date(2026, 9, 17, 9, 12).getTime();
5
- const WF = ['Discover', 'Ideate', 'Strategize', 'Prioritize', 'Plan', 'Build', 'Deliver', 'Monitor', 'Evaluate'].map((name, i) => ({ name, cat: ['Discover', 'Discover', 'Plan', 'Plan', 'Plan', 'Do', 'Do', 'Learn', 'Learn'][i] }));
5
+ // The eight lifecycle steps (premium-agreed-design L1): six stages and two milestones, as scripts/boards.js SELF_LADDER draws them.
6
+ const WF = ['Triage', 'Discover', 'Plan', 'Prioritize', 'Build', 'Deliver', 'Monitor', 'Evaluate'].map((name, i) => ({ name, cat: ['Discover', 'Discover', 'Plan', 'Plan', 'Do', 'Do', 'Learn', 'Learn'][i], ...(name === 'Deliver' || name === 'Evaluate' ? { milestone: true } : {}) }));
6
7
  const ROW = { id: 'self-serve-v2', title: 'Self-serve onboarding v2', lane: 'feature', stage: 'Build', cat: 'Do', owner: 'Dara', anchor: 'q3-2026:o1:kr1', horizon: 'now', status: 'at risk', start: '2026-09-01', end: '2026-10-30', progress: 40, warnings: ['no recorded owner for the rubric'], stageSource: 'derived', workflow: WF };
7
8
  const SHEET = {
8
9
  initiative: { id: 'self-serve-v2', health: { level: 'warn', reasons: ['the contract is not approved'] }, progress: { done: 2, total: 5, label: '2 of 5 · from self-serve-v2-prd.md' }, display: { word: 'Build', line2: 'The contract waits for you' } },