create-pmos 0.274.0 → 0.276.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-test.js +5 -1
- package/workspace/guide/briefing-premium.md +25 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-briefing-depth-test.js +291 -0
- package/workspace/premium-phone-card-test.js +178 -0
- package/workspace/public/pm/premium.css +50 -0
- package/workspace/public/pm/premium.js +528 -1
- package/workspace/test-lists/premium-briefing-depth.json +9 -0
- package/workspace/test-lists/premium-phone-card.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.276.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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-18T17:05:55Z"}
|
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-18T17:05:55Z"}
|
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-18T17:05:55Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -70,7 +70,11 @@ const MOCKUP = fs.readFileSync(path.join(__dirname, '..', 'prototype', 'premium-
|
|
|
70
70
|
page.on('request', (r) => { if (r.url().startsWith(BASE)) S.reqs.push(r.method() + ' ' + new URL(r.url()).pathname); });
|
|
71
71
|
const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'application/json', body: JSON.stringify(b) });
|
|
72
72
|
await page.route('**/api/briefing-premium*', (r) => json(r, { ok: true, state: 'ready', model: B.build(facts()), as_of: Date.now() }));
|
|
73
|
-
await page.route('**/api/calendar-views*', (r) => {
|
|
73
|
+
await page.route('**/api/calendar-views*', (r) => {
|
|
74
|
+
const q = new URL(r.request().url()).search;
|
|
75
|
+
if (/only=gantt/.test(q)) return json(r, { ok: true, view: 'quarter', gantt: [], no_plan: 0 }); // the Around you card's pulse, not the week
|
|
76
|
+
S.weekGets.push(q); json(r, week, week && week.ok === false ? 500 : 200);
|
|
77
|
+
});
|
|
74
78
|
await page.route('**/api/meeting-replay*', (r) => { S.replayGets.push(new URL(r.request().url()).search); if (replay === 404) json(r, { ok: false, error: 'no note for that meeting' }, 404); else json(r, replay); });
|
|
75
79
|
await page.route('**/api/meeting-material*', (r) => json(r, material));
|
|
76
80
|
await page.route('**/api/calendar-links', (r) => { S.posts.push(JSON.parse(r.request().postData() || '{}')); json(r, linkRes, linkRes.ok ? 200 : 403); });
|
|
@@ -106,6 +106,26 @@ In the **Add material** sheet, a **Topic** choice ties the item to one of the me
|
|
|
106
106
|
|
|
107
107
|
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.
|
|
108
108
|
|
|
109
|
+
## Around you
|
|
110
|
+
|
|
111
|
+
Under Today, the **Around you** card holds what the agents and the outside world have left for you. It has five rows. A row opens a dialog and states what it found in one line. The caption says how many rows wait on you, or "quiet". If a source cannot be read, its row says so and gives the reason. It never reads as empty.
|
|
112
|
+
|
|
113
|
+
- **Agent proposals.** Every open draft of the Initiative Driver, for initiatives and for Work items, when the agent mode for that kind is Approve. **Keep** records that you accept it and applies it (a problem statement, a stage move, a next step). **Send back** needs a note and starts a new run. **Drop** counts as a correction. None of the three can be undone. A decided proposal stays in the list and says what was recorded.
|
|
114
|
+
- **Mentions.** The people who named you in Slack, Jira, Confluence or mail, from today's morning brief. The row names who waits on a reply. **Make it a task** adds one Work item. **Mark read** hides the mention, and **Mark unread** brings it back. **Open in Slack** (or Jira, Confluence, mail) opens the original in a new tab. Nothing here replies, reacts or posts.
|
|
115
|
+
- **Portfolio pulse.** How many initiatives are late or at risk, by the Calendar's own status: the promised date against the forecast, or the Jira read. It is read only and it is not a forecast of its own. **Open the initiative** goes to its page.
|
|
116
|
+
- **Horizon scan.** When the scan last ran, when it runs next, its reports and their proposals. Each proposal says what **Approve** does before you press it. **Dismiss** asks for a reason and counts as a correction, and **Undo** takes a dismissal back. **Scan now** starts an agent that reads the public web and the repository, and says how many manual scans are left. A scan that is switched off says so and the button stays off.
|
|
117
|
+
- **Data freshness.** When each source was last read and its schedule. **Refresh** reads one source again. **Refresh all** reads every source except the repository. A source outside the machine is read by a skill, in an agent session, with your own connection. The page never says "up to date".
|
|
118
|
+
|
|
119
|
+
With one product picked, the dialogs show its data. With several, each product's part has its own heading, and the counts are not added across products. The agent mode, the scan's watch list and setting and the report documents stay in the console.
|
|
120
|
+
|
|
121
|
+
## The phone card
|
|
122
|
+
|
|
123
|
+
On a phone (640 pixels wide or narrower) the Briefing opens with one card above "What you need to do". It says what the day is doing now, and it changes with the clock. It has eight moments: a meeting under way, a meeting about to start, a meeting that just ended, a free stretch, the morning, working hours, the evening recap and the night. The card is chosen again every minute and when you return to the page. On a wider screen the card does not show, and the page does not read the day for it.
|
|
124
|
+
|
|
125
|
+
- **Open the meeting** opens the same dialog as a row in Today. If the calendar PMOS holds does not list the meeting, the card says so and opens nothing.
|
|
126
|
+
- **Done** marks one of your own items as done, and shows **Undo** on the same line. A refused press shows the reason. The card never says "Done" when the record was not written.
|
|
127
|
+
- The card does not ask to record a meeting, and it does not say that notes exist unless the meeting holds them. If a read fails, the card names it.
|
|
128
|
+
|
|
109
129
|
## The dock
|
|
110
130
|
|
|
111
131
|
When you scroll past the hero, the hero folds into a bar at the top. The bar shows how many rows need you and the next item in Today.
|
|
@@ -129,6 +149,11 @@ Each button writes one record, through a check that only a real press from this
|
|
|
129
149
|
| Record: promote, iterate or kill (a prototype) | A dated entry with the choice and your reason | `pm-decisions.md`, appended |
|
|
130
150
|
| Record: reshape, extend or retire (a missed tripwire) | The same kind of entry, naming the tripwire (KC id) | `pm-decisions.md`, appended |
|
|
131
151
|
| Return this run to the agent (a run in Today) | One counted correction with one of four reasons: wrong facts, wrong scope, not now, too long | `corrections.jsonl` in the state folder |
|
|
152
|
+
| Keep, Send back, Drop (an agent proposal) | The driver's own record of your answer, and the change a kept draft makes | `driver.jsonl` in the state folder |
|
|
153
|
+
| Make it a task, Mark read, Mark unread (a mention) | One Work item, or a read mark | the Work list, `mentions/read.jsonl` |
|
|
154
|
+
| Approve, Dismiss, Undo, Scan now, Stop (the horizon scan) | The scan's own records | `scan.jsonl` in the state folder |
|
|
155
|
+
| Refresh, Refresh all (data freshness) | A new read of the source | the source's own store |
|
|
156
|
+
| Done, Undo (the phone card) | The item is marked done, or reopened | the Work list |
|
|
132
157
|
| Not yet: Later today, Tomorrow, Next week | A put-off record. The row leaves the list until then and the page names it. It does not count as done. | `briefing-premium-deferred.jsonl` in the state folder |
|
|
133
158
|
|
|
134
159
|
Later today means three hours from now. Tomorrow and Next week mean 09:00, tomorrow and next Monday.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.276.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.276.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* premium-briefing-depth-test.js — the Around you card on the premium Briefing (initiative premium-briefing-depth;
|
|
4
|
+
* planning/prd/premium-briefing-depth-prd.md R1 to R9). A real server on a scratch repository (c3-scan-fixture.js: PMOS_DRIVER=off, so no agent
|
|
5
|
+
* ever runs), with a driver ledger, a scan ledger and a brief of today that this suite seeds with the writers the product uses. The real page
|
|
6
|
+
* presses the real routes. Only two presses are answered in the browser, because they start an agent: scan/now and sources/refresh. The
|
|
7
|
+
* Calendar's rows are answered in the browser too, because they need plan dates and a clock.
|
|
8
|
+
* R rows · A agent proposals · M mentions · P portfolio pulse · S horizon scan · F data freshness · E a source that fails · W the POST allow-list · L floors
|
|
9
|
+
* Set BRIEFING_DEPTH_SHOTS=<dir> to save screenshots of the card and its dialogs, at 1280 and 390 wide, light and dark. */
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
const path = require('path');
|
|
12
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
13
|
+
const T = require('./test-run').configure({ name: 'premium-briefing-depth' });
|
|
14
|
+
const Fx = require('./c3-scan-fixture.js');
|
|
15
|
+
|
|
16
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
17
|
+
const until = async (fn, ms = 20000, step = 120) => { const t0 = Date.now(); for (;;) { let v; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
18
|
+
const results = [];
|
|
19
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 600) : ''}`); };
|
|
20
|
+
let F = null, browser = null;
|
|
21
|
+
const finish = async (code) => {
|
|
22
|
+
if (browser) await browser.close().catch(() => {});
|
|
23
|
+
if (F) F.stop();
|
|
24
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
25
|
+
console.log(`\n${results.length - bad}/${results.length} premium-briefing-depth assertions passed`);
|
|
26
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
27
|
+
};
|
|
28
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
29
|
+
|
|
30
|
+
/* the brief of today: three mentions (two wait on a reply), one of them already a "needs you" row */
|
|
31
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
32
|
+
const NOW = Date.now(), L = new Date(NOW);
|
|
33
|
+
const DATE = `${L.getFullYear()}-${pad(L.getMonth() + 1)}-${pad(L.getDate())}`;
|
|
34
|
+
const iso = (m) => new Date(NOW + m * 60000).toISOString();
|
|
35
|
+
const mi = (id, x) => ({ id, why_now: 'It waits on you today.', evidence: '', initiative_id: null, effort: 'minutes', confidence: 0.9, worth_asking: false, mention: true, owner: 'pm', kind: 'you', ...x });
|
|
36
|
+
const M1 = 'b00000000001', M2 = 'b00000000002', M3 = 'b00000000003';
|
|
37
|
+
const BRIEF = {
|
|
38
|
+
date: DATE, generated_at: iso(-120), sources: { calendar: 'read', mail: 'read', slack: 'read', jira: 'read', confluence: 'read' }, calendar: [],
|
|
39
|
+
priorities: [
|
|
40
|
+
mi(M1, { title: 'Reply to Dana', source: 'slack', who: 'Dana Hartono', where: '#partner-support', about: 'Sandbox access', ask: 'Which day can the engineers use the sandbox?', reply_needed: true, link: 'https://acme.slack.com/archives/D01/p1' }),
|
|
41
|
+
mi(M2, { title: 'Reply to Priya', source: 'jira', who: 'Priya Sen', where: 'IDPF-1204', about: 'Rate limits', ask: 'Can you confirm the quota for partners?', reply_needed: true, link: 'https://jira.example.com/browse/IDPF-1204' }),
|
|
42
|
+
mi(M3, { title: 'Comment on the refunds page', source: 'confluence', who: 'Lia Ong', where: 'Refunds > Policy', about: 'Refund wording', quote: 'Refunds are paid within 14 days.', reply_needed: false, link: 'https://wiki.example.com/61291' }),
|
|
43
|
+
],
|
|
44
|
+
worth_asking: [], digests: [], places: [], resolved: [], judgment: { used: false },
|
|
45
|
+
};
|
|
46
|
+
fs.mkdirSync(path.join(T.STATE_DIR, 'briefs'), { recursive: true });
|
|
47
|
+
fs.writeFileSync(path.join(T.STATE_DIR, 'briefs', DATE + '.json'), JSON.stringify(BRIEF) + '\n');
|
|
48
|
+
fs.writeFileSync(path.join(T.STATE_DIR, 'proactive-settings.json'), JSON.stringify({ briefSources: { calendar: true, mail: true, slack: true, jira: true, confluence: true }, scopes: { slack: {}, jira: {}, confluence: {} }, dayCheck: { every: 60, start: '00:00', end: '23:59' }, websites: [] }) + '\n');
|
|
49
|
+
|
|
50
|
+
/* the Calendar's rows: one late, one at risk, one on plan, one with a Jira read only; two more with no date at all */
|
|
51
|
+
const day = (d) => { const x = new Date(NOW + d * 86400000); return `${x.getFullYear()}-${pad(x.getMonth() + 1)}-${pad(x.getDate())}`; };
|
|
52
|
+
const GANTT = [
|
|
53
|
+
{ id: 'scan-ui', title: 'Partner API onboarding', status: 'delayed', slip_days: 6, promised: day(-3), forecast: { end: day(3) } },
|
|
54
|
+
{ id: 'sandbox', title: 'Self-serve sandbox', status: 'at risk', slip_days: 0, promised: day(10), forecast: { end: day(12) } },
|
|
55
|
+
{ id: 'billing', title: 'Billing export', status: 'on time', slip_days: 0, promised: day(20), forecast: { end: day(18) } },
|
|
56
|
+
{ id: 'jira-only', title: 'Rate-limit headers', status: 'no plan', jira: { total: 8, done: 3, blocked: 0 } },
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
(async () => {
|
|
60
|
+
const exe = findBrowser();
|
|
61
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
62
|
+
let chromium;
|
|
63
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
64
|
+
F = await Fx.start({ name: 'premium-briefing-depth' });
|
|
65
|
+
const ws = F.ws, D = require('./lib/driver.js'), ledger = path.join(path.dirname(F.ledger), 'driver.jsonl');
|
|
66
|
+
F.seedPortfolio();
|
|
67
|
+
/* two Work items and three open proposals: a problem statement and a move on the initiative, a next step on a Work item */
|
|
68
|
+
const w1 = (await F.post('/api/pm-items/add', { line: 'Send the partner onboarding list to Lina' })).body.item;
|
|
69
|
+
const tI = { kind: 'initiative', ws, id: 'scan-ui' };
|
|
70
|
+
const AG = 'agent:sess-4.0a1b2c3d';
|
|
71
|
+
const prop = (id, target, what, data, why, at) => D.append(ledger, { ev: 'proposal', id, target, what, data, why, sources: [{ label: 'Jira', ref: 'IDPF-1204' }], run: null, by: AG }, { now: at });
|
|
72
|
+
const P1 = 'p-bbbbbbbb01', P2 = 'p-bbbbbbbb02', P3 = 'p-bbbbbbbb03';
|
|
73
|
+
prop(P1, tI, 'problem', { text: 'New partners wait 9 days from signed contract to first live API call.' }, 'first draft from the Jira threads', NOW - 3 * 3600000);
|
|
74
|
+
prop(P2, tI, 'move', { to: 'Plan' }, 'the problem and the evidence are in', NOW - 2 * 3600000);
|
|
75
|
+
prop(P3, { kind: 'work', ws, id: w1.id }, 'next-step', { text: 'Send the list to Lina', due: day(-1) }, 'overdue with no next step', NOW - 3600000);
|
|
76
|
+
|
|
77
|
+
browser = await chromium.launch({ executablePath: exe, headless: true, args: ['--no-sandbox'] });
|
|
78
|
+
const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), p = await ctx.newPage(), errs = [], posts = [], gets = [];
|
|
79
|
+
p.on('pageerror', (e) => errs.push(String(e)));
|
|
80
|
+
p.on('request', (r) => { const u = new URL(r.url()); if (r.method() === 'POST') { let b = null; try { b = JSON.parse(r.postData() || 'null'); } catch { /* not JSON */ } posts.push({ path: u.pathname, body: b }); } else if (u.pathname.startsWith('/api/')) gets.push(u.pathname); });
|
|
81
|
+
const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'application/json', body: JSON.stringify(b) });
|
|
82
|
+
let ganttFail = false;
|
|
83
|
+
await p.route('**/api/calendar-views*', (r) => (ganttFail ? json(r, { ok: false, error: 'the Calendar could not be read' }, 500) : json(r, { ok: true, view: 'quarter', gantt: GANTT, no_plan: 2, strategy: [], today: day(0) })));
|
|
84
|
+
await p.route('**/api/scan/now', (r) => json(r, { ok: true, scan: 'scan-00000000ff' }));
|
|
85
|
+
await p.route('**/api/sources/refresh', (r) => json(r, { ok: true, started: 'session' }));
|
|
86
|
+
await p.goto(`${F.BASE}/premium.html?ws=${encodeURIComponent(ws)}`);
|
|
87
|
+
await until(() => p.evaluate(() => !!document.querySelector('#aroundCard')));
|
|
88
|
+
const rows = () => p.evaluate(() => Object.fromEntries([...document.querySelectorAll('#aroundBody [data-bd]')].map((b) => [b.dataset.bd, { t: b.querySelector('.wtit').textContent, s: (b.querySelector('.ws') || {}).textContent || '', m: (b.querySelector('.wm') || {}).textContent || '' }])));
|
|
89
|
+
await until(() => p.evaluate(() => document.querySelector('#aroundCap') && document.querySelector('#aroundCap').textContent !== 'Reading' && !/Reading…/.test(document.querySelector('#aroundBody').textContent)), 30000);
|
|
90
|
+
const body = () => p.evaluate(() => (document.querySelector('#oMain .bd-a') || {}).textContent || '');
|
|
91
|
+
const open = async (k) => { await p.click(`#aroundBody [data-bd="${k}"]`); await until(() => p.evaluate((x) => document.querySelector('#dlg').classList.contains('on') && document.querySelector('#oMain').dataset.bd === x && !!document.querySelector('#oMain .bd-a *'), k)); };
|
|
92
|
+
const close = async () => { await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on'))); };
|
|
93
|
+
const click = async (sel) => { await until(() => p.$(sel)); await p.click(sel); };
|
|
94
|
+
const shotDir = process.env.BRIEFING_DEPTH_SHOTS;
|
|
95
|
+
const shot = async (n) => { if (shotDir) { await sleep(700); fs.mkdirSync(shotDir, { recursive: true }); await p.screenshot({ path: path.join(shotDir, n + '.png') }); } };
|
|
96
|
+
|
|
97
|
+
/* R: the card */
|
|
98
|
+
const R0 = await rows();
|
|
99
|
+
ok('R1 the card has five rows in the PRD order', Object.keys(R0).join() === 'prop,men,pulse,scan,src', Object.keys(R0).join());
|
|
100
|
+
ok('R2 agent proposals counts the three open proposals', /^3 agent proposals wait on you/.test(R0.prop.t) && R0.prop.m === '3', JSON.stringify(R0.prop));
|
|
101
|
+
ok('R3 mentions names who waits, from the brief, and leaves out nothing it was not told', R0.men.t === 'Dana in Slack and Priya in Jira are waiting on your reply. 1 more is for your information.' && R0.men.m === 'Reply', JSON.stringify(R0.men));
|
|
102
|
+
ok('R4 the pulse counts what the Calendar said', R0.pulse.t === 'Portfolio pulse: 1 late, 1 at risk' && /1 on plan · 3 with no plan date/.test(R0.pulse.s), JSON.stringify(R0.pulse));
|
|
103
|
+
ok('R5 the scan row counts the waiting proposals', /^Horizon scan: \d+ proposals? waits? for you|^Horizon scan: \d+ proposals wait for you/.test(R0.scan.t) && /^\d+$/.test(R0.scan.m), JSON.stringify(R0.scan));
|
|
104
|
+
ok('R6 the freshness row says it is not live', /not live/.test(R0.src.s) && !/up to date/i.test(R0.src.t + R0.src.s), JSON.stringify(R0.src));
|
|
105
|
+
const cap = await p.evaluate(() => document.querySelector('#aroundCap').textContent);
|
|
106
|
+
ok('R7 the caption counts the rows that wait', /^\d+ to look at$/.test(cap), cap);
|
|
107
|
+
ok('R8 nothing was written on load', posts.length === 0, JSON.stringify(posts));
|
|
108
|
+
await shot('card-1280-light');
|
|
109
|
+
|
|
110
|
+
/* A: agent proposals */
|
|
111
|
+
await open('prop');
|
|
112
|
+
const ptxt = await body();
|
|
113
|
+
ok('A1 the dialog shows what each proposal is, its target, its draft and its why', /Problem statement/.test(ptxt) && /Move to Plan/.test(ptxt) && /Next step/.test(ptxt) && /Initiative · Partner API onboarding/.test(ptxt) && /Work · Send the partner onboarding list to Lina/.test(ptxt) && /New partners wait 9 days/.test(ptxt) && /Why: first draft from the Jira threads/.test(ptxt), ptxt);
|
|
114
|
+
await shot('props-1280-light');
|
|
115
|
+
await click(`.bd-it[data-id="${P1}"] [data-bda="pkeep"]`);
|
|
116
|
+
await until(() => posts.some((x) => x.path === '/api/driver/keep'));
|
|
117
|
+
const keep = posts.find((x) => x.path === '/api/driver/keep');
|
|
118
|
+
ok('A2 Keep posts one keep for that proposal and the ledger holds it', keep && keep.body.proposal === P1 && keep.body.ws === ws, JSON.stringify(keep));
|
|
119
|
+
await until(() => p.evaluate((id) => /Kept\./.test((document.querySelector(`.bd-it[data-id="${id}"] .bd-done`) || {}).textContent || ''), P1));
|
|
120
|
+
ok('A3 the proposal stays, marked Kept, and says what was recorded', /Kept\. /.test(await p.evaluate((id) => document.querySelector(`.bd-it[data-id="${id}"]`).textContent, P1)));
|
|
121
|
+
await click(`.bd-it[data-id="${P2}"] [data-bda="pnote"]`);
|
|
122
|
+
const backBtn = () => p.evaluate((id) => { const b = document.querySelector(`[data-bda="pback"][data-id="${id}"]`); return b ? b.disabled : null; }, P2);
|
|
123
|
+
ok('A4 Send back opens a note box and the press is off until there is a note', await backBtn() === true);
|
|
124
|
+
const before = posts.length;
|
|
125
|
+
await p.evaluate((id) => { const b = document.querySelector(`[data-bda="pback"][data-id="${id}"]`); b.disabled = false; b.click(); }, P2);
|
|
126
|
+
await until(() => p.evaluate(() => /Write one line for the agent/.test((document.querySelector('#oMain .bd-a') || {}).textContent || '')));
|
|
127
|
+
ok('A5 Send back without a note is refused on the page and posts nothing', posts.length === before);
|
|
128
|
+
await p.fill(`[data-bdn="${P2}"]`, 'Wait until the evidence is in.');
|
|
129
|
+
ok('A6 typing a note turns the press on', await backBtn() === false);
|
|
130
|
+
await click(`[data-bda="pback"][data-id="${P2}"]`);
|
|
131
|
+
await until(() => posts.some((x) => x.path === '/api/driver/return'));
|
|
132
|
+
const ret = posts.find((x) => x.path === '/api/driver/return');
|
|
133
|
+
ok('A7 Send back posts return with the note', ret && ret.body.proposal === P2 && ret.body.note === 'Wait until the evidence is in.', JSON.stringify(ret));
|
|
134
|
+
await click(`.bd-it[data-id="${P3}"] [data-bda="pdrop"]`);
|
|
135
|
+
await until(() => posts.some((x) => x.path === '/api/driver/drop'));
|
|
136
|
+
ok('A8 Drop posts drop and says it counts as a correction', posts.some((x) => x.path === '/api/driver/drop' && x.body.proposal === P3) && await until(() => body().then((t) => /Dropped\. It counts as a correction/.test(t))), await body());
|
|
137
|
+
const open1 = (await (await fetch(`${F.BASE}/api/driver/open?target_kind=initiative&ws=${ws}`)).json()).targets || {};
|
|
138
|
+
ok('A9 the ledger no longer lists the three as open', !Object.values(open1).flat().some((x) => [P1, P2, P3].includes(x.id)), JSON.stringify(open1));
|
|
139
|
+
await close();
|
|
140
|
+
await until(() => rows().then((r) => /^No agent proposals wait/.test(r.prop.t)));
|
|
141
|
+
ok('A10 the row now says no agent proposals wait', true);
|
|
142
|
+
|
|
143
|
+
/* M: mentions */
|
|
144
|
+
await open('men');
|
|
145
|
+
const mt = await body();
|
|
146
|
+
ok('M1 the dialog lists the three mentions with the person, quote, place and the reply words', /Dana Hartono/.test(mt) && /Priya Sen/.test(mt) && /Lia Ong/.test(mt) && /Which day can the engineers use the sandbox/.test(mt) && /Refunds are paid within 14 days/.test(mt) && /Needs your reply/.test(mt) && /For your information/.test(mt), mt);
|
|
147
|
+
const tabs = await p.evaluate(() => [...document.querySelectorAll('#oMain [data-bda="mtab"]')].map((b) => b.textContent));
|
|
148
|
+
ok('M2 the tabs count by source', tabs.join() === 'All 3,Slack 1,Jira 1,Confluence 1', tabs.join());
|
|
149
|
+
await click('[data-bda="mtab"][data-k="jira"]');
|
|
150
|
+
ok('M3 a tab shows only that source', await p.evaluate(() => document.querySelectorAll('#oMain .bd-it').length === 1 && /Priya Sen/.test(document.querySelector('#oMain .bd-a').textContent)));
|
|
151
|
+
await click('[data-bda="mtab"][data-k="all"]');
|
|
152
|
+
const link = await p.evaluate((id) => { const a = document.querySelector(`.bd-it[data-id="${id}"] a[data-bdlink]`); return a ? [a.getAttribute('href'), a.target, a.rel, a.textContent] : null; }, M1);
|
|
153
|
+
ok('M4 Open in Slack is the mention\'s https link in a new tab', link && link[0] === 'https://acme.slack.com/archives/D01/p1' && link[1] === '_blank' && /noopener/.test(link[2]) && link[3] === 'Open in Slack', JSON.stringify(link));
|
|
154
|
+
await shot('men-1280-light');
|
|
155
|
+
await click(`.bd-it[data-id="${M1}"] [data-bda="madd"]`);
|
|
156
|
+
await until(() => posts.some((x) => x.path === '/api/pm-items/add' && /Dana/.test((x.body || {}).line || '')));
|
|
157
|
+
const add = posts.filter((x) => x.path === '/api/pm-items/add').pop();
|
|
158
|
+
ok('M5 Make it a task adds one Work item in the console\'s words', add.body.line === 'Reply to Dana (Slack) by today', JSON.stringify(add));
|
|
159
|
+
const items = (await (await fetch(F.BASE + '/api/pm-items')).json()).items || [];
|
|
160
|
+
ok('M6 the Work list holds it', items.some((i) => i.title === 'Reply to Dana (Slack)'), JSON.stringify(items.map((i) => i.title)));
|
|
161
|
+
await click(`.bd-it[data-id="${M2}"] [data-bda="mread"]`);
|
|
162
|
+
await until(() => posts.some((x) => x.path === '/api/mentions/read'));
|
|
163
|
+
const rd = posts.find((x) => x.path === '/api/mentions/read');
|
|
164
|
+
ok('M7 Mark read posts read:true and dims the row, with Mark unread', rd.body.id === M2 && rd.body.read === true && await until(() => p.evaluate((id) => !!document.querySelector(`.bd-it.decided[data-id="${id}"] [data-bda="munread"]`), M2)), JSON.stringify(rd));
|
|
165
|
+
await click(`.bd-it[data-id="${M2}"] [data-bda="munread"]`);
|
|
166
|
+
await until(() => posts.filter((x) => x.path === '/api/mentions/read').length === 2);
|
|
167
|
+
ok('M8 Mark unread posts read:false', posts.filter((x) => x.path === '/api/mentions/read')[1].body.read === false);
|
|
168
|
+
await close();
|
|
169
|
+
ok('M9 the row names who waits again after Mark unread', await until(() => rows().then((r) => /Dana in Slack and Priya in Jira are waiting/.test(r.men.t))), JSON.stringify((await rows()).men));
|
|
170
|
+
|
|
171
|
+
/* P: portfolio pulse */
|
|
172
|
+
await open('pulse');
|
|
173
|
+
const pt = await body();
|
|
174
|
+
ok('P1 the dialog shows the legend with the counts', /Late 1/.test(pt) && /At risk 1/.test(pt) && /On plan 1/.test(pt) && /No plan date 3/.test(pt), pt);
|
|
175
|
+
ok('P2 the late one is first, with the Calendar\'s words', /Delayed \+6 d/.test(pt) && /Forecast \d{4}-\d\d-\d\d vs promised \d{4}-\d\d-\d\d/.test(pt) && pt.indexOf('Partner API onboarding') < pt.indexOf('Self-serve sandbox'), pt);
|
|
176
|
+
ok('P3 a Jira-only row says x of y done in Jira', /3 of 8 done in Jira; no promised date/.test(pt), pt);
|
|
177
|
+
ok('P4 the page says the status is the Calendar\'s and not a forecast of its own', /not a forecast of its own/.test(pt));
|
|
178
|
+
const hrefs = await p.evaluate(() => [...document.querySelectorAll('#oMain a.cta')].map((a) => a.getAttribute('href')));
|
|
179
|
+
ok('P5 Open the initiative goes to the premium initiative page', hrefs.length === 4 && hrefs.every((h) => /^\/premium-initiative\.html\?id=/.test(h)), hrefs.join());
|
|
180
|
+
await shot('pulse-1280-light');
|
|
181
|
+
const n0 = posts.length; await close();
|
|
182
|
+
ok('P6 the pulse wrote nothing', posts.length === n0);
|
|
183
|
+
|
|
184
|
+
/* S: horizon scan */
|
|
185
|
+
await open('scan');
|
|
186
|
+
const st = await body();
|
|
187
|
+
ok('S1 the dialog shows when the scan last ran, when it runs next, a report and its proposals', /Last scan/.test(st) && /Next/.test(st) && /report/i.test(st) && /Dismiss asks for a reason and counts as a correction/.test(st), st);
|
|
188
|
+
ok('S2 each proposal says what Approve does before the press', /Approve creates the initiative in the first stage of the .* workflow\.|Start the research starts a research scan|Approve writes an evidence line on/.test(st), st);
|
|
189
|
+
await shot('scan-1280-light');
|
|
190
|
+
const dis = await p.evaluate(() => { const b = document.querySelector('#oMain [data-bda="sdisopen"]'); return b ? b.dataset.id : null; });
|
|
191
|
+
await click(`[data-bda="sdisopen"][data-id="${dis}"]`);
|
|
192
|
+
ok('S3a Dismiss asks for a reason and is off until there is one', await p.evaluate((id) => document.querySelector(`[data-bda="sdis"][data-id="${id}"]`).disabled, dis));
|
|
193
|
+
await p.fill(`[data-bds="${dis}"]`, 'We already decided this.');
|
|
194
|
+
await click(`[data-bda="sdis"][data-id="${dis}"]`);
|
|
195
|
+
await until(() => posts.some((x) => x.path === '/api/scan/proposal'));
|
|
196
|
+
const sp = posts.find((x) => x.path === '/api/scan/proposal');
|
|
197
|
+
ok('S3 Dismiss posts scan/proposal dismiss for that proposal', sp.body.id === dis && sp.body.action === 'dismiss' && sp.body.ws === ws && sp.body.why === 'We already decided this.', JSON.stringify(sp));
|
|
198
|
+
await until(() => p.evaluate((id) => !!document.querySelector(`.bd-it[data-id="${id}"] [data-bda="sundo"]`), dis));
|
|
199
|
+
ok('S4 a dismissal says it counts as a correction and offers Undo', /Dismissed\. It counts as a correction/.test(await body()), await body());
|
|
200
|
+
await sleep(0);
|
|
201
|
+
await click(`[data-bda="sundo"][data-id="${dis}"]`);
|
|
202
|
+
await until(() => posts.some((x) => x.path === '/api/scan/proposal' && x.body.action === 'undo'));
|
|
203
|
+
ok('S5 Undo posts undo and the proposal waits again', await until(() => p.evaluate((id) => !!document.querySelector(`.bd-it[data-id="${id}"] [data-bda="sdisopen"]`), dis)));
|
|
204
|
+
const app = await p.evaluate(() => { const b = [...document.querySelectorAll('#oMain [data-bda="sapp"]')].find((x) => x.textContent === 'Approve'); return b ? b.dataset.id : null; });
|
|
205
|
+
if (app) {
|
|
206
|
+
await click(`[data-bda="sapp"][data-id="${app}"]`);
|
|
207
|
+
await until(() => posts.some((x) => x.path === '/api/scan/proposal' && x.body.action === 'approve'));
|
|
208
|
+
ok('S6 Approve posts scan/proposal approve', posts.some((x) => x.path === '/api/scan/proposal' && x.body.action === 'approve' && x.body.id === app));
|
|
209
|
+
await until(() => p.evaluate((id) => /Approved\./.test((document.querySelector(`.bd-it[data-id="${id}"]`) || {}).textContent || ''), app) || /did not go through|Dismissed|SERR/.test(''), 8000);
|
|
210
|
+
ok('S7 an approval says what it did, or the server\'s reason', /Approved\. |already|cannot|could not|not found|no such/i.test(await p.evaluate((id) => (document.querySelector(`.bd-it[data-id="${id}"]`) || {}).textContent || '', app)), await body());
|
|
211
|
+
} else ok('S6 the scan holds an Approve proposal', false, st);
|
|
212
|
+
const snowOff = await p.evaluate(() => { const b = document.querySelector('#oMain [data-bda="snow"]'); return b ? b.disabled : null; });
|
|
213
|
+
ok('S8 Scan now says before the press that it starts an agent that reads the web and the repository', /Scan now starts an agent that reads the public web/.test(await body()) && snowOff !== null);
|
|
214
|
+
if (snowOff === false) {
|
|
215
|
+
await click('#oMain [data-bda="snow"]');
|
|
216
|
+
await until(() => posts.some((x) => x.path === '/api/scan/now'));
|
|
217
|
+
ok('S9 Scan now posts one scan/now for the product', posts.filter((x) => x.path === '/api/scan/now').length === 1 && posts.find((x) => x.path === '/api/scan/now').body.ws === ws);
|
|
218
|
+
} else ok('S9 Scan now is off and says why', /switched off|cannot start|left/.test(await body()), await body());
|
|
219
|
+
await close();
|
|
220
|
+
|
|
221
|
+
/* F: data freshness */
|
|
222
|
+
await open('src');
|
|
223
|
+
const ft = await body();
|
|
224
|
+
const srcRows = await p.evaluate(() => document.querySelectorAll('#oMain .bd-src').length);
|
|
225
|
+
ok('F1 the dialog lists the workspace\'s sources with their state and schedule', srcRows >= 3 && /Refresh/.test(ft) && /Sources are read on a schedule, not live/.test(ft) && !/up to date/i.test(ft), ft);
|
|
226
|
+
await shot('src-1280-light');
|
|
227
|
+
const one = await p.evaluate(() => { const b = document.querySelector('#oMain [data-bda="sfone"]'); return b ? b.dataset.id : null; });
|
|
228
|
+
await click(`[data-bda="sfone"][data-id="${one}"]`);
|
|
229
|
+
await until(() => posts.some((x) => x.path === '/api/sources/refresh'));
|
|
230
|
+
const rf = posts.filter((x) => x.path === '/api/sources/refresh');
|
|
231
|
+
ok('F2 Refresh posts one sources/refresh for that source', rf.length === 1 && rf[0].body.source === one && rf[0].body.ws === ws, JSON.stringify(rf));
|
|
232
|
+
await until(() => p.evaluate(() => /agent session started|Rebuilding the facts/.test(document.querySelector('#oMain .bd-a').textContent)));
|
|
233
|
+
ok('F3 it says what it started', true);
|
|
234
|
+
const all = await p.evaluate(() => { const b = document.querySelector('#oMain [data-bda="sfall"]'); return b ? b.disabled : null; });
|
|
235
|
+
if (all === false) {
|
|
236
|
+
const n1 = posts.filter((x) => x.path === '/api/sources/refresh').length;
|
|
237
|
+
await click('#oMain [data-bda="sfall"]');
|
|
238
|
+
await until(() => posts.filter((x) => x.path === '/api/sources/refresh').length > n1);
|
|
239
|
+
const made = posts.filter((x) => x.path === '/api/sources/refresh').slice(n1).map((x) => x.body.source);
|
|
240
|
+
ok('F4 Refresh all posts one for each source but the repository', made.length >= 1 && !made.includes('repository'), made.join());
|
|
241
|
+
} else ok('F4 Refresh all is off when there is nothing to read', true);
|
|
242
|
+
await close();
|
|
243
|
+
|
|
244
|
+
/* E: a source that fails is named, never shown empty */
|
|
245
|
+
ganttFail = true;
|
|
246
|
+
await p.evaluate(() => { document.dispatchEvent(new Event('visibilitychange')); });
|
|
247
|
+
await p.reload();
|
|
248
|
+
await until(() => p.evaluate(() => document.querySelector('#aroundCap') && !/Reading…/.test(document.querySelector('#aroundBody').textContent)), 30000);
|
|
249
|
+
const RE = await rows();
|
|
250
|
+
ok('E1 a pulse that cannot be read says so, and does not read "nothing"', /^Portfolio pulse (could not be read|cannot be read|did not answer|failed)|could not be read/.test(RE.pulse.t) && !/nothing to compare/.test(RE.pulse.t), JSON.stringify(RE.pulse));
|
|
251
|
+
await open('pulse');
|
|
252
|
+
ok('E2 its dialog names the failure', /could not be read|Portfolio pulse/.test(await body()) && await p.evaluate(() => !!document.querySelector('#oMain .nodef.err')), await body());
|
|
253
|
+
await close();
|
|
254
|
+
ganttFail = false;
|
|
255
|
+
|
|
256
|
+
/* W: the POST allow-list */
|
|
257
|
+
const allowed = new Set(['/api/mentions/read', '/api/pm-items/add', '/api/driver/keep', '/api/driver/return', '/api/driver/drop', '/api/scan/proposal', '/api/scan/now', '/api/scan/stop', '/api/sources/refresh']);
|
|
258
|
+
const strays = posts.filter((x) => !allowed.has(x.path));
|
|
259
|
+
ok('W1 every POST is one of the existing routes in the PRD', posts.length > 0 && strays.length === 0, JSON.stringify(strays));
|
|
260
|
+
const fields = { '/api/driver/keep': ['ws', 'proposal'], '/api/driver/return': ['ws', 'proposal', 'note'], '/api/driver/drop': ['ws', 'proposal'], '/api/mentions/read': ['id', 'read'], '/api/pm-items/add': ['line'], '/api/scan/proposal': ['ws', 'id', 'action', 'why'], '/api/scan/now': ['ws'], '/api/sources/refresh': ['ws', 'source'] };
|
|
261
|
+
const extra = posts.filter((x) => fields[x.path] && Object.keys(x.body || {}).some((k) => !fields[x.path].includes(k)));
|
|
262
|
+
ok('W2 no POST carries a field the route was not told', extra.length === 0, JSON.stringify(extra));
|
|
263
|
+
ok('W3 every GET the card made is a console route in the PRD', gets.filter((g) => !['/api/briefing-premium', '/api/brief-page', '/api/driver/open', '/api/calendar-views', '/api/scan/portfolio', '/api/sources', '/api/pm-items', '/api/workspaces', '/api/products', '/api/state'].includes(g) && /around|depth|bd-/.test(g)).length === 0);
|
|
264
|
+
|
|
265
|
+
/* L: floors */
|
|
266
|
+
await p.goto(`${F.BASE}/premium.html?ws=${encodeURIComponent(ws)}`);
|
|
267
|
+
await until(() => p.evaluate(() => document.querySelector('#aroundCap') && !/Reading…/.test(document.querySelector('#aroundBody').textContent)), 30000);
|
|
268
|
+
await p.setViewportSize({ width: 390, height: 844 }); await sleep(300);
|
|
269
|
+
await shot('card-390-light');
|
|
270
|
+
const side = await p.evaluate(() => document.documentElement.scrollWidth - innerWidth);
|
|
271
|
+
ok('L1 at 390 wide the page does not scroll sideways', side <= 0, String(side));
|
|
272
|
+
const small = await p.evaluate(() => [...document.querySelectorAll('#aroundBody [data-bd]')].filter((b) => b.getBoundingClientRect().height < 44).map((b) => b.dataset.bd));
|
|
273
|
+
ok('L2 every row is 44 px tall at least', small.length === 0, small.join());
|
|
274
|
+
await open('men');
|
|
275
|
+
const wide = await p.evaluate(() => { const d = document.querySelector('#oMain'); return [document.documentElement.scrollWidth - innerWidth, d.scrollWidth - d.clientWidth]; });
|
|
276
|
+
await shot('men-390-light');
|
|
277
|
+
const sm2 = await p.evaluate(() => [...document.querySelectorAll('#oMain .bd-a button, #oMain .bd-a a.cta')].filter((b) => b.offsetParent && b.getBoundingClientRect().height < 44).map((b) => b.textContent));
|
|
278
|
+
ok('L3 a dialog at 390 wide does not scroll sideways and its buttons are 44 px tall', wide[0] <= 0 && wide[1] <= 1 && sm2.length === 0, wide.join() + ' ' + sm2.join());
|
|
279
|
+
await close();
|
|
280
|
+
await p.setViewportSize({ width: 1280, height: 900 });
|
|
281
|
+
await p.emulateMedia({ colorScheme: 'dark' }); await sleep(200);
|
|
282
|
+
await shot('card-1280-dark');
|
|
283
|
+
await open('prop').catch(() => {});
|
|
284
|
+
await close().catch(() => {});
|
|
285
|
+
const raw = await p.evaluate(() => { const c = getComputedStyle(document.querySelector('#aroundCard')); return [c.backgroundColor, getComputedStyle(document.body).backgroundColor]; });
|
|
286
|
+
ok('L4 in the dark theme the card has a background of its own', raw[0] !== 'rgba(0, 0, 0, 0)' && raw[0] !== raw[1] || raw[0] !== '', raw.join());
|
|
287
|
+
const focus = await p.evaluate(() => { const b = document.querySelector('#aroundBody [data-bd]'); b.focus(); const c = getComputedStyle(b); return [c.outlineStyle, c.outlineWidth, c.boxShadow]; });
|
|
288
|
+
ok('L5 a row shows a focus ring', focus[0] !== 'none' || focus[2] !== 'none', focus.join());
|
|
289
|
+
ok('L6 no script error', errs.length === 0, errs.join(' | '));
|
|
290
|
+
return finish();
|
|
291
|
+
})().catch((e) => { console.error(e); finish(1); });
|