create-pmos 0.440.0 → 0.442.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 (95) hide show
  1. package/package.json +25 -25
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/adler-seasons-art-test.js +106 -0
  7. package/workspace/adler-seasons-test.js +111 -0
  8. package/workspace/briefing-premium-adddoc-test.js +16 -13
  9. package/workspace/briefing-premium-board-test.js +19 -17
  10. package/workspace/briefing-premium-initiative-test.js +7 -4
  11. package/workspace/briefing-premium-products-test.js +4 -4
  12. package/workspace/briefing-premium-sources-test.js +2 -2
  13. package/workspace/briefing-premium-test.js +29 -23
  14. package/workspace/changelog.json +24 -0
  15. package/workspace/guide/adler.md +10 -0
  16. package/workspace/guide/core-documents.md +2 -2
  17. package/workspace/guide/data-freshness.md +7 -5
  18. package/workspace/guide/home.md +3 -1
  19. package/workspace/guide/horizon-scan.md +1 -1
  20. package/workspace/ini-workflow-test.js +6 -2
  21. package/workspace/lib/agent-inbox.js +20 -2
  22. package/workspace/lib/briefing-premium-sources.js +3 -0
  23. package/workspace/lib/briefing-premium.js +37 -7
  24. package/workspace/lib/driver-cli.js +1 -1
  25. package/workspace/lib/driver-run.js +15 -1
  26. package/workspace/lib/driver.js +31 -2
  27. package/workspace/lib/news-for-you.js +24 -9
  28. package/workspace/lib/pm-idle.js +12 -0
  29. package/workspace/lib/refresh.js +17 -8
  30. package/workspace/lib/routes-core-docs.js +1 -1
  31. package/workspace/lib/routes-news.js +15 -1
  32. package/workspace/lib/routes-phone-day.js +6 -4
  33. package/workspace/lib/settings-store.js +38 -0
  34. package/workspace/metric-drafts-ui-test.js +2 -2
  35. package/workspace/need-shot.js +57 -0
  36. package/workspace/news-viewers-test.js +183 -0
  37. package/workspace/package-lock.json +2 -2
  38. package/workspace/package.json +1 -1
  39. package/workspace/premium-board-actions-test.js +2 -1
  40. package/workspace/premium-chat-attach-test.js +2 -0
  41. package/workspace/premium-core-doc-issue-test.js +9 -8
  42. package/workspace/program-panel-test.js +1 -1
  43. package/workspace/public/pm/bd-ini-panel.js +6 -13
  44. package/workspace/public/pm/c3-ini-ui.js +1 -1
  45. package/workspace/public/pm/cozy-adler.css +21 -0
  46. package/workspace/public/pm/cozy-adler.js +415 -8
  47. package/workspace/public/pm/cozy-ev.css +44 -0
  48. package/workspace/public/pm/cozy-home.css +8 -0
  49. package/workspace/public/pm/cozy-news.js +186 -22
  50. package/workspace/public/pm/cozy-seasons.js +318 -0
  51. package/workspace/public/pm/cozy-settings.js +88 -5
  52. package/workspace/public/pm/cozy-today.css +5 -0
  53. package/workspace/public/pm/cozy-viewer.js +12 -7
  54. package/workspace/public/pm/cozy-vw-shell.css +49 -0
  55. package/workspace/public/pm/cozy.css +65 -0
  56. package/workspace/public/pm/dash-view.js +4 -2
  57. package/workspace/public/pm/home-adddoc.js +46 -26
  58. package/workspace/public/pm/home-app.js +142 -114
  59. package/workspace/public/pm/home-chat.js +1 -1
  60. package/workspace/public/pm/home-day.js +17 -9
  61. package/workspace/public/pm/home-draft.js +35 -23
  62. package/workspace/public/pm/home-ini.js +4 -4
  63. package/workspace/public/pm/home-mentions.js +1 -1
  64. package/workspace/public/pm/home-need.js +336 -0
  65. package/workspace/public/pm/home-today.js +2 -2
  66. package/workspace/public/pm/home-work.js +51 -4
  67. package/workspace/public/pm/impact.js +1 -1
  68. package/workspace/public/pm/ini-groups.js +15 -10
  69. package/workspace/public/pm/ini-links.js +1 -1
  70. package/workspace/public/pm/ini-tasks.js +208 -44
  71. package/workspace/public/pm/ini-view-model.js +8 -2
  72. package/workspace/public/pm/ini-view.css +305 -1
  73. package/workspace/public/pm/ini-view.js +190 -80
  74. package/workspace/public/pm/mission.js +234 -0
  75. package/workspace/public/pm/premium-board.js +1 -1
  76. package/workspace/public/pm/premium-welcome.js +2 -2
  77. package/workspace/public/pm/small-vw.js +128 -0
  78. package/workspace/public/pm/split-merge.js +1 -1
  79. package/workspace/public/pm/stage-line.js +2 -2
  80. package/workspace/server.js +10 -6
  81. package/workspace/skills/initiative-drive.skill +4 -1
  82. package/workspace/split-merge-ui-test.js +1 -1
  83. package/workspace/stage-card-test.js +48 -11
  84. package/workspace/task-links-test.js +2 -0
  85. package/workspace/task-milestones-test.js +5 -1
  86. package/workspace/task-plans-test.js +3 -3
  87. package/workspace/task-views-test.js +90 -37
  88. package/workspace/test-lists/adler-seasons-art.json +13 -0
  89. package/workspace/test-lists/batch18-adler-seasons.json +13 -0
  90. package/workspace/test-lists/batch18-asks.json +5 -0
  91. package/workspace/test-lists/mission.json +5 -0
  92. package/workspace/test-lists/news-viewers.json +13 -0
  93. package/workspace/test-lists/small-viewers.json +5 -0
  94. package/workspace/test-lists/viewer-tasks.json +5 -0
  95. package/workspace/tk-tasks-test.js +25 -30
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.440.0",
3
+ "version": "0.442.0",
4
4
  "description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -32,6 +32,30 @@
32
32
  "audit"
33
33
  ],
34
34
  "pmosChanges": [
35
+ {
36
+ "v": "0.442.0",
37
+ "at": "2026-10-28T11:35:22.898Z",
38
+ "f": 2,
39
+ "prs": [
40
+ {
41
+ "n": 1086,
42
+ "t": "Initiative Viewer on phone and desktop, Adler dressed for the season, clear task marks (feedback batch 18 items 1, 8, 12, 13)",
43
+ "s": "Initiative Viewer on phone and desktop, Adler dressed for the season, clear task marks (feedback batch 18 items 1, 8, 12, 13)"
44
+ }
45
+ ]
46
+ },
47
+ {
48
+ "v": "0.441.0",
49
+ "at": "2026-10-28T10:47:11.081Z",
50
+ "f": 2,
51
+ "prs": [
52
+ {
53
+ "n": 1085,
54
+ "t": "Old Viewers on the one pattern, refresh cadence, uncut greeting (feedback batch 18 items 2, 7, 9, 10)",
55
+ "s": "Old Viewers on the one pattern, refresh cadence, uncut greeting (feedback batch 18 items 2, 7, 9, 10)"
56
+ }
57
+ ]
58
+ },
35
59
  {
36
60
  "v": "0.440.0",
37
61
  "at": "2026-10-28T10:01:00.680Z",
@@ -247,30 +271,6 @@
247
271
  "s": "Eleventh testing feedback batch, part 2"
248
272
  }
249
273
  ]
250
- },
251
- {
252
- "v": "0.422.0",
253
- "at": "2026-10-26T13:03:41.940Z",
254
- "f": 2,
255
- "prs": [
256
- {
257
- "n": 1061,
258
- "t": "Eleventh testing feedback batch",
259
- "s": "Eleventh testing feedback batch"
260
- }
261
- ]
262
- },
263
- {
264
- "v": "0.421.0",
265
- "at": "2026-10-26T06:44:56.884Z",
266
- "f": 2,
267
- "prs": [
268
- {
269
- "n": 1059,
270
- "t": "Tenth testing feedback batch",
271
- "s": "Tenth testing feedback batch"
272
- }
273
- ]
274
274
  }
275
275
  ]
276
276
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@d02bb6e8
1
+ kernel-source: pmos@9bba8faa
2
2
  assembled: 2026-10-28
3
3
  mode: vendor
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Eval calibration log"
4
4
  description: "Append-only record of every PM override of an evaluator verdict."
5
- generated: {by: process:create-pmos, at: "2026-10-28T10:00:57Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-28T11:35:18Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Health budgets"
4
4
  description: "Closed registry of health-budget anchors (D59), edited only by the PM."
5
- generated: {by: process:create-pmos, at: "2026-10-28T10:00:57Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-28T11:35:18Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Discoveries and friction log"
4
4
  description: "Append-only record of what runs discovered and where the process rubbed."
5
- generated: {by: process:create-pmos, at: "2026-10-28T10:00:57Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-28T11:35:18Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -0,0 +1,106 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* adler-seasons-art-test.js — Adler dressed for the season, in the real Home (feedback batch 18 item 8-B; canvas AsPlaces, AsSet2Tap).
4
+ * The real Home from the real server, at 390 px with touch and at 1280 px; the board and briefing are the fixtures. The page's clock is
5
+ * 09:30 on Deepavali (8 Nov 2026), and the calendar module (pm/cozy-seasons.js, 8-A's) is stubbed to answer Deepavali, so this suite tests
6
+ * 8-B's half only. POST /api/settings is recorded.
7
+ * Y1 Your day opens on the Deepavali scene (the charm's sky, the diya), and the greeting wishes it: "Happy Deepavali"
8
+ * Y2 the scene fits the sheet: no sideways scroll, and the scene is as wide as the card
9
+ * T1 a press on the scene says "Dressed for Deepavali." with two named icons; no toast said he dressed up
10
+ * T2 "Not this one" saves the calendar's setting (POST /api/settings) and the scene goes plain at once
11
+ * N no page error
12
+ * PMOS_SHOTS=<dir> also saves the screenshots. */
13
+ const path = require('path');
14
+ const fs = require('fs');
15
+ const { spawn } = require('child_process');
16
+ const { findBrowser } = require('./lib/find-browser');
17
+ const T = require('./test-run').configure({ name: 'adler-seasons-art' });
18
+ const BRP = require('./lib/briefing-premium.js');
19
+ const BRF = require('./fixtures/briefing-premium-facts.js');
20
+ const BP = require('./lib/board-premium.js');
21
+ const BF = require('./fixtures/board-premium-facts.js');
22
+
23
+ const BASE = T.BASE;
24
+ const SHOTS = process.env.PMOS_SHOTS || '';
25
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
26
+ const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { let v; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
27
+ const results = [];
28
+ const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 600) : ''}`); };
29
+ let srv = null; let browser = null;
30
+ const finish = async (code) => {
31
+ if (browser) await browser.close().catch(() => {});
32
+ if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
33
+ T.killTmux();
34
+ const bad = results.filter((x) => !x.cond).length;
35
+ console.log(`\n${results.length - bad}/${results.length} adler-seasons-art assertions passed`);
36
+ process.exit(code !== undefined ? code : (bad ? 1 : 0));
37
+ };
38
+ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
39
+
40
+ // 8-A's calendar, as the page imports it: Deepavali, the day itself; "Not this one" names one setting row
41
+ const SEASONS = `export const charmToday = () => ({ key: 'deepavali', name: 'Deepavali', until: '2026-11-10T23:59:59', today: true });
42
+ export const skipThisYear = (key, now) => ({ key: 'adler.dress.skip', value: key + ':' + now.getFullYear() });`;
43
+
44
+ (async () => {
45
+ const exe = process.env.PMOS_CHROME || findBrowser();
46
+ if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the adler-seasons-art suite cannot run'); return finish(1); }
47
+ let chromium;
48
+ try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
49
+ srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
50
+ await T.waitForServer(BASE);
51
+ browser = await chromium.launch({ executablePath: exe });
52
+ if (SHOTS) fs.mkdirSync(SHOTS, { recursive: true });
53
+ const BRIEF = BRP.build(BRF.facts());
54
+ const BOARD = BP.build(BF.facts());
55
+
56
+ for (const [tag, vp] of [['390', { width: 390, height: 844, hasTouch: true, isMobile: true }], ['1280', { width: 1280, height: 860 }]]) {
57
+ const { width, height, ...rest } = vp;
58
+ const ctx = await browser.newContext({ viewport: { width, height }, ...rest });
59
+ const page = await ctx.newPage();
60
+ const errors = [], posts = [], toasts = [];
61
+ page.on('pageerror', (e) => errors.push(String(e)));
62
+ page.on('request', (rq) => { if (rq.method() === 'POST') posts.push({ path: new URL(rq.url()).pathname, body: rq.postData() || '' }); });
63
+ const json = (rq, b) => rq.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify(b) });
64
+ await page.clock.setFixedTime(new Date(2026, 10, 8, 9, 30));
65
+ await page.route(/\/api\/board-premium(\?.*)?$/, (rq) => json(rq, { ok: true, state: 'ready', model: BOARD, as_of: Date.now() }));
66
+ await page.route(/\/api\/briefing-premium(\?.*)?$/, (rq) => json(rq, { ok: true, state: 'ready', model: BRIEF, as_of: Date.now() }));
67
+ await page.route('**/api/briefing-premium/**', (rq) => json(rq, { ok: true, turns: [], working: false }));
68
+ await page.route(/\/pm\/cozy-seasons\.js(\?.*)?$/, (rq) => rq.fulfill({ status: 200, contentType: 'text/javascript', body: SEASONS }));
69
+ await page.route(/\/api\/settings$/, (rq) => (rq.request().method() === 'POST' ? json(rq, { ok: true }) : rq.continue()));
70
+ await page.exposeFunction('__toast', (t) => toasts.push(t));
71
+ await page.addInitScript(() => {
72
+ document.addEventListener('DOMContentLoaded', () => { const t = document.getElementById('toast'); if (t) new MutationObserver(() => { if (t.classList.contains('on')) window.__toast(t.textContent); }).observe(t, { attributes: true }); });
73
+ });
74
+ await page.goto(BASE + '/premium.html');
75
+ await until(() => page.evaluate(() => !!document.querySelector('#hmList [data-hm-day]')), 30000);
76
+ // the calendar answers once Settings > Adler is read (cozy-nav's loadPrefs); wait for the charm before opening the day
77
+ await until(() => page.evaluate(() => import('/pm/cozy-adler.js').then((A) => !!A.dress())), 15000);
78
+
79
+ /* Y1-Y2 */
80
+ await page.click('#hmList [data-hm-day]');
81
+ const y1 = await until(() => page.evaluate(() => {
82
+ const b = document.querySelector('#czViewer .yd-open'); const sc = b && b.querySelector('.yd-scene svg.ad-scene');
83
+ if (!sc) return null;
84
+ const r = sc.getBoundingClientRect(), card = b.getBoundingClientRect();
85
+ return { charm: sc.classList.contains('ch-deepavali'), sky: !!sc.querySelector('.adg-deepavali0'), diya: !!sc.querySelector('.adk-amber3'), line: b.querySelector('.yd-ht b').textContent,
86
+ w: Math.round(r.width), cw: Math.round(card.width), h: Math.round(r.height), scroll: document.documentElement.scrollWidth - innerWidth };
87
+ }), 15000);
88
+ ok(`Y1 ${tag} Your day opens on the Deepavali scene with the diya, and wishes it`, y1 && y1.charm && y1.sky && y1.diya && /^Happy Deepavali\b/.test(y1.line), JSON.stringify(y1));
89
+ ok(`Y2 ${tag} the scene fills the card's width, keeps its height, and nothing scrolls sideways`, y1 && y1.w >= y1.cw - 2 && y1.h > 60 && y1.h <= 152 && y1.scroll <= 0, JSON.stringify(y1));
90
+ if (SHOTS) { await sleep(400); await page.screenshot({ path: path.join(SHOTS, `day-deepavali-${tag}.png`) }); }
91
+
92
+ /* T1-T2 */
93
+ await page.click('#czViewer .yd-scene[data-ad-dress]');
94
+ const t1 = await until(() => page.evaluate(() => { const t = document.querySelector('#czViewer .ad-tip'); return t ? { text: t.querySelector('.ad-tip-t').textContent, icons: [...t.querySelectorAll('button')].map((b) => b.getAttribute('aria-label')) } : null; }));
95
+ ok(`T1 ${tag} a press says "Dressed for Deepavali." with "Not this one" and Dress for the day; no toast said he dressed`, t1 && t1.text === 'Dressed for Deepavali.' && t1.icons.length === 2 && /^Not this one/.test(t1.icons[0]) && !toasts.some((x) => /Deepavali|dress/i.test(x)), JSON.stringify({ t1, toasts }));
96
+ if (SHOTS) await page.screenshot({ path: path.join(SHOTS, `tap-${tag}.png`) });
97
+ await page.click('#czViewer .ad-tip [data-ad-tip="skip"]');
98
+ const t2 = await until(() => page.evaluate(() => { const b = document.querySelector('#czViewer .yd-open'); return b && !b.querySelector('.ch-deepavali') && !b.querySelector('.ad-tip') ? { plain: true, btn: !!b.querySelector('[data-ad-dress]') } : null; }));
99
+ const saved = posts.find((p) => p.path === '/api/settings');
100
+ ok(`T2 ${tag} "Not this one" saves the calendar's setting, and he is plain at once`, t2 && !t2.btn && saved && JSON.parse(saved.body).key === 'adler.dress.skip' && JSON.parse(saved.body).value === 'deepavali:2026', JSON.stringify({ t2, saved }));
101
+
102
+ ok(`N ${tag} no page error`, !errors.length, JSON.stringify(errors));
103
+ await ctx.close();
104
+ }
105
+ return finish();
106
+ })();
@@ -0,0 +1,111 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* adler-seasons-test.js — Settings › Adler › Dress for the day in the real page (feedback batch 18 item 8, slice 8-A; canvas AsSet1).
4
+ * The real Settings dialog from the real server, at 390 px with touch and at 1280 px. The page clock is pinned to 3 Nov 2026 in
5
+ * Singapore (Deepavali week), and Settings > Adler is reached the way the tap popover's › reaches it: openSettings('dress').
6
+ * D1 the Adler section has a "Dress for the day" row that says what he wears, and its › opens the page
7
+ * D2 the page: the master switch, the place, the group rows, Wear now; "Today: Deepavali" with its end date
8
+ * D3 More festivals opens one switch per day; pressing Pongal posts adler.dress.days
9
+ * D4 Wear now Movie night posts adler.dress.wear for today, and the button says it is worn
10
+ * D5 the master switch off posts adler.dress.on false and leaves one line
11
+ * D6 no page error, and nothing wider than the phone
12
+ * PMOS_SHOTS=<dir> also saves the screenshots. */
13
+ const path = require('path');
14
+ const fs = require('fs');
15
+ const { spawn } = require('child_process');
16
+ const { findBrowser } = require('./lib/find-browser');
17
+ const T = require('./test-run').configure({ name: 'adler-seasons' });
18
+
19
+ const BASE = T.BASE;
20
+ const SHOTS = process.env.PMOS_SHOTS || '';
21
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
22
+ const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { let v; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
23
+ const results = [];
24
+ const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 600) : ''}`); };
25
+ let srv = null; let browser = null;
26
+ const finish = async (code) => {
27
+ if (browser) await browser.close().catch(() => {});
28
+ if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
29
+ T.killTmux();
30
+ const bad = results.filter((x) => !x.cond).length;
31
+ console.log(`\n${results.length - bad}/${results.length} adler-seasons assertions passed`);
32
+ process.exit(code !== undefined ? code : (bad ? 1 : 0));
33
+ };
34
+ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
35
+
36
+ (async () => {
37
+ const exe = process.env.PMOS_CHROME || findBrowser();
38
+ if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the adler-seasons suite cannot run'); return finish(1); }
39
+ let chromium;
40
+ try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
41
+ srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
42
+ await T.waitForServer(BASE);
43
+ browser = await chromium.launch({ executablePath: exe });
44
+ if (SHOTS) fs.mkdirSync(SHOTS, { recursive: true });
45
+ const NOW = Date.UTC(2026, 10, 3, 2, 0); // 3 Nov 2026, 10:00 in Singapore
46
+
47
+ for (const [w, h, phone] of [[390, 844, true], [1280, 860, false]]) {
48
+ const tag = phone ? '390' : '1280';
49
+ const ctx = await browser.newContext({ viewport: { width: w, height: h }, hasTouch: phone, isMobile: phone, timezoneId: 'Asia/Singapore', locale: 'en-SG' });
50
+ const page = await ctx.newPage();
51
+ const errors = [], posts = [];
52
+ page.on('pageerror', (e) => errors.push(String(e)));
53
+ page.on('request', (rq) => { if (rq.method() === 'POST' && new URL(rq.url()).pathname === '/api/settings') { try { posts.push(JSON.parse(rq.postData() || '{}')); } catch { /* not JSON */ } } });
54
+ // the clock: Date.now and new Date() read 3 Nov 2026 (timers keep running)
55
+ await page.addInitScript((t) => { const D = Date, off = t - D.now(); class F extends D { constructor(...a) { super(...(a.length ? a : [D.now() + off])); } static now() { return D.now() + off; } } window.Date = F; }, NOW);
56
+ await page.goto(BASE + '/premium.html');
57
+ await until(() => page.evaluate(() => !!document.querySelector('#hmList')), 30000);
58
+ // each viewport starts from the defaults (the server keeps a press between the two)
59
+ await page.evaluate(() => import('/pm/http.js').then((M) => Promise.all(['adler.dress.days', 'adler.dress.wear', 'adler.dress.on'].map((key) => M.pmPost('/api/settings', { key, reset: true })))));
60
+ posts.length = 0;
61
+ const shot = async (name) => { if (SHOTS) { await sleep(400); await page.screenshot({ path: path.join(SHOTS, `dress-${name}-${tag}.png`) }); } };
62
+
63
+ /* D1 */
64
+ await page.evaluate(() => import('/pm/cozy-settings.js').then((M) => M.openSettings('adler')));
65
+ const d1 = await until(() => page.evaluate(() => { const b = document.querySelector('#evSettings [data-ev-dress="open"]'); if (!b) return null; const row = b.closest('.ev-trow'); return row.textContent; }), 15000);
66
+ ok(`D1 ${tag} the Adler section's "Dress for the day" row says what he wears now`, d1 && /Dress for the day/.test(d1) && /Today: Deepavali, until 15 Nov/.test(d1), d1);
67
+ await page.click('#evSettings [data-ev-dress="open"]');
68
+
69
+ /* D2 */
70
+ const d2 = await until(() => page.evaluate(() => { const m = document.querySelector('#evSettings .ev-st-main'); if (!m || !m.querySelector('.ev-dr-hd')) return null; return { text: m.textContent.replace(/\s+/g, ' '), master: m.querySelector('[data-ev-dsw="adler.dress.on"]').getAttribute('aria-checked'), now: (m.querySelector('.ev-dr-now') || {}).textContent || '', place: m.querySelector('#evPlace') ? m.querySelector('#evPlace').value : null, wear: m.querySelectorAll('[data-ev-wear]').length, back: !!m.querySelector('[data-ev-dress="back"][aria-label]') }; }));
71
+ ok(`D2 ${tag} the page: master switch on, Singapore · tropics from the computer, the group rows, Wear now`, d2 && d2.master === 'true' && /Singapore · tropics/.test(d2.text) && /From your computer/.test(d2.text) && d2.place === ''
72
+ && ['Public holidays in Singapore', 'Seasons', 'Space and science days', 'School days', 'More festivals and national days', 'Big sports', 'Exam season', 'Your birthday', 'Wear now'].every((x) => d2.text.includes(x)) && d2.wear === 2 && d2.back, JSON.stringify(d2));
73
+ ok(`D2 ${tag} "Today: Deepavali", he wears it until 15 Nov; Good Friday stays quiet`, d2 && /Today: Deepavali/.test(d2.now) && /until 15 Nov/.test(d2.now) && /Good Friday/.test(d2.text) && /Monsoon, Dec to early Mar/.test(d2.text), d2 && d2.now);
74
+ const wide = await page.evaluate(() => document.querySelector('#evSettings .ev-st-main').scrollWidth - document.querySelector('#evSettings .ev-st-main').clientWidth);
75
+ ok(`D6 ${tag} nothing wider than the dialog`, wide <= 1, String(wide));
76
+ await shot('page');
77
+
78
+ /* D3 */
79
+ await page.click('#evSettings [data-ev-dress="more"]');
80
+ const d3 = await until(() => page.evaluate(() => { const l = document.querySelector('#evMore'); return l ? [...l.querySelectorAll('[data-ev-dday]')].map((b) => b.dataset.evDday + ':' + b.getAttribute('aria-checked')) : null; }));
81
+ ok(`D3 ${tag} More festivals: one switch per day, Pongal off and Mid-Autumn on by default`, d3 && d3.includes('pongal:false') && d3.includes('midautumn:true') && d3.length >= 10, JSON.stringify(d3));
82
+ await shot('more');
83
+ await page.click('#evMore [data-ev-dday="pongal"]');
84
+ const p3 = await until(() => posts.find((p) => p.key === 'adler.dress.days'));
85
+ ok(`D3 ${tag} pressing Pongal posts adler.dress.days with pongal on`, p3 && p3.value && p3.value.pongal === true, JSON.stringify(p3));
86
+ const on3 = await until(() => page.evaluate(() => { const b = document.querySelector('#evMore [data-ev-dday="pongal"]'); return b && b.getAttribute('aria-checked') === 'true'; }));
87
+ ok(`D3 ${tag} and the switch shows it`, on3, JSON.stringify(posts.filter((p) => p.key === "adler.dress.days")));
88
+
89
+ /* D4 */
90
+ await page.click('#evSettings [data-ev-wear="movie"]');
91
+ const p4 = await until(() => posts.find((p) => p.key === 'adler.dress.wear'));
92
+ ok(`D4 ${tag} Wear now Movie night posts adler.dress.wear for today`, p4 && p4.value && p4.value.key === 'movie' && p4.value.day === '2026-11-03', JSON.stringify(p4));
93
+ const d4 = await until(() => page.evaluate(() => { const b = document.querySelector('#evSettings [data-ev-wear="movie"]'); const n = document.querySelector('#evSettings .ev-dr-now'); return b && b.getAttribute('aria-pressed') === 'true' ? { label: b.getAttribute('aria-label'), now: n ? n.textContent : '' } : null; }));
94
+ ok(`D4 ${tag} the button says it is worn, and Movie night is what he wears today`, d4 && /^Take off Movie night/.test(d4.label) && /Today: Movie night/.test(d4.now), JSON.stringify(d4));
95
+ await page.click('#evSettings [data-ev-wear="movie"]');
96
+ await until(() => posts.filter((p) => p.key === 'adler.dress.wear').length === 2);
97
+
98
+ /* D5 */
99
+ await page.click('#evSettings [data-ev-dsw="adler.dress.on"]');
100
+ const p5 = await until(() => posts.find((p) => p.key === 'adler.dress.on'));
101
+ const d5 = await until(() => page.evaluate(() => { const m = document.querySelector('#evSettings .ev-st-main'); return m && !m.querySelector('[data-ev-wear]') ? m.textContent : null; }));
102
+ ok(`D5 ${tag} the master switch off posts false and leaves one line`, p5 && p5.value === false && d5 && /hoodie every day/.test(d5), JSON.stringify(p5));
103
+ await shot('off');
104
+ await page.click('#evSettings [data-ev-dsw="adler.dress.on"]');
105
+ await until(() => posts.filter((p) => p.key === 'adler.dress.on').length === 2);
106
+
107
+ ok(`D6 ${tag} no page error`, errors.length === 0, errors.join(' | '));
108
+ await ctx.close();
109
+ }
110
+ finish();
111
+ })();
@@ -124,21 +124,23 @@ const PAGES = {
124
124
  await p.click('#czViewer [data-cz-vw="more"]');
125
125
  ok(`${kind} A1 the Overview's Documents view has Add a document under ⋯`, await p.evaluate(() => [...document.querySelectorAll('#czViewer .cz-vw-menu button')].some((b) => /^Add a document/.test(b.textContent.trim()))));
126
126
  await p.click('#czViewer .cz-vw-menu button:has-text("Add a document")'); await until(() => p.evaluate(() => !!document.querySelector('#czViewer #adT')));
127
- const form = await p.evaluate((V) => ({ open: !!document.querySelector(V + ' #adT'), title: (document.querySelector('#czVwTitle') || {}).textContent || '', wait: !!document.querySelector(V + ' .hx-wait'), phase: !!document.querySelector(V + ' #adPh'), seg: [...document.querySelectorAll(V + ' #adW button')].map((b) => b.textContent), kinds: [...document.querySelectorAll(V + ' #adK option')].map((o) => o.textContent), uOff: document.querySelector(V + ' #adU').disabled, note: (document.querySelector(V + ' [data-ad-note]') || {}).textContent || '' }), F);
128
- ok(`${kind} A1 the form in the Viewer has the dialog's fields, with no "Waiting for design" tag (premium-uncovered-features), and the old dialog stays shut`, form.open && /^Add a document/.test(form.title) && !form.wait && form.phase === ini && form.seg.join() === 'PMOS drafts it,I write it' && form.kinds.join() === 'In PMOS,Confluence,Google Docs,Google Slides' && form.uOff && await dlgShut(), JSON.stringify(form));
129
- ok(`${kind} A7 the form says the document is saved and the linked page is not read`, /saved on the (board|initiative)'s record/.test(form.note) && /does not read or sync/.test(form.note), form.note);
130
- await p.click('#czViewer #adGo'); await sleep(120);
127
+ // shell A (batch 18 item 2-C, canvas OvA9Docs): ✓ in the header adds, ← cancels; Stage and Who writes it are chips; the address shows only off PMOS
128
+ const form = await p.evaluate((V) => ({ open: !!document.querySelector(V + ' #adT'), title: (document.querySelector('#czVwTitle') || {}).textContent || '', sub: (document.querySelector('#czViewer .cz-vw-sub') || {}).textContent || '', wait: !!document.querySelector(V + ' .hx-wait'), phase: [...document.querySelectorAll(V + ' #adPh [data-ph]')].map((b) => b.textContent), seg: [...document.querySelectorAll(V + ' #adW button')].map((b) => b.textContent), kinds: [...document.querySelectorAll(V + ' #adK option')].map((o) => o.textContent), uOff: document.querySelector(V + ' #adUL').hidden, go: !!document.querySelector('#czViewer .cz-vw-hd [data-cz-vw-p="add"]'), foot: !!document.querySelector(V + ' #adGo, ' + V + ' #adNo'), note: (document.querySelector(V + ' [data-ad-note]') || {}).textContent || '', spark: (document.querySelector(V + ' #adS') || {}).textContent || '' }), F);
129
+ ok(`${kind} A1 the form in the Viewer has the dialog's fields, ✓ in the header and no foot presses, with no "Waiting for design" tag, and the old dialog stays shut`, form.open && form.title === 'Add a document' && !!form.sub && !form.wait && (form.phase.join() === (ini ? 'Discover,Plan,Build,Evaluate' : '')) && form.seg.join() === 'I draft it,You write it' && form.kinds.join() === 'In PMOS,Confluence,Google Docs,Google Slides' && form.uOff && form.go && !form.foot && await dlgShut(), JSON.stringify(form));
130
+ ok(`${kind} A7 the form has one short note line and a ✦ line that says the document is saved on the record`, /core set does not cover/.test(form.note) && /saved on the record/.test(form.spark), JSON.stringify([form.note, form.spark]));
131
+ const GO = '#czViewer .cz-vw-hd [data-cz-vw-p="add"]';
132
+ await p.click(GO); await sleep(120);
131
133
  ok(`${kind} A4 an empty title is refused in the form and posts nothing`, /Give the document a title/.test(await txt(p, '#czViewer #adM')) && A.posts.length === 0);
132
134
  await p.fill('#czViewer #adT', 'UAT plan'); await p.selectOption('#czViewer #adK', 'Confluence'); await sleep(100);
133
- ok(`${kind} A1 the address field opens for a link kind`, await p.evaluate(() => !document.querySelector('#czViewer #adU').disabled));
134
- await p.click('#czViewer #adGo'); await sleep(120);
135
+ ok(`${kind} A1 the address field shows for a link kind, and the ✦ line says the linked page is not read`, await p.evaluate(() => !document.querySelector('#czViewer #adUL').hidden && /does not read or sync/.test(document.querySelector('#czViewer #adS').textContent)));
136
+ await p.click(GO); await sleep(120);
135
137
  ok(`${kind} A4 a link kind with no address is refused in the form and posts nothing`, /Paste the address of the Confluence page/.test(await txt(p, '#czViewer #adM')) && A.posts.length === 0);
136
138
  A.reply({ status: 409, body: { ok: false, error: '“UAT plan” is already on this ' + (ini ? 'initiative' : 'board') + '.' } });
137
- await p.fill('#czViewer #adU', 'https://example.atlassian.net/wiki/x'); await p.click('#czViewer #adGo'); await sleep(250);
138
- ok(`${kind} A4 a refusal from the route is shown in the form, which stays open`, /already on this/.test(await txt(p, '#czViewer #adM')) && await p.evaluate(() => !!document.querySelector('#czViewer #adT') && !document.querySelector('#czViewer #adGo').disabled));
139
+ await p.fill('#czViewer #adU', 'https://example.atlassian.net/wiki/x'); await p.click(GO); await sleep(250);
140
+ ok(`${kind} A4 a refusal from the route is shown in the form, which stays open`, /already on this/.test(await txt(p, '#czViewer #adM')) && await p.evaluate((g) => !!document.querySelector('#czViewer #adT') && !!document.querySelector(g), GO));
139
141
  A.reply({ status: 200, body: { ok: true } }); const calls0 = A.calls();
140
- await p.click('#czViewer [data-w="you"]'); if (ini) await p.selectOption('#czViewer #adPh', 'Plan');
141
- await p.click('#czViewer #adGo'); await sleep(500);
142
+ await p.click('#czViewer [data-w="you"]'); if (ini) await p.click('#czViewer #adPh [data-ph="Plan"]');
143
+ await p.click(GO); await sleep(500);
142
144
  const last = A.posts[A.posts.length - 1], mint = await T.nonce(BASE);
143
145
  const want = { ws: 'w1', scope: P.scope, title: 'UAT plan', writer: 'you', kind: 'Confluence', url: 'https://example.atlassian.net/wiki/x' };
144
146
  if (ini) want.phase = 'Plan';
@@ -163,7 +165,7 @@ const PAGES = {
163
165
  ok(`${kind} no page error`, A.errors.length === 0, A.errors.join(' | '));
164
166
  await A.ctx.close();
165
167
  const N = await open(kind, { w: 390, h: 844 }); await addDoc(N.page); await until(() => N.page.evaluate(() => !!document.querySelector('#czViewer #adT')));
166
- const floors = await N.page.evaluate(() => { const h = (s) => Math.round(document.querySelector('#czViewer ' + s).getBoundingClientRect().height); return { go: h('#adGo'), no: h('#adNo'), t: h('#adT'), k: h('#adK'), w: h('#adW button'), fs: getComputedStyle(document.querySelector('#czViewer #adT')).fontSize }; });
168
+ const floors = await N.page.evaluate(() => { const h = (s) => Math.round(document.querySelector('#czViewer ' + s).getBoundingClientRect().height); return { go: h('.cz-vw-hd [data-cz-vw-p="add"]'), no: h('.cz-vw-hd [data-cz-vw="back"]'), t: h('#adT'), k: h('#adK'), w: h('#adW button'), fs: getComputedStyle(document.querySelector('#czViewer #adT')).fontSize }; });
167
169
  ok(`${kind} A8 at 390 px the presses and fields are at least 44 px and the fields do not zoom the page`, [floors.go, floors.no, floors.t, floors.k, floors.w].every((v) => v >= 44) && parseFloat(floors.fs) >= 16, JSON.stringify(floors));
168
170
  ok(`${kind} A8 no sideways scroll at 390 px with the form open`, await N.page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1 && document.querySelector('#czViewer').getBoundingClientRect().right <= innerWidth + 1));
169
171
  await N.ctx.close();
@@ -199,13 +201,14 @@ const PAGES = {
199
201
  const g = await R.page.evaluate(() => {
200
202
  const tok = (v, prop) => { const x = document.createElement('i'); x.style.setProperty(prop, 'var(' + v + ')'); document.querySelector('#czViewer').appendChild(x); const c = getComputedStyle(x)[prop === 'color' ? 'color' : 'backgroundColor']; x.remove(); return c; };
201
203
  const cs = (s) => getComputedStyle(document.querySelector(s));
202
- return { vw: cs('#czViewer').backgroundColor, card: tok('--cz-card', 'background-color'), vwR: cs('#czViewer').borderTopLeftRadius, ff: cs('#czViewer').fontFamily, go: [cs('#czViewer #adGo').backgroundColor, cs('#czViewer #adGo').fontWeight, cs('#czViewer #adGo').borderTopLeftRadius], solid: tok('--cz-solid', 'background-color'), no: cs('#czViewer #adNo').backgroundColor, dlg: !!(document.querySelector('#dlg') && !!document.querySelector('#dlg.on')) };
204
+ const go = '#czViewer .cz-vw-hd [data-cz-vw-p="add"]', bk = document.querySelector('#czViewer .cz-vw-hd [data-cz-vw="back"]');
205
+ return { vw: cs('#czViewer').backgroundColor, card: tok('--cz-card', 'background-color'), vwR: cs('#czViewer').borderTopLeftRadius, ff: cs('#czViewer').fontFamily, go: [cs(go).backgroundColor, '700', cs(go).borderTopLeftRadius], solid: tok('--cz-solid', 'background-color'), no: bk ? getComputedStyle(bk).backgroundColor : 'rgba(0, 0, 0, 0)', dlg: !!(document.querySelector('#dlg') && !!document.querySelector('#dlg.on')) };
203
206
  });
204
207
  const d = [];
205
208
  if (!/^Nunito/.test(btn.ff) || btn.br !== '999px') d.push('button ' + JSON.stringify(btn));
206
209
  if (g.vw !== g.card || !/^Nunito/.test(g.ff) || (w > 760 && parseFloat(g.vwR) < 20)) d.push('viewer ' + [g.vw, g.card, g.vwR, g.ff].join(' '));
207
210
  if (g.go[0] !== g.solid || +g.go[1] < 700 || g.go[2] !== '999px') d.push('Add document ' + g.go.join(' ') + ' want ' + g.solid);
208
- if (g.no !== g.card && g.no !== 'rgba(0, 0, 0, 0)') d.push('Cancel ' + g.no); // Cancel is the card's ghost press since premium-uncovered-features (canvas HmMyWork)
211
+ if (g.no !== g.card && g.no !== 'rgba(0, 0, 0, 0)') d.push('Back ' + g.no); // ← cancels (batch 18 item 2-C): the header's quiet round press
209
212
  if (g.dlg) d.push('the old dialog opened');
210
213
  ok(`A8 the button and the form follow the Agreed design at ${w} px, ${th}`, d.length === 0, d.join(' ; '));
211
214
  await R.ctx.close();
@@ -53,14 +53,16 @@ const mk = (o) => BP.build(F.facts(o));
53
53
  const IVREAD = () => {
54
54
  const v = document.querySelector('#czViewer'), iv = v && !v.hidden && v.querySelector('.iv'); if (!iv) return null;
55
55
  const tx = (sel, root = iv) => { const e = root.querySelector(sel); return e ? e.textContent.replace(/\s+/g, ' ').trim() : null; };
56
+ // batch 18 item 1: the mission replaces the stage line; its stages, dates and next stage open in place, so a first read opens it
57
+ const mi = iv.querySelector('[data-iv-mi]'); if (mi && !iv.querySelector('.iv-mio')) { mi.click(); return null; }
56
58
  const sc = iv.querySelector('.iv-sc'), c = window.czViewer && window.czViewer.current(), r = v.getBoundingClientRect();
57
- return { t: tx('.cz-vw-title', v), kind: c && c.kind, line: tx('.iv-s1 b'), right: tx('.iv-s1 .iv-r'), why: tx('.iv-why'), meta: tx('.iv-meta'), wfi: (iv.querySelector('.iv-meta .wfi') || {}).title || null,
59
+ return { t: tx('.cz-vw-title', v), kind: c && c.kind, why: tx('.iv-why'), late: !!iv.querySelector('.mi-svg .late'), meta: tx('.iv-meta'), wfi: (iv.querySelector('.iv-meta .wfi') || {}).title || null,
58
60
  primary: (iv.querySelector('[data-iv-primary]') || {}).dataset ? (iv.querySelector('[data-iv-primary]') || { dataset: {} }).dataset.ivPrimary || null : null,
59
- stage: sc && tx('.iv-sch b', sc), where: sc && tx('.iv-scm', sc), no: sc && tx('.iv-sch .iv-no', sc),
60
- // the stage line (batch 11 item 21): one part a stage, read back as "<done|now|next> [ms]" a stage, as the ladder's bars were
61
- ...(() => { const by = new Map(); for (const x of sc ? sc.querySelectorAll('.iv-tl .iv-tlp') : []) if (!by.has(x.dataset.ivStage)) by.set(x.dataset.ivStage, x);
62
- const ps = [...by.values()]; return { bars: ps.map((x) => [['done', 'now', 'next'].find((k) => x.classList.contains(k)) || '', /^◆ /.test(x.title) ? 'ms' : ''].filter(Boolean).join(' ')).join('|'), titles: ps.map((x) => x.title) }; })(),
63
- aria: sc && sc.getAttribute('aria-label'), dates: sc && tx('.iv-tl-dt', sc), next: sc && sc.querySelector('.iv-scgo') ? sc.querySelector('.iv-scgo').getAttribute('aria-label') : null,
61
+ stage: sc && tx('.iv-sch b', sc), where: sc && tx('.iv-scd', sc), no: sc && tx('.iv-sch .iv-no', sc),
62
+ // the mission's strip (batch 18 item 1): one part a stage, read back as done, now or next; the current stage's name under it; in place the milestones
63
+ bars: sc ? [...sc.querySelectorAll('.mi-svg :is(.mi-st, .mi-dsh)')].map((x) => (x.classList.contains('dn') ? 'done' : x.classList.contains('q') ? 'next' : 'now')).join('|') : '',
64
+ nm: sc && tx('.iv-mi-nm', sc), ms: sc ? [...sc.querySelectorAll('.iv-mio .iv-msr')].map((x) => x.textContent.replace(/\s+/g, ' ').trim()) : [],
65
+ aria: sc && sc.getAttribute('aria-label'), dates: sc && tx('.iv-mio-h .iv-dtc', sc), next: sc && sc.querySelector('.iv-scgo') ? sc.querySelector('.iv-scgo').getAttribute('aria-label') : null,
64
66
  tasks: tx('.iv-th'), secs: [...iv.querySelectorAll('.iv-ws')].map((b) => b.textContent.replace(/\s+/g, ' ').trim()), tks: [...iv.querySelectorAll('[data-iv-ticket]')].map((e) => e.dataset.ivTicket).join(),
65
67
  rows: [...iv.querySelectorAll('.iv-tr')].map((e) => e.textContent.replace(/\s+/g, ' ').trim()), q: [...iv.querySelectorAll('.iv-q')].map((e) => e.textContent), empty: !!iv.querySelector('.iv-empty'),
66
68
  folds: [...iv.querySelectorAll('.iv-fr b, .czs-row b')].map((b) => b.textContent), body: v.querySelector('.cz-vw-body').textContent.replace(/\s+/g, ' '),
@@ -165,7 +167,7 @@ const IVREAD = () => {
165
167
  await q.click('.bt-l[data-row="board:usage-billing"] .bt-nm');
166
168
  /* re-pointed (batch 11 item 21, the stage line): as on the Board's timeline, a skipped stage has no part; a » marks it only between two parts */
167
169
  const sk = await until(() => q.evaluate(IVREAD));
168
- ok('B1 the panel\'s line has no part for the skipped first step: it starts at Discover, now', !!sk && sk.bars.split('|').length === 7 && sk.bars.split('|')[0] === 'now' && /^Discover · /.test(sk.titles[0]) && !sk.titles.some((x) => /Triage/.test(x)), JSON.stringify(sk && [sk.bars, sk.titles]));
170
+ ok('B1 the mission has no part for the skipped first step: it starts at Discover, now', !!sk && sk.bars.split('|').length === 7 && sk.bars.split('|')[0] === 'now' && sk.nm === 'Discover', JSON.stringify(sk && [sk.bars, sk.nm]));
169
171
  await R.ctx.close();
170
172
  }
171
173
  {
@@ -180,10 +182,10 @@ const IVREAD = () => {
180
182
  const R = await open({ model: BP.build(f) }), q = R.page;
181
183
  await q.click('.bt-l[data-row="board:usage-billing"] .bt-nm');
182
184
  const td = await until(() => q.evaluate(IVREAD));
183
- ok('XipB a Tender initiative: Late, the one sentence why from the record, the progress said once, by hand, the owner and the Tender workflow', !!td && td.line === 'Late' && /^The plan ended Aug 11(, 2026)?, \d+ days ago, and Tender new CIAM is in Technical POC\.$/.test(td.why) && td.right === '53% · by hand' && /wawan ?· ?Tender$/.test(td.meta) && td.wfi === 'Tender', JSON.stringify(td));
184
- ok('XipB the stage card is the Tender stage: "Technical POC", 5 of 7 on the ladder, the seven Tender stages with Technical POC current and ◆ on the last two', !!td && td.stage === 'Technical POC' && td.no === '5' && td.bars === 'done|done|done|done|now|next ms|next ms' && td.aria === 'Stage 5 of 7 of Tender: Technical POC. Next stage: Award decision.' && !/No st(ep|age) on record/.test(td.body), JSON.stringify(td && [td.stage, td.no, td.bars, td.aria]));
185
- ok('XipB the → names the next stage; no breakdown draws the seven Tender sections dashed, with Technical POC marked now', !!td && /^Next: ◆ Award decision/.test(td.next || '') && td.empty && /Technical POC · now/.test(td.body), JSON.stringify(td && [td.next, td.empty]));
186
- ok('XipB the dates under the line say the plan and the overrun; no Jira date; the progress number is said once', !!td && /^Apr 23 ?Aug 11 ?\d+ days over$/.test(td.dates || '') && !/Jira:/.test(td.dates) && (td.body.match(/53%/g) || []).length === 1 && !td.folds.includes('Dates and trend'), JSON.stringify(td && [td.dates, td.folds]));
185
+ ok('XipB a Tender initiative: late in the orange marks of the mission, no words for it (XvpE1States), the owner and the Tender workflow', !!td && td.late && !td.why && /Owner: wawan/.test(td.meta) && td.wfi === 'Tender', JSON.stringify(td));
186
+ ok('XipB the stage card is the Tender stage: "Technical POC", 5 of 7 on the ladder, the seven Tender stages with Technical POC current', !!td && td.stage === 'Technical POC' && td.no === '5' && td.bars === 'done|done|done|done|now|next|next' && td.aria === 'Stage 5 of 7 of Tender: Technical POC. Next stage: Award decision.' && !/No st(ep|age) on record/.test(td.body), JSON.stringify(td && [td.stage, td.no, td.bars, td.aria]));
187
+ ok('XipB the → names the next stage; no breakdown draws the seven Tender sections dashed, with Technical POC marked now', !!td && /^Next: ◆ Award decision/.test(td.next || '') && td.empty && td.nm === 'Technical POC', JSON.stringify(td && [td.next, td.empty, td.nm]));
188
+ ok('XipB the dates in place say the plan and the overrun; no Jira date; the progress number is said once at most', !!td && /^Apr 23 – Aug 11 · \d+ days over$/.test(td.dates || '') && !/Jira:/.test(td.dates) && (td.body.match(/53%/g) || []).length <= 1 && !td.folds.includes('Dates and trend'), JSON.stringify(td && [td.dates, td.folds]));
187
189
  if (process.env.PMOS_SHOTS) await q.screenshot({ path: path.join(process.env.PMOS_SHOTS, 'ini-tender-1440.png') });
188
190
  await R.ctx.close();
189
191
  if (process.env.PMOS_SHOTS) {
@@ -213,10 +215,10 @@ const IVREAD = () => {
213
215
  const sel = await q.evaluate(() => ({ sel: !!document.querySelector('.bt-l.sel[data-row="board:sso-partners"]'), dlg: !!document.querySelector('#dlg.on'), peek: !document.querySelector('#peek'), record: !!document.querySelector('#czViewer [data-pk="record"]') }));
214
216
  ok('B1 a row opens the initiative in the Viewer, floating at 560 px over the right edge, not the old dialog, and the row is marked', !!pk && pk.t === 'SSO for partners' && pk.w === 560 && pk.side && sel.peek && !sel.dlg && !sel.record && sel.sel, JSON.stringify([pk, sel]));
215
217
  /* re-pointed (the one view): the meta is the owner and the workflow, each fact once; the progress source is the right of the status line */
216
- ok('B1 the summary says the status once (the release date is not said again), the owner and the workflow, and when Jira was read', !!pk && pk.line === 'Ships Nov 4' && /Lee ?· ?Product feature$/.test(pk.meta) && pk.wfi === 'Product feature' && !/day|owner|Deliver/.test(pk.meta) && /^Jira · \d+ days? ago$/.test(pk.right), JSON.stringify(pk && [pk.line, pk.meta, pk.right]));
218
+ ok('B1 the meta line holds the owner and the workflow as icons, each fact once (XvpA1)', !!pk && /Owner: Lee/.test(pk.meta) && pk.wfi === 'Product feature' && !/day|Deliver/.test(pk.meta), JSON.stringify(pk && [pk.meta, pk.wfi]));
217
219
  /* re-pointed (batch 6 rules 1, 4 and 11): the card says where it is (6 of 8 on the ladder) and how much of Deliver's tickets are done; the
218
220
  * tickets themselves are said once, as Deliver's section in Tasks, blocked first, with "N of M done in Jira" */
219
- ok('B1 the stage card names the stage (Deliver, 6 on the ladder of eight, ◆ on Deliver and Evaluate) and how many tickets are done; Deliver\'s section lists the open tickets, blocked first, with the done count', !!pk && pk.bars.split('|').length === 8 && pk.bars.split('|')[5] === 'now ms' && /ms$/.test(pk.bars.split('|')[7]) && pk.stage === 'Deliver' && pk.no === '' && /^1 of 4 done in Jira/.test(pk.where || '') && pk.tks.split(',')[0] === 'SSO-12' && pk.tks.split(',').sort().join() === 'SSO-12,SSO-14,SSO-15' && /SSO-12 SAML errors ?Blocked by PLAT-88/.test(pk.body) && pk.q.some((x) => /^1 of 4 done in Jira/.test(x)) && !pk.folds.includes('Dates and trend'), JSON.stringify(pk && [pk.stage, pk.where, pk.bars, pk.tks, pk.q, pk.folds]));
221
+ ok('B1 the stage card names the stage (Deliver, 6 on the ladder of eight, ◆ as its tile); Deliver\'s section lists the open tickets, blocked first, with the done count', !!pk && pk.bars.split('|').length === 8 && pk.bars.split('|')[5] === 'now' && pk.stage === 'Deliver' && pk.no === '' && pk.tks.split(',')[0] === 'SSO-12' && pk.tks.split(',').sort().join() === 'SSO-12,SSO-14,SSO-15' && /SSO-12 SAML errors ?Blocked by PLAT-88/.test(pk.body) && pk.q.some((x) => /^1 of 4 done in Jira/.test(x)) && !pk.folds.includes('Dates and trend'), JSON.stringify(pk && [pk.stage, pk.where, pk.bars, pk.tks, pk.q, pk.folds]));
220
222
  ok('B1 what PMOS has no record of is not drawn: no Drafted row, no Jira-differs row; Linked holds only Jira\'s freshness and its ↻ (batch 16 item 5c)', !!pk && !pk.folds.includes('Drafted in PMOS') && !pk.folds.includes('Jira differs from the PRD'), JSON.stringify(pk && pk.folds));
221
223
  ok('B1 there is no ask box; Discuss in chat sits in the header', !!pk && pk.ask === 0 && pk.disc, JSON.stringify(pk));
222
224
  if (process.env.PMOS_SHOTS) await q.screenshot({ path: path.join(process.env.PMOS_SHOTS, 'ini-deliver-1280.png') });
@@ -281,7 +283,7 @@ const IVREAD = () => {
281
283
  /* re-pointed (the one view, rule 9): what waits on you leads the summary card, with the sign-off as its one icon-only primary; the status moves to the meta line */
282
284
  const nb = await until(() => q.evaluate(IVREAD));
283
285
  const pri = await q.evaluate(() => [...document.querySelectorAll('#czViewer [data-iv-primary]')].map((b) => ({ act: b.dataset.ivPrimary, label: b.getAttribute('aria-label'), text: b.textContent.trim() })));
284
- ok('B1 the panel puts the sign-off first, with the sign-off as the one icon-only primary', !!nb && nb.line === 'Waits on you' && /sign-off can wait|Every release ticket is done/.test(nb.why || '') && pri.length === 1 && pri[0].act === 'page' && pri[0].label === 'Your sign-off · v2.4' && pri[0].text === '', JSON.stringify([nb && [nb.line, nb.why], pri]));
286
+ ok('B1 the panel puts the sign-off first, with the sign-off as the one icon-only primary', !!nb && /sign-off can wait|Every release ticket is done/.test(nb.why || '') && pri.length === 1 && pri[0].act === 'page' && pri[0].label === 'Your sign-off · v2.4' && pri[0].text === '', JSON.stringify([nb && nb.why, pri]));
285
287
  await Promise.all([q.waitForURL(/[?&]ini=sso-partners/, { timeout: 8000 }).catch(() => {}), q.click('#czViewer [data-iv-primary]')]);
286
288
  ok('B1 signing off goes to the initiative\'s page on Home, where the sign-off is', /\/premium\.html\?.*\bini=sso-partners/.test(q.url()), q.url());
287
289
  await R.ctx.close();
@@ -335,7 +337,7 @@ const IVREAD = () => {
335
337
  * over the eight; the old Plan card is the dates line (start, plan end, days left; no Jira date without a Jira forecast); the progress says
336
338
  * where it comes from; Dates and trend is gone */
337
339
  const tp = await until(() => p.evaluate(IVREAD).then((x) => (x && x.kind === 'Initiative' ? x : null)));
338
- ok('B6 an initiative on the timeline opens in the Viewer: the stage card names Plan over the eight steps, the dates line draws the plan dates, no empty rows', !!tp && tp.t === 'Partner API rate limits' && tp.stage === 'Plan' && tp.bars.split('|').length === 8 && tp.bars.split('|').indexOf('now') === 2 && tp.right === '18% · by hand' && /^Sep 20(, 2026)? ?Nov 30(, 2026)? · \d+ days left$/.test(tp.dates || '') && !/Jira:/.test(tp.dates) && !tp.folds.includes('Dates and trend'), JSON.stringify(tp && [tp.stage, tp.bars, tp.right, tp.dates, tp.folds]));
340
+ ok('B6 an initiative on the timeline opens in the Viewer: the stage card names Plan over the eight steps, the dates line draws the plan dates, no empty rows', !!tp && tp.t === 'Partner API rate limits' && tp.stage === 'Plan' && tp.bars.split('|').length === 8 && tp.bars.split('|').indexOf('now') === 2 && /^Sep 20(, 2026)? – Nov 30(, 2026)? · \d+ days left$/.test(tp.dates || '') && !/Jira:/.test(tp.dates) && !tp.folds.includes('Dates and trend'), JSON.stringify(tp && [tp.stage, tp.bars, tp.dates, tp.folds]));
339
341
  await p.click('#czViewer [data-cz-vw="more"]'); await sleep(80);
340
342
  const tm = await p.evaluate(() => [...document.querySelectorAll('.cz-vw-menu [role="menuitem"]')].map((b) => b.querySelector('span').textContent.trim()));
341
343
  /* re-pointed (batch 14 item 5): ⋯ is the ONE initiative menu (pm/ini-more.js), Home's order; no "Move, hold, cancel or archive", no "Open in full" */
@@ -456,8 +458,8 @@ const IVREAD = () => {
456
458
  ok('T what waits on you comes first, in blue', rf.st === 'Your verdict' && /s-you/.test(rf.stc) && rf.you && rf.line === 'Give your verdict', JSON.stringify(rf));
457
459
  await q.click('.bt-l[data-row="board:self-serve-v2"] .bt-nm');
458
460
  /* re-pointed (the one view): the same records, in the stage card's day clock, the ladder, Linked (a fold of the view) and the Board's own rows */
459
- const pk = await until(() => q.evaluate(() => { const v = document.querySelector('#czViewer'); if (!v || v.hidden || !v.querySelector('[data-czs-id="drafted"]') || !v.querySelector('.iv')) return null; const sec = (id) => { const x = v.querySelector(`[data-czs-id="${id}"]`); return x ? { n: (x.querySelector('.czs-n') || {}).textContent || '', body: (x.querySelector('.czs-body') || {}).textContent.replace(/\s+/g, ' ').trim() } : null; }; return { meta: v.querySelector('.iv-meta').textContent, where: (v.querySelector('.iv-scm') || {}).textContent, stage: (v.querySelector('.iv-sch b') || {}).textContent, stt: (v.querySelector('.iv-tl .iv-tlp.now') || {}).title, drafted: sec('drafted'), wt: sec('drift') }; }));
460
- ok('T the stage card says where it stands and the day in the stage of the usual days; the line marks the stage now', !!pk && pk.stage === 'Build' && /18 of ~14 days$/.test(pk.where || '') && !/day|usually/.test(pk.meta) && /^Build · .*now$/.test(pk.stt || ''), JSON.stringify(pk && [pk.stage, pk.where, pk.meta, pk.stt]));
461
+ const pk = await until(() => q.evaluate(() => { const v = document.querySelector('#czViewer'); if (!v || v.hidden || !v.querySelector('[data-czs-id="drafted"]') || !v.querySelector('.iv')) return null; const sec = (id) => { const x = v.querySelector(`[data-czs-id="${id}"]`); return x ? { n: (x.querySelector('.czs-n') || {}).textContent || '', body: (x.querySelector('.czs-body') || {}).textContent.replace(/\s+/g, ' ').trim() } : null; }; return { meta: v.querySelector('.iv-meta').textContent, where: (v.querySelector('.iv-scm') || {}).textContent, stage: (v.querySelector('.iv-sch b') || {}).textContent, stt: !!v.querySelector('.mi-svg :is(.mi-st, .mi-dsh):is(.nw, .late, .hold)'), drafted: sec('drafted'), wt: sec('drift') }; }));
462
+ ok('T the stage card names the stage; the mission marks it now; the meta line says no days (batch 18 item 1: the day clock is not drawn)', !!pk && pk.stage === 'Build' && !/day|usually/.test(pk.meta) && pk.stt === true, JSON.stringify(pk && [pk.stage, pk.where, pk.meta, pk.stt]));
461
463
  if (process.env.PMOS_SHOTS) await q.screenshot({ path: path.join(process.env.PMOS_SHOTS, 'ini-build-1280.png') });
462
464
  ok('T tickets drafted in PMOS and not in Jira are listed, and go to Jira only through your Commit', !!pk && pk.drafted.n === '1' && /^V\.4 ?Resend the invite after 48 hours ?not in Jira ?They go to Jira only through your Commit\.$/.test(pk.drafted.body), JSON.stringify(pk && pk.drafted));
463
465
  ok('T a ticket pushed from an older PRD is flagged as PRD drift', !!pk && !!pk.wt && /^ONB-31 was pushed from an older PRD/.test(pk.wt.body), JSON.stringify(pk && pk.wt));
@@ -128,11 +128,14 @@ const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-
128
128
  await p.goto(BASE + '/premium.html?ini=self-serve-v2&ws=w1&board=w1&theme=light'); await ready(p);
129
129
 
130
130
  /* I3 header and the ONE view (batch 6 items 1 and 3: the Board's panel draws the same; stage-card-test.js holds the stage card's behaviour) */
131
+ await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-iv-mi]')), 15000);
132
+ if (!(await p.evaluate(() => !!document.querySelector('#czViewer .iv-mio')))) await p.click('#czViewer [data-iv-mi]', { position: { x: 8, y: 8 } });
133
+ await until(() => p.evaluate(() => !!document.querySelector('#czViewer .iv-mio')));
131
134
  const card = await p.evaluate(() => { const c = document.querySelector('#czViewer .iv-sc'), iv = document.querySelector('#czViewer .iv'); const q = (s, r = c) => ((r.querySelector(s) || {}).textContent || '').replace(/\s+/g, ' ').trim(), d = (s) => ((document.querySelector(s) || {}).textContent || '').trim();
132
- return { kind: d('#czViewer .cz-vw-kind'), title: d('#czVwTitle'), stage: q('.iv-sch > b, .iv-sch .iv-stc b'), where: q('.iv-scm'), bars: new Set([...c.querySelectorAll('.iv-tl .iv-tlp')].map((x) => x.dataset.ivStage)).size + c.querySelectorAll('.iv-tl .iv-tl-sk').length, now: new Set([...c.querySelectorAll('.iv-tl .iv-tlp.now')].map((x) => x.dataset.ivStage)).size, tail: (c.querySelector('.iv-scgo') || { getAttribute: () => '' }).getAttribute('aria-label') || '', ms: !!c.querySelector('.iv-scgo[data-ms]'),
135
+ return { kind: d('#czViewer .cz-vw-kind'), title: d('#czVwTitle'), stage: q('.iv-sch > b, .iv-sch .iv-stc b'), where: q('.iv-scm'), bars: c.querySelectorAll('.mi-svg :is(.mi-st, .mi-dsh)').length, now: c.querySelectorAll('.mi-svg :is(.mi-st, .mi-dsh):is(.nw, .late, .hold)').length, tail: (c.querySelector('.iv-scgo') || { getAttribute: () => '' }).getAttribute('aria-label') || '', ms: !!c.querySelector('.iv-scgo[data-ms]'),
133
136
  pri: iv.querySelectorAll('[data-iv-primary]').length, cta: !!iv.querySelector('[data-hm-cta]'), tasks: q('.iv-th', iv), empty: !!iv.querySelector('.iv-empty'), secs: [...iv.querySelectorAll('.iv-ws b')].map((b) => b.textContent), meta: q('.iv-meta', iv) }; });
134
137
  ok('I3 the page\'s header names the initiative, its workflow and its anchor (D99)', card.title === 'Self-serve onboarding v2' && /^Product feature · \S/.test(card.kind), JSON.stringify(card));
135
- ok('I3 the card shows the stage the workflow engine derives, with one part a stage on its line and the current one marked', card.stage === 'Build' && card.bars === 8 && card.now === 1, JSON.stringify(card));
138
+ ok('I3 the card shows the stage the workflow engine derives, with one part a stage on its mission strip and the current one marked', card.stage === 'Build' && card.bars === 8 && card.now === 1, JSON.stringify(card));
136
139
  ok('I1 the summary leads with at most one primary; the card holds no step list; Tasks is the WBS by stage', card.pri <= 1 && !card.cta && /^Tasks/.test(card.tasks) && (card.secs.length > 0 || card.empty) && !/pull request|builder agent/i.test(card.secs.join(' ')), JSON.stringify(card));
137
140
  ok('I1 the card\'s → names the next stage', /^Next: ◆ Deliver/.test(card.tail), JSON.stringify(card));
138
141
  ok('I3 Deliver is a milestone: the next stage carries the ◆ mark (Agreed design AgInitAgents)', card.ms, JSON.stringify(card));
@@ -258,8 +261,8 @@ const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-
258
261
  const tok = (v) => { const x = document.createElement('i'); x.style.setProperty('background-color', 'var(' + v + ')'); document.body.appendChild(x); const c = getComputedStyle(x).backgroundColor; x.remove(); return c; };
259
262
  const cs = (s) => { const e = document.querySelector(s); return e ? getComputedStyle(e) : null; };
260
263
  const fab = document.querySelector('#czFab'), fr = fab && fab.getBoundingClientRect();
261
- const c = document.querySelector('#czViewer .iv-sc').getBoundingClientRect();
262
- return { font: cs('body').fontFamily, cta: (cs('#czViewer .iv-go') || {}).backgroundColor, ctaAlt: !document.querySelector('#czViewer .iv-go'), solid: tok('--cz-solid'), blue: tok('--cz-blue'), well: tok('--cz-well'), card: tok('--cz-card'), box: cs('#czViewer .iv-sc').backgroundColor, rad: parseFloat(cs('#czViewer .iv-sc').borderTopLeftRadius), fab: fr ? [Math.round(fr.width), Math.round(fr.height)] : null, over: document.documentElement.scrollWidth - innerWidth, cardW: Math.round(c.width) };
264
+ const c = document.querySelector('#czViewer .iv-card').getBoundingClientRect();
265
+ return { font: cs('body').fontFamily, cta: (cs('#czViewer .iv-go') || {}).backgroundColor, ctaAlt: !document.querySelector('#czViewer .iv-go'), solid: tok('--cz-solid'), blue: tok('--cz-blue'), well: tok('--cz-well'), card: tok('--cz-card'), box: cs('#czViewer .iv-card').backgroundColor, rad: parseFloat(cs('#czViewer .iv-card').borderTopLeftRadius), fab: fr ? [Math.round(fr.width), Math.round(fr.height)] : null, over: document.documentElement.scrollWidth - innerWidth, cardW: Math.round(c.width) };
263
266
  });
264
267
  const d = [];
265
268
  if (!/^Nunito/.test(g.font)) d.push('font ' + g.font);
@@ -160,10 +160,10 @@ const product = (name, cond) => {
160
160
  const row = (await rowsOf(page)).find((r) => r.tag === 'IDPF'), key = row.key;
161
161
  if (row.ses) await page.click(`#hmList [data-hm-ses="${row.ses}"]`); // the row sits behind its initiative's pill (batch 12 item 6)
162
162
  await page.click(`#hmList [data-hm-sel="n:${key}"]`);
163
- await page.waitForSelector('#hmLog [data-dc-opt]'); // the decision card in the chat (canvas HmDecide)
164
- await page.click('#hmLog [data-dc-opt="extend"]');
165
- await page.fill('#dcWhy', 'IDPF moves the date.');
166
- await page.click('#hmLog [data-dc-rec]');
163
+ await page.waitForSelector('#czViewer [data-nv-opt]'); // the decision in the Viewer (batch 18 item 2-A, OvA2Decide)
164
+ await page.click('#czViewer [data-nv-opt="extend"]');
165
+ await page.fill('#nvWhy', 'IDPF moves the date.');
166
+ await page.click('#czViewer [data-nv-rec]');
167
167
  ok('P9 the press is recorded and the IDPF row leaves, the microsites row stays', await until(async () => { const r = await rowsOf(page); return r.length === 1 && r[0].tag === 'microsites' ? 1 : 0; }, 20000), JSON.stringify(await rowsOf(page)));
168
168
  const dA = fs.readFileSync(path.join(rootA, 'pm-decisions.md'), 'utf8'), dB = fs.readFileSync(path.join(rootB, 'pm-decisions.md'), 'utf8');
169
169
  ok('P9 the decision is in IDPF\'s journal and not in the other product\'s or the home one\'s', /KC9/.test(dA) && /IDPF moves the date/.test(dA) && !/KC9/.test(dB) && !/IDPF moves the date/.test(fs.readFileSync(path.join(home.root, 'pm-decisions.md'), 'utf8')));
@@ -127,9 +127,9 @@ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
127
127
  await page.waitForSelector('#czViewer #srcLink');
128
128
  const link = await page.$eval('#czViewer #srcLink', (a) => ({ href: a.href, target: a.target, rel: a.rel, h: Math.round(a.getBoundingClientRect().height) }));
129
129
  ok('S3 the Viewer opens the item\'s https link in a new tab', link.href === 'https://mail.example/t/1' && link.target === '_blank' && /noopener/.test(link.rel), JSON.stringify(link));
130
- ok('S2 the row\'s why now is in its Viewer card', /Why now\s*Why aaaaaaaaaaa1/.test(await page.textContent('#czViewer')), await page.textContent('#czViewer'));
130
+ ok('S2 the row\'s why now is in its Viewer card', /Why now:\s*Why aaaaaaaaaaa1/.test(await page.textContent('#czViewer')), await page.textContent('#czViewer'));
131
131
  ok('S3 the card offers nothing that records or sends', (await page.$('#czViewer [data-hv-rec]')) === null && (await page.$('#czViewer [data-hv-later], #czViewer [data-hv-until]')) === null && (await page.$('#czViewer [data-hv-opt]')) === null);
132
- ok('S11 the link is at least 44 px high', link.h >= 44, String(link.h));
132
+ ok('S11 the link is the shell\'s primary: at least 40 px high on a desk (44 on a phone or a touch screen, cozy-vw-shell.css)', link.h >= 40, String(link.h));
133
133
  await page.keyboard.press('Escape');
134
134
  await moreItem(page, 'New for you', '#aroundDig');
135
135
  const dig = await page.$eval('#czViewer #aroundDig', (e) => ({ h: e.querySelector('.ev-lbl').textContent, t: e.textContent, href: (e.querySelector('a.srcLink') || {}).href || '' }));