create-pmos 0.441.0 → 0.443.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +25 -25
- package/payload/KIT-VERSION +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/adler-seasons-art-test.js +106 -0
- package/workspace/adler-seasons-test.js +111 -0
- package/workspace/briefing-premium-board-test.js +19 -17
- package/workspace/briefing-premium-initiative-test.js +7 -4
- package/workspace/changelog.json +24 -0
- package/workspace/goals-clear-ui-test.js +249 -0
- package/workspace/guide/adler.md +10 -0
- package/workspace/guide/home.md +8 -1
- package/workspace/guide/metric-drafts.md +8 -2
- package/workspace/home-railcard-test.js +193 -0
- package/workspace/ini-workflow-test.js +6 -2
- package/workspace/intelligence-gaps-ui-test.js +16 -14
- package/workspace/lib/engine/records/index.js +9 -2
- package/workspace/lib/initiative-layout.js +3 -1
- package/workspace/lib/insights-premium.js +22 -1
- package/workspace/lib/metric-drafts.js +37 -10
- package/workspace/lib/metric-read-runs.js +20 -13
- package/workspace/lib/metric-reads.js +208 -23
- package/workspace/lib/metrics-cli.js +62 -5
- package/workspace/lib/routes-goal-status.js +89 -6
- package/workspace/lib/routes-insights-premium.js +1 -1
- package/workspace/lib/routes-metric-drafts.js +26 -3
- package/workspace/lib/settings-store.js +38 -0
- package/workspace/metric-drafts-ui-test.js +7 -4
- package/workspace/okr-goals-ui-test.js +7 -5
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +2 -1
- package/workspace/premium-chat-attach-test.js +2 -0
- package/workspace/program-panel-test.js +1 -1
- package/workspace/public/pm/bd-ini-panel.js +2 -2
- package/workspace/public/pm/c3-ini-ui.js +1 -1
- package/workspace/public/pm/cozy-adler.css +21 -0
- package/workspace/public/pm/cozy-adler.js +415 -8
- package/workspace/public/pm/cozy-ev.css +16 -1
- package/workspace/public/pm/cozy-home.css +8 -0
- package/workspace/public/pm/cozy-insights.css +82 -0
- package/workspace/public/pm/cozy-live-pill.css +5 -0
- package/workspace/public/pm/cozy-news.js +1 -1
- package/workspace/public/pm/cozy-seasons.js +318 -0
- package/workspace/public/pm/cozy-settings.js +88 -5
- package/workspace/public/pm/cozy-today.css +15 -0
- package/workspace/public/pm/cozy-viewer.js +50 -18
- package/workspace/public/pm/cozy-vw-shell.css +4 -0
- package/workspace/public/pm/cozy.css +65 -0
- package/workspace/public/pm/dash-view.js +4 -2
- package/workspace/public/pm/goals-clear.js +258 -0
- package/workspace/public/pm/home-app.js +59 -5
- package/workspace/public/pm/home-chat.js +1 -1
- package/workspace/public/pm/home-day.js +7 -4
- package/workspace/public/pm/home-ini.js +2 -2
- package/workspace/public/pm/home-mentions.js +1 -1
- package/workspace/public/pm/home-today.js +51 -10
- package/workspace/public/pm/impact.js +1 -1
- package/workspace/public/pm/ini-groups.js +28 -17
- package/workspace/public/pm/ini-links.js +1 -1
- package/workspace/public/pm/ini-tasks.js +246 -48
- package/workspace/public/pm/ini-view-model.js +45 -16
- package/workspace/public/pm/ini-view.css +330 -1
- package/workspace/public/pm/ini-view.js +196 -83
- package/workspace/public/pm/metric-drafts.js +4 -1
- package/workspace/public/pm/mission.js +238 -0
- package/workspace/public/pm/premium-board.js +1 -1
- package/workspace/public/pm/premium-insights.js +178 -24
- package/workspace/public/pm/premium-welcome.js +2 -2
- package/workspace/public/pm/split-merge.js +1 -1
- package/workspace/public/pm/stage-line.js +2 -2
- package/workspace/server.js +6 -2
- package/workspace/skills/metric-read.skill +7 -5
- package/workspace/split-merge-ui-test.js +1 -1
- package/workspace/stage-card-test.js +56 -11
- package/workspace/task-links-test.js +2 -0
- package/workspace/task-milestones-test.js +5 -1
- package/workspace/task-plans-test.js +3 -3
- package/workspace/task-views-test.js +279 -37
- package/workspace/test-lists/adler-seasons-art.json +13 -0
- package/workspace/test-lists/batch18-adler-seasons.json +13 -0
- package/workspace/test-lists/goals-clear.json +15 -0
- package/workspace/test-lists/home-railcard.json +9 -0
- package/workspace/test-lists/mission.json +5 -0
- package/workspace/test-lists/viewer-tasks.json +5 -0
- package/workspace/tk-tasks-test.js +27 -32
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* goals-clear-ui-test.js — goals made clear on Intelligence (feedback batch 18 item 11, build 11-B; main canvas In development, frames Gc*). Serves
|
|
4
|
+
* the real page from the real server; GET /api/insights-premium answers the model lib/insights-premium.js builds from its fixture, with the fields
|
|
5
|
+
* of the goals reading engine (11-A, next18/11-okr-clarity/api-contract.md section 5) set on some goals; GET /api/metric-drafts answers drafted
|
|
6
|
+
* metrics with their recipe, counts, live read and checks. The write routes are stubbed so each press can be read back.
|
|
7
|
+
* T GcJ1aTable: the drafted metrics are one table (Proposed metric, How it is counted, Now read hh:mm, Target, From, how often), grouped, with
|
|
8
|
+
* ✕ / ✓; no second North Star row; ✓ keeps that row and the toast names its rhythm, never "every morning"
|
|
9
|
+
* C GcJ1Drafts: a row opens its check panel: how it is counted, the live read, my checks, your number, how often, the query folded, ↗ ✎ ↻ Keep;
|
|
10
|
+
* ↻ posts the live read; a number posts the compare
|
|
11
|
+
* S GcS3Differs: mine beside yours, why, the suggestion; ✓ posts the pick
|
|
12
|
+
* F GcJ2FirstMonday: one reading: the reading with its source and time, a grey dot, "pace known after 3 readings"; the chart waits for the 2nd
|
|
13
|
+
* K GcR3Goal: a key result's Viewer: the counts as a fraction, From … with the rhythm and the last and next read said once, ↻ in the header
|
|
14
|
+
* R GcR4Failed: the last good number stays, the reason, Reconnect posts the drafted connect fix
|
|
15
|
+
* H GcR5Held: the held reading is not drawn; why, its checks, the Jira draft; ✓✓ files it
|
|
16
|
+
* P on a phone: the table and the check panel with no sideways scroll. PMOS_SHOTS=<dir> also saves screenshots. */
|
|
17
|
+
const path = require('path');
|
|
18
|
+
const fs = require('fs');
|
|
19
|
+
const { spawn } = require('child_process');
|
|
20
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
21
|
+
const T = require('./test-run').configure({ name: 'goals-clear-ui' });
|
|
22
|
+
const IP = require('./lib/insights-premium.js');
|
|
23
|
+
const F = require('./fixtures/insights-premium-facts.js');
|
|
24
|
+
|
|
25
|
+
const BASE = T.BASE;
|
|
26
|
+
const SHOTS = process.env.PMOS_SHOTS || '';
|
|
27
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
28
|
+
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { let v; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
29
|
+
const results = [];
|
|
30
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 700) : ''}`); };
|
|
31
|
+
let srv = null; let browser = null;
|
|
32
|
+
const finish = async (code) => {
|
|
33
|
+
if (browser) await browser.close().catch(() => {});
|
|
34
|
+
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
35
|
+
T.killTmux();
|
|
36
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
37
|
+
console.log(`\n${results.length - bad}/${results.length} goals-clear-ui assertions passed`);
|
|
38
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
39
|
+
};
|
|
40
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
41
|
+
|
|
42
|
+
const WEEKLY = { connector: 'Amplitude', query: 'event login_success\ncount unique users, per week (Mon–Sun, SGT)', cadence: 'weekly', at: '07:00', day: 'mon', where: 'chart “Signed-in shoppers”', url: 'https://app.amplitude.com/chart/1' };
|
|
43
|
+
const RH = (txt, short, cadence) => ({ cadence, txt, short, ...(/\d{2}:\d{2}/.test(txt) ? { at: txt.match(/\d{2}:\d{2}/)[0] } : {}) });
|
|
44
|
+
const CHECKS = [{ id: 'zero', ok: true, text: 'No segment reads 0' }, { id: 'jump', ok: true, text: 'The last 8 weeks rise slowly, with no gaps' }, { id: 'den', ok: true, text: 'A plain count: no share to check' }, { id: 'range', ok: true, text: 'It is less than all shoppers (61k), as it must be' }];
|
|
45
|
+
/* day 1: Claude drafted a North Star, 3 inputs and 2 guardrails (GcJ1aTable) */
|
|
46
|
+
const metric = (id, group, name, type, what, nowTxt, targetTxt, recipe, rhythm, o = {}) => Object.assign({ id, kind: 'metric', group, name, type, nowTxt, targetTxt, source: recipe.connector, why: '', state: 'open', ticket: null, goal: null,
|
|
47
|
+
recipe, rhythm, counts: { what }, live: { at: '2026-10-28T10:58:00', ok: true, value: 1, txt: nowTxt, period: 'week of 19 Oct', source: recipe.connector }, checks: CHECKS }, o);
|
|
48
|
+
const ROWS = () => [
|
|
49
|
+
metric('d-ns', 'North Star', 'Weekly signed-in shoppers', 'Count', 'Shoppers who signed in at least once in the week, each person once', '38.8k', '45k by Dec 31', WEEKLY, RH('every Monday 07:00', 'Every Monday', 'weekly')),
|
|
50
|
+
metric('d-i1', 'Inputs', 'Login success rate', 'Percentage', 'Logins that worked ÷ logins started', '94.1%', '96%', WEEKLY, RH('every Monday 07:00', 'Every Monday', 'weekly')),
|
|
51
|
+
metric('d-i2', 'Inputs', 'Checkout login drop-off', 'Percentage', 'Checkouts that stop at login ÷ checkouts that reach login', '21.4%', '15%', WEEKLY, RH('every Monday 07:00', 'Every Monday', 'weekly')),
|
|
52
|
+
metric('d-i3', 'Inputs', 'Returning shopper share', 'Percentage', 'Shoppers back within 30 days ÷ shoppers this week', '58%', '60%', WEEKLY, RH('every Monday 07:00', 'Every Monday', 'weekly')),
|
|
53
|
+
metric('d-g1', 'Guardrails', 'Login time, slowest 5%', 'Stay within', 'The time 95 of 100 logins finish within', '0.9 s', 'Under 1.2 s', { connector: 'Datadog', query: 'p95(login.duration)', cadence: 'hourly' }, RH('every hour in working hours', 'Every hour', 'hourly')),
|
|
54
|
+
metric('d-g2', 'Guardrails', 'Login support tickets', 'Stay within', 'New tickets in Jira LOGIN tagged “sign-in”, per week', '31', 'Under 40', { connector: 'Jira', query: 'project = LOGIN AND labels = sign-in', cadence: 'daily', at: '07:00' }, RH('every day 07:00', 'Every day', 'daily')),
|
|
55
|
+
];
|
|
56
|
+
const DRAFTS = (rows) => ({ ok: true, scope: 'product', id: 'w1', title: 'pmos-idpf', run: { state: 'ready', step: 4, reads: [] }, head: '', sub: '', src: '', rows });
|
|
57
|
+
|
|
58
|
+
/* the model: day 1 has no goal read (the fixture's goals emptied), later days carry the reading engine's fields */
|
|
59
|
+
function model(kind) {
|
|
60
|
+
const M = IP.build(F.facts({ pinned: 'all', budgets: [] }));
|
|
61
|
+
M.board.name = 'pmos-idpf';
|
|
62
|
+
const g = (id) => M.goals.find((x) => x.id === id);
|
|
63
|
+
if (kind === 'day1') { M.goals = []; M.charts = []; M.budgets = []; return M; }
|
|
64
|
+
const ns = g('krm-up'), act = g('krm-act');
|
|
65
|
+
ns.role = 'north-star';
|
|
66
|
+
const counts = { what: 'Checkouts that stop at login ÷ checkouts that reach login', num_label: 'checkouts stopped at login', den_label: 'checkouts reached login' };
|
|
67
|
+
if (kind === 'first') {
|
|
68
|
+
// one reading each (GcJ2FirstMonday)
|
|
69
|
+
for (const x of M.goals) { const s = (x.series || []).slice(-1); x.series = s.length ? s : [{ at: '2026-11-02', v: 1 }]; x.readings = 1; x.key = null; x.reading = { dot: 'on', at: '2026-11-02', ageDays: 0, txt: x.nowTxt || '1', line: '' }; x.recipe = Object.assign({}, WEEKLY); x.rhythm = RH('every Monday 07:00', 'Every Monday', 'weekly');
|
|
70
|
+
x.lastRead = { at: '2026-11-02T07:02:00', value: 1, txt: x.nowTxt || '1', source: 'Amplitude' }; x.nextRead = '2026-11-09T07:00:00'; }
|
|
71
|
+
return M;
|
|
72
|
+
}
|
|
73
|
+
Object.assign(act, { recipe: Object.assign({}, WEEKLY, { where: 'chart “Checkout funnel”' }), rhythm: RH('every Monday 07:00', 'Every Monday', 'weekly'), counts,
|
|
74
|
+
lastRead: { at: '2026-11-16T07:02:00', value: 20.2, txt: '20.2%', num: 1212, den: 6000, source: 'Amplitude', period: 'week of 9 Nov' }, nextRead: '2026-11-23T07:00:00', checks: CHECKS, held: [], failed: null,
|
|
75
|
+
reading: { dot: 'behind', at: '2026-11-16', ageDays: 0, stale: false, txt: '20.2% of 15%', line: 'its line says 16.5%' } });
|
|
76
|
+
if (kind === 'failed') Object.assign(act, { failed: { at: '2026-11-16T07:02:00', why: 'Amplitude said your login has expired.', fix: { kind: 'connect', connector: 'Amplitude', row: 'fx-amp' } },
|
|
77
|
+
lastRead: { at: '2026-11-09T07:02:00', value: 20.2, txt: '20.2%', num: 1212, den: 6000, source: 'Amplitude', period: 'week of 2 Nov' } });
|
|
78
|
+
if (kind === 'held') Object.assign(ns, { recipe: Object.assign({}, WEEKLY), rhythm: RH('every Monday 07:00', 'Every Monday', 'weekly'), counts: { what: 'Shoppers who signed in at least once in the week, each person once' },
|
|
79
|
+
lastRead: { at: '2026-11-16T07:02:00', value: 40600, txt: '40.6k', source: 'Amplitude' }, nextRead: '2026-11-30T07:00:00',
|
|
80
|
+
held: [{ at: '2026-11-23T07:02:00', day: '2026-11-23', value: 52300, txt: '52.3k', source: 'Amplitude', why: 'Moved more than 3× a normal week', checks: [{ id: 'jump', ok: false, text: 'Moved more than 3× a normal week' }, { id: 'den', ok: true, text: 'Both counts came back' }], ticket: 'tk-held' }] });
|
|
81
|
+
return M;
|
|
82
|
+
}
|
|
83
|
+
const TICKET = { id: 'tk-held', kind: 'ticket', goal: 'krm-up', text: 'Send a ticket to fix the double count', act: 'Send to Jira', state: 'open', ticket: { title: 'login_success fires twice on app 5.2', text: '…' }, why: '' };
|
|
84
|
+
const FIX = { id: 'fx-amp', kind: 'connect', goal: 'krm-act', connector: 'Amplitude', text: 'Connect Amplitude', act: 'Connect Amplitude', state: 'open', ticket: null, why: '' };
|
|
85
|
+
|
|
86
|
+
(async () => {
|
|
87
|
+
const exe = process.env.PMOS_CHROME || findBrowser();
|
|
88
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
89
|
+
let chromium;
|
|
90
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
91
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT), PMOS_SELF_ROOT: path.resolve(__dirname, '..') }) });
|
|
92
|
+
await T.waitForServer(BASE);
|
|
93
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
94
|
+
if (SHOTS) fs.mkdirSync(SHOTS, { recursive: true });
|
|
95
|
+
const shot = async (p, name) => { if (!SHOTS) return; await sleep(450); await p.screenshot({ path: path.join(SHOTS, name + '.png') }); };
|
|
96
|
+
|
|
97
|
+
const open = async ({ w = 1440, h = 900, m = model('day1'), rows = ROWS(), theme = 'light', ready = '#draftBox .gc-tr' } = {}) => {
|
|
98
|
+
const ctx = await browser.newContext({ viewport: { width: w, height: h }, timezoneId: 'UTC' });
|
|
99
|
+
const page = await ctx.newPage();
|
|
100
|
+
const errors = [], posts = [], S = { rows };
|
|
101
|
+
page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
|
|
102
|
+
await page.route('**/api/insights-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, model: m }) }));
|
|
103
|
+
await page.route('**/api/board-metrics-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: { tiles: [] } }) }));
|
|
104
|
+
await page.route('**/api/briefing-premium/products', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, all: false, chosen: true, products: [{ ws: m.board.ws, name: m.board.name, primary: true, on: true }] }) }));
|
|
105
|
+
await page.route('**/api/metric-drafts?*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify(DRAFTS(S.rows)) }));
|
|
106
|
+
const answer = (p, body) => {
|
|
107
|
+
if (p === '/api/metric-drafts/keep') return { ok: true, rid: 'r1', rhythm: (S.rows.find((x) => x.id === body.row) || {}).rhythm };
|
|
108
|
+
if (p === '/api/goal-status/compare') {
|
|
109
|
+
// the server stores the PM's number; the GET then carries the compare with Claude's why and suggestion
|
|
110
|
+
S.rows = S.rows.map((x) => (x.id === body.goal ? Object.assign({}, x, { compare: { value: body.value, txt: '44.1k', ours: 38800, oursTxt: '38.8k', label: 'Yours', apart: '5.3k', pct: 13.7, differs: true, state: 'differs',
|
|
111
|
+
why: 'finance counts a shopper once per device; I count each shopper once. 5.3k shoppers signed in on two devices last week.', suggest: { text: 'I suggest per shopper: the North Star is about people.', keep: 'mine' } } }) : x));
|
|
112
|
+
return { ok: true, pct: 13.7, apart: '5.3k', differs: true };
|
|
113
|
+
}
|
|
114
|
+
if (p === '/api/goal-status/test') { S.rows = S.rows.map((x) => (x.id === (body.rows || [])[0] ? Object.assign({}, x, { live: Object.assign({}, x.live, { at: '2026-10-28T11:05:00' }) }) : x)); return { ok: true, run: 'r', rids: body.rows }; }
|
|
115
|
+
return { ok: true };
|
|
116
|
+
};
|
|
117
|
+
for (const k of ['metric-drafts/keep', 'metric-drafts/keep-all', 'metric-drafts/drop', 'metric-drafts/edit', 'metric-drafts/undo', 'goal-status/test', 'goal-status/read', 'goal-status/compare', 'goal-status/compare-pick', 'goal-status/file-held']) {
|
|
118
|
+
await page.route('**/api/' + k, (r) => { const p = '/api/' + k, body = JSON.parse(r.request().postData() || '{}'); posts.push({ path: p, body }); r.fulfill({ contentType: 'application/json', body: JSON.stringify(answer(p, body)) }); });
|
|
119
|
+
}
|
|
120
|
+
await page.goto(BASE + '/premium-intelligence.html?theme=' + theme);
|
|
121
|
+
await until(() => page.evaluate((s) => !!document.querySelector(s), ready), 20000);
|
|
122
|
+
return { ctx, page, errors, posts, S };
|
|
123
|
+
};
|
|
124
|
+
const txt = (p, s) => p.evaluate((x) => { const e = document.querySelector(x); return e ? e.textContent.replace(/\s+/g, ' ').trim() : ''; }, s);
|
|
125
|
+
const vw = (p) => until(() => p.evaluate(() => { const V = document.querySelector('#czViewer'); return V && !V.hidden && V.querySelector('.ins-vbody') ? V.querySelector('.ins-vbody').innerText.replace(/\s+/g, ' ').trim() : null; }), 5000);
|
|
126
|
+
|
|
127
|
+
/* T · the drafts table */
|
|
128
|
+
const A = await open(), p = A.page;
|
|
129
|
+
const tb = await p.evaluate(() => ({ heads: [...document.querySelectorAll('#draftBox .gc-th [role="columnheader"]')].map((e) => e.textContent.replace(/\s+/g, ' ').trim()),
|
|
130
|
+
groups: [...document.querySelectorAll('#draftBox .gc-grp b')].map((e) => e.textContent), rows: document.querySelectorAll('#draftBox .gc-tr').length,
|
|
131
|
+
ns: (() => { const r = document.querySelector('[data-gc-row="d-ns"]'); return r ? [...r.querySelectorAll('[role="cell"]')].map((c) => c.innerText.replace(/\s+/g, ' ').trim()) : []; })(),
|
|
132
|
+
g1: (document.querySelector('[data-gc-row="d-g1"] .gc-from') || {}).innerText || '', g2: (document.querySelector('[data-gc-row="d-g2"] .gc-from') || {}).innerText || '',
|
|
133
|
+
nsRow: !document.querySelector('#nsRow').hidden, list: document.querySelectorAll('#goalTbl .okr-row').length, empty: /No key result is recorded/.test(document.querySelector('#goalTbl').textContent),
|
|
134
|
+
acts: [...document.querySelectorAll('[data-gc-row="d-ns"] .gc-acts button')].map((b) => b.getAttribute('aria-label') + '|' + b.textContent.trim()) }));
|
|
135
|
+
ok('T1 one table: Proposed metric, How it is counted, Now (read 10:58), Target, From, how often', tb.heads.slice(0, 5).join(' | ') === 'Proposed metric | How it is counted | Now read 10:58 | Target | From, how often', tb.heads.join(' | '));
|
|
136
|
+
ok('T2 grouped: North Star, Inputs, Guardrails; 6 rows', tb.groups.join('|') === 'North Star|Inputs|Guardrails' && tb.rows === 6, JSON.stringify(tb));
|
|
137
|
+
ok('T3 a row says how it is counted, now, its target and where and how often it is read', tb.ns.join(' / ') === 'Weekly signed-in shoppers Count / Shoppers who signed in at least once in the week, each person once / 38.8k / 45k by Dec 31 / Amplitude Every Monday / ', tb.ns.join(' / '));
|
|
138
|
+
ok('T4 the rhythm is each goal\'s own: Every hour, Every day, 07:00', /Datadog\s*Every hour/.test(tb.g1) && /Jira\s*Every day, 07:00/.test(tb.g2), tb.g1 + ' | ' + tb.g2);
|
|
139
|
+
ok('T5 no second North Star row, no plain goal list and no empty card under the table', !tb.nsRow && tb.list === 0 && !tb.empty, JSON.stringify(tb));
|
|
140
|
+
ok('T6 ✕ and ✓ are icon-only, named in their label', tb.acts.length === 2 && tb.acts.every((a) => /\|$/.test(a)) && /^Not now: /.test(tb.acts[0]) && /^Keep: /.test(tb.acts[1]), tb.acts.join(', '));
|
|
141
|
+
const line = await p.evaluate(() => document.querySelector('#brief').textContent + ' ' + document.querySelector('#insWhy').textContent);
|
|
142
|
+
ok('T7 a goal behind its line stays the ✦ news; the drafts are kept from the table or with Keep all', /^Partner activation is behind its line/.test(line) && !/I drafted a North Star/.test(line) && !!(await p.$('#insAct [data-okl="keep-all"]')), line);
|
|
143
|
+
await shot(p, 'GcJ1aTable-built');
|
|
144
|
+
await p.click('[data-gc-row="d-g2"] [data-gc="keep"]');
|
|
145
|
+
ok('T8 ✓ keeps that row', await until(() => A.posts.some((x) => x.path === '/api/metric-drafts/keep' && x.body.row === 'd-g2')));
|
|
146
|
+
const toastT = await until(() => p.evaluate(() => { const t = document.querySelector('#toast'); return t && /Kept/.test(t.textContent) ? t.textContent : null; }), 4000);
|
|
147
|
+
ok('T9 the Kept toast names the goal\'s own rhythm, never "every morning"', /Kept\. I read it every day 07:00\./.test(toastT || '') && !/every morning/.test(toastT || ''), toastT);
|
|
148
|
+
|
|
149
|
+
/* C · the check panel */
|
|
150
|
+
await p.click('[data-gc-row="d-ns"] .gc-hw');
|
|
151
|
+
const c1 = await vw(p);
|
|
152
|
+
const cp = await p.evaluate(() => { const V = document.querySelector('#czViewer'); return { title: (V.querySelector('.cz-vw-title') || {}).textContent || '', sel: !!document.querySelector('[data-gc-row="d-ns"].sel'), q: !!V.querySelector('details.gc-q:not([open])'),
|
|
153
|
+
foot: [...V.querySelectorAll('.gc-foot .cz-ib')].map((b) => b.getAttribute('aria-label') + '|' + b.textContent.trim()) }; });
|
|
154
|
+
ok('C1 a row opens its check panel beside the table, the row marked', /Weekly signed-in shoppers/.test(cp.title) && cp.sel, JSON.stringify(cp));
|
|
155
|
+
ok('C2 how it is counted with the live read, then my checks', /How it is counted Shoppers who signed in at least once in the week, each person once 38\.8k read .*week of 19 Oct My checks No segment reads 0/.test(c1 || '') && /It is less than all shoppers \(61k\), as it must be/.test(c1), c1);
|
|
156
|
+
ok('C3 "No other number to compare yet", the input for yours, how often once, and the query folded', /No other number to compare yet: type yours/.test(c1) && /How often every Monday 07:00/.test(c1) && (c1.match(/every Monday/g) || []).length === 1 && cp.q, c1);
|
|
157
|
+
ok('C4 ↗ ✎ ↻ and Keep, icon-only', cp.foot.length === 4 && /^Open in Amplitude/.test(cp.foot[0]) && /^Edit/.test(cp.foot[1]) && /^Read it now/.test(cp.foot[2]) && /^Keep\|$/.test(cp.foot[3]) && cp.foot.every((f) => /\|$/.test(f)), cp.foot.join(', '));
|
|
158
|
+
ok('C5 the old "test read" wording is gone', !/test read/i.test(c1) && !/test read/i.test(await txt(p, '#draftBox')));
|
|
159
|
+
await shot(p, 'GcJ1Drafts-built');
|
|
160
|
+
await p.click('#czViewer [data-gc="test"]');
|
|
161
|
+
ok('C6 ↻ reads it now: POST /api/goal-status/test for that row', await until(() => A.posts.some((x) => x.path === '/api/goal-status/test' && (x.body.rows || [])[0] === 'd-ns')));
|
|
162
|
+
|
|
163
|
+
/* S · your number differs */
|
|
164
|
+
await until(() => p.evaluate(() => { const b = document.querySelector('#czViewer [data-gc="test"]'); return b && !b.disabled; }), 8000);
|
|
165
|
+
await p.fill('#czViewer [data-gc-cmp] input', '44.1k');
|
|
166
|
+
await p.click('#czViewer [data-gc-cmp] button[type="submit"]');
|
|
167
|
+
ok('S1 your number posts the compare, 44.1k as 44100', await until(() => A.posts.some((x) => x.path === '/api/goal-status/compare' && x.body.goal === 'd-ns' && x.body.value === 44100)));
|
|
168
|
+
const s1 = await until(() => p.evaluate(() => { const V = document.querySelector('#czViewer .ins-vbody'); return V && V.querySelector('.gc-two') ? V.innerText.replace(/\s+/g, ' ').trim() : null; }), 6000);
|
|
169
|
+
ok('S2 mine beside yours, how far apart, and why', /Mine 38\.8k/.test(s1 || '') && /Yours 44\.1k/.test(s1 || '') && /5\.3k apart\. I found why: finance counts a shopper once per device/.test(s1 || ''), s1);
|
|
170
|
+
ok('S3 Claude suggests one, and writes the pick into "How it is counted"', /I suggest per shopper: the North Star is about people\. I write your pick into “How it is counted”/.test(s1 || ''), s1);
|
|
171
|
+
await shot(p, 'GcS3Differs-built');
|
|
172
|
+
await p.click('#czViewer [data-gc="pick"]');
|
|
173
|
+
ok('S4 ✓ posts the pick (mine, as suggested)', await until(() => A.posts.some((x) => x.path === '/api/goal-status/compare-pick' && x.body.goal === 'd-ns' && x.body.pick === 'mine')));
|
|
174
|
+
ok('S5 no script error on the page', !A.errors.length, A.errors.join(' | '));
|
|
175
|
+
await A.ctx.close();
|
|
176
|
+
|
|
177
|
+
/* F · the first readings */
|
|
178
|
+
const B = await open({ m: model('first'), rows: [], ready: '#goalTbl .okr-row' });
|
|
179
|
+
const f1 = await B.page.evaluate(() => { const r = document.querySelector('#goalTbl [data-goal="krm-act"]'); return { meta: r.querySelector('.okr-main .note').textContent, dot: r.querySelector('.okr-main .cz-dot').className, line: document.querySelector('#brief').textContent + ' ' + document.querySelector('#insWhy').textContent }; });
|
|
180
|
+
ok('F1 one reading: the number, its source and time, "pace known after 3 readings", and a grey dot', /· Amplitude, Mon 2 Nov, 07:02 · pace known after 3 readings$/.test(f1.meta) && /\bq\b/.test(f1.dot), JSON.stringify(f1));
|
|
181
|
+
ok('F2 the ✦ line: the first readings are in; one reading is a starting point, not a trend', /^The first readings are in/.test(f1.line) && /One reading is a starting point, not a trend/.test(f1.line), f1.line);
|
|
182
|
+
await shot(B.page, 'GcJ2FirstMonday-built');
|
|
183
|
+
await B.page.click('#goalTbl [data-goal="krm-act"] .okr-main');
|
|
184
|
+
const f2 = await vw(B.page);
|
|
185
|
+
ok('F3 the Viewer waits for the 2nd reading instead of drawing a line', /The line starts with the 2nd reading, Mon 9 Nov/.test(f2 || '') && /pace known after 3 readings/.test(f2 || ''), f2);
|
|
186
|
+
await B.ctx.close();
|
|
187
|
+
|
|
188
|
+
/* K · a key result's panel */
|
|
189
|
+
const K = await open({ m: model('kr'), rows: [], ready: '#goalTbl .okr-row' });
|
|
190
|
+
await K.page.click('#goalTbl [data-goal="krm-act"] .okr-main');
|
|
191
|
+
const k1 = await vw(K.page);
|
|
192
|
+
const kh = await K.page.evaluate(() => ({ read: !!document.querySelector('#czViewer [data-cz-act="gc-read"], #czViewer button[aria-label="Read it now"]'), folds: [...document.querySelectorAll('#czViewer .czs-row b')].map((b) => b.textContent) }));
|
|
193
|
+
ok('K1 how it is counted as the two counts: 1,212 over 6,000 = 20.2%, week of 9 Nov', /How it is counted 1,212 checkouts stopped at login 6,000 checkouts reached login = 20\.2%, week of 9 Nov/.test(k1 || ''), k1);
|
|
194
|
+
ok('K2 From Amplitude, its chart, every Monday 07:00; last and next read said once', /From Amplitude, chart “Checkout funnel”, every Monday 07:00\. Last Mon 16 Nov, next Mon 23 Nov\./.test(k1 || '') && (k1.match(/every Monday/g) || []).length === 1, k1);
|
|
195
|
+
ok('K3 the last read with its checks, and the query', /Last read Mon 16 Nov, 07:02/.test(k1) && /The last 8 weeks rise slowly/.test(k1) && /The query Amplitude · chart “Checkout funnel” event login_success/.test(k1), k1);
|
|
196
|
+
ok('K4 ↻ Read now is in the header; the folds no longer repeat How I read it or What it counts', kh.read && !kh.folds.includes('How I read it') && !kh.folds.includes('What it counts') && kh.folds.includes('Readings'), JSON.stringify(kh));
|
|
197
|
+
await shot(K.page, 'GcR3Goal-built');
|
|
198
|
+
await K.page.click('#czViewer button[aria-label="Read it now"]');
|
|
199
|
+
ok('K5 ↻ reads that goal now (POST /api/goal-status/read)', await until(() => K.posts.some((x) => x.path === '/api/goal-status/read' && x.body.id === 'krm-act')));
|
|
200
|
+
await K.ctx.close();
|
|
201
|
+
|
|
202
|
+
/* R · a read that failed */
|
|
203
|
+
const R = await open({ m: model('failed'), rows: [FIX], ready: '#goalTbl .okr-row' });
|
|
204
|
+
const r0 = await R.page.evaluate(() => ({ meta: document.querySelector('#goalTbl [data-goal="krm-act"] .okr-main .note').textContent, line: document.querySelector('#brief').textContent + ' ' + document.querySelector('#insWhy').textContent }));
|
|
205
|
+
ok('R1 the row keeps the last good reading and says it was not read', /^20\.2% of 15%.* · not read Mon 16 Nov$/.test(r0.meta), r0.meta);
|
|
206
|
+
ok('R2 the ✦ line: I couldn’t read it, the reason the source gave, reconnect and I read it straight away', /^I couldn’t read Partner activation on Monday\. Amplitude said your login has expired\. Reconnect it and I read it straight away\./.test(r0.line), r0.line);
|
|
207
|
+
ok('R2b the drafted reconnect is not said again under the row', !(await R.page.$('#goalTbl [data-goal="krm-act"] [data-draft="fx-amp"]')));
|
|
208
|
+
await R.page.click('#goalTbl [data-goal="krm-act"] .okr-main');
|
|
209
|
+
const r1 = await vw(R.page);
|
|
210
|
+
ok('R3 the Viewer: the last good number, when it was not read and why, and that no number was guessed', /from Mon 9 Nov, the last good reading/.test(r1 || '') && /Mon 16 Nov, 07:02 · not read Amplitude said your login has expired\. I did not guess a number\./.test(r1 || ''), r1);
|
|
211
|
+
ok('R4 the counts are not known for this week', /\? checkouts stopped at login \? checkouts reached login = not known for this week/.test(r1 || ''), r1);
|
|
212
|
+
await shot(R.page, 'GcR4Failed-built');
|
|
213
|
+
await R.page.click('#czViewer [data-gc="reconnect"]');
|
|
214
|
+
ok('R5 its one fix: Reconnect keeps the drafted connect fix', await until(() => R.posts.some((x) => x.path === '/api/metric-drafts/keep' && x.body.row === 'fx-amp')));
|
|
215
|
+
await R.ctx.close();
|
|
216
|
+
|
|
217
|
+
/* H · a held reading */
|
|
218
|
+
const H = await open({ m: model('held'), rows: [TICKET], ready: '#nsRow .okr-row' });
|
|
219
|
+
const h0 = await H.page.evaluate(() => ({ meta: document.querySelector('#nsRow [data-goal="krm-up"] .okr-main .note').textContent, line: document.querySelector('#brief').textContent + ' ' + document.querySelector('#insWhy').textContent }));
|
|
220
|
+
ok('H1 the row says one reading is held and never shows it', / · 1 reading held$/.test(h0.meta) && !/52\.3k/.test(h0.meta), h0.meta);
|
|
221
|
+
ok('H2 the ✦ line: I held back one reading of the North Star', /^I held back one reading of the North Star\. Moved more than 3× a normal week\. Check it in the side panel\./.test(h0.line), h0.line);
|
|
222
|
+
ok('H2b the held reading\'s drafted ticket is said in the panel, not again under the row', !(await H.page.$('#nsRow [data-draft="tk-held"]')));
|
|
223
|
+
await H.page.click('#nsRow [data-goal="krm-up"] .okr-main');
|
|
224
|
+
const h1 = await vw(H.page);
|
|
225
|
+
ok('H3 the Viewer: the last good number, the held reading with why and its checks', /the last good reading, Mon 16 Nov/.test(h1 || '') && /Mon 23 Nov · read 52\.3k · held Moved more than 3× a normal week/.test(h1 || '') && /Both counts came back/.test(h1 || ''), h1);
|
|
226
|
+
ok('H4 the drafted Jira ticket, and "(held)" said once in From', /I drafted a Jira ticket: “login_success fires twice on app 5\.2”/.test(h1 || '') && /Last Mon 23 Nov \(held\), next Mon 30 Nov\./.test(h1 || ''), h1);
|
|
227
|
+
await shot(H.page, 'GcR5Held-built');
|
|
228
|
+
await H.page.click('#czViewer [data-gc="file-held"]');
|
|
229
|
+
ok('H5 ✓✓ files it as a reading', await until(() => H.posts.some((x) => x.path === '/api/goal-status/file-held' && x.body.id === 'krm-up' && x.body.held === '2026-11-23T07:02:00')));
|
|
230
|
+
await H.page.click('#czViewer [data-okd="keep"][data-row="tk-held"]').catch(() => {});
|
|
231
|
+
ok('H6 ✓ on the ticket sends the Jira draft', await until(() => H.posts.some((x) => x.path === '/api/metric-drafts/keep' && x.body.row === 'tk-held'), 4000));
|
|
232
|
+
ok('H7 no script error', !H.errors.length, H.errors.join(' | '));
|
|
233
|
+
await H.ctx.close();
|
|
234
|
+
|
|
235
|
+
/* P · a phone */
|
|
236
|
+
for (const theme of ['light', 'dark']) {
|
|
237
|
+
const Q = await open({ w: 390, h: 844, theme });
|
|
238
|
+
const ph = await Q.page.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1, rows: document.querySelectorAll('#draftBox .gc-tr').length }));
|
|
239
|
+
ok('P1 on a phone (' + theme + ') the drafts table shows with no sideways scroll', !ph.over && ph.rows === 6, JSON.stringify(ph));
|
|
240
|
+
await shot(Q.page, 'GcJ1aTable-phone-' + theme);
|
|
241
|
+
await Q.page.click('[data-gc-row="d-ns"] .gc-hw');
|
|
242
|
+
await vw(Q.page);
|
|
243
|
+
const pv = await Q.page.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1 }));
|
|
244
|
+
ok('P2 on a phone (' + theme + ') the check panel opens with no sideways scroll', !pv.over, JSON.stringify(pv));
|
|
245
|
+
await shot(Q.page, 'GcJ1Drafts-phone-' + theme);
|
|
246
|
+
await Q.ctx.close();
|
|
247
|
+
}
|
|
248
|
+
finish();
|
|
249
|
+
})();
|
package/workspace/guide/adler.md
CHANGED
|
@@ -46,6 +46,16 @@ Each mood comes from real state. When nothing happens, Adler is calm or he rests
|
|
|
46
46
|
|
|
47
47
|
Adler never sits in a list row, a bar, a chart or a report. Rows keep their own signals: a dot is a session and a box is a task.
|
|
48
48
|
|
|
49
|
+
## Adler dressed for the day
|
|
50
|
+
|
|
51
|
+
On a festival, a season or a day of your own, Adler wears a small charm: a hat, a scarf, something in his paws or at his feet, and a scene around him. Deepavali gives him a diya and a garland of marigolds. Christmas gives him a beanie, a gift and a tree. The charm changes what he wears, never his mood.
|
|
52
|
+
|
|
53
|
+
- **Where he wears it.** The scene on the first open of Your day, the night scene after 22:00, his face on the latest chat reply (a hat only), the first run, and a real milestone win on the Board.
|
|
54
|
+
- **Where he never wears it.** Toasts, the recording pill (the headphones win), Intelligence, list rows, charts, reports, and his smallest face.
|
|
55
|
+
- **The mood stays true.** When he needs you, the charm stays and the scene goes plain. When the news is bad, the charm comes off.
|
|
56
|
+
- **The greeting.** On the day itself, Your day says "Happy Deepavali, <your name>." It does not say this on a day with bad news.
|
|
57
|
+
- **Why is he dressed?** Press the scene. One line tells you why. The eye-off icon turns that day off for this year. The arrow opens **Settings › Adler › Dress for the day**.
|
|
58
|
+
|
|
49
59
|
## Choose how much of Adler you see
|
|
50
60
|
|
|
51
61
|
Open **Settings › Adler**. Each choice saves on this computer when you press it.
|
package/workspace/guide/home.md
CHANGED
|
@@ -74,6 +74,10 @@ Press an initiative's name in the list, or open `?ini=<id>`. The list stays as i
|
|
|
74
74
|
- A cancelled, done or archived initiative leaves Home, and so do the next steps that were for it.
|
|
75
75
|
- With no dates at all, the parts are even and dashed. The calendar button opens **Tasks** in the Timeline view to set the dates.
|
|
76
76
|
- On a phone the line shows only the next open milestone's name. Press the line to unfold the stages and milestones as a list under it.
|
|
77
|
+
- On a wide Viewer the stage's dates, ⋯ and the next stage always show under the picture, and the milestones are in their own **Milestones** card under it. When the dates are too long for the row, they take their own line. They are never cut.
|
|
78
|
+
- **Group by** (Stage, Owner, Status or Epic) is saved for the initiative. It stays after you change a task.
|
|
79
|
+
- When the list is folded, the Live pill above the menu button shows its marks in a column.
|
|
80
|
+
- The picture spans the card from edge to edge. The telescope stands at the left, the launch pad in the middle and the dish at the right, whatever the stages' dates. The rocket gets smaller as it flies toward the planet.
|
|
77
81
|
- Under the card are the 3 most urgent tasks and the documents that need a look. **Show N more** opens all the tasks and **Show all N** opens all the documents. ← goes back to the page. A task or a document that you open from the page also has ← back to the page.
|
|
78
82
|
- ⋯ is a short menu. It is the same on Home and on the Board, in the same order: **Split into a new initiative**, **Merge into**, **Program**, **Open on the Board** (only on Home), **Copy** (**Link** or **Text**), **The record**, a line, then **Delete** in red.
|
|
79
83
|
- **Program** is one list: the open programs (the current one says Now), then **No program** to move out. An initiative that is in no program has **Make it a program** at the end.
|
|
@@ -93,7 +97,9 @@ Press an initiative's name in the list, or open `?ini=<id>`. The list stays as i
|
|
|
93
97
|
- **Moves on by itself** is a switch, on by default. When every exit item is done, the stage moves to the next stage and a message shows **Undo**. A stage never moves by itself into a milestone (Deliver or Evaluate). This rule is a proposal that the PM has not confirmed yet.
|
|
94
98
|
- → with open tasks in the stage asks first (**Move anyway**, with a note). **Back** always asks for a reason.
|
|
95
99
|
- **Tasks** in the Viewer can be grouped by stage, by groups that you name, by owner or by status. Drag a task to another group.
|
|
96
|
-
- In
|
|
100
|
+
- In **Tasks**, a box is a PMOS task: half blue is In progress, empty is To do. A ticket mark with a bold key is a Jira ticket. Jira owns its status, so it has no box. Its dates can be kept in PMOS (see below). A ◇ always means a milestone.
|
|
101
|
+
- In the Build stage, the open Jira tickets show with the tasks. A task whose name holds the key of a Jira ticket that PMOS read (for example "MSD-4376 Navigation tabs") is linked to that ticket. The ticket shows once, as the task, and counts once. In the List, Timeline and Kanban, the task has the ticket's status square (grey To do, blue In progress, green Done) in place of the box, and the key shows once, in blue. Its status follows Jira, so it has no box and does not drag between Kanban columns. Its start and due stay yours: press the dates or drag the bar, and PMOS keeps them. Jira's dates show only while the task has none of its own. In **By epic**, the task shows once, as its ticket, with the task's bar on the Timeline.
|
|
102
|
+
- A key that PMOS did not read from Jira is only text in the name. The task stays a PMOS task with its box.
|
|
97
103
|
- **Set a Jira ticket's dates.** Press the dates of a Jira ticket in the List, or drag its bar on the Timeline, as you do for a task. PMOS keeps the start and due days and shows them in place of the sprint end. Jira does not change. The status and the name stay Jira's.
|
|
98
104
|
- **Tasks** show one row (one group) for each stage of the workflow, in order. Finished stages and later stages are never merged into one row; they start folded, and the current stage and any stage with a late task start open.
|
|
99
105
|
- **Delete a task.** Press the caret under a task's box (on a phone, press and hold the box) and press the trash at the end of the status picker. The task goes at once and the message shows **Undo**. In the Task Viewer, the trash is the last icon of the Status row, and **Delete** is the last entry of its ⋯ menu. You can delete every PMOS task, also a task that Claude planned in the breakdown and a task that a stage's To finish list made. A deleted To finish task does not come back when the stage is read again or when the initiative moves back to that stage. A Jira ticket has no Delete: change it in Jira. A task deleted in a draft leaves only the draft.
|
|
@@ -175,6 +181,7 @@ There is no My work page. The list on Home is your list:
|
|
|
175
181
|
## The chat
|
|
176
182
|
|
|
177
183
|
- A conversation opens at its latest message.
|
|
184
|
+
- A file that you send shows as a chip in your message, with a small picture for a photo. Press the chip to open the file beside the conversation.
|
|
178
185
|
- Type `/` to see every command: `/goal`, the commands built into Claude Code, and the commands and skills in the workspace's `.claude` folder and in your own `~/.claude` folder.
|
|
179
186
|
- The mic types what you say into the box. **Stop** keeps the words, and **Discard** puts the box back. Both end listening at once.
|
|
180
187
|
- When Claude Code asks whether to trust the folder of a new chat, the chat shows the ask as a card: **Trust this folder** or **No, end the session**. Your first message waits until you answer, for up to 15 minutes, and is then sent. It is never typed into the question.
|
|
@@ -53,7 +53,12 @@ The run writes no record and sends nothing.
|
|
|
53
53
|
|
|
54
54
|
Claude also reads your goals and repairs them. You see the result on Intelligence and on the product page. You do not fill in a form.
|
|
55
55
|
|
|
56
|
-
- **Each goal has a recipe:** a connector, a query and a
|
|
56
|
+
- **Each goal has a recipe:** a connector, a query and a rhythm: every hour (in working hours), every day, every week or every month, at a time of day and on a weekday you can set. When the rhythm comes round, Claude reads the goal and files the value with where it read it and when.
|
|
57
|
+
- **How it is counted:** a goal says in one sentence how it is counted, and the names of its two counts (for example 1,212 ÷ 6,000). Each reading keeps both counts.
|
|
58
|
+
- **Read now** reads a goal at any time. It does not move the next scheduled read.
|
|
59
|
+
- **Claude checks every reading before it is drawn:** a part that always reads 0, a jump of more than 3 times (or less than a third) the usual level, too small a count, and a value the goal cannot be. A reading that fails a check is held. A held reading never moves the dot, the line or "target reached". Claude says why and drafts a Jira ticket for the owner. Press "file it" when the number is real.
|
|
60
|
+
- **Compare with your number:** give your own number for the goal. When the two differ by more than 2%, Claude says why and suggests which way to count it. Your pick changes how it is counted.
|
|
61
|
+
- **A guardrail is always on:** it needs no end date.
|
|
57
62
|
- **A goal Claude cannot read** says so plainly, and comes with a drafted fix: connect the source, or read it another way. If no connector reads it, upload a CSV or sheet export with a date and a number on each line.
|
|
58
63
|
- **The dot of a goal comes from its latest reading only:** on its line, behind it, close to a limit, or a broken limit. A goal with no reading has a hollow dot. A late initiative never sets a goal's dot.
|
|
59
64
|
- **Fixes sit under the goal they repair:** an outcome for a goal that names a project, a recipe, connect a source, a thankful note to the owner, a rollback ticket, next quarter's goal, carry on, and an owner. Press ✓ to keep one, or ✓✓ to keep them all. A note or a ticket goes to the outbox. Nothing is sent until you send it. Undo puts it back.
|
|
@@ -63,7 +68,8 @@ Claude also reads your goals and repairs them. You see the result on Intelligenc
|
|
|
63
68
|
The reading run files with these commands, pinned by the server to the run and its goals:
|
|
64
69
|
|
|
65
70
|
- `pmos metrics reading list`: the goals of this run, with their recipes.
|
|
66
|
-
- `pmos metrics reading <rid> <value> --source "<connector · what>" [--day YYYY-MM-DD]`: one value read.
|
|
71
|
+
- `pmos metrics reading <rid> <value> --source "<connector · what>" [--day YYYY-MM-DD] [--num N --den D] [--segments "web=597/733,app=0/904"] [--period "<period>"]`: one value read, with its counts. A value that fails a check is held.
|
|
72
|
+
- `pmos metrics reading <rid> --why "<why>" [--suggest mine|yours --suggest-text "<line>"] [--yours-what "<how>" --yours-query "<query>"]`: in a compare run only, why your number and Claude's differ.
|
|
67
73
|
- `pmos metrics reading <rid> --cant "<why>" [--fix connect|recipe --connector <name>]`: Claude could not read it, and the fix it drafted.
|
|
68
74
|
|
|
69
75
|
To turn the reading runs off, set `PMOS_METRIC_READ=off`.
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* home-railcard-test.js — the folded rail's card on Home (feedback batch 18 item 14; canvas FlA1, FlA2, FlA3Dark, FlA4After, FlA5Dark;
|
|
4
|
+
* public/pm/home-app.js drawRailCard, home-today.js railCardHtml, cozy-viewer.js railCard).
|
|
5
|
+
* Serves the real page from the real server; GET /api/briefing-premium answers the fixture model (as home-rows-test.js does).
|
|
6
|
+
* C1 a wide Viewer folds the list to a rail; a tile's press opens a card beside it with that group's rows (Home's own), the tile has a
|
|
7
|
+
* ring and aria-expanded; the rail and the Viewer's width do not change
|
|
8
|
+
* C2 the card's header: the group's name opens it (›), × closes; a program shows its next milestone
|
|
9
|
+
* C3 the pill lists the sessions in place inside the card (no second popover), waiting first, with + for a new session
|
|
10
|
+
* C4 a row's press opens it as on Home and closes the card; the rail stays folded and the Viewer as wide
|
|
11
|
+
* C5 the tile of the group that holds what is open has the blue bar and "(open)"; the other tiles none
|
|
12
|
+
* C6 Escape closes the card and gives the focus back to its tile; Enter on a tile opens it with the focus on its first row; arrows move;
|
|
13
|
+
* a second press on the tile and a press outside close it
|
|
14
|
+
* C7 dark: the card's colours come from the tokens; no page error anywhere
|
|
15
|
+
* Screenshots (1440x900) go to PMOS_SHOTS when it is set. Every wait polls the page. */
|
|
16
|
+
const fs = require('fs');
|
|
17
|
+
const path = require('path');
|
|
18
|
+
const { spawn } = require('child_process');
|
|
19
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
20
|
+
const T = require('./test-run').configure({ name: 'home-railcard' });
|
|
21
|
+
const B = require('./lib/briefing-premium.js');
|
|
22
|
+
const F = require('./fixtures/briefing-premium-facts.js');
|
|
23
|
+
|
|
24
|
+
const BASE = T.BASE;
|
|
25
|
+
const SHOTS = process.env.PMOS_SHOTS || '';
|
|
26
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
27
|
+
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { let v; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
28
|
+
const results = [];
|
|
29
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 600) : ''}`); };
|
|
30
|
+
let srv = null; let browser = null;
|
|
31
|
+
const finish = async (code) => {
|
|
32
|
+
if (browser) await browser.close().catch(() => {});
|
|
33
|
+
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
34
|
+
T.killTmux();
|
|
35
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
36
|
+
console.log(`\n${results.length - bad}/${results.length} home-railcard assertions passed`);
|
|
37
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
38
|
+
};
|
|
39
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
40
|
+
const BP = require('./lib/board-premium.js');
|
|
41
|
+
const BF = require('./fixtures/board-premium-facts.js');
|
|
42
|
+
|
|
43
|
+
(async () => {
|
|
44
|
+
const exe = findBrowser();
|
|
45
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the home-railcard suite cannot run'); return finish(1); }
|
|
46
|
+
let chromium;
|
|
47
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed — the home-railcard suite cannot run'); return finish(1); }
|
|
48
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
49
|
+
await T.waitForServer(BASE);
|
|
50
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
51
|
+
|
|
52
|
+
const open = async ({ w = 1440, h = 900, dark = false } = {}) => {
|
|
53
|
+
const ctx = await browser.newContext({ viewport: { width: w, height: h }, colorScheme: dark ? 'dark' : 'light' });
|
|
54
|
+
const page = await ctx.newPage();
|
|
55
|
+
const errors = [];
|
|
56
|
+
page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
|
|
57
|
+
const json = (r, b) => r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify(b) });
|
|
58
|
+
// Home with Project Ascent across IDPF and Microsites (fixtures/briefing-premium-facts.js): a program's group and the products' groups
|
|
59
|
+
await page.route(/\/api\/board-premium(\?.*)?$/, (r) => { const ws = new URL(r.request().url()).searchParams.get('ws') || 'idpf'; return json(r, { ok: true, state: 'ready', model: BP.build(BF.programFacts(ws)), as_of: Date.now() }); });
|
|
60
|
+
await page.route(/\/api\/briefing-premium(\?.*)?$/, (r) => json(r, { ok: true, state: 'ready', model: B.buildMany(F.programFacts()), as_of: Date.now() }));
|
|
61
|
+
await page.route('**/api/programs', (r) => json(r, { ok: true, programs: F.programs() }));
|
|
62
|
+
// two sessions in Descope feature parity: one waits on the PM, one runs (the pill, FlA2)
|
|
63
|
+
await page.route('**/api/sessions', (r) => json(r, { ok: true, sessions: [
|
|
64
|
+
{ id: 's-run', name: 'Paywall copy review', initiative: 'descope-parity', shown: 'working', state: 'working' },
|
|
65
|
+
{ id: 's-ask', name: 'Pick the price test length', initiative: 'descope-parity', shown: 'needs', state: 'needs' }] }));
|
|
66
|
+
await page.goto(BASE + '/premium.html');
|
|
67
|
+
const up = await until(() => page.evaluate(() => document.querySelectorAll('#hmList [data-cz-rail-tile]').length > 0), 20000);
|
|
68
|
+
const close = async () => { await ctx.unrouteAll({ behavior: 'ignoreErrors' }).catch(() => {}); await ctx.close().catch(() => {}); };
|
|
69
|
+
return { ctx, page, errors, up, close };
|
|
70
|
+
};
|
|
71
|
+
const shot = async (page, name) => { if (!SHOTS) return; await sleep(400); fs.mkdirSync(SHOTS, { recursive: true }); await page.screenshot({ path: path.join(SHOTS, name + '.png') }); };
|
|
72
|
+
const lay = (page) => page.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); const l = document.getElementById('hmList'); return { rail: window.czViewer.railOn(), vw: v ? Math.round(v.getBoundingClientRect().width) : 0, list: Math.round(l.getBoundingClientRect().width), title: v ? (v.querySelector('#czVwTitle') || {}).textContent : '' }; });
|
|
73
|
+
const card = (page) => page.evaluate(() => {
|
|
74
|
+
const c = document.querySelector('#hmList .hv-rc'); if (!c) return null;
|
|
75
|
+
const r = c.getBoundingClientRect(), on = document.querySelector('.cz-vw-railtile.on');
|
|
76
|
+
return { name: (c.querySelector('.hv-rch .hv-pt b') || {}).textContent || '', head: (c.querySelector('.hv-rch .hv-pt') || { getAttribute: () => '' }).getAttribute('aria-label'), ms: !!c.querySelector('.hv-rch .hv-msd'), x: !!c.querySelector('.hv-rch [data-hm-rcx]'),
|
|
77
|
+
rows: [...c.querySelectorAll('.hv-rcb > .hv-r .hm-rt b, .hv-rcb > .hm-r .hm-rt b')].map((b) => b.textContent), fold: (c.querySelector('.hv-rcb .hv-fold') || {}).textContent || '', pills: c.querySelectorAll('.hv-rcb .hv-sp').length,
|
|
78
|
+
ses: [...c.querySelectorAll('.hv-rcs .hm-rt b')].map((b) => b.textContent), plus: !!c.querySelector('.hv-rcs [data-hm-sesnew]'), spp: !!c.querySelector('.hv-spp'), grip: !!c.querySelector('.po-grip, [data-po-grip]'),
|
|
79
|
+
left: Math.round(r.left), top: Math.round(r.top), w: Math.round(r.width), bottom: Math.round(r.bottom), bg: getComputedStyle(c).backgroundColor, dialog: c.getAttribute('role'), on: on ? on.dataset.czVwRail : null, exp: on ? on.getAttribute('aria-expanded') : null };
|
|
80
|
+
});
|
|
81
|
+
const tiles = (page) => page.evaluate(() => [...document.querySelectorAll('.cz-vw-railtile')].map((b) => ({ key: b.dataset.czVwRail, here: b.classList.contains('here'), label: b.getAttribute('aria-label'), on: b.classList.contains('on'), r: (() => { const x = b.getBoundingClientRect(); return [Math.round(x.right), Math.round(x.top)]; })() })));
|
|
82
|
+
|
|
83
|
+
const A = await open();
|
|
84
|
+
ok('0 Home draws its groups', !!A.up);
|
|
85
|
+
// the first initiative row on Home opens its page in the Viewer; wide folds the list to the rail
|
|
86
|
+
const first = await A.page.evaluate(() => { const b = document.querySelector('#hmList .hv-r.ini .hm-rm'); return b ? b.dataset.hmSel : null; });
|
|
87
|
+
await A.page.click(`#hmList .hv-r.ini .hm-rm[data-hm-sel="${first}"]`);
|
|
88
|
+
await until(() => A.page.evaluate(() => !!document.querySelector('#czViewer:not([hidden])')));
|
|
89
|
+
await A.page.evaluate(() => window.czViewer.wide(true));
|
|
90
|
+
const l0 = await until(() => lay(A.page).then((l) => (l.rail ? l : null)));
|
|
91
|
+
ok('C1 a wide Viewer folds the list to a rail of tiles', !!l0 && l0.list < 100, JSON.stringify(l0));
|
|
92
|
+
const T0 = await tiles(A.page);
|
|
93
|
+
ok('C1 the rail has a tile per group, each a dialog press', T0.length >= 2 && T0.every((t) => / Show its initiatives$/.test(t.label)), JSON.stringify(T0));
|
|
94
|
+
ok('C5 the tile of the group that holds the open initiative has the blue bar and "(open)"; the others none', T0.filter((t) => t.here).length === 1 && T0.filter((t) => t.here).every((t) => /\(open\)/.test(t.label)) && T0.filter((t) => !t.here).every((t) => !/\(open\)/.test(t.label)), JSON.stringify(T0));
|
|
95
|
+
await shot(A.page, 'rail-1440');
|
|
96
|
+
|
|
97
|
+
// C1 the program's tile: a card beside it with the program's rows
|
|
98
|
+
const prog = T0.find((t) => /^g:/.test(t.key)), prod = T0.find((t) => /^p:/.test(t.key) && !t.here) || T0.find((t) => /^p:/.test(t.key));
|
|
99
|
+
await A.page.click(`.cz-vw-railtile[data-cz-vw-rail="${prog.key}"]`);
|
|
100
|
+
const c1 = await until(() => card(A.page));
|
|
101
|
+
const l1 = await lay(A.page);
|
|
102
|
+
ok('C1 a tile press opens a card (a dialog) beside the tile, its top with the tile, about 372 px wide', !!c1 && c1.dialog === 'dialog' && c1.left >= prog.r[0] && c1.left <= prog.r[0] + 20 && Math.abs(c1.top - prog.r[1]) <= 14 && c1.w >= 360 && c1.w <= 380 && c1.bottom <= 900, JSON.stringify(c1));
|
|
103
|
+
ok('C1 the tile has a ring and aria-expanded', !!c1 && c1.on === prog.key && c1.exp === 'true', JSON.stringify(c1 && [c1.on, c1.exp]));
|
|
104
|
+
ok('C1 the rail and the Viewer\'s width do not change', l1.rail && l1.vw === l0.vw && l1.list === l0.list, JSON.stringify([l0, l1]));
|
|
105
|
+
const homeRows = await A.page.evaluate(() => { const s = document.querySelector('#hmList section.prg'); return s ? [...s.querySelectorAll('.hv-card .hm-rt b')].map((b) => b.textContent) : []; });
|
|
106
|
+
ok('C1 the card shows Home\'s own rows for the program, in Home\'s order (no grip)', !!c1 && c1.rows.length > 0 && JSON.stringify(c1.rows) === JSON.stringify(homeRows) && !c1.grip, JSON.stringify([c1 && c1.rows, homeRows]));
|
|
107
|
+
ok('C2 the header: the program\'s name opens it, its next milestone, ×', !!c1 && c1.name === 'Project Ascent' && /^Open Project Ascent, a program$/.test(c1.head) && c1.x, JSON.stringify(c1));
|
|
108
|
+
ok('C6 a press on the tile opened it with the focus on its first row', await A.page.evaluate(() => !!document.activeElement && !!document.activeElement.closest('.hv-rc .hv-rcb')));
|
|
109
|
+
await shot(A.page, 'card-program-1440');
|
|
110
|
+
|
|
111
|
+
// C3 the pill: the sessions in place
|
|
112
|
+
const hasPill = await A.page.evaluate(() => !!document.querySelector('#hmList .hv-rc .hv-sp'));
|
|
113
|
+
if (hasPill) {
|
|
114
|
+
await A.page.click('#hmList .hv-rc .hv-sp');
|
|
115
|
+
const c3 = await until(() => card(A.page).then((c) => (c && c.ses.length ? c : null)));
|
|
116
|
+
ok('C3 the pill lists its sessions in place inside the card, with +; no second popover', !!c3 && c3.ses.length > 0 && c3.plus && !c3.spp, JSON.stringify(c3));
|
|
117
|
+
ok('C3 waiting first: the session that asks you leads', !!c3 && c3.ses[0] === 'Pick the price test length', JSON.stringify(c3 && c3.ses));
|
|
118
|
+
ok('C3 the focus is on the first session', await A.page.evaluate(() => !!document.activeElement && !!document.activeElement.closest('.hv-rcs')));
|
|
119
|
+
ok('C3 the rail and the Viewer stay', (await lay(A.page)).vw === l0.vw);
|
|
120
|
+
await shot(A.page, 'card-sessions-1440');
|
|
121
|
+
await A.page.keyboard.press('Escape');
|
|
122
|
+
const c3b = await until(() => card(A.page).then((c) => (c && !c.ses.length ? c : null)));
|
|
123
|
+
ok('C3 Escape folds the sessions first; the card stays', !!c3b);
|
|
124
|
+
await A.page.click('#hmList .hv-rc .hv-sp');
|
|
125
|
+
await until(() => card(A.page).then((c) => (c && c.ses.length ? c : null)));
|
|
126
|
+
await A.page.click('#hmList .hv-rc .hv-rcs .hm-rm');
|
|
127
|
+
await until(() => card(A.page).then((c) => !c));
|
|
128
|
+
const l3 = await lay(A.page);
|
|
129
|
+
const chatT = await A.page.evaluate(() => (document.getElementById('hmChat') || {}).textContent || '');
|
|
130
|
+
ok('C3 a session press opens it in the chat and closes the card; the rail and the Viewer stay', !(await card(A.page)) && l3.rail && l3.vw === l0.vw && /Pick the price test length/.test(chatT), JSON.stringify(l3));
|
|
131
|
+
await A.page.click(`.cz-vw-railtile[data-cz-vw-rail="${prog.key}"]`); await until(() => card(A.page));
|
|
132
|
+
} else ok('C3 the fixture has an initiative with a session pill', false);
|
|
133
|
+
|
|
134
|
+
// C6 keys: arrows move between rows; Escape closes and gives the focus back to the tile
|
|
135
|
+
await A.page.focus('#hmList .hv-rc .hv-rcb .hm-rm');
|
|
136
|
+
await A.page.keyboard.press('ArrowDown');
|
|
137
|
+
const mv = await A.page.evaluate(() => { const all = [...document.querySelectorAll('#hmList .hv-rc .hv-rcb .hm-rm, #hmList .hv-rc .hv-rcb .hv-fold')]; return all.indexOf(document.activeElement); });
|
|
138
|
+
ok('C6 ArrowDown moves to the next row', mv === 1, String(mv));
|
|
139
|
+
await A.page.keyboard.press('Escape');
|
|
140
|
+
await until(() => card(A.page).then((c) => !c));
|
|
141
|
+
ok('C6 Escape closes the card and gives the focus back to its tile', !(await card(A.page)) && await A.page.evaluate((k) => document.activeElement && document.activeElement.dataset.czVwRail === k, prog.key), String(prog.key));
|
|
142
|
+
ok('C6 the Viewer is still open after Escape closed the card', (await lay(A.page)).vw === l0.vw);
|
|
143
|
+
await A.page.keyboard.press('Enter');
|
|
144
|
+
const c6 = await until(() => card(A.page));
|
|
145
|
+
ok('C6 Enter on the tile opens it again, the focus on its first row', !!c6 && await A.page.evaluate(() => !!document.activeElement.closest('.hv-rc .hv-rcb')));
|
|
146
|
+
await A.page.click(`.cz-vw-railtile[data-cz-vw-rail="${prog.key}"]`);
|
|
147
|
+
await until(() => card(A.page).then((c) => !c));
|
|
148
|
+
ok('C6 a second press on the tile closes it', !(await card(A.page)));
|
|
149
|
+
await A.page.click(`.cz-vw-railtile[data-cz-vw-rail="${prog.key}"]`); await until(() => card(A.page));
|
|
150
|
+
await A.page.mouse.click(900, 600);
|
|
151
|
+
await until(() => card(A.page).then((c) => !c));
|
|
152
|
+
ok('C6 a press outside closes it', !(await card(A.page)));
|
|
153
|
+
await A.page.click(`.cz-vw-railtile[data-cz-vw-rail="${prog.key}"]`); await until(() => card(A.page));
|
|
154
|
+
await A.page.click('#hmList .hv-rc [data-hm-rcx]');
|
|
155
|
+
await until(() => card(A.page).then((c) => !c));
|
|
156
|
+
ok('C2 × closes it', !(await card(A.page)));
|
|
157
|
+
|
|
158
|
+
// C4 a product's row: it opens, the card closes, the rail and the Viewer stay
|
|
159
|
+
await A.page.click(`.cz-vw-railtile[data-cz-vw-rail="${prod.key}"]`);
|
|
160
|
+
const c4 = await until(() => card(A.page));
|
|
161
|
+
ok('C2 a product\'s card: its name opens the product; no milestone', !!c4 && /, a product$/.test(c4.head) && !c4.ms, JSON.stringify(c4));
|
|
162
|
+
await shot(A.page, 'card-product-1440');
|
|
163
|
+
const pick = await A.page.evaluate(() => { const b = document.querySelector('#hmList .hv-rc .hv-rcb .hv-r.ini:not(.sel) .hm-rm'); return b ? { id: b.dataset.hmSel, t: b.querySelector('.hm-rt b').textContent } : null; });
|
|
164
|
+
if (pick) {
|
|
165
|
+
await A.page.click(`#hmList .hv-rc .hm-rm[data-hm-sel="${pick.id}"]`);
|
|
166
|
+
await until(() => card(A.page).then((c) => !c));
|
|
167
|
+
const l4 = await until(() => lay(A.page).then((l) => (l.title && l.title.includes(pick.t) ? l : null)), 8000);
|
|
168
|
+
ok('C4 a row press opens it in the Viewer and closes the card', !!l4 && !(await card(A.page)), JSON.stringify([pick, await lay(A.page)]));
|
|
169
|
+
ok('C4 the rail stays folded and the Viewer as wide', !!l4 && l4.rail && l4.vw === l0.vw, JSON.stringify([l0, l4]));
|
|
170
|
+
const T4 = await tiles(A.page);
|
|
171
|
+
ok('C5 the blue bar moves to the tile of the group that now holds what is open', T4.filter((t) => t.here).map((t) => t.key).join() === prod.key, JSON.stringify(T4));
|
|
172
|
+
await shot(A.page, 'after-pick-1440');
|
|
173
|
+
} else ok('C4 the product card has an initiative to pick', false, JSON.stringify(c4));
|
|
174
|
+
ok('C the list button keeps its job: it is no card press', await A.page.evaluate(() => { const b = document.querySelector('.cz-vw-railbar [data-cz-vw-rail="show"]'); return !!b && !b.hasAttribute('aria-haspopup') && b.getAttribute('aria-label') === 'Show the list'; }));
|
|
175
|
+
ok('C no page error', !A.errors.length, A.errors.join(' | '));
|
|
176
|
+
await A.close();
|
|
177
|
+
|
|
178
|
+
/* C7 dark */
|
|
179
|
+
const K = await open({ dark: true });
|
|
180
|
+
await K.page.click('#hmList .hv-r.ini .hm-rm');
|
|
181
|
+
await until(() => K.page.evaluate(() => !!document.querySelector('#czViewer:not([hidden])')));
|
|
182
|
+
await K.page.evaluate(() => window.czViewer.wide(true));
|
|
183
|
+
await until(() => lay(K.page).then((l) => l.rail));
|
|
184
|
+
const kt = (await tiles(K.page)).find((t) => /^p:/.test(t.key));
|
|
185
|
+
await K.page.click(`.cz-vw-railtile[data-cz-vw-rail="${kt.key}"]`);
|
|
186
|
+
const k1 = await until(() => card(K.page));
|
|
187
|
+
const lightBg = c1 && c1.bg;
|
|
188
|
+
ok('C7 dark: the card takes the dark card colour from the tokens', !!k1 && k1.bg !== lightBg && k1.bg === await K.page.evaluate(() => getComputedStyle(document.querySelector('.cz')).getPropertyValue('--cz-card').trim() ? getComputedStyle(document.querySelector('#hmList .hv-rc')).backgroundColor : ''), JSON.stringify([k1 && k1.bg, lightBg]));
|
|
189
|
+
await shot(K.page, 'card-dark-1440');
|
|
190
|
+
ok('C7 no page error', !K.errors.length, K.errors.join(' | '));
|
|
191
|
+
await K.close();
|
|
192
|
+
return finish();
|
|
193
|
+
})();
|
|
@@ -97,12 +97,15 @@ const BRIEF = BRP.build(BRF.facts());
|
|
|
97
97
|
const pickStage = async (p, label) => { await p.click(V + ' [data-iv-stagepick]'); await until(() => p.evaluate(() => !!document.querySelector('.hi-pop [data-sp-life]'))); await p.click(`.hi-pop [data-sp-life]:has(> span:text-is("${label}"))`); };
|
|
98
98
|
const pickMore = async (p, label) => { await p.click('#czViewer [data-cz-vw="more"]'); await until(() => p.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); await p.click(`#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${label}"))`); };
|
|
99
99
|
|
|
100
|
+
const openMi = async (p) => { if (!(await p.evaluate((v) => !!document.querySelector(v + ' .iv-mio'), V))) await p.click(V + ' [data-iv-mi]', { position: { x: 8, y: 8 } }); await until(() => p.evaluate((v) => !!document.querySelector(v + ' .iv-mio'), V)); };
|
|
100
101
|
const A = await open(), p = A.page;
|
|
101
102
|
ok('W1 the page opens on the initiative with the workflow on its meta line', A.up, await txt(p, V + ' .cz-vw-kind'));
|
|
102
103
|
ok('W1 the kind line names the workflow and the anchor: "Tender · KR 1.1" (Kind becomes Workflow)', /^Tender · KR 1\.1$/.test(await txt(p, V + ' .cz-vw-kind')), await txt(p, V + ' .cz-vw-kind'));
|
|
103
104
|
ok('W1 the card names the stage of that workflow: Triage', (await txt(p, V + ' .iv-sch > b, .iv-sch .iv-stc b')) === 'Triage', await txt(p, V + ' .iv-sch'));
|
|
104
|
-
ok('W1 the
|
|
105
|
+
ok('W1 the mission strip draws the ten stages of Tender', await p.evaluate((v) => document.querySelectorAll(v + ' .mi-svg :is(.mi-st, .mi-dsh)').length === 10, V));
|
|
106
|
+
await openMi(p);
|
|
105
107
|
ok('W1 the next stage is Tender\'s own: the → names Requirements', await p.evaluate((v) => /^Next: Requirements/.test(document.querySelector(v + ' .iv-scgo').getAttribute('aria-label')), V));
|
|
108
|
+
await p.click(V + ' [data-iv-mi]', { position: { x: 8, y: 8 } });
|
|
106
109
|
ok('W1 the icon names the workflow for a screen reader', await p.evaluate((v) => /Workflow: Tender/.test(document.querySelector(v + ' [data-iv-wf]').getAttribute('aria-label')), V));
|
|
107
110
|
ok('W2 PMOS set it from the BRD: the toast says so, with Undo (WfTriage)', await until(() => p.evaluate(() => { const t = document.getElementById('hiToast'); return !!t && !t.hidden && /Set to Tender from the BRD/.test(t.textContent) && !!t.querySelector('[data-hi-undo]'); })));
|
|
108
111
|
await shot(p, 'triage-1440');
|
|
@@ -144,6 +147,7 @@ const BRIEF = BRP.build(BRF.facts());
|
|
|
144
147
|
await p.reload();
|
|
145
148
|
await until(() => p.evaluate((v) => !!document.querySelector(v + ' .hi-end'), V), 30000);
|
|
146
149
|
ok('W7 the page of a Won’t do says why, and offers Back to Triage', /Won't do · No budget: Moved to next year’s budget\./.test(await txt(p, V + ' .hi-end')), await txt(p, V + ' .hi-end'));
|
|
150
|
+
await openMi(p);
|
|
147
151
|
ok('W7 its stage does not move: the card has no next stage to move to', !(await p.evaluate((v) => !!document.querySelector(v + ' .iv-sc .iv-scgo, ' + v + ' [data-iv-next]'), V)), await txt(p, V + ' .iv-sc'));
|
|
148
152
|
ok('W7 the stage chip has Back to Triage in place of Won’t do', await stageLabels(p).then((l) => l.includes('Back to Triage') && !l.includes('Won’t do')));
|
|
149
153
|
await shot(p, 'wontdo-page-1440');
|
|
@@ -154,7 +158,7 @@ const BRIEF = BRP.build(BRF.facts());
|
|
|
154
158
|
|
|
155
159
|
// W8 the phone, and dark
|
|
156
160
|
const P = await open({ w: 390, h: 844, fresh: false, B: board('requirements') });
|
|
157
|
-
ok('W8 the phone opens the page with the workflow at Requirements, the second of its ten bars', P.up && (await txt(P.page, V + ' .iv-sch > b, .iv-sch .iv-stc b')) === 'Requirements' && await P.page.evaluate((v) => { const t = [...
|
|
161
|
+
ok('W8 the phone opens the page with the workflow at Requirements, the second of its ten bars', P.up && (await txt(P.page, V + ' .iv-sch > b, .iv-sch .iv-stc b')) === 'Requirements' && await P.page.evaluate((v) => { const t = [...document.querySelectorAll(v + ' .mi-svg :is(.mi-st, .mi-dsh)')]; return t.length === 10 && /\b(nw|late)\b/.test(t[1].getAttribute('class')); }, V));
|
|
158
162
|
ok('W8 the toast shows once only: seen before, not again', !(await P.page.evaluate(() => { const t = document.getElementById('hiToast'); return !!t && !t.hidden; })));
|
|
159
163
|
await shot(P.page, 'page-390');
|
|
160
164
|
await P.page.click(V + ' [data-iv-wf]');
|