create-pmos 0.396.0 → 0.398.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +25 -25
- package/payload/KIT-VERSION +2 -2
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/scripts/nine-stages.js +49 -20
- package/payload/state/discoveries.md +1 -1
- package/payload/state/log.md +1 -1
- package/workspace/briefing-premium-adddoc-test.js +103 -74
- package/workspace/briefing-premium-board-test.js +316 -154
- package/workspace/briefing-premium-calendar-2-test.js +135 -195
- package/workspace/briefing-premium-calendar-3-test.js +143 -413
- package/workspace/briefing-premium-calendar-test.js +86 -185
- package/workspace/briefing-premium-doc-edit-test.js +95 -83
- package/workspace/briefing-premium-initiative-test.js +166 -294
- package/workspace/briefing-premium-insights-test.js +351 -214
- package/workspace/briefing-premium-metrics-test.js +53 -118
- package/workspace/briefing-premium-products-test.js +40 -27
- package/workspace/briefing-premium-sources-test.js +91 -52
- package/workspace/briefing-premium-test.js +150 -633
- package/workspace/briefing-premium-work-test.js +88 -269
- package/workspace/changelog.json +24 -0
- package/workspace/fixtures/board-premium-facts.js +2 -1
- package/workspace/fixtures/board-premium-jira.js +28 -0
- package/workspace/fixtures/board-premium-trail.js +32 -0
- package/workspace/fixtures/initiative-premium-facts.js +2 -1
- package/workspace/fixtures/initiatives-api/list.json +30 -42
- package/workspace/fixtures/initiatives-api/roadmap.json +40 -56
- package/workspace/fixtures/initiatives-api/sheet.json +10 -14
- package/workspace/fixtures/insights-premium-facts.js +11 -2
- package/workspace/fixtures/premium-viewer-fixtures.js +182 -0
- package/workspace/guide/briefing-premium.md +3 -1
- package/workspace/guide/home.md +47 -0
- package/workspace/guide/index.md +2 -0
- package/workspace/guide/lifecycle.md +51 -0
- package/workspace/home-shot.js +38 -0
- package/workspace/lib/agent-roles.js +71 -0
- package/workspace/lib/board-premium.js +160 -3
- package/workspace/lib/board-trail.js +223 -0
- package/workspace/lib/engine/boards.js +15 -14
- package/workspace/lib/engine/nine-stages.js +49 -20
- package/workspace/lib/engine/signals/detectors.js +13 -11
- package/workspace/lib/home-work-item.js +58 -0
- package/workspace/lib/insights-goals.js +196 -0
- package/workspace/lib/insights-premium.js +126 -1
- package/workspace/lib/insights-records.js +101 -0
- package/workspace/lib/jira-tickets.js +1 -1
- package/workspace/lib/route-modules.js +4 -0
- package/workspace/lib/routes-board-premium.js +3 -2
- package/workspace/lib/routes-board-trail.js +33 -0
- package/workspace/lib/routes-home-desk.js +176 -0
- package/workspace/lib/routes-initiatives.js +1 -1
- package/workspace/lib/routes-insights-premium.js +19 -3
- package/workspace/lib/routes-insights-records.js +129 -0
- package/workspace/lib/routes-notes.js +1 -0
- package/workspace/lib/routes-viewer.js +108 -0
- package/workspace/lib/transcript-steps.js +123 -0
- package/workspace/lib/vendor/scripts/nine-stages.js +49 -20
- package/workspace/lib/viewer-meeting.js +205 -0
- package/workspace/lib/viewer-report.js +89 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-agreed-viewer-shots.js +76 -0
- package/workspace/premium-board-actions-test.js +85 -73
- package/workspace/premium-briefing-depth-test.js +66 -53
- package/workspace/premium-chat-attach-test.js +54 -63
- package/workspace/premium-chat-chart-tab-test.js +35 -36
- package/workspace/premium-chat-context-test.js +22 -19
- package/workspace/premium-chat-goal-view-test.js +28 -26
- package/workspace/premium-chat-notes-test.js +29 -33
- package/workspace/premium-chat-report-tab-test.js +35 -25
- package/workspace/premium-chat-term-test.js +16 -14
- package/workspace/premium-chat-viewer-test.js +60 -53
- package/workspace/premium-core-doc-issue-test.js +50 -41
- package/workspace/premium-html-viewer-test.js +17 -18
- package/workspace/premium-phone-card-test.js +8 -2
- package/workspace/premium-phone-room-test.js +42 -31
- package/workspace/premium-report-read-test.js +115 -197
- package/workspace/premium-viewer-download-test.js +19 -22
- package/workspace/premium-viewer-flicker-test.js +11 -16
- package/workspace/premium-viewer-share-test.js +6 -9
- package/workspace/premium-viewer-test.js +41 -60
- package/workspace/premium-vw-backlog-test.js +53 -31
- package/workspace/premium-vw-cal-test.js +82 -123
- package/workspace/premium-vw-copy-test.js +17 -33
- package/workspace/premium-vw-doc-test.js +12 -11
- package/workspace/premium-vw-item-test.js +50 -48
- package/workspace/premium-vw-jira-test.js +55 -26
- package/workspace/premium-vw-meet-test.js +118 -187
- package/workspace/premium-vw-notes-test.js +85 -107
- package/workspace/premium-vw-rec-test.js +72 -193
- package/workspace/premium-vw-slides-test.js +46 -50
- package/workspace/premium-welcome-test.js +3 -2
- package/workspace/premium-work-depth-test.js +63 -51
- package/workspace/public/pm/bd-acts.js +305 -0
- package/workspace/public/pm/bd-span.js +224 -0
- package/workspace/public/pm/bd-stages.js +47 -0
- package/workspace/public/pm/c3-doc-sheet.js +1 -1
- package/workspace/public/pm/c3-md.js +3 -395
- package/workspace/public/pm/c3-phone-detail.js +1 -1
- package/workspace/public/pm/c3-phone-model.js +3 -68
- package/workspace/public/pm/chat-term.js +3 -3
- package/workspace/public/pm/cozy-board.css +640 -0
- package/workspace/public/pm/cozy-home.css +580 -0
- package/workspace/public/pm/cozy-home.js +172 -0
- package/workspace/public/pm/cozy-initiative.css +138 -0
- package/workspace/public/pm/cozy-insights.css +421 -0
- package/workspace/public/pm/cozy-md.js +396 -0
- package/workspace/public/pm/cozy-nav.js +65 -0
- package/workspace/public/pm/cozy-placeholder.js +26 -0
- package/workspace/public/pm/cozy-viewer.css +143 -0
- package/workspace/public/pm/cozy-viewer.js +144 -0
- package/workspace/public/pm/cozy-vw.css +485 -0
- package/workspace/public/pm/cozy.css +254 -0
- package/workspace/public/pm/home-adddoc.js +48 -0
- package/workspace/public/pm/home-app.js +905 -0
- package/workspace/public/pm/home-around.js +515 -0
- package/workspace/public/pm/home-chat.js +459 -0
- package/workspace/public/pm/home-data.js +312 -0
- package/workspace/public/pm/home-draft.js +68 -0
- package/workspace/public/pm/home-more.js +249 -0
- package/workspace/public/pm/home-phone-card.js +109 -0
- package/workspace/public/pm/home-work.js +519 -0
- package/workspace/public/pm/lifecycle-lens-model.js +45 -27
- package/workspace/public/pm/lifecycle-lens.js +22 -11
- package/workspace/public/pm/phone-moment.js +69 -0
- package/workspace/public/pm/pm-work-view.js +1 -1
- package/workspace/public/pm/premium-attach.js +4 -0
- package/workspace/public/pm/premium-board.js +544 -253
- package/workspace/public/pm/premium-brief.js +1 -1
- package/workspace/public/pm/premium-chart-tab.js +110 -62
- package/workspace/public/pm/premium-chat.js +17 -10
- package/workspace/public/pm/premium-deck.js +3 -3
- package/workspace/public/pm/premium-first.js +25 -21
- package/workspace/public/pm/premium-initiative-head.js +138 -0
- package/workspace/public/pm/premium-initiative.js +28 -4
- package/workspace/public/pm/premium-insights.js +950 -440
- package/workspace/public/pm/premium-meeting.js +61 -549
- package/workspace/public/pm/premium-notes.js +1 -1
- package/workspace/public/pm/premium-report-frame.css +20 -0
- package/workspace/public/pm/premium-report-read.js +509 -480
- package/workspace/public/pm/premium-report-tab.js +87 -63
- package/workspace/public/pm/premium-shell.js +107 -124
- package/workspace/public/pm/premium-viewer.js +27 -1
- package/workspace/public/pm/premium-vw-cal.js +187 -48
- package/workspace/public/pm/premium-vw-doc.css +6 -0
- package/workspace/public/pm/premium-vw-doc.js +40 -2
- package/workspace/public/pm/premium-vw-file.js +2 -2
- package/workspace/public/pm/premium-vw-jira-model.js +22 -5
- package/workspace/public/pm/premium-vw-jira.css +11 -0
- package/workspace/public/pm/premium-vw-jira.js +11 -4
- package/workspace/public/pm/premium-vw-meet.js +6 -83
- package/workspace/public/pm/premium-vw-mtg.js +731 -0
- package/workspace/public/pm/premium-vw-notes.js +56 -69
- package/workspace/public/pm/premium-vw-open.js +35 -0
- package/workspace/public/pm/premium-vw-page.js +16 -0
- package/workspace/public/pm/premium-vw-rec.js +11 -215
- package/workspace/public/pm/premium-vw-slides.css +5 -0
- package/workspace/public/pm/premium-vw-slides.js +44 -8
- package/workspace/public/pm/term-view.js +22 -0
- package/workspace/public/premium-board.html +57 -64
- package/workspace/public/premium-chat.html +7 -33
- package/workspace/public/premium-initiative.html +8 -41
- package/workspace/public/premium-insights.html +63 -62
- package/workspace/public/premium-viewer.html +20 -0
- package/workspace/public/premium-work.html +6 -72
- package/workspace/public/premium.html +21 -66
- package/workspace/public/vendor/nunito-var.woff2 +0 -0
- package/workspace/server.js +25 -3
- package/workspace/test-files.json +1 -0
- package/workspace/test-lists/home-libs.json +9 -0
- package/workspace/test-lists/premium-agreed-viewer.json +9 -0
- package/workspace/test-lists/premium-report-read.json +1 -1
- package/workspace/test-lists/premium-vw-agreed.json +9 -0
- package/workspace/test-lists/premium-vw-notes.json +1 -1
- package/workspace/third-party/README.md +1 -0
- package/workspace/public/pm/premium-work.js +0 -719
- package/workspace/public/pm/premium.js +0 -1133
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
/* briefing-premium-initiative-test.js — the
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
|
|
3
|
+
/* briefing-premium-initiative-test.js — the initiative (initiative briefing-premium-initiative; planning/prd/briefing-premium-initiative-prd.md I1 to I12),
|
|
4
|
+
* re-pointed for premium-agreed-design: the initiative is a layout inside Home (/premium.html?ini=<id>), not a page of its own, and the old
|
|
5
|
+
* /premium-initiative.html?id= link lands there. The card at the top of the chat is the mockup's ("Inside one initiative"); its Overview press opens
|
|
6
|
+
* the minimal Overview in the Viewer (stage, lifecycle, tasks, core documents; Waiting for design). What moved elsewhere has its own suite:
|
|
7
|
+
* a document's page premium-vw-doc-test.js, Add a document briefing-premium-adddoc-test.js, Issue it premium-core-doc-issue-test.js, the record and
|
|
8
|
+
* task views premium-vw-item-test.js, the Jira views premium-vw-jira-test.js. The old page's List / By stage / Timeline views, the document filter
|
|
9
|
+
* and search and the document sheet's tabs have no place in the Agreed design and are not drawn.
|
|
10
|
+
* Serves the real page from the real server. Most checks answer GET /api/initiative-premium with the model lib/initiative-premium.js builds from a
|
|
11
|
+
* fixture and GET /api/board-premium with lib/board-premium.js's; the last block reads this repository's own initiative through the real route.
|
|
12
|
+
* I1 place · I2 reading · I3 header · I4 overview · I6 tasks · I7 documents · I10 presses · I12 floors and fidelity */
|
|
8
13
|
const path = require('path');
|
|
9
14
|
const { spawn } = require('child_process');
|
|
10
15
|
const { findBrowser } = require('./lib/find-browser');
|
|
11
|
-
const CT = require('./lib/premium-console-type'); // the mockup is read with the console's type (PM, 2026-10-19), as premium.css is
|
|
12
|
-
const CT_VENDOR = 'file://' + path.join(__dirname, 'public', 'vendor') + '/';
|
|
13
16
|
const T = require('./test-run').configure({ name: 'briefing-premium-initiative' });
|
|
14
17
|
const IP = require('./lib/initiative-premium.js');
|
|
15
18
|
const F = require('./fixtures/initiative-premium-facts.js');
|
|
19
|
+
const BP = require('./lib/board-premium.js');
|
|
20
|
+
const BF = require('./fixtures/board-premium-facts.js');
|
|
21
|
+
const BRP = require('./lib/briefing-premium.js');
|
|
22
|
+
const BRF = require('./fixtures/briefing-premium-facts.js');
|
|
16
23
|
|
|
17
24
|
const BASE = T.BASE;
|
|
18
25
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
19
26
|
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); } };
|
|
20
27
|
const results = [];
|
|
21
|
-
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
28
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 600) : ''}`); };
|
|
22
29
|
let srv = null; let browser = null;
|
|
23
30
|
const finish = async (code) => {
|
|
24
31
|
if (browser) await browser.close().catch(() => {});
|
|
@@ -31,10 +38,9 @@ const finish = async (code) => {
|
|
|
31
38
|
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
32
39
|
|
|
33
40
|
const mk = (o) => IP.build(F.facts(o));
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const HEALTH = { ok: true, path: 'planning/prd/self-serve-v2-prd.md', health: { passed: 1, total: 2, checks: [{ id: 'fresh', pass: true, reason: 'no cited source changed after it' }, { id: 'traced', pass: false, reason: 'a line with a figure has no source' }, { id: 'readers', pass: null, reason: 'no input' }] } };
|
|
41
|
+
const BOARD = BP.build(BF.facts());
|
|
42
|
+
const BRIEF = BRP.build(BRF.facts());
|
|
43
|
+
const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-docs\/draft)$/;
|
|
38
44
|
|
|
39
45
|
(async () => {
|
|
40
46
|
const exe = findBrowser();
|
|
@@ -45,275 +51,148 @@ const HEALTH = { ok: true, path: 'planning/prd/self-serve-v2-prd.md', health: {
|
|
|
45
51
|
await T.waitForServer(BASE);
|
|
46
52
|
browser = await chromium.launch({ executablePath: exe });
|
|
47
53
|
|
|
48
|
-
const open = async ({ w = 1280, h = 900, theme = 'light', model = mk(), answers = null,
|
|
54
|
+
const open = async ({ w = 1280, h = 900, theme = 'light', model = mk(), answers = null, url = '/premium.html?ini=self-serve-v2&ws=w1&board=w1' } = {}) => {
|
|
49
55
|
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
50
56
|
const page = await ctx.newPage();
|
|
51
|
-
let
|
|
57
|
+
let current = model, calls = 0, answer = { status: 200, body: { ok: true } };
|
|
58
|
+
const errors = [], posts = [];
|
|
52
59
|
page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
await page.route('**/api/
|
|
56
|
-
await page.route(/\/api\/
|
|
57
|
-
await page.route(
|
|
58
|
-
|
|
59
|
-
await page.route('**/api/
|
|
60
|
-
await page.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const up = await until(() => page.evaluate(() => document.querySelector('#cIniTk') || /could not be read|No initiative|not on a board/.test(document.querySelector('#snap').textContent + document.querySelector('#iMain').textContent)), 20000);
|
|
65
|
-
return { ctx, page, errors, posts, gets, up, calls: () => calls, setModel: (m) => { current = m; }, set: (a) => { answer = a; }, setThread: (t) => { thread = t; } };
|
|
60
|
+
page.on('request', (rq) => { if (rq.method() === 'POST') posts.push({ path: new URL(rq.url()).pathname, body: JSON.parse(rq.postData() || '{}'), headers: rq.headers() }); });
|
|
61
|
+
const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'application/json', body: JSON.stringify(b) });
|
|
62
|
+
await page.route('**/api/initiative-premium*', (r) => { calls++; if (answers) { const a = answers(calls, r.request().url()); return json(r, a.body, a.status); } return json(r, { ok: true, state: 'ready', model: current, as_of: Date.now() }); });
|
|
63
|
+
await page.route(/\/api\/board-premium(\?.*)?$/, (r) => json(r, { ok: true, state: 'ready', model: BOARD, as_of: Date.now() }));
|
|
64
|
+
await page.route(/\/api\/briefing-premium(\?.*)?$/, (r) => json(r, { ok: true, state: 'ready', model: BRIEF, as_of: Date.now() }));
|
|
65
|
+
for (const p of ['**/api/boards/move', '**/api/boards/tasks/**', '**/api/lifecycle', '**/api/core-docs/draft']) await page.route(p, (r) => json(r, answer.body, answer.status));
|
|
66
|
+
await page.route('**/api/briefing-premium/**', (r) => json(r, { ok: true, turns: [], working: false }));
|
|
67
|
+
await page.goto(BASE + url + (url.includes('?') ? '&' : '?') + 'theme=' + theme);
|
|
68
|
+
// ready: the card is drawn and the board's initiatives are read (the switcher and the card's kind line come from them)
|
|
69
|
+
const up = await ready(page, !answers);
|
|
70
|
+
return { ctx, page, errors, posts, up, calls: () => calls, setModel: (m) => { current = m; }, set: (a) => { answer = a; } };
|
|
66
71
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
const V = '#czViewer:not([hidden])';
|
|
73
|
+
// ready: the card is drawn from the board's row (kind · anchor) and, when the initiative reads, from its record (the ladder)
|
|
74
|
+
async function ready(page, full = true) { return until(() => page.evaluate((f) => !!document.querySelector('.hm-card [data-hm-ov]') && /·/.test((document.querySelector('.hm-card .hm-sw .k') || {}).textContent || '') && (!f || !!((document.querySelector('.hm-card .hm-lad b') || {}).textContent || '').trim()), full), 30000); }
|
|
75
|
+
const txt = (p, s) => p.evaluate((q) => ((document.querySelector(q) || {}).textContent || '').replace(/\s+/g, ' ').trim(), s);
|
|
76
|
+
const overview = async (p) => {
|
|
77
|
+
if (!(await p.evaluate(() => { const b = document.querySelector('.hm-card [data-hm-ov]'); return !!b && !!b.offsetParent; }))) await p.click('#hmNeeds'); // a phone shows the list (and its card) in the sheet
|
|
78
|
+
await p.click('.hm-card [data-hm-ov]'); return until(() => p.evaluate((v) => !!document.querySelector(v + ' [data-ov-move]') || /could not be read|Reading the initiative/.test((document.querySelector(v) || {}).textContent || ''), V), 15000); };
|
|
79
|
+
const writes = (X) => X.posts.filter((x) => WRITES.test(x.path));
|
|
80
|
+
|
|
81
|
+
const A = await open(), p = A.page;
|
|
82
|
+
ok('0 Home draws the initiative layout: its card at the top of the list', A.up && await p.evaluate(() => new URLSearchParams(location.search).get('ini') === 'self-serve-v2' && !!document.querySelector('#hmChat .hm-card, .hm-card')));
|
|
74
83
|
|
|
75
84
|
/* I1 place */
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
await p.
|
|
85
|
-
|
|
86
|
-
await p.click('#
|
|
87
|
-
{ const u = new URL(p.url()); ok('I1
|
|
88
|
-
await p.click('.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
await p.
|
|
92
|
-
|
|
93
|
-
/* I3 header */
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
ok('
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
ok('
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
await p.
|
|
109
|
-
ok('
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
ok('
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
ok('I6
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
await p.locator('#cIniTk .tkq').first().click(); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
|
|
128
|
-
const td = await p.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, grid: [...document.querySelectorAll('#oMain .kv2 span')].map((s) => s.textContent).join('|'), ask: document.querySelector('#askF').hidden, seg: !!document.querySelector('#oMain .tkst') }));
|
|
129
|
-
ok('I6 a Jira task opens its record as a grid, read-only: no status control, and its own conversation (premium-popup-context P1)', td.title === 'Sandbox key step' && /Reference\|ONB-12\|Source\|Jira \(read-only\)/.test(td.grid) && td.ask === false && td.seg === false, JSON.stringify(td));
|
|
130
|
-
// popup context slice 3 (L2, L3): the stored lead comes first, with its time and reads, and Refresh asks the popup's own session
|
|
131
|
-
A.setThread({ ok: true, working: false, turns: [], lead: { text: 'ONB-12 waits on the sandbox key. Ask Sam for a date.', cites: ['Jira read 07:02'], at: new Date().toISOString() } });
|
|
132
|
-
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
133
|
-
await p.locator('#cIniTk .tkq').first().click(); await until(() => p.evaluate(() => !!document.querySelector('#dlg.on #leadT .plead')), 6000);
|
|
134
|
-
const ld = await p.evaluate(() => { const s = document.querySelector('#dBody .stream'); return { first: s.firstElementChild && s.firstElementChild.id, text: document.querySelector('#leadT').textContent }; });
|
|
135
|
-
ok('I6 a task popup shows Claude\'s stored lead first, with when it was written and what it read (popup context L2)', ld.first === 'leadT' && /waits on the sandbox key/.test(ld.text) && /Lead · written \d\d:\d\d · from Jira read 07:02/.test(ld.text), JSON.stringify(ld));
|
|
136
|
-
{ const nA = A.posts.length; await p.click('#leadT [data-lead="refresh"]');
|
|
137
|
-
ok('I6 Refresh asks the popup\'s own session to write the lead again and save it with pmos lead put (popup context L3)', await until(() => A.posts.slice(nA).some((x) => x.path === '/api/briefing-premium/ask' && /^pop:task:/.test(x.body.key) && x.body.text.includes('pmos lead put --key ' + x.body.key))), JSON.stringify(A.posts.slice(nA))); }
|
|
138
|
-
A.setThread({ ok: true, working: false, turns: [] });
|
|
139
|
-
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
140
|
-
/* a PMOS task: its status can be changed */
|
|
141
|
-
A.set({ status: 200, body: { ok: true, item: {} } });
|
|
142
|
-
await p.locator('#cIniTk .tkq', { hasText: 'UAT with five partners' }).click(); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
|
|
143
|
-
ok('I6 a PMOS task offers the board\'s four states, with its own marked', await p.evaluate(() => [...document.querySelectorAll('#oMain [data-tks]')].map((b) => b.textContent + (b.getAttribute('aria-pressed') === 'true' ? '*' : '')).join('|')) === 'To do*|In progress|In review|Done');
|
|
144
|
-
await p.click('#oMain [data-tks="In progress"]');
|
|
145
|
-
ok('I10 a status change posts the board, the task and the state to the board\'s own route, and nothing else', await until(() => A.posts.some((x) => x.path === '/api/boards/tasks/state' && x.body.ws === 'w1' && x.body.board === 'w1' && x.body.task === 't1' && x.body.state === 'In progress' && Object.keys(x.body).sort().join() === 'board,state,task,ws')));
|
|
146
|
-
await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
147
|
-
/* add a task */
|
|
148
|
-
await p.click('[data-tkadd]'); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(400);
|
|
149
|
-
ok('I6 Add a task opens a form with common tasks, a title, an owner and optional dates, and says what empty dates mean', await p.evaluate(() => document.querySelectorAll('#oMain .chq button').length === 6 && !!document.querySelector('#atT') && !!document.querySelector('#atO') && !!document.querySelector('#atF') && !!document.querySelector('#atD') && /from tomorrow, for a week/.test(document.querySelector('#oMain').textContent)));
|
|
150
|
-
await p.click('#atGo'); ok('I6 an empty title is refused before any post', /Give the task a title/.test(await txt('#atM')) && !A.posts.some((x) => x.path === '/api/boards/tasks/add'));
|
|
151
|
-
await p.fill('#atT', 'UAT'); await p.fill('#atF', '2026-11-05'); await p.click('#atGo'); ok('I6 a start without a due date is refused', /Add a due date too/.test(await txt('#atM')));
|
|
152
|
-
await p.fill('#atD', '2026-11-01'); await p.click('#atGo'); ok('I6 a due date before the start is refused', /due date is before the start/.test(await txt('#atM')) && !A.posts.some((x) => x.path === '/api/boards/tasks/add'));
|
|
153
|
-
await p.click('#oMain [data-pre="1"]'); ok('I6 a common task fills the title', await p.inputValue('#atT') === 'Release plan');
|
|
154
|
-
await p.fill('#atF', ''); await p.fill('#atD', '');
|
|
155
|
-
A.set({ status: 400, body: { ok: false, error: 'no initiative self-serve-v2 on this board' } }); await p.click('#atGo');
|
|
156
|
-
ok('I6 a refusal shows the route\'s reason, keeps the form and turns the button back on', await until(() => p.evaluate(() => /no initiative self-serve-v2 on this board/.test(document.querySelector('#atM').textContent) && !document.querySelector('#atGo').disabled)));
|
|
157
|
-
A.set({ status: 200, body: { ok: true, item: {} } }); await p.fill('#atO', 'Dara'); await p.fill('#atF', '2026-11-01'); await p.fill('#atD', '2026-11-05'); await p.click('#atGo');
|
|
158
|
-
ok('I10 Add task posts the workspace, the board, this initiative, the title, the owner and the dates to the board\'s own route', await until(() => A.posts.some((x) => x.path === '/api/boards/tasks/add' && x.body.ws === 'w1' && x.body.board === 'w1' && x.body.initiative === 'self-serve-v2' && x.body.title === 'Release plan' && x.body.owner === 'Dara' && x.body.start === '2026-11-01' && x.body.due === '2026-11-05' && Object.keys(x.body).sort().join() === 'board,due,initiative,owner,start,title,ws')));
|
|
159
|
-
const mint0 = await T.nonce(BASE);
|
|
160
|
-
ok('I10 both task presses carried the launch nonce and no writer field', !!mint0 && A.posts.filter((x) => /^\/api\/boards\/tasks\//.test(x.path)).every((x) => x.headers['x-pmos-nonce'] === mint0 && !['by', 'via', 'at', 'actor', 'pm', 'nonce'].some((k) => k in x.body)));
|
|
161
|
-
await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
162
|
-
ok('I6 Add a document is the one button of the Core documents card that adds (its own suite is briefing-premium-adddoc-test.js)', await p.evaluate(() => document.querySelectorAll('[data-adddoc]').length === 1 && /Add a document/.test(document.querySelector('#cIniDoc .ch').textContent)));
|
|
163
|
-
|
|
164
|
-
/* I7 documents, I11 one count */
|
|
165
|
-
ok('I7 the counts agree: caption, summary, filter and bar', await p.evaluate(() => { const s = document.querySelector('.dsum').textContent.replace(/\s+/g, ' '); const f = [...document.querySelectorAll('#dmF button')].map((b) => b.textContent.replace(/\s+/g, '')).join(','); return document.querySelector('#hDoc + small').textContent === '5' && /1 draft to review/.test(s) && /3 not started/.test(s) && /1 up to date/.test(s) && f === 'All5,Notstarted3,Draft1,Uptodate1' && document.querySelectorAll('.dprog i').length === 5; }));
|
|
166
|
-
ok('I7 the technical documents are grouped and not counted', await p.evaluate(() => /Technical documents \(2\)/.test(document.querySelector('.dmtech summary').textContent)));
|
|
167
|
-
await p.click('#dmF [data-dmf="none"]');
|
|
168
|
-
ok('I7 the filter shows the documents not started', (await all('#dmList .dmn b')).join('|') === 'Problem statement|Research notes|Launch checklist and comms');
|
|
169
|
-
await p.click('#dmF [data-dmf="all"]'); await p.fill('#dmQ', 'risk');
|
|
170
|
-
ok('I7 the search finds a document and keeps the focus in the box', (await all('#dmList .dmn b')).join('|') === 'Risks' && await p.evaluate(() => document.activeElement.id === 'dmQ'));
|
|
171
|
-
await p.fill('#dmQ', 'zzz'); ok('I7 no match says so', /No document matches/.test(await txt('#dmList')));
|
|
172
|
-
await p.fill('#dmQ', '');
|
|
173
|
-
|
|
174
|
-
/* I10 the press */
|
|
175
|
-
A.set({ status: 200, body: { ok: true, run: 'r1' } });
|
|
176
|
-
await p.locator('#dmList [data-draft="problem"]').click();
|
|
177
|
-
ok('I10 Draft it posts the workspace, the initiative scope and the key and nothing else, and says what happens', await until(() => A.posts.some((x) => x.path === '/api/core-docs/draft' && x.body.ws === 'w1' && x.body.scope === 'initiative:self-serve-v2' && x.body.key === 'problem' && Object.keys(x.body).sort().join() === 'key,scope,ws')) && await until(() => p.evaluate(() => /drafting “Problem statement”/.test(document.querySelector('#toast').textContent))));
|
|
85
|
+
{
|
|
86
|
+
const R = await open({ url: '/premium-initiative.html?id=self-serve-v2&ws=w1&board=w1' });
|
|
87
|
+
const u = new URL(R.page.url());
|
|
88
|
+
ok('I1 the old initiative link lands on Home with this initiative, its workspace and board kept', R.up && u.pathname === '/premium.html' && u.searchParams.get('ini') === 'self-serve-v2' && u.searchParams.get('ws') === 'w1' && u.searchParams.get('board') === 'w1', R.page.url());
|
|
89
|
+
await R.ctx.close();
|
|
90
|
+
}
|
|
91
|
+
ok('I1 the console is not linked from Home', await p.evaluate(() => ![...document.querySelectorAll('a[href]')].some((a) => /console(\.html)?/.test(a.getAttribute('href')))));
|
|
92
|
+
await p.click('.hm-card .hm-sw[data-hm-switch]');
|
|
93
|
+
const sw = await until(() => p.evaluate(() => { const m = document.querySelector('#hmMenu'); return m && !m.hidden ? [...m.querySelectorAll('[data-hm-mi] b')].map((b) => b.textContent) : null; }));
|
|
94
|
+
ok('I1 the switcher lists Home, the product and the board\'s initiatives', !!sw && sw[0] === 'Home' && ['Self-serve onboarding v2', 'Partner API rate limits', 'Usage-based billing'].every((t) => sw.includes(t)), JSON.stringify(sw));
|
|
95
|
+
await p.click('#hmMenu [data-hm-mi]:has(b:text-is("Partner API rate limits"))');
|
|
96
|
+
{ const u = new URL(p.url()); ok('I1 choosing an initiative opens its layout on the same board', await until(() => p.evaluate(() => new URLSearchParams(location.search).get('ini') === 'partner-rate-limits')) && u.searchParams.get('ws') === 'w1' && u.searchParams.get('board') === 'w1', p.url()); }
|
|
97
|
+
await p.click('.hm-card .hm-sw[data-hm-switch]'); await until(() => p.evaluate(() => !document.querySelector('#hmMenu').hidden));
|
|
98
|
+
await p.click('#hmMenu [data-hm-mi="0"]');
|
|
99
|
+
ok('I1 Home in the switcher leads back to all work', await until(() => p.evaluate(() => !new URLSearchParams(location.search).get('ini'))), p.url());
|
|
100
|
+
await p.goto(BASE + '/premium.html?ini=self-serve-v2&ws=w1&board=w1&theme=light'); await ready(p);
|
|
101
|
+
|
|
102
|
+
/* I3 header: the card */
|
|
103
|
+
const card = await p.evaluate(() => { const c = document.querySelector('.hm-card'); const q = (s) => ((c.querySelector(s) || {}).textContent || '').replace(/\s+/g, ' ').trim();
|
|
104
|
+
return { kind: q('.hm-sw .k'), title: q('.hm-sw b'), turn: q('.hm-turn'), stage: q('.hm-br .st'), lad: q('.hm-lad'), cur: q('.hm-lad b'), bars: c.querySelectorAll('.hm-bars i').length, now: c.querySelectorAll('.hm-bars i.now').length, ckh: q('.hm-ckh'), items: [...c.querySelectorAll('.hm-it')].map((x) => x.textContent.replace(/\s+/g, ' ').trim()), then: q('.hm-then'), time: q('.hm-time'), cta: q('[data-hm-cta]') }; });
|
|
105
|
+
ok('I3 the card names the initiative, its lane and its anchor', card.title === 'Self-serve onboarding v2' && /^Feature · \S/.test(card.kind), JSON.stringify(card));
|
|
106
|
+
ok('I3 the card shows the stage the workflow engine derives, with the ladder\'s current step and one bar a step', /Build/.test(card.stage + card.cur) && card.bars === 8 && card.now === 1, JSON.stringify(card));
|
|
107
|
+
ok('I1 the card lists what finishes the step, says whose turn it is, and has one CTA', card.items.length > 0 && !!card.turn && !!card.cta && !/pull request|builder agent/i.test(card.items.join(' ')), JSON.stringify(card));
|
|
108
|
+
ok('I1 the card has the payoff line and the time in the stage when the record has them', (!card.then || /^Then:/.test(card.then)) && (card.then || card.time), JSON.stringify(card));
|
|
109
|
+
if (await p.evaluate(() => !!document.querySelector('.hm-card [data-hm-done]'))) {
|
|
110
|
+
await p.click('.hm-card [data-hm-done]');
|
|
111
|
+
ok('I1 the done items open from their summary row', await until(() => p.evaluate(() => document.querySelector('.hm-card [data-hm-done]').getAttribute('aria-expanded') === 'true')));
|
|
112
|
+
}
|
|
113
|
+
ok('I3 Deliver is a milestone: the ladder and the checklist title carry the ◆ mark before it (Agreed design AgInitAgents)', await p.evaluate(() => !!document.querySelector('.hm-card .hm-lad .nx .cz-ms') && !!document.querySelector('.hm-card .hm-ckh .cz-ms') && /To reach Deliver/.test(document.querySelector('.hm-card .hm-ckh').textContent)));
|
|
114
|
+
await p.click('.hm-card [data-hm-cfold]');
|
|
115
|
+
const fold = await until(() => p.evaluate(() => { const c = document.querySelector('.hm-card'), f = c.querySelector('[data-hm-cfold]'); return f && f.getAttribute('aria-expanded') === 'false' ? { sum: f.textContent.replace(/\s+/g, ' ').trim(), items: c.querySelectorAll('.hm-it').length, then: !!c.querySelector('.hm-then'), time: !!c.querySelector('.hm-time'), cta: !!c.querySelector('[data-hm-cta]') } : null; }));
|
|
116
|
+
ok('I3 the checklist folds to one line with its summary; Then and the time line hide, the CTA stays (AgInitSpec)', fold && /^To reach Deliver ?\d+ of \d+ done/.test(fold.sum) && fold.items === 0 && !fold.then && !fold.time && fold.cta, JSON.stringify(fold));
|
|
117
|
+
await p.click('.hm-card [data-hm-cfold]');
|
|
118
|
+
ok('I3 it unfolds again', await until(() => p.evaluate(() => document.querySelector('.hm-card [data-hm-cfold]').getAttribute('aria-expanded') === 'true' && document.querySelectorAll('.hm-card .hm-it').length > 0)));
|
|
119
|
+
ok('I1 the card wrote nothing on its own', writes(A).length === 0, JSON.stringify(writes(A)));
|
|
120
|
+
|
|
121
|
+
/* I7 documents: the list's Files group opens a document's page in the Viewer */
|
|
122
|
+
ok('I7 the list holds the initiative\'s files, the PRD among them', await until(() => p.evaluate(() => !!document.querySelector('.hm-r[data-id="f:planning/prd/self-serve-v2-prd.md"]'))));
|
|
123
|
+
await p.click('.hm-r[data-id="f:planning/prd/self-serve-v2-prd.md"] .hm-rm');
|
|
124
|
+
ok('I7 a file opens as its page in the Viewer, not a dialog', await until(() => p.evaluate((v) => !!document.querySelector(v + ' .obody.vw[data-vw="doc:planning/prd/self-serve-v2-prd.md"]') && !(document.querySelector('#dlg') && !!document.querySelector('#dlg.on')), V), 15000));
|
|
125
|
+
|
|
126
|
+
/* I4 the Overview */
|
|
127
|
+
ok('I4 the card\'s Overview press opens the Overview in the Viewer, marked Waiting for design', await overview(p) && await p.evaluate((v) => /Overview/.test(document.querySelector('#czViewer .cz-vw-kind').textContent) && !!document.querySelector(v + ' .hx-wait'), V));
|
|
128
|
+
const ov = await p.evaluate((v) => { const o = document.querySelector(v); return { moves: [...o.querySelectorAll('[data-ov-move]')].map((b) => b.dataset.ovMove), cur: (o.querySelector('[data-ov-move][aria-pressed="true"]') || {}).textContent, life: [...o.querySelectorAll('[data-ov-life]')].map((b) => b.dataset.ovLife), tasks: [...o.querySelectorAll('[data-ov-tkrow] b')].map((b) => b.textContent), states: [...o.querySelectorAll('[data-ov-task]')].map((s) => s.dataset.ovTask + '=' + s.value), docs: [...o.querySelectorAll('[data-ov-doc]')].map((d) => d.dataset.ovDoc), draft: [...o.querySelectorAll('[data-ov-draft]')].map((b) => b.dataset.ovDraft), drafting: [...o.querySelectorAll('[data-ov-doc]')].filter((d) => /Drafting/.test(d.textContent)).map((d) => d.dataset.ovDoc), dread: [...o.querySelectorAll('[data-ov-dread]')].map((b) => b.dataset.ovDread), sum: (o.querySelector('[data-ov-dsum]') || {}).textContent || '' }; }, V);
|
|
129
|
+
const M = mk();
|
|
130
|
+
ok('I4 the stage row lists the board\'s stages with the current one pressed, and the lifecycle presses', JSON.stringify(ov.moves) === JSON.stringify(M.acts.stages) && ov.cur === 'Build' && ov.life.join() === 'on-hold,cancelled', JSON.stringify(ov));
|
|
131
|
+
ok('I6 the tasks are the record\'s, and only a PMOS task has a status control with its own state', JSON.stringify(ov.tasks) === JSON.stringify(M.tasks.rows.slice(0, 40).map((t) => t.title)) && JSON.stringify(ov.states) === JSON.stringify(M.tasks.rows.filter((t) => t.pmos && t.uid).map((t) => t.uid + '=' + t.state)), JSON.stringify(ov));
|
|
132
|
+
ok('I7 the core documents are the non-technical ones, with the engine\'s summary', JSON.stringify(ov.docs) === JSON.stringify(M.docs.rows.filter((d) => !d.tech).map((d) => d.key)) && ov.sum === M.docs.cap, JSON.stringify(ov));
|
|
133
|
+
ok('I7 a document not started offers Draft it; a running one says Drafting and has no press; a draft offers Read', ov.draft.join() === 'problem,research' && ov.drafting.join() === 'launch' && ov.dread.length === M.docs.rows.filter((d) => !d.tech && d.st === 'draft' && d.path && d.slot).length, JSON.stringify(ov));
|
|
134
|
+
|
|
135
|
+
/* I10 presses */
|
|
178
136
|
const mint = await T.nonce(BASE);
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
await
|
|
182
|
-
ok('I10 a
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
ok('
|
|
188
|
-
|
|
189
|
-
await
|
|
190
|
-
ok('I10
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
await p.
|
|
195
|
-
const
|
|
196
|
-
ok('
|
|
197
|
-
|
|
198
|
-
await
|
|
199
|
-
const
|
|
200
|
-
ok('
|
|
201
|
-
await p.
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
ok('
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
await p.click(
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
ok('
|
|
213
|
-
ok('I8 Relations read the library by GET for this workspace and a goal that is a node is listed, not opened', A.gets.some((g) => g.path === '/api/docs/library' && /ws=w1/.test(g.query)) && await p.evaluate(() => document.querySelectorAll('#oMain [data-rel]').length) === 2);
|
|
214
|
-
await p.click('#shV'); await p.click('#shT [data-sh="read"]');
|
|
215
|
-
ok('I8 a document with no copy offers Link a copy in the status line', await p.evaluate(() => /Link a copy/.test(document.querySelector('#oMain .dsm2').textContent)));
|
|
216
|
-
await p.click('#oMain [data-ds="cp"]'); await p.fill('#dsCpUrl', 'notes'); await p.click('[data-ds="cplink"]');
|
|
217
|
-
ok('I8 a link that names no tool is refused on the sheet, and nothing is posted', /Confluence page or Google Doc/.test(await txt('#oMain .dscp [role="alert"]')) && !A.posts.some((x) => x.path === '/api/docs/link'));
|
|
218
|
-
await p.fill('#dsCpUrl', 'https://docs.google.com/document/d/abc/edit'); await p.click('[data-ds="cplink"]');
|
|
219
|
-
await until(() => p.evaluate(() => /Google Doc: not checked/.test(document.querySelector('#oMain .dsm2').textContent)));
|
|
220
|
-
ok('I8 linking posts the path, the tool and the address, and the status line then names the copy', A.posts.some((x) => x.path === '/api/docs/link' && x.body.kind === 'google' && x.body.path === 'planning/prd/self-serve-v2-prd.md' && x.body.ws === 'w1' && /docs\.google\.com/.test(x.body.target)));
|
|
221
|
-
await p.click('[data-ds="cpcheck"]');
|
|
222
|
-
ok('I8 Check now posts the workspace only and the button reads Checking', A.posts.some((x) => x.path === '/api/docs/check' && Object.keys(x.body).join() === 'ws') && await until(() => p.evaluate(() => /Checking/.test(document.querySelector('[data-ds="cpcheck"]').textContent))));
|
|
223
|
-
await p.click('#oMain [data-ds="cp"]');
|
|
224
|
-
ok('I8 the health check posts the path and the workspace only', A.posts.some((x) => x.path === '/api/doc-health/check' && Object.keys(x.body).sort().join() === 'path,ws' && x.body.ws === 'w1'));
|
|
225
|
-
ok('I8 the sheet wrote nothing: no edit, propose, accept, reject, why, mark or ask post went out', !A.posts.slice(nPost0).some((x) => /doc-sheet/.test(x.path)) && !A.posts.some((x) => /^\/api\/doc-sheet\/(edit|propose|accept|reject|why|mark-current|ask)/.test(x.path)));
|
|
226
|
-
ok('I8 the sheet says the file changes only on Save or Accept', /only when you press Save or Accept/.test(await txt('#oMain .xn')));
|
|
227
|
-
A.setThread({ ok: true, working: false, turns: [] });
|
|
228
|
-
await p.fill('#askIn', 'What is missing?'); const nA = A.posts.length; await p.press('#askIn', 'Enter');
|
|
229
|
-
ok('I8 a question posts the document key and the text', await until(() => A.posts.length > nA && A.posts[A.posts.length - 1].path === '/api/briefing-premium/ask' && A.posts[A.posts.length - 1].body.key === 'doc:self-serve-v2:prd' && A.posts[A.posts.length - 1].body.text === 'What is missing?'));
|
|
230
|
-
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
231
|
-
await p.fill('#dmQ', ''); await p.click('#dmF [data-dmf="all"]');
|
|
232
|
-
ok('I8 every document row opens, including one with no file', await p.evaluate(() => [...document.querySelectorAll('#dmList .dmr')].every((r) => !!r.querySelector('.dmo[data-doc]'))));
|
|
233
|
-
await p.click('#dmList .dmo[data-doc="problem"]'); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(400);
|
|
234
|
-
{ const ab = await p.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, body: document.querySelector('#oMain').textContent, draft: !!document.querySelector('#abDraft'), ask: document.querySelector('#askF').hidden }));
|
|
235
|
-
ok('I8 a document with no file says what it is for, who writes it and offers Draft it', ab.title === 'Problem statement' && /Who writes it/.test(ab.body) && ab.draft && ab.ask === false, JSON.stringify(ab)); }
|
|
236
|
-
const nD = A.posts.length; A.set({ status: 200, body: { ok: true, run: 'r1' } }); await p.click('#abDraft');
|
|
237
|
-
ok('I8 Draft it in that popup posts the draft route and closes the popup', await until(() => A.posts.length > nD && A.posts[A.posts.length - 1].path === '/api/core-docs/draft' && A.posts[A.posts.length - 1].body.key === 'problem') && await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on'))));
|
|
238
|
-
await p.click('#dmList .dmo[data-doc="research"]'); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && document.querySelector('#dTitle').textContent === 'Research notes')); await sleep(400);
|
|
239
|
-
{ const rs = await p.evaluate(() => ({ say: document.querySelector('#dBody .stream').textContent, prd: (document.querySelector('#oMain .dprd') || {}).textContent || '', body: document.querySelector('#oMain').textContent, first: !!document.querySelector('#oMain .dprd') && document.querySelector('#oMain .dprd').compareDocumentPosition(document.querySelector('#oMain .kv2')) === Node.DOCUMENT_POSITION_FOLLOWING }));
|
|
240
|
-
ok('I8 a derived document with no file shows the PRD section it comes from, before its details, and the first line says so', /The PRD’s “Evidence” section covers it/.test(rs.say) && /Five of eight trial teams stalled/.test(rs.prd) && /• Support tickets doubled/.test(rs.prd) && /From the PRD: Evidence/.test(rs.body) && /planning\/prd\/self-serve-v2-prd\.md § Evidence/.test(rs.body) && !/nothing to read here/.test(rs.body) && rs.first, JSON.stringify(rs)); }
|
|
241
|
-
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
137
|
+
const settle = async (fn) => { const c = A.calls(); await fn(); await until(() => A.calls() > c, 10000); await sleep(500); }; // a press that lands reads the initiative again and draws the Overview again
|
|
138
|
+
await settle(() => p.click(`${V} [data-ov-move="Deliver"]`));
|
|
139
|
+
const mv = await until(() => A.posts.find((x) => x.path === '/api/boards/move'));
|
|
140
|
+
ok('I10 a stage press posts the board, the initiative and the stage to the move route', mv && mv.body.ws === 'w1' && mv.body.board === 'w1' && mv.body.id === 'self-serve-v2' && mv.body.to === 'Deliver', JSON.stringify(mv && mv.body));
|
|
141
|
+
await until(() => p.evaluate((v) => !!document.querySelector(v + ' [data-ov-move]'), V));
|
|
142
|
+
await p.click(`${V} [data-ov-life="on-hold"]`);
|
|
143
|
+
ok('I10 a lifecycle press asks its reason inline before it posts', await until(() => p.evaluate((v) => !!document.querySelector(v + ' #ovWhy'), V)) && !A.posts.some((x) => x.path === '/api/lifecycle'));
|
|
144
|
+
await p.fill(`${V} #ovWhy`, 'x'); await p.click(`${V} [data-ov-life-go]`);
|
|
145
|
+
ok('I10 a reason too short is refused and nothing is posted', await until(async () => /Say why in a few words/.test(await txt(p, V + ' #ovMsg'))) && !A.posts.some((x) => x.path === '/api/lifecycle'));
|
|
146
|
+
await p.fill(`${V} #ovWhy`, 'Waiting on legal'); await settle(() => p.click(`${V} [data-ov-life-go]`));
|
|
147
|
+
const lf = await until(() => A.posts.find((x) => x.path === '/api/lifecycle'));
|
|
148
|
+
ok('I10 Record posts the state and the reason to the lifecycle route', lf && lf.body.initiative_id === 'self-serve-v2' && lf.body.state === 'on-hold' && lf.body.reason === 'Waiting on legal' && lf.body.ws === 'w1', JSON.stringify(lf && lf.body));
|
|
149
|
+
await until(() => p.evaluate((v) => !!document.querySelector(v + ' #ovTask'), V));
|
|
150
|
+
await p.click(`${V} [data-ov-add]`); await sleep(200);
|
|
151
|
+
ok('I6 Add with no title posts nothing', !A.posts.some((x) => x.path === '/api/boards/tasks/add'));
|
|
152
|
+
await p.fill(`${V} #ovTask`, 'Release plan'); await settle(() => p.click(`${V} [data-ov-add]`));
|
|
153
|
+
const ad = await until(() => A.posts.find((x) => x.path === '/api/boards/tasks/add'));
|
|
154
|
+
ok('I10 Add posts the workspace, the board, this initiative and the title to the board\'s own route', ad && ad.body.ws === 'w1' && ad.body.board === 'w1' && ad.body.initiative === 'self-serve-v2' && ad.body.title === 'Release plan', JSON.stringify(ad && ad.body));
|
|
155
|
+
await until(() => p.evaluate((v) => !!document.querySelector(v + ' [data-ov-task]'), V));
|
|
156
|
+
await settle(() => p.selectOption(`${V} [data-ov-task]`, 'In progress'));
|
|
157
|
+
const ts = await until(() => A.posts.find((x) => x.path === '/api/boards/tasks/state'));
|
|
158
|
+
ok('I10 a status change posts the board, the task and the state, and nothing else', ts && Object.keys(ts.body).sort().join() === 'board,state,task,ws' && ts.body.state === 'In progress', JSON.stringify(ts && ts.body));
|
|
159
|
+
await until(() => p.evaluate((v) => !!document.querySelector(v + ' [data-ov-draft="problem"]'), V));
|
|
160
|
+
await settle(() => p.click(`${V} [data-ov-draft="problem"]`));
|
|
161
|
+
const dr = await until(() => A.posts.find((x) => x.path === '/api/core-docs/draft'));
|
|
162
|
+
ok('I10 Draft it posts the workspace, the initiative scope and the key and nothing else', dr && Object.keys(dr.body).sort().join() === 'key,scope,ws' && dr.body.scope === 'initiative:self-serve-v2' && dr.body.key === 'problem', JSON.stringify(dr && dr.body));
|
|
163
|
+
A.set({ status: 409, body: { ok: false, error: 'PMOS is already drafting this document.' } });
|
|
164
|
+
await until(() => p.evaluate((v) => !!document.querySelector(v + ' [data-ov-draft="research"]'), V));
|
|
165
|
+
await p.click(`${V} [data-ov-draft="research"]`);
|
|
166
|
+
ok('I10 a refused press shows the route\'s reason in the Overview', await until(async () => /already drafting/.test(await txt(p, V + ' #ovMsg'))));
|
|
167
|
+
A.set({ status: 200, body: { ok: true } });
|
|
168
|
+
ok('I10 every press carried the launch nonce and no writer field', !!mint && writes(A).length >= 5 && writes(A).every((x) => x.headers['x-pmos-nonce'] === mint && !['by', 'via', 'at', 'actor', 'pm', 'nonce'].some((k) => k in x.body)), JSON.stringify(writes(A).map((x) => x.path)));
|
|
169
|
+
ok('I10 the Overview posts only to the move, lifecycle, task and draft routes', A.posts.filter((x) => /^\/api\/(boards|lifecycle|core-docs)/.test(x.path)).every((x) => WRITES.test(x.path)));
|
|
170
|
+
ok('I1 the old dialog never opened', await p.evaluate(() => { const d = document.querySelector('#dlg'); return !d || !d.classList.contains('on'); }));
|
|
242
171
|
ok('0 no page error', A.errors.length === 0, A.errors.join(' | '));
|
|
243
172
|
await A.ctx.close();
|
|
244
173
|
|
|
245
|
-
/*
|
|
246
|
-
{
|
|
247
|
-
const B = await open();
|
|
248
|
-
await B.page.unroute('**/api/doc-sheet/**'); await B.page.route('**/api/doc-sheet/**', (r) => r.fulfill({ status: 404, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'the file is not in this repository' }) }));
|
|
249
|
-
await B.page.locator('#dmList .dmo[data-doc="prd"]').click();
|
|
250
|
-
ok('I8 a file that cannot be read says why and shows no text', await until(() => B.page.evaluate(() => /the file is not in this repository/.test(document.querySelector('#oMain').textContent))));
|
|
251
|
-
await B.ctx.close();
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
/* I2 reading and failure */
|
|
174
|
+
/* I2 reading and honest states */
|
|
255
175
|
{
|
|
256
176
|
let n = 0;
|
|
257
|
-
const
|
|
258
|
-
await
|
|
259
|
-
await
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
await
|
|
263
|
-
|
|
264
|
-
ok('I2
|
|
177
|
+
const R = await open({ answers: (c) => { n = c; return c <= 2 ? { status: 202, body: { ok: true, state: 'reading' } } : { status: 200, body: { ok: true, state: 'ready', model: mk(), as_of: Date.now() } }; } });
|
|
178
|
+
await overview(R.page);
|
|
179
|
+
ok('I2 while the initiative is read the Overview says so, then draws when the read ends', await until(() => R.page.evaluate((v) => !!document.querySelector(v + ' [data-ov-move]'), V), 20000) && n >= 3, String(n));
|
|
180
|
+
await R.ctx.close();
|
|
181
|
+
const E = await open({ answers: () => ({ status: 500, body: { ok: false, state: 'error', error: 'the board could not be read' } }) });
|
|
182
|
+
await overview(E.page);
|
|
183
|
+
ok('I2 a failed read says so in the Overview and draws no stage or task', await until(() => E.page.evaluate((v) => { const o = document.querySelector(v); return !!o && /could not be read/.test(o.textContent) && !o.querySelector('[data-ov-move], [data-ov-tkrow]'); }, V), 60000));
|
|
184
|
+
ok('I2 no page error on a failed read', E.errors.length === 0, E.errors.join(' | '));
|
|
265
185
|
await E.ctx.close();
|
|
266
|
-
const N = await open({ answers: () => ({ status: 404, body: { ok: false, state: 'error', error: 'nope is not an initiative on a board' } }), qs: '?id=nope' });
|
|
267
|
-
ok('I2 an initiative that is not on a board says so and does not retry', await N.page.evaluate(() => /nope is not an initiative on a board/.test(document.querySelector('#iMain').textContent)) && N.calls() === 1);
|
|
268
|
-
await N.ctx.close();
|
|
269
|
-
const X = await open({ qs: '?x=1', answers: () => ({ status: 400, body: { ok: false, state: 'error', error: 'id must name an initiative' } }) });
|
|
270
|
-
ok('I2 no initiative named says so', await X.page.evaluate(() => /needs an initiative/.test(document.querySelector('#iMain').textContent)));
|
|
271
|
-
await X.ctx.close();
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
/* I4 the description */
|
|
275
|
-
{
|
|
276
|
-
const L = await open({ model: mk({ row: Object.assign({}, F.ROW, { title: 'Self-serve onboarding v2 — a partner reaches a first call without help' }) }) });
|
|
277
|
-
ok('I4 a title "name — purpose" puts the name in the crumb and the purpose in the description line', await L.page.evaluate(() => document.querySelector('#crIni').textContent === 'Self-serve onboarding v2' && document.querySelector('#cIniOv .lede').textContent === 'A partner reaches a first call without help' && document.querySelector('#iH1').textContent.includes('—')));
|
|
278
|
-
await L.ctx.close();
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
/* I6 a long task list is paged */
|
|
282
|
-
{
|
|
283
|
-
const many = Array.from({ length: 25 }, (_, n) => ({ uid: 'm' + n, key: 'M-' + n, kind: 'Task', src: 'jira', title: 'Task ' + n, status: n % 3 ? 'To do' : 'Done', blocked: false, owner: null, ini: 'self-serve-v2', start: null, end: null }));
|
|
284
|
-
const D = await open({ model: mk({ items: many }) });
|
|
285
|
-
const rows = () => D.page.evaluate(() => document.querySelectorAll('#tkBody .tkq').length);
|
|
286
|
-
ok('I6 the List shows ten tasks and says where it is', await rows() === 10 && /1–10 of 28/.test(await D.page.evaluate(() => document.querySelector('.tkpg').textContent)));
|
|
287
|
-
await D.page.click('[data-tkpg="1"]'); await D.page.click('[data-tkpg="1"]');
|
|
288
|
-
ok('I6 Next walks to the last page, which holds the rest, and Next is then off', await rows() === 8 && await D.page.evaluate(() => document.querySelector('[data-tkpg="1"]').disabled));
|
|
289
|
-
await D.page.click('#tkTabs [data-v="stage"]');
|
|
290
|
-
ok('I6 By stage caps a column and Show more opens it', await D.page.evaluate(() => document.querySelectorAll('#tkBody .isc:nth-child(1) .tkc').length) <= 6 && (await D.page.locator('[data-tkmore]').count()) > 0);
|
|
291
|
-
await D.page.locator('[data-tkmore]').first().click();
|
|
292
|
-
ok('I6 Show more lists the whole column', await D.page.evaluate(() => document.querySelectorAll('#tkBody .tkc').length) >= 25);
|
|
293
|
-
await D.page.click('#tkTabs [data-v="time"]');
|
|
294
|
-
ok('I6 the Timeline keeps working and is paged too', /of 28/.test(await D.page.evaluate(() => document.querySelector('.tkpg').textContent)));
|
|
295
|
-
await D.ctx.close();
|
|
296
186
|
}
|
|
297
187
|
|
|
298
|
-
/*
|
|
188
|
+
/* I12 floors at 390 */
|
|
299
189
|
{
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
/* I12 floors */
|
|
307
|
-
for (const [w, h] of [[1280, 900], [390, 844]]) {
|
|
308
|
-
const R = await open({ w, h });
|
|
309
|
-
const f = await R.page.evaluate(() => { const bad = []; for (const e of document.querySelectorAll('button,a,[role=button],input')) { if (e.closest('[hidden],[inert]')) continue; const r = (e.tagName === 'INPUT' && e.closest('label') ? e.closest('label') : e).getBoundingClientRect(); if (r.width && r.height && (r.height < 32 || r.width < 32) && !e.closest('.seg,.dprog')) bad.push((e.id || e.className || e.tagName) + ' ' + Math.round(r.width) + 'x' + Math.round(r.height)); } return { sx: document.documentElement.scrollWidth - innerWidth, small: bad.slice(0, 6) }; });
|
|
310
|
-
ok(`I12 no sideways scroll and no tiny target at ${w} px`, f.sx <= 0 && f.small.length === 0, JSON.stringify(f));
|
|
311
|
-
if (w === 390) {
|
|
312
|
-
await R.page.locator('#dmList .dmo[data-doc="prd"]').click(); await until(() => R.page.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(700);
|
|
313
|
-
const g = await R.page.evaluate(() => { const r = document.querySelector('#dlg').getBoundingClientRect(); return { l: Math.round(r.left), w: Math.round(r.width), vw: innerWidth }; });
|
|
314
|
-
ok('I12 the sheet is full width on a phone', g.l <= 1 && g.w >= g.vw - 2, JSON.stringify(g));
|
|
315
|
-
}
|
|
316
|
-
await R.ctx.close();
|
|
190
|
+
const N = await open({ w: 390, h: 844 });
|
|
191
|
+
await overview(N.page);
|
|
192
|
+
const fl = await N.page.evaluate((v) => { const o = document.querySelector(v); const small = [...o.querySelectorAll('button, select, input')].filter((b) => b.offsetParent && b.getBoundingClientRect().height < 44).map((b) => b.textContent.trim().slice(0, 24) || b.id || b.tagName); return { over: document.documentElement.scrollWidth - innerWidth, small, vw: Math.round(o.getBoundingClientRect().width) }; }, V);
|
|
193
|
+
ok('I12 at 390 px the Overview has no sideways scroll and every target is 44 px', fl.over <= 0 && fl.small.length === 0, JSON.stringify(fl));
|
|
194
|
+
ok('I12 no page error at 390 px', N.errors.length === 0, N.errors.join(' | '));
|
|
195
|
+
await N.ctx.close();
|
|
317
196
|
}
|
|
318
197
|
|
|
319
198
|
/* the real routes against this repository */
|
|
@@ -329,35 +208,28 @@ const HEALTH = { ok: true, path: 'planning/prd/self-serve-v2-prd.md', health: {
|
|
|
329
208
|
const bad = await fetch(BASE + '/api/initiative-premium?id=../etc/passwd'); ok('I1 an id that is not an id is refused', bad.status === 400);
|
|
330
209
|
const post = await fetch(BASE + '/api/initiative-premium?id=x', { method: 'POST' }); ok('I10 the route answers GET only', post.status === 405);
|
|
331
210
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
const
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
if (geom && ((k === 'width' && SKIP_W.includes(n)) || (k === 'left' && SKIP_L.includes(n)))) continue;
|
|
355
|
-
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]}`);
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
ok(`I12 styles and geometry match the mockup at ${w} px, ${th}`, diffs.length === 0, diffs.join(' ; '));
|
|
359
|
-
await m.context().close(); await R.ctx.close();
|
|
360
|
-
}
|
|
211
|
+
|
|
212
|
+
/* I12 fidelity: the Agreed design (premium-agreed-design, Inside one initiative): Nunito, the cozy card, the CTA in the solid colour, the floating
|
|
213
|
+
* menu. The colours are read from the page's own tokens, so each theme is checked against itself. */
|
|
214
|
+
for (const [w, h] of [[1440, 900], [390, 844]]) for (const th of ['light', 'dark']) {
|
|
215
|
+
const R = await open({ w, h, theme: th });
|
|
216
|
+
const g = await R.page.evaluate(() => {
|
|
217
|
+
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; };
|
|
218
|
+
const cs = (s) => { const e = document.querySelector(s); return e ? getComputedStyle(e) : null; };
|
|
219
|
+
const fab = document.querySelector('#czFab'), fr = fab && fab.getBoundingClientRect();
|
|
220
|
+
const c = document.querySelector('.hm-card').getBoundingClientRect();
|
|
221
|
+
return { font: cs('body').fontFamily, cta: cs('.hm-card [data-hm-cta]').backgroundColor, ctaAlt: document.querySelector('.hm-card [data-hm-cta]').classList.contains('alt'), solid: tok('--cz-solid'), blue: tok('--cz-blue'), well: tok('--cz-well'), card: tok('--cz-card'), box: cs('.hm-card .hm-box').backgroundColor, rad: parseFloat(cs('.hm-card .hm-box').borderTopLeftRadius), fab: fr ? [Math.round(fr.width), Math.round(fr.height)] : null, over: document.documentElement.scrollWidth - innerWidth, cardW: Math.round(c.width) };
|
|
222
|
+
});
|
|
223
|
+
const d = [];
|
|
224
|
+
if (!/^Nunito/.test(g.font)) d.push('font ' + g.font);
|
|
225
|
+
if (!g.ctaAlt && ![g.solid, g.blue].includes(g.cta)) d.push('cta ' + g.cta + ' want ' + g.solid + ' or ' + g.blue);
|
|
226
|
+
if (![g.well, g.card].includes(g.box) && !/rgba/.test(g.box)) d.push('card box ' + g.box);
|
|
227
|
+
if (g.rad < 12) d.push('card radius ' + g.rad);
|
|
228
|
+
if (!g.fab || g.fab[0] !== 56 || g.fab[1] !== 56) d.push('fab ' + JSON.stringify(g.fab));
|
|
229
|
+
if (g.over > 0) d.push('sideways scroll ' + g.over);
|
|
230
|
+
ok(`I12 the initiative follows the Agreed design at ${w} px, ${th}: Nunito, the cozy card, the CTA, the floating menu`, d.length === 0, d.join(' ; '));
|
|
231
|
+
ok(`I12 no page error at ${w} px, ${th}`, R.errors.length === 0, R.errors.join(' | '));
|
|
232
|
+
await R.ctx.close();
|
|
361
233
|
}
|
|
362
234
|
return finish();
|
|
363
235
|
})().catch((e) => { console.error(e); finish(1); });
|