create-pmos 0.324.0 → 0.325.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 +1 -1
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/briefing-premium-calendar-2-test.js +8 -6
- package/workspace/briefing-premium-calendar-3-test.js +7 -4
- package/workspace/briefing-premium-calendar-test.js +4 -2
- package/workspace/guide/briefing-premium.md +14 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-vw-item-test.js +128 -0
- package/workspace/premium-vw-meet-test.js +210 -0
- package/workspace/premium-vw-notes-test.js +161 -0
- package/workspace/public/pm/premium-board.js +3 -1
- package/workspace/public/pm/premium-initiative.js +7 -2
- package/workspace/public/pm/premium-meeting.js +84 -31
- package/workspace/public/pm/premium-vw-item-model.js +58 -0
- package/workspace/public/pm/premium-vw-item.css +25 -0
- package/workspace/public/pm/premium-vw-item.js +66 -0
- package/workspace/public/pm/premium-vw-meet.css +87 -0
- package/workspace/public/pm/premium-vw-meet.js +322 -0
- package/workspace/public/pm/premium-vw-notes.css +43 -0
- package/workspace/public/pm/premium-vw-notes.js +188 -0
- package/workspace/public/pm/premium.js +2 -0
- package/workspace/test-lists/premium-vw-item.json +13 -0
- package/workspace/test-lists/premium-vw-meet.json +13 -0
- package/workspace/test-lists/premium-vw-notes.json +13 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.325.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": {
|
package/payload/KIT-VERSION
CHANGED
|
@@ -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-19T22:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T22:44:01Z"}
|
|
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-19T22:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T22:44:01Z"}
|
|
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-19T22:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T22:44:01Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -69,7 +69,7 @@ const SUGGEST = { ok: true, suggested: [{ kind: 'pmos-doc', ref: 'planning/prd/p
|
|
|
69
69
|
browser = await chromium.launch({ executablePath: exe });
|
|
70
70
|
|
|
71
71
|
const facts = () => { const f = F.facts(); f.meetings = [{ start: at(14, 0).getTime(), end: at(15, 0).getTime(), title: 'Sprint planning', with: 'Dara, Priya, Sam', initiative: null }]; return f; };
|
|
72
|
-
const open = async ({ w = 1280, h = 900, theme = 'light', replay = REPLAY, items = [{ id: 'm1', kind: 'link', url: 'https://x.example/road', title: 'Roadmap', scope: 'meeting', from: 'you' }], writeStatus = 200, planStatus = 200, stages = [{ id: 'st1', label: 'Intake' }] } = {}) => {
|
|
72
|
+
const open = async ({ w = 1280, h = 900, theme = 'light', replay = REPLAY, items = [{ id: 'm1', kind: 'link', url: 'https://x.example/road', title: 'Roadmap', scope: 'meeting', from: 'you' }], writeStatus = 200, planStatus = 200, stages = [{ id: 'st1', label: 'Intake' }], stage = 'before' } = {}) => {
|
|
73
73
|
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
74
74
|
const page = await ctx.newPage();
|
|
75
75
|
const S = { errors: [], reqs: [], matPosts: [], planPosts: [], suggestGets: [], items: items.slice() };
|
|
@@ -109,6 +109,8 @@ const SUGGEST = { ok: true, suggested: [{ kind: 'pmos-doc', ref: 'planning/prd/p
|
|
|
109
109
|
await until(() => page.evaluate(() => document.querySelectorAll('#wkStrip [data-day]').length === 5)); // the card's day strip: today is picked, so the row is a Today row
|
|
110
110
|
await page.evaluate(() => { const r = [...document.querySelectorAll('#tl .ev')].find((e) => e.querySelector('b').textContent === 'Sprint planning'); r.id = 'rowSprint'; r.click(); });
|
|
111
111
|
S.dlg = await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#mmAdd') && /Roadmap|No material/.test(document.querySelector('#oMain').textContent)));
|
|
112
|
+
// the detail opens on After when the meeting has notes (premium-viewer S3): material is under Before, Make task under After
|
|
113
|
+
if (S.dlg && stage) { await page.click(`#oMain [data-ph="${stage}"]`); S.dlg = await until(() => page.evaluate((k) => !document.querySelector(`#oMain .vm-body[data-part="${k}"]`).hidden, stage)); }
|
|
112
114
|
return Object.assign(S, { ctx, page });
|
|
113
115
|
};
|
|
114
116
|
const text = (p) => p.evaluate(() => document.querySelector('#oMain').textContent);
|
|
@@ -177,7 +179,7 @@ const SUGGEST = { ok: true, suggested: [{ kind: 'pmos-doc', ref: 'planning/prd/p
|
|
|
177
179
|
ok('M5 the refused writes changed nothing in the list', D.items.length === 1);
|
|
178
180
|
|
|
179
181
|
/* M4 make task */
|
|
180
|
-
const N = await open();
|
|
182
|
+
const N = await open({ stage: 'after' });
|
|
181
183
|
const steps = await text(N.page);
|
|
182
184
|
ok('M4 the next step has Make task, and decisions and questions have none', /Make task/.test(steps) && await N.page.evaluate(() => document.querySelectorAll('.mtg-task').length === 1));
|
|
183
185
|
await N.page.click('.mtg-task');
|
|
@@ -190,13 +192,13 @@ const SUGGEST = { ok: true, suggested: [{ kind: 'pmos-doc', ref: 'planning/prd/p
|
|
|
190
192
|
await until(() => N.planPosts.length === 2);
|
|
191
193
|
ok('M4 Undo withdraws the item', N.planPosts[1].events[0].ev === 'withdrawn' && N.planPosts[1].events[0].item === 'item-9' && N.planPosts[1].events[0].initiative === 'premium-ux', JSON.stringify(N.planPosts[1]));
|
|
192
194
|
ok('M4 after Undo the step can be made a task again', await until(() => N.page.evaluate(() => document.querySelector('.mtg-task').textContent === 'Make task' && !document.querySelector('.mtg-task').disabled)));
|
|
193
|
-
const NI = await open({ replay: REPLAY_NOINI });
|
|
195
|
+
const NI = await open({ stage: 'after', replay: REPLAY_NOINI });
|
|
194
196
|
await NI.page.click('.mtg-task');
|
|
195
197
|
ok('M4 with no initiative the button says to link one and writes nothing', await until(() => NI.page.evaluate(() => /Link the note to an initiative first/.test(document.querySelector('#mtgStatus').textContent))) && NI.planPosts.length === 0);
|
|
196
|
-
const NS = await open({ stages: [] });
|
|
198
|
+
const NS = await open({ stage: 'after', stages: [] });
|
|
197
199
|
await NS.page.click('.mtg-task');
|
|
198
200
|
ok('M4 an initiative with no stage says so and writes nothing', await until(() => NS.page.evaluate(() => /The task was not made: The initiative has no stage/.test(document.querySelector('#mtgStatus').textContent))) && NS.planPosts.length === 0);
|
|
199
|
-
const NR = await open({ planStatus: 403 });
|
|
201
|
+
const NR = await open({ stage: 'after', planStatus: 403 });
|
|
200
202
|
await NR.page.click('.mtg-task');
|
|
201
203
|
ok('M5 a refused Make task shows the reason and the step stays open', await until(() => NR.page.evaluate(() => /The task was not made: a page press is required/.test(document.querySelector('#mtgStatus').textContent) && document.querySelector('.mtg-task').textContent === 'Make task' && !document.querySelector('.mtg-task').disabled)));
|
|
202
204
|
|
|
@@ -210,7 +212,7 @@ const SUGGEST = { ok: true, suggested: [{ kind: 'pmos-doc', ref: 'planning/prd/p
|
|
|
210
212
|
/* M7 floors and fidelity */
|
|
211
213
|
for (const th of ['light', 'dark']) {
|
|
212
214
|
const P = await open({ w: 390, h: 844, theme: th });
|
|
213
|
-
const f1 = await P.page.evaluate(() => ({ scroll: document.documentElement.scrollWidth <= innerWidth + 1, btn: [...document.querySelectorAll('#mmAdd,.mtg-rm,.mtg-task')].map((b) => Math.min(b.getBoundingClientRect().width, b.getBoundingClientRect().height)) }));
|
|
215
|
+
const f1 = await P.page.evaluate(() => ({ scroll: document.documentElement.scrollWidth <= innerWidth + 1, btn: [...document.querySelectorAll('#mmAdd,.mtg-rm,.mtg-task,#oMain .vm-ph button')].filter((b) => b.getClientRects().length).map((b) => Math.min(b.getBoundingClientRect().width, b.getBoundingClientRect().height)) }));
|
|
214
216
|
await P.page.click('#mmAdd'); await until(() => P.page.evaluate(() => /Premium UX PRD/.test(document.querySelector('#mmSug').textContent)));
|
|
215
217
|
await P.page.click('#mmSug [data-pick]');
|
|
216
218
|
const f2 = await P.page.evaluate(() => ({ scroll: document.documentElement.scrollWidth <= innerWidth + 1 && document.querySelector('#oMain').scrollWidth <= document.querySelector('#oMain').clientWidth + 1, btn: [...document.querySelectorAll('#mmBack,#mmDo,#mmCancel,[data-scope],[data-pick],.mtg-in')].map((b) => Math.min(b.getBoundingClientRect().width, b.getBoundingClientRect().height)) }));
|
|
@@ -146,7 +146,10 @@ const RECORDER = () => {
|
|
|
146
146
|
};
|
|
147
147
|
const text = (p) => p.evaluate(() => document.querySelector('#oMain').textContent);
|
|
148
148
|
const rec = (p) => p.evaluate(() => document.querySelector('#m3Rec') ? document.querySelector('#m3Rec').textContent : '');
|
|
149
|
-
|
|
149
|
+
/* A control under a stage the dialog is not showing (Before / During / After) is reached by pressing that stage first; the press holds the stage
|
|
150
|
+
* when the meeting's answers land and the dialog would otherwise open on its own pick. */
|
|
151
|
+
const reveal = async (p, sel) => { await until(() => p.evaluate(() => document.querySelector('#oMain').dataset.ready === 'meeting')); await p.evaluate((q) => { const b = document.querySelector(q), part = b && b.closest('.vm-body[data-part]'); if (part) document.querySelector(`#oMain [data-ph="${part.dataset.part}"]`).click(); }, sel); };
|
|
152
|
+
const press = async (p, act) => { const sel = `#oMain [data-m3="${act}"]`; await reveal(p, sel); await p.click(sel); };
|
|
150
153
|
const chip = (p) => p.evaluate(() => { const c = document.querySelector('#recChip'); return c && !c.hidden ? c.textContent : null; });
|
|
151
154
|
|
|
152
155
|
const A = await open();
|
|
@@ -165,7 +168,7 @@ const RECORDER = () => {
|
|
|
165
168
|
ok('R1 Not yet closes the ask and sends nothing', await until(() => p.evaluate(() => !/Tell everyone first/.test(document.querySelector('#m3Rec').textContent))) && A.newPosts.length === 0);
|
|
166
169
|
await press(p, 'rec'); await press(p, 'go');
|
|
167
170
|
ok('R1 "I told them, start" makes the note for the calendar event, then listens on it', await until(() => A.recPosts.length === 1) && A.newPosts.length === 1 && A.newPosts[0].meeting.event_id === 'ev-live' && A.newPosts[0].meeting.title === 'Live review' && A.recPosts[0].id === 'n1', JSON.stringify([A.newPosts, A.recPosts]));
|
|
168
|
-
ok('R2 the row now says Recording with the clock, Pause and Stop, from the recorder and the note', await until(() => p.evaluate(() => /Recording/.test(document.querySelector('#m3Rec').textContent) && /1:0\d/.test(document.querySelector('#m3Clk').textContent) && !!document.querySelector('[data-m3="pause"]') && !!document.querySelector('[data-m3="stop"]'))), await rec(p));
|
|
171
|
+
ok('R2 the row now says Recording with the clock, Pause and Stop, from the recorder and the note', await until(() => p.evaluate(() => /Recording/.test(document.querySelector('#m3Rec').textContent) && /1:0\d/.test((document.querySelector('#m3Clk') || {}).textContent || '') && !!document.querySelector('[data-m3="pause"]') && !!document.querySelector('[data-m3="stop"]'))), await rec(p));
|
|
169
172
|
ok('R3 the chip says Recording with the title, and has Open and Stop', await until(async () => /Recording Live review/.test((await chip(p)) || '')) && await p.evaluate(() => !!document.querySelector('#recChip [data-r="open"]') && !!document.querySelector('#recChip [data-r="stop"]') && !!document.querySelector('#recChip [data-r="pause"]')), String(await chip(p)));
|
|
170
173
|
ok('R9 the meeting\'s row carries a Recording mark', await until(() => p.evaluate(() => !!document.querySelector('#tl .ev .m3-mark') && /Recording/.test(document.querySelector('#tl .m3-mark').textContent))));
|
|
171
174
|
await press(p, 'pause');
|
|
@@ -310,7 +313,7 @@ const RECORDER = () => {
|
|
|
310
313
|
|
|
311
314
|
/* R8 Topic on material */
|
|
312
315
|
const Tp = await open({ topics: ['Capacity', 'Risks'] });
|
|
313
|
-
await Tp.page.click('#mmAdd'); await until(() => Tp.page.evaluate(() => /Roadmap/.test(document.querySelector('#mmSug').textContent)));
|
|
316
|
+
await reveal(Tp.page, '#mmAdd'); await Tp.page.click('#mmAdd'); await until(() => Tp.page.evaluate(() => /Roadmap/.test(document.querySelector('#mmSug').textContent)));
|
|
314
317
|
await Tp.page.click('#mmSug [data-pick]');
|
|
315
318
|
ok('R8 the sheet offers a Topic choice from the route\'s topics, and the line names the topic when one is chosen', await until(() => Tp.page.evaluate(() => document.querySelectorAll('[data-topic]').length === 3)));
|
|
316
319
|
await Tp.page.click('[data-topic="2"]');
|
|
@@ -319,7 +322,7 @@ const RECORDER = () => {
|
|
|
319
322
|
ok('R8 Add posts the topic with the item', await until(() => Tp.matPosts.length === 1) && Tp.matPosts[0].topic === 'Risks', JSON.stringify(Tp.matPosts));
|
|
320
323
|
await Tp.ctx.close();
|
|
321
324
|
const Tn = await open();
|
|
322
|
-
await Tn.page.click('#mmAdd'); await until(() => Tn.page.evaluate(() => /Roadmap/.test(document.querySelector('#mmSug').textContent)));
|
|
325
|
+
await reveal(Tn.page, '#mmAdd'); await Tn.page.click('#mmAdd'); await until(() => Tn.page.evaluate(() => /Roadmap/.test(document.querySelector('#mmSug').textContent)));
|
|
323
326
|
await Tn.page.click('#mmSug [data-pick]');
|
|
324
327
|
ok('R8 with no topics the Topic choice is not drawn and no topic is sent', await Tn.page.evaluate(() => document.querySelectorAll('[data-topic]').length === 0));
|
|
325
328
|
await Tn.page.click('#mmDo'); await until(() => Tn.matPosts.length === 1);
|
|
@@ -152,6 +152,7 @@ const MOCKUP = fs.readFileSync(path.join(__dirname, '..', 'prototype', 'premium-
|
|
|
152
152
|
/* C5 link it */
|
|
153
153
|
await p.click('#rowSprint');
|
|
154
154
|
await until(() => p.evaluate(() => !!document.querySelector('#mtgSel') && /Capacity sheet/.test(document.querySelector('#oMain').textContent)));
|
|
155
|
+
await p.click('#oMain [data-vm="about"]'); // the head's Change opens the choice (premium-viewer S3)
|
|
155
156
|
const dis = await p.evaluate(() => document.querySelector('#mtgLink').disabled);
|
|
156
157
|
ok('C5 Link it is off until a choice is made', dis === true);
|
|
157
158
|
const optsText = await p.evaluate(() => [...document.querySelectorAll('#mtgSel option')].map((o) => o.textContent));
|
|
@@ -176,8 +177,9 @@ const MOCKUP = fs.readFileSync(path.join(__dirname, '..', 'prototype', 'premium-
|
|
|
176
177
|
const R = await open({ replay: REPLAY });
|
|
177
178
|
await week(R.page);
|
|
178
179
|
await R.page.evaluate(() => { [...document.querySelectorAll('#tl .ev')].find((e) => e.querySelector('b').textContent === 'Sprint planning').click(); });
|
|
179
|
-
const rd = await until(() => R.page.evaluate(() => /
|
|
180
|
-
|
|
180
|
+
const rd = await until(() => R.page.evaluate(() => /Next step/.test(document.querySelector('#oMain').textContent) ? document.querySelector('#oMain').textContent : null));
|
|
181
|
+
const owner = await R.page.evaluate(() => { const c = document.querySelector('#oMain [data-vm-t="actions"] tbody tr'); return c ? [...c.children].slice(1, 3).map((x) => x.textContent).join(' · ') : ''; });
|
|
182
|
+
ok('C6 the note\'s decisions, next steps and questions are listed as the note holds them', rd && /Plan the sprint with eight people/.test(rd) && /Sam confirms the data fix owner/.test(rd) && /^Sam · Tue/.test(owner) && /Does a release eat the capacity\?/.test(rd) && /Sprint planning notes/.test(rd), String(rd).slice(0, 300));
|
|
181
183
|
ok('C8 a kept recording is summarised, and Replay opens in the dialog', rd && /A recording is kept: 25 min, 3 key points/.test(rd) && /Replay/.test(rd) && !/Replay opens in the console/.test(rd));
|
|
182
184
|
ok('C6 the replay answer\'s people are used only when the calendar lists none', rd && /Dara, Priya, Sam/.test(rd));
|
|
183
185
|
|
|
@@ -137,6 +137,10 @@ In **Notes**, each next step has **Make task** when the note is linked to an ini
|
|
|
137
137
|
|
|
138
138
|
In the **Add material** sheet, a **Topic** choice ties the item to one of the meeting's topics, so Focus can bring it up. It appears only when the meeting has topics.
|
|
139
139
|
|
|
140
|
+
**Notes.** The Calendar card header has a **Notes** press. On a phone the header has no room, so **Notes** sits under the day; show the card first if it is hidden. It opens the dialog with every meeting note in the detail pane, as the console's Calendar › Notes lists them. The notes are grouped by what each one is about: Portfolio, each board in the portfolio's order, Initiatives, then Not linked. A row shows the meeting's day and time, its length, its initiative or a "board" tag, "no meeting" when the note has no meeting, "recording" or "paused", and a count when statements differ from a file. The notes of one meeting series are one row with the number of meetings and how many next steps are still open. The chevron folds it open to its newest three notes, each with the first line of its summary. Type in the search field to filter by title, meeting, initiative or summary at once. After a moment PMOS also searches what was said, the decisions and the transcripts, and adds the notes it finds. A private note is found by its title only.
|
|
141
|
+
|
|
142
|
+
Press a note to open it as a tab beside the list, with **Before**, **During** and **After** as the meeting dialog has. Press a series to open its newest note, then page through the series with the arrows. The tab's head shows the note's meeting and what it is about. **Change** (or **Choose what it is about**) lists the Portfolio, each board and its initiatives; **Save** writes the note's link, as the console's picker does, and the note moves into its group. Linking a note to another calendar event stays in the console. Make task writes the next step to the note's initiative, as in the meeting dialog.
|
|
143
|
+
|
|
140
144
|
Not built in premium: translation, Present and the slides stage, Ask PMOS quietly, Park and Add topic, the phone companion and the Meet extension view. The console keeps them.
|
|
141
145
|
|
|
142
146
|
## Around you
|
|
@@ -170,6 +174,8 @@ A row or a Today item opens a dialog with the same parts every time. At the top
|
|
|
170
174
|
|
|
171
175
|
The right side can hold more than one item. When the dialog opens a related item there, such as a document, a meeting or a ticket, the item opens as a tab beside the dialog's own detail. The first tab is always the dialog's own detail. You can have up to four more tabs; a fifth closes the oldest. Click a tab or use the arrow keys to move between them. Use the **×** on a tab, or press Delete, to close it. The tabs close when the dialog closes. With no extra item, there are no tabs.
|
|
172
176
|
|
|
177
|
+
**An initiative or a task as a tab.** On the Board (with initiatives set to open as a popup), an initiative's dialog has **Open the full record**. On the initiative page, the initiative's own dialog has the same press, and a task's dialog has **Open the initiative**. The initiative opens as a tab with its record (lane, stage, anchor, status, owner, planned finish, progress), the next step, the checks with their evidence, its tasks and its links (the record files and the documents that have a file). Press a task to open it as its own tab: type, reference, source, owner, start, due date and status, with a link back to its initiative. The tabs read what the initiative page reads and change nothing. While the board is still reading, the tab says so; if the read fails, the tab says what failed.
|
|
178
|
+
|
|
173
179
|
### The document page
|
|
174
180
|
|
|
175
181
|
Every markdown document opens as one page in a tab: a report, a PRD, a new document or any other `.md` file. On a document sheet, click **Open as a page**. On a report, click **Edit**.
|
|
@@ -335,4 +341,12 @@ A dialog's detail panel opens with the record's path, its heading and one lead l
|
|
|
335
341
|
|
|
336
342
|
A calendar meeting's panel follows the mockup's Design review panel: the title with a status chip (when it starts, on now, or done), **Focus** and **Record**, **Prepared for you** (what it is about, people, material and the last meeting, each Ready only when PMOS holds that record), **Material** with **Add material**, **Previous meetings** and **Topics**. What Record and Focus do is one press away under **What Record does** and **What Focus reads**.
|
|
337
343
|
|
|
344
|
+
The panel is laid out like the console's note sheet. Under the head, a line shows the time, then what the meeting is about with **Change** (the link choice). When the meeting is part of a series, the series line names it with "N of M" and has a press for the meeting before and the one after. Each opens that meeting's notes as a tab in the viewer, and the tab pages through the series. **Not part of this series** takes the note out of the series, and **Put it back** returns it. A switch then shows one part at a time:
|
|
345
|
+
|
|
346
|
+
- **Before**: the open steps carried in from the meeting before, the agenda with each item marked when the transcript heard it, what the meeting is for, what to have ready, what to read first and the people. Prepared for you, Material, Previous meetings and Topics follow.
|
|
347
|
+
- **During**: the transcript the note holds, with times.
|
|
348
|
+
- **After**: **Since the last one** (each step from the meeting before as Done, Raised again or Not mentioned, and the new steps), the replay, the summary, a table of decisions with their why, a table of next steps with owner, due and **Make task**, the open questions, the screenshots of the shared screen and the transcript, folded.
|
|
349
|
+
|
|
350
|
+
The switch opens on During while the note records, on After once there are notes, and on Before otherwise. A part with no record behind it says so. A private note shows none of its notes.
|
|
351
|
+
|
|
338
352
|
A document opens in one sheet on both the Board and the initiative page. Its status line shows the state, the version, the checks, the file and the last change; the file's path and front matter sit behind the file chip. The outline lists the headings at their depth, with **Find a heading** when there are many and **Hide the outline**. The body shows lists, tables, bold, code and links. A board draft keeps **Issue it** and **Draft it again**.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.325.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.325.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* premium-vw-item-test.js — an initiative and its tasks as tabs of the premium dialog's viewer (initiative premium-viewer, S7; planning/prd/premium-viewer-prd.md R9, R6, R7).
|
|
4
|
+
* Serves the real initiative and Board pages from the real server with /api/initiative-premium and /api/board-premium answered by stand-ins built
|
|
5
|
+
* from the libraries' own fixtures. Opens the dialog, presses Open the full record, then a task inside the tab and the initiative link inside the task.
|
|
6
|
+
* Every wait polls the page; no fixed sleep stands in for a state. */
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const { spawn } = require('child_process');
|
|
9
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
10
|
+
const T = require('./test-run').configure({ name: 'premium-vw-item' });
|
|
11
|
+
const IP = require('./lib/initiative-premium.js');
|
|
12
|
+
const F = require('./fixtures/initiative-premium-facts.js');
|
|
13
|
+
const BP = require('./lib/board-premium.js');
|
|
14
|
+
const BF = require('./fixtures/board-premium-facts.js');
|
|
15
|
+
|
|
16
|
+
const BASE = T.BASE;
|
|
17
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
18
|
+
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
19
|
+
const results = [];
|
|
20
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
21
|
+
let srv = null; let browser = null;
|
|
22
|
+
const finish = async (code) => {
|
|
23
|
+
if (browser) await browser.close().catch(() => {});
|
|
24
|
+
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
25
|
+
T.killTmux();
|
|
26
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
27
|
+
console.log(`\n${results.length - bad}/${results.length} premium-vw-item assertions passed`);
|
|
28
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
29
|
+
};
|
|
30
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
31
|
+
|
|
32
|
+
(async () => {
|
|
33
|
+
const exe = findBrowser();
|
|
34
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
35
|
+
let chromium;
|
|
36
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
37
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
38
|
+
await T.waitForServer(BASE);
|
|
39
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
40
|
+
const MODEL = IP.build(F.facts());
|
|
41
|
+
|
|
42
|
+
const open = async ({ w = 1280, h = 900, theme = 'light', answer = null } = {}) => {
|
|
43
|
+
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
44
|
+
const page = await ctx.newPage();
|
|
45
|
+
const S = { errors: [], gets: [] };
|
|
46
|
+
page.on('pageerror', (e) => S.errors.push(String((e && e.message) || e)));
|
|
47
|
+
await page.route('**/api/initiative-premium*', (r) => { S.gets.push(r.request().url()); const a = answer ? answer(S.gets.length) : { status: 200, body: { ok: true, state: 'ready', model: MODEL, as_of: Date.now() } }; r.fulfill({ status: a.status, contentType: 'application/json', body: JSON.stringify(a.body) }); });
|
|
48
|
+
await page.route('**/api/briefing-premium/**', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, turns: [], working: false }) }));
|
|
49
|
+
await page.goto(BASE + '/premium-initiative.html?id=self-serve-v2&ws=w1&board=w1&theme=' + theme);
|
|
50
|
+
S.up = await until(() => page.evaluate(() => !!document.querySelector('#cIniTk') && !!window.__premiumViewer), 20000);
|
|
51
|
+
return { page, ctx, S };
|
|
52
|
+
};
|
|
53
|
+
const st = (page) => page.evaluate(() => ({ ...window.__premiumViewer.vwState(), tabs: [...document.querySelectorAll('#vTabs .vtab')].map((x) => x.textContent.trim()) }));
|
|
54
|
+
const paneTxt = (page, id) => page.evaluate((k) => { const p = document.querySelector(`#dOut .obody.vw[data-vw="${CSS.escape(k)}"]`); return p ? p.textContent.replace(/\s+/g, ' ') : ''; }, id);
|
|
55
|
+
const INI = 'item:ini:self-serve-v2';
|
|
56
|
+
|
|
57
|
+
/* R9 on the initiative page, at 1280 */
|
|
58
|
+
{
|
|
59
|
+
const { page, ctx, S } = await open();
|
|
60
|
+
ok('R9 the initiative page loads with the viewer', S.up);
|
|
61
|
+
await page.locator('#cIniTk .tkq', { hasText: 'UAT with five partners' }).click(); await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on')));
|
|
62
|
+
const n0 = S.gets.length; // the page's own read
|
|
63
|
+
ok('R9 a task dialog offers Open the initiative', await page.evaluate(() => /Open the initiative/.test((document.querySelector('#oMain [data-vwopen]') || {}).textContent || '')));
|
|
64
|
+
await page.click('#oMain [data-vwopen]');
|
|
65
|
+
await until(async () => /Checks/.test(await paneTxt(page, INI)));
|
|
66
|
+
let s = await st(page), t = await paneTxt(page, INI);
|
|
67
|
+
ok('R9 the initiative opens as a tab beside the task\'s own detail', JSON.stringify(s.ids) === JSON.stringify([INI]) && s.on === INI && s.tabs.length === 2, JSON.stringify(s));
|
|
68
|
+
ok('R9 the tab holds the record, next step, checks, tasks and links', ['planning/initiatives/self-serve-v2.md', 'q3-2026:o1:kr1', 'Dara', '30 Oct', 'Next: contract', 'Checks', 'Sandbox key step', 'UAT with five partners', 'planning/evals/self-serve-v2-eval-rubric.md'].every((x) => t.includes(x)), t.slice(0, 500));
|
|
69
|
+
ok('R9 the tab loads its own stylesheet', await page.evaluate(() => !!document.querySelector('link[data-vw-css="item"]')));
|
|
70
|
+
await page.click(`#dOut .obody.vw[data-vw="${INI}"] [data-vwtask="task:t1"]`);
|
|
71
|
+
const TK = 'item:task:self-serve-v2:task:t1';
|
|
72
|
+
await until(async () => /UAT with five partners/.test(await paneTxt(page, TK)));
|
|
73
|
+
s = await st(page); t = await paneTxt(page, TK);
|
|
74
|
+
ok('R9 a task inside the tab opens its own tab, named by the task', JSON.stringify(s.ids) === JSON.stringify([INI, TK]) && s.on === TK && s.tabs[2] === 'UAT with five partners', JSON.stringify(s));
|
|
75
|
+
ok('R9 the task tab shows owner, start, due and status', ['Dara', '20 Oct', '27 Oct', 'To do', 'PMOS task'].every((x) => t.includes(x)), t);
|
|
76
|
+
ok('R9 two tabs of one initiative read the route once', S.gets.length - n0 === 1, String(S.gets.length - n0));
|
|
77
|
+
await page.click(`#dOut .obody.vw[data-vw="${TK}"] [data-vwini]`);
|
|
78
|
+
s = await st(page);
|
|
79
|
+
ok('R9 the initiative link brings the open initiative tab forward, not a second one', s.on === INI && s.ids.length === 2, JSON.stringify(s));
|
|
80
|
+
await page.keyboard.press('Escape'); await until(() => page.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
81
|
+
await page.click('#crAsk'); await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on')));
|
|
82
|
+
s = await st(page);
|
|
83
|
+
ok('R9 a new dialog starts with no extra tab; the initiative\'s own dialog offers Open the full record', s.ids.length === 0 && await page.evaluate(() => /Open the full record/.test((document.querySelector('#oMain [data-vwopen]') || {}).textContent || '')), JSON.stringify(s));
|
|
84
|
+
ok('R9 no page error', S.errors.length === 0, S.errors.join(' | '));
|
|
85
|
+
await ctx.close();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* R6 a route that is reading, then fails */
|
|
89
|
+
{
|
|
90
|
+
const { page, ctx, S } = await open({ answer: (n) => (n === 1 ? { status: 200, body: { ok: true, state: 'ready', model: MODEL } } : n <= 3 ? { status: 202, body: { ok: true, state: 'reading' } } : { status: 500, body: { ok: false, state: 'error', error: 'the board could not be read' } }) });
|
|
91
|
+
await page.click('#crAsk'); await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on')));
|
|
92
|
+
await page.evaluate(() => window.__premiumWorkItem.openWorkItem({ kind: 'initiative', id: 'other-two', title: 'Other' }));
|
|
93
|
+
ok('R6 while the route reads, the tab says so', await until(async () => /Reading the initiative/.test(await paneTxt(page, 'item:ini:other-two')), 3000));
|
|
94
|
+
ok('R6 a failed read says what failed and invents nothing', await until(async () => /could not be read: the board could not be read/.test(await paneTxt(page, 'item:ini:other-two')), 8000), await paneTxt(page, 'item:ini:other-two'));
|
|
95
|
+
await ctx.close();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* R9 from the Board's initiative dialog (Popup), and R7 floors at 390 in dark */
|
|
99
|
+
{
|
|
100
|
+
const ctx = await browser.newContext({ viewport: { width: 390, height: 844 } });
|
|
101
|
+
const page = await ctx.newPage(); const errors = [];
|
|
102
|
+
page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
|
|
103
|
+
await page.addInitScript(() => { try { localStorage.setItem('pmos.premium.openAs', 'popup'); } catch { /* none */ } });
|
|
104
|
+
await page.route('**/api/board-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: BP.build(BF.facts()), as_of: Date.now() }) }));
|
|
105
|
+
await page.route('**/api/initiative-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: MODEL, as_of: Date.now() }) }));
|
|
106
|
+
await page.route('**/api/briefing-premium/**', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, turns: [], working: false }) }));
|
|
107
|
+
await page.goto(BASE + '/premium-board.html?theme=dark');
|
|
108
|
+
const up = await until(() => page.evaluate(() => document.querySelectorAll('#ibBody [data-key]').length > 0), 20000);
|
|
109
|
+
ok('R9 the Board loads', up);
|
|
110
|
+
const opened = await page.evaluate(() => { const b = document.querySelector('#ibBody [data-key]'); if (b) b.click(); return !!b; });
|
|
111
|
+
await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on')));
|
|
112
|
+
ok('R9 an initiative row opens the Board dialog with Open the full record', opened && await until(() => page.evaluate(() => !!document.querySelector('#oMain [data-vwopen]')), 3000));
|
|
113
|
+
await page.evaluate(() => document.querySelector('#oMain [data-vwopen]').click());
|
|
114
|
+
const id = await until(() => page.evaluate(() => window.__premiumViewer.vwState().ids[0]), 3000);
|
|
115
|
+
ok('R9 the Board dialog opens the record as a tab', /^item:ini:/.test(id || ''), String(id));
|
|
116
|
+
await until(async () => /Checks/.test(await paneTxt(page, id)));
|
|
117
|
+
const fl = await page.evaluate((k) => {
|
|
118
|
+
const p = document.querySelector(`#dOut .obody.vw[data-vw="${CSS.escape(k)}"]`);
|
|
119
|
+
const small = [...p.querySelectorAll('button, a')].filter((b) => b.offsetParent && b.getBoundingClientRect().height < 44).map((b) => b.textContent.trim().slice(0, 30));
|
|
120
|
+
return { wide: document.documentElement.scrollWidth <= 390, small, bg: getComputedStyle(p.querySelector('.vwi-l') || p).backgroundColor };
|
|
121
|
+
}, id);
|
|
122
|
+
ok('R7 at 390px in dark: no sideways scroll, every press at least 44px', fl.wide && fl.small.length === 0, JSON.stringify(fl));
|
|
123
|
+
ok('R7 dark theme cards are dark', /rgba?\((\d+), (\d+), (\d+)/.test(fl.bg) && +RegExp.$1 < 80, fl.bg);
|
|
124
|
+
ok('R9 no page error on the Board', errors.length === 0, errors.join(' | '));
|
|
125
|
+
await ctx.close();
|
|
126
|
+
}
|
|
127
|
+
finish();
|
|
128
|
+
})();
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* premium-vw-meet-test.js — the meeting detail laid out as the console's note sheet (initiative premium-viewer, R3, slice S3; planning/prd/premium-viewer-prd.md).
|
|
4
|
+
* Serves the real Briefing from the real server. The Briefing model, the calendar, the notes and the note (GET /api/notes/one) are answered by stand-ins,
|
|
5
|
+
* so each press can be read off the request the page sent. The routes' own behaviour is in their own suites; the pure half is in premium-vw-meet.test.js.
|
|
6
|
+
* S1 stage · S2 head · S3 After · S4 Make task · S5 Before · S6 During · S7 series membership · S8 no note · S9 writes · S10 floors
|
|
7
|
+
* Every wait polls the page; no fixed sleep stands in for a state. */
|
|
8
|
+
const path = require('path');
|
|
9
|
+
const { spawn } = require('child_process');
|
|
10
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
11
|
+
const T = require('./test-run').configure({ name: 'premium-vw-meet' });
|
|
12
|
+
const B = require('./lib/briefing-premium.js');
|
|
13
|
+
const F = require('./fixtures/briefing-premium-facts.js');
|
|
14
|
+
|
|
15
|
+
const BASE = T.BASE;
|
|
16
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
17
|
+
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); } };
|
|
18
|
+
const results = [];
|
|
19
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
20
|
+
let srv = null; let browser = null;
|
|
21
|
+
const finish = async (code) => {
|
|
22
|
+
if (browser) await browser.close().catch(() => {});
|
|
23
|
+
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
24
|
+
T.killTmux();
|
|
25
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
26
|
+
console.log(`\n${results.length - bad}/${results.length} premium-vw-meet assertions passed`);
|
|
27
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
28
|
+
};
|
|
29
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
30
|
+
|
|
31
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
32
|
+
const dayKey = (d) => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
33
|
+
const iso = (d) => { const off = -d.getTimezoneOffset(), a = Math.abs(off); return `${dayKey(d)}T${pad(d.getHours())}:${pad(d.getMinutes())}:00${off >= 0 ? '+' : '-'}${pad(Math.floor(a / 60))}:${pad(a % 60)}`; };
|
|
34
|
+
const NOW = new Date();
|
|
35
|
+
const midnight = new Date(NOW.getFullYear(), NOW.getMonth(), NOW.getDate());
|
|
36
|
+
const monday = () => { const d = new Date(midnight); d.setDate(d.getDate() - ((d.getDay() + 6) % 7)); return d; };
|
|
37
|
+
/* "Weekly sync" started at most 10 minutes ago (never before midnight), so it is a Today row; START is in whole minutes, as the calendar answer holds it */
|
|
38
|
+
const START = new Date(Math.max(midnight.getTime(), Math.floor((NOW.getTime() - 10 * 60000) / 60000) * 60000)), END = new Date(START.getTime() + 45 * 60000);
|
|
39
|
+
const weekAnswer = () => {
|
|
40
|
+
const m = monday(), cells = [];
|
|
41
|
+
for (let i = 0; i < 7; i++) { const d = new Date(m.getFullYear(), m.getMonth(), m.getDate() + i); cells.push({ key: dayKey(d), start: dayKey(d), end: dayKey(d), events: [] }); }
|
|
42
|
+
cells.find((c) => c.key === dayKey(START)).events.push({ id: 'ev-sync', at: iso(START), end: iso(END), title: 'Weekly sync', attendees: ['Dara', 'Sam'] });
|
|
43
|
+
return { ok: true, view: 'week', range: { start: cells[0].key, end: cells[6].key }, cells, events_source: 'calendar-memory', today: dayKey(NOW), context: {}, link_boards: [], gantt: [] };
|
|
44
|
+
};
|
|
45
|
+
const ROW = { id: 'n1', title: 'Weekly sync', state: 'ended', updated_at: NOW.toISOString(), meeting: { kind: 'event', event_id: 'ev-sync', start: iso(START), title: 'Weekly sync' }, series: { key: 'weekly-sync' } };
|
|
46
|
+
const NOTE = { ...ROW, meeting_ms: 32 * 60000,
|
|
47
|
+
meeting: { ...ROW.meeting, end: iso(END), context: { with: 'Dara and Sam', purpose: 'Agree what blocks the release.', agenda: ['Migration check status', 'Hiring loop'], links: [{ label: 'Release PRD', url: 'https://x.example/prd' }] } },
|
|
48
|
+
initiative: { id: 'premium-ux', ws: 'w1', title: 'Premium UX' }, board: { id: 'b1', ws: 'w1', title: 'Growth' },
|
|
49
|
+
final_notes: { overview: 'The team reviewed the migration check.', decisions: [{ text: 'Keep the new copy', why: 'Completion rose six points.' }], actions: [{ text: 'Start the migration check', owner: 'Sam', due: '2026-10-22' }], questions: [{ text: 'Do old workspaces need a manual step?' }] },
|
|
50
|
+
final: { segments: [{ t: 61000, spk: 'meeting', text: 'The migration check status is not started.' }, { t: 125000, spk: 'mic', text: 'Then we keep the copy.' }] }, speakers: { meeting: 'Dara' } };
|
|
51
|
+
const PLACE = { key: 'weekly-sync', title: 'Weekly sync', pos: 2, count: 3, by: 'calendar', prev: { id: 'n0', at: '2026-10-06T10:00:00Z', overview: 'The copy test plan.' }, next: { id: 'n2', at: '2026-10-20T10:00:00Z' },
|
|
52
|
+
since: { at: '2026-10-06T10:00:00Z', items: [{ text: 'Write the runbook', owner: 'Sam', state: 'done' }, { text: 'Book the readout', owner: 'Dara', state: 'again' }], fresh: [{ text: 'Start the migration check', owner: 'Sam' }] },
|
|
53
|
+
carried_in: [{ text: 'Book the readout', owner: 'Dara' }], carried: {} };
|
|
54
|
+
const PNG = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==', 'base64');
|
|
55
|
+
|
|
56
|
+
(async () => {
|
|
57
|
+
const exe = findBrowser();
|
|
58
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
59
|
+
let chromium;
|
|
60
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
61
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
62
|
+
await T.waitForServer(BASE);
|
|
63
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
64
|
+
|
|
65
|
+
const facts = () => { const f = F.facts(); f.meetings = [{ start: START.getTime(), end: END.getTime(), title: 'Weekly sync', with: 'Dara, Sam', initiative: null }]; return f; };
|
|
66
|
+
const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'application/json', body: JSON.stringify(b) });
|
|
67
|
+
const SESS = [];
|
|
68
|
+
/* opts: notes (the rows GET /api/notes holds), note (the note GET /api/notes/one answers) */
|
|
69
|
+
const open = async ({ w = 1280, h = 900, theme = 'light', notes = [ROW], note = NOTE } = {}) => {
|
|
70
|
+
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
71
|
+
const page = await ctx.newPage();
|
|
72
|
+
const S = { errors: [], reqs: [], planPosts: [], memberPosts: [], oneGets: [], out: false };
|
|
73
|
+
page.on('pageerror', (e) => S.errors.push(String((e && e.message) || e)));
|
|
74
|
+
page.on('request', (r) => { if (r.url().startsWith(BASE)) S.reqs.push(r.method() + ' ' + new URL(r.url()).pathname); });
|
|
75
|
+
await page.route('**/api/briefing-premium*', (r) => json(r, { ok: true, state: 'ready', model: B.build(facts()), as_of: Date.now() }));
|
|
76
|
+
await page.route('**/api/calendar-views*', (r) => json(r, weekAnswer()));
|
|
77
|
+
await page.route('**/api/meeting-replay*', (r) => json(r, { ok: false, error: 'no note' }, 404));
|
|
78
|
+
await page.route('**/api/meeting-material*', (r) => json(r, { ok: true, key: 'k', items: [] }));
|
|
79
|
+
await page.route('**/api/notes/recording*', (r) => r.fulfill({ status: 200, contentType: 'audio/wav', body: Buffer.alloc(0) }));
|
|
80
|
+
await page.route('**/api/notes/screen*', (r) => r.fulfill({ status: 200, contentType: 'image/png', body: PNG }));
|
|
81
|
+
await page.route('**/api/notes/series?*', (r) => json(r, { ok: true, series: { key: 'weekly-sync', meetings: [] } }));
|
|
82
|
+
await page.route('**/api/notes/one*', (r) => {
|
|
83
|
+
const id = new URL(r.request().url()).searchParams.get('id'); S.oneGets.push(id);
|
|
84
|
+
const n = S.out ? { ...note, series_pm: 'off' } : note;
|
|
85
|
+
return json(r, { ok: true, note: n, recording: { bytes: 64 }, screen: { frames: [{ t: 120000, why: 'A slide with the plan' }] }, place: S.out ? null : PLACE });
|
|
86
|
+
});
|
|
87
|
+
await page.route('**/api/notes/series-member', (r) => { const b = JSON.parse(r.request().postData() || '{}'); S.memberPosts.push(b); S.out = b.key === 'off'; return json(r, { ok: true }); });
|
|
88
|
+
await page.route(/\/api\/notes$/, (r) => json(r, { ok: true, notes }));
|
|
89
|
+
await page.route('**/api/plan-items*', (r) => {
|
|
90
|
+
const req = r.request();
|
|
91
|
+
if (req.method() === 'POST') { const b = JSON.parse(req.postData() || '{}'); S.planPosts.push(b); return json(r, { ok: true, written: [{ item: 'item-9' }] }); }
|
|
92
|
+
return json(r, { ok: true, stages: [{ id: 'st1', label: 'Intake' }] });
|
|
93
|
+
});
|
|
94
|
+
await page.goto(BASE + '/premium.html?theme=' + theme);
|
|
95
|
+
S.up = await until(() => page.evaluate(() => document.querySelectorAll('#rank .rr').length > 0 && document.querySelectorAll('#tl .ev').length > 0), 20000);
|
|
96
|
+
await until(() => page.evaluate(() => document.querySelectorAll('#wkStrip [data-day]').length === 5));
|
|
97
|
+
await page.evaluate(() => { const r = [...document.querySelectorAll('#tl .ev')].find((e) => e.querySelector('b').textContent === 'Weekly sync'); r.click(); });
|
|
98
|
+
S.dlg = await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#oMain .vm-ph')));
|
|
99
|
+
SESS.push(S);
|
|
100
|
+
return Object.assign(S, { ctx, page });
|
|
101
|
+
};
|
|
102
|
+
const part = (p, k) => p.evaluate((x) => { const e = document.querySelector(`#oMain .vm-body[data-part="${x}"]`); return e ? { shown: !e.hidden, text: e.textContent } : null; }, k);
|
|
103
|
+
const stage = async (p, k) => { await p.click(`#oMain [data-ph="${k}"]`); await until(async () => ((await part(p, k)) || {}).shown); };
|
|
104
|
+
|
|
105
|
+
const A = await open();
|
|
106
|
+
ok('0 the meeting dialog opens with Before, During and After', A.up && A.dlg);
|
|
107
|
+
if (!A.up || !A.dlg) return finish(1);
|
|
108
|
+
const p = A.page;
|
|
109
|
+
|
|
110
|
+
/* S1 the stage */
|
|
111
|
+
const st = await until(() => p.evaluate(() => { const b = [...document.querySelectorAll('#oMain .vm-ph [data-ph]')]; return b.length === 3 && b.find((x) => x.getAttribute('aria-pressed') === 'true') && /migration check/.test(document.querySelector('#oMain').textContent) ? b.map((x) => x.dataset.ph + ':' + x.getAttribute('aria-pressed')).join() : null; }));
|
|
112
|
+
ok('S1 a meeting with notes opens on After, and only one stage is pressed', st === 'before:false,during:false,after:true', String(st));
|
|
113
|
+
ok('S1 the note was read from GET /api/notes/one for the meeting\'s note', A.oneGets[0] === 'n1', JSON.stringify(A.oneGets));
|
|
114
|
+
|
|
115
|
+
/* S2 the head */
|
|
116
|
+
const head = await p.evaluate(() => ({ lines: [...document.querySelectorAll('#oMain .vm-ln')].map((x) => x.textContent), ser: (document.querySelector('#oMain .vm-ser') || {}).textContent || '', prev: (document.querySelector('#oMain [data-vm="prev"]') || {}).dataset, next: !!document.querySelector('#oMain [data-vm="next"][data-id="n2"]'), sel: !!document.querySelector('#mtgSel') }));
|
|
117
|
+
ok('S2 the head says when the meeting is and what it is about, with Change', head.lines.length >= 2 && head.lines.some((l) => / to /.test(l)) && head.lines.some((l) => /Not linked yet|It is about/.test(l)) && head.sel, JSON.stringify(head.lines));
|
|
118
|
+
ok('S2 the series line says N of M and pages to the meeting before and after', /Weekly sync · 2 of 3/.test(head.ser) && head.prev && head.prev.id === 'n0' && head.next && /Not part of this series/.test(head.ser), head.ser);
|
|
119
|
+
|
|
120
|
+
/* S3 After */
|
|
121
|
+
const af = (await part(p, 'after')).text;
|
|
122
|
+
ok('S3 Since the last one lists the step done, raised again and the new one', /Since the last one, /.test(af) && /Write the runbook/.test(af) && /Done/.test(af) && /Raised again/.test(af) && /New/.test(af));
|
|
123
|
+
ok('S3 the summary, the Decision and Why table and the open question come from the final notes', /The team reviewed the migration check\./.test(af) && /Keep the new copy/.test(af) && /Completion rose six points\./.test(af) && /Do old workspaces need a manual step\?/.test(af));
|
|
124
|
+
const tb = await p.evaluate(() => ({ dec: [...document.querySelectorAll('#oMain [data-vm-t="decisions"] th')].map((x) => x.textContent).join('|'), act: [...document.querySelectorAll('#oMain [data-vm-t="actions"] tbody td')].slice(0, 3).map((x) => x.textContent).join('|'),
|
|
125
|
+
img: !!document.querySelector('#oMain .vm-shots img[src*="/api/notes/screen?id=n1"]'), aud: (document.querySelector('#oMain audio.vm-aud') || {}).src || '', fold: (document.querySelector('#oMain details.vm-fold summary') || {}).textContent || '' }));
|
|
126
|
+
ok('S3 the tables have Decision and Why, and Next step with owner and due', tb.dec === 'Decision|Why' && tb.act === 'Start the migration check|Sam|2026-10-22', JSON.stringify(tb));
|
|
127
|
+
ok('S3 the screenshot, the kept audio and the folded transcript are shown', tb.img && /\/api\/notes\/recording\?id=n1&b=64/.test(tb.aud) && /Transcript · 2 lines/.test(tb.fold), JSON.stringify(tb));
|
|
128
|
+
|
|
129
|
+
/* S4 Make task */
|
|
130
|
+
await p.click('#oMain .mtg-task');
|
|
131
|
+
await until(() => A.planPosts.length === 1);
|
|
132
|
+
const pp = A.planPosts[0];
|
|
133
|
+
ok('S4 Make task posts one planned event to the note\'s initiative with the owner and due', pp && pp.ws === 'w1' && pp.events[0].ev === 'planned' && pp.events[0].initiative === 'premium-ux' && pp.events[0].owner === 'person:Sam' && pp.events[0].due === '2026-10-22' && pp.events[0].stage === 'st1', JSON.stringify(pp));
|
|
134
|
+
ok('S4 the step says Task made and the status says where it went', await until(() => p.evaluate(() => /Added to Premium UX, under Intake\./.test(document.querySelector('#mtgStatus').textContent) && document.querySelector('#oMain .mtg-task').textContent === 'Task made')));
|
|
135
|
+
await p.click('#mtgUndo'); await until(() => A.planPosts.length === 2);
|
|
136
|
+
ok('S4 Undo withdraws the item', A.planPosts[1].events[0].ev === 'withdrawn' && A.planPosts[1].events[0].item === 'item-9');
|
|
137
|
+
|
|
138
|
+
/* S5 Before */
|
|
139
|
+
await stage(p, 'before');
|
|
140
|
+
const bf = (await part(p, 'before')).text;
|
|
141
|
+
ok('S5 Before shows what was carried in, the agenda with what was heard, and what it is for', /Carried in from/.test(bf) && /Book the readout/.test(bf) && /1 of 2 heard/.test(bf) && /What it is for/.test(bf) && /Release PRD/.test(bf), bf.slice(0, 300));
|
|
142
|
+
ok('S5 Before keeps Prepared for you and Material', /Prepared for you/.test(bf) && /Material/.test(bf) && await p.evaluate(() => !!document.querySelector('#mmAdd') && !!document.querySelector('#mmAdd').offsetParent));
|
|
143
|
+
ok('S1 pressing a stage shows it, hides the others and moves the pressed state', await p.evaluate(() => document.querySelector('#oMain [data-ph="before"]').getAttribute('aria-pressed') === 'true' && document.querySelector('#oMain .vm-body[data-part="after"]').hidden));
|
|
144
|
+
|
|
145
|
+
/* S6 During */
|
|
146
|
+
await stage(p, 'during');
|
|
147
|
+
const du = (await part(p, 'during')).text;
|
|
148
|
+
ok('S6 During lists the transcript with times and the speakers the note names', /01:01/.test(du) && /Dara/.test(du) && /The migration check status is not started\./.test(du) && /You/.test(du), du.slice(0, 200));
|
|
149
|
+
ok('S6 the Record and Focus presses stay in the head on every stage', await p.evaluate(() => !!document.querySelector('#oMain [data-m3="focus"]').offsetParent));
|
|
150
|
+
|
|
151
|
+
/* S7 series membership */
|
|
152
|
+
await p.click('#oMain [data-vm="serout"]');
|
|
153
|
+
await until(() => A.memberPosts.length === 1);
|
|
154
|
+
ok('S7 Not part of this series posts the note with key off', A.memberPosts[0].id === 'n1' && A.memberPosts[0].key === 'off', JSON.stringify(A.memberPosts));
|
|
155
|
+
ok('S7 the note is read again and the line offers Put it back', await until(() => p.evaluate(() => /Taken out of its series/.test(document.querySelector('#oMain').textContent) && !!document.querySelector('#oMain [data-vm="serback"]'))));
|
|
156
|
+
await p.click('#oMain [data-vm="serback"]'); await until(() => A.memberPosts.length === 2);
|
|
157
|
+
ok('S7 Put it back posts the note with no key', A.memberPosts[1].key === null, JSON.stringify(A.memberPosts[1]));
|
|
158
|
+
|
|
159
|
+
/* S2 a meeting of the series opens beside this one as a viewer tab (the frame, premium-viewer S1) */
|
|
160
|
+
await until(() => p.evaluate(() => !!document.querySelector('#oMain [data-vm="prev"][data-id="n0"]')));
|
|
161
|
+
await p.click('#oMain [data-vm="prev"]');
|
|
162
|
+
const tab = await until(() => p.evaluate(() => { const t = document.querySelector('#vTabs'), pane = document.querySelector('#dOut .obody.vw[data-vw="meet-note"]'); return t && !t.hidden && pane && !pane.hidden && /Since the last one/.test(pane.textContent) ? { tabs: [...t.querySelectorAll('.vtab')].map((x) => x.textContent.trim()), main: document.querySelector('#oMain').hidden, ph: [...pane.querySelectorAll('[data-ph]')].length } : null; }));
|
|
163
|
+
ok('S2 the meeting before opens as a viewer tab beside the meeting, with its own Before, During and After', tab && tab.tabs.length === 2 && tab.main && tab.ph === 3 && A.oneGets.includes('n0'), JSON.stringify([tab, A.oneGets]));
|
|
164
|
+
await p.click('#dOut .obody.vw[data-vw="meet-note"] [data-vm="next"]');
|
|
165
|
+
ok('S2 paging in the tab reads the next meeting into the same tab', await until(() => A.oneGets.includes('n2')) && await p.evaluate(() => document.querySelectorAll('#vTabs .vtab').length === 2));
|
|
166
|
+
await p.click('#vTabs .vx');
|
|
167
|
+
ok('S2 closing the tab shows the meeting again', await until(() => p.evaluate(() => !document.querySelector('#oMain').hidden && document.querySelector('#vTabs').hidden)));
|
|
168
|
+
|
|
169
|
+
/* S8 a meeting with no note */
|
|
170
|
+
const Z = await open({ notes: [], note: null });
|
|
171
|
+
const zst = await until(() => Z.page.evaluate(() => { const b = document.querySelector('#oMain [data-ph="before"]'); return b && b.getAttribute('aria-pressed') === 'true' && /No notes for this meeting\./.test(document.querySelector('#oMain').textContent); }));
|
|
172
|
+
ok('S8 with no note the detail opens on Before and After says there are no notes', zst);
|
|
173
|
+
ok('S8 with no note During says nothing was transcribed, and no note was asked for', /Nothing was transcribed/.test((await part(Z.page, 'during')).text) && Z.oneGets.length === 0 && !(await Z.page.evaluate(() => !!document.querySelector('#oMain .vm-ser'))));
|
|
174
|
+
|
|
175
|
+
/* S9 writes */
|
|
176
|
+
const posts = [...new Set([].concat(A.reqs, Z.reqs).filter((r) => /^POST /.test(r)))].sort();
|
|
177
|
+
ok('S9 the only writes are Make task and the series membership', posts.join() === 'POST /api/notes/series-member,POST /api/plan-items', posts.join());
|
|
178
|
+
for (const [pth, body] of [['/api/notes/series-member', { id: 'n-nothing', key: 'off' }]]) {
|
|
179
|
+
const res = await fetch(BASE + pth, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) });
|
|
180
|
+
ok(`S9 ${pth} without the launch nonce is refused`, res.status === 403, String(res.status));
|
|
181
|
+
}
|
|
182
|
+
await A.ctx.close(); await Z.ctx.close();
|
|
183
|
+
|
|
184
|
+
/* S10 floors (PMOS_SHOTS=<dir> also saves a picture of each stage) */
|
|
185
|
+
const shotDir = process.env.PMOS_SHOTS || '';
|
|
186
|
+
for (const [w, h, th] of [[1280, 900, 'light'], [1280, 900, 'dark']]) {
|
|
187
|
+
if (!shotDir) break;
|
|
188
|
+
const P = await open({ w, h, theme: th });
|
|
189
|
+
await until(() => P.page.evaluate(() => /migration check/.test(document.querySelector('#oMain').textContent)));
|
|
190
|
+
for (const k of ['after', 'before', 'during']) { await stage(P.page, k); await P.page.screenshot({ path: path.join(shotDir, `${k}-${w}-${th}.png`) }); }
|
|
191
|
+
await P.ctx.close();
|
|
192
|
+
}
|
|
193
|
+
for (const th of ['light', 'dark']) {
|
|
194
|
+
const P = await open({ w: 390, h: 844, theme: th });
|
|
195
|
+
await until(() => P.page.evaluate(() => /migration check/.test(document.querySelector('#oMain').textContent)));
|
|
196
|
+
/* measure once the meeting stylesheet has loaded and the dialog's presses are live, not on the first unstyled frame */
|
|
197
|
+
await until(() => P.page.evaluate(() => document.querySelector('#oMain').dataset.ready === 'meeting' && [...document.styleSheets].some((x) => /premium-vw-meet\.css/.test(x.href || '') && x.cssRules.length > 0)));
|
|
198
|
+
const fl = () => P.page.evaluate(() => ({ scroll: document.documentElement.scrollWidth <= innerWidth + 1 && document.querySelector('#oMain').scrollWidth <= document.querySelector('#oMain').clientWidth + 1,
|
|
199
|
+
btn: [...document.querySelectorAll('#oMain .vm-ph button, #oMain .vm-ib, #oMain .vm-lk, #oMain .mtg-task')].filter((b) => b.getClientRects().length).map((b) => Math.round(Math.min(b.getBoundingClientRect().width, b.getBoundingClientRect().height))) }));
|
|
200
|
+
const f0 = await fl();
|
|
201
|
+
if (shotDir) await P.page.screenshot({ path: path.join(shotDir, `after-390-${th}.png`) });
|
|
202
|
+
await P.page.click('#oMain [data-ph="before"]'); const f1 = await fl();
|
|
203
|
+
ok(`S10 at 390 px (${th}) the detail has no sideways scroll and every press is at least 44 px`, f0.scroll && f1.scroll && f0.btn.length > 3 && [...f0.btn, ...f1.btn].every((n) => n >= 44), JSON.stringify([f0, f1]));
|
|
204
|
+
const contrast = await P.page.evaluate(() => { const b = document.querySelector('#oMain .vm-ph [aria-pressed="true"]'); const c = getComputedStyle(b); return c.color !== c.backgroundColor; });
|
|
205
|
+
ok(`S10 (${th}) the pressed stage is drawn apart from its label`, contrast);
|
|
206
|
+
await P.ctx.close();
|
|
207
|
+
}
|
|
208
|
+
ok('S9 no page error in any run', SESS.every((x) => x.errors.length === 0), JSON.stringify(SESS.map((x) => x.errors).filter((e) => e.length)));
|
|
209
|
+
return finish();
|
|
210
|
+
})().catch((e) => { console.error(e); finish(1); });
|