create-pmos 0.410.0 → 0.412.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 -30
- 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-adddoc-test.js +2 -2
- package/workspace/briefing-premium-initiative-test.js +9 -15
- package/workspace/briefing-premium-insights-test.js +2 -2
- package/workspace/briefing-premium-test.js +3 -3
- package/workspace/changelog.json +24 -0
- package/workspace/chat-asks-test.js +146 -0
- package/workspace/guide/board.md +1 -1
- package/workspace/guide/breakdown.md +6 -13
- package/workspace/guide/briefing-premium.md +1 -1
- package/workspace/guide/home.md +24 -0
- package/workspace/guide/index.md +1 -1
- package/workspace/guide/initiative-driver.md +1 -1
- package/workspace/guide/initiatives-screen.md +1 -1
- package/workspace/guide/pm-only-acts.md +23 -24
- package/workspace/guide/today.md +1 -1
- package/workspace/home-rows-test.js +149 -56
- package/workspace/ini-workflow-test.js +4 -4
- package/workspace/lib/briefing-premium-agent.js +8 -1
- package/workspace/lib/briefing-premium-writes.js +5 -4
- package/workspace/lib/coredoc-cli.js +1 -1
- package/workspace/lib/driver-cli.js +2 -1
- package/workspace/lib/driver-decide.js +3 -2
- package/workspace/lib/driver.js +2 -1
- package/workspace/lib/engine/boards.js +3 -1
- package/workspace/lib/goal-chat.js +94 -30
- package/workspace/lib/grant-mint.js +3 -2
- package/workspace/lib/initiative-cli.js +9 -9
- package/workspace/lib/issues.js +5 -4
- package/workspace/lib/mention-cli.js +70 -0
- package/workspace/lib/mention-store.js +307 -0
- package/workspace/lib/people-store.js +1 -1
- package/workspace/lib/people.js +3 -1
- package/workspace/lib/placements.js +13 -15
- package/workspace/lib/plan-items.js +17 -48
- package/workspace/lib/pm-guard.js +18 -5
- package/workspace/lib/pm-lines-needs.js +9 -5
- package/workspace/lib/pmos-verbs.js +3 -0
- package/workspace/lib/report-cli.js +2 -2
- package/workspace/lib/routes-board-metric-targets.js +0 -1
- package/workspace/lib/routes-boards.js +12 -0
- package/workspace/lib/routes-briefing-premium.js +5 -7
- package/workspace/lib/routes-core-docs.js +0 -1
- package/workspace/lib/routes-custom-docs.js +0 -1
- package/workspace/lib/routes-driver.js +0 -1
- package/workspace/lib/routes-home-desk.js +1 -1
- package/workspace/lib/routes-home-review.js +1 -1
- package/workspace/lib/routes-initiative-layout.js +1 -1
- package/workspace/lib/routes-insights-records.js +0 -1
- package/workspace/lib/routes-meeting-material.js +0 -1
- package/workspace/lib/routes-mentions.js +62 -9
- package/workspace/lib/routes-onboarding.js +3 -1
- package/workspace/lib/routes-orchestrator.js +0 -1
- package/workspace/lib/routes-premium-charts.js +0 -1
- package/workspace/lib/routes-premium-dashboards.js +0 -1
- package/workspace/lib/routes-programs.js +1 -1
- package/workspace/lib/routes-records.js +1 -1
- package/workspace/lib/routes-report-design.js +7 -3
- package/workspace/lib/routes-report-setups.js +0 -1
- package/workspace/lib/routes-report-structure.js +0 -1
- package/workspace/lib/routes-runs.js +2 -5
- package/workspace/lib/routes-scan.js +0 -1
- package/workspace/lib/routes-sources.js +1 -1
- package/workspace/lib/run-answers.js +14 -5
- package/workspace/lib/scan-cli.js +2 -1
- package/workspace/lib/scan.js +2 -1
- package/workspace/lib/session-files.js +132 -0
- package/workspace/lib/session-name.js +103 -0
- package/workspace/lib/source-reads.js +4 -1
- package/workspace/lib/vendor/scripts/onboarding/proposals.js +7 -3
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +10 -8
- package/workspace/premium-chat-goal-setup-test.js +203 -0
- package/workspace/premium-chat-goal-view-test.js +28 -23
- package/workspace/premium-chat-line-test.js +189 -0
- package/workspace/premium-core-doc-issue-test.js +1 -1
- package/workspace/premium-viewer-share-test.js +5 -2
- package/workspace/premium-vw-backlog-test.js +1 -1
- package/workspace/premium-vw-item-test.js +1 -1
- package/workspace/premium-vw-jira-test.js +1 -1
- package/workspace/public/pm/chat-ask.js +17 -9
- package/workspace/public/pm/cozy-home-rows.css +39 -1
- package/workspace/public/pm/cozy-home.css +112 -12
- package/workspace/public/pm/cozy-search.js +2 -1
- package/workspace/public/pm/cozy-steps.css +69 -0
- package/workspace/public/pm/cozy-steps.js +90 -0
- package/workspace/public/pm/goal-chat.js +141 -23
- package/workspace/public/pm/home-app.js +68 -35
- package/workspace/public/pm/home-ask.js +121 -0
- package/workspace/public/pm/home-chat.js +120 -68
- package/workspace/public/pm/home-data.js +10 -2
- package/workspace/public/pm/home-goal.js +159 -0
- package/workspace/public/pm/home-ini.css +35 -0
- package/workspace/public/pm/home-ini.js +50 -19
- package/workspace/public/pm/home-line.css +59 -0
- package/workspace/public/pm/home-line.js +200 -0
- package/workspace/public/pm/home-list.js +2 -2
- package/workspace/public/pm/home-mentions.js +303 -111
- package/workspace/public/pm/home-ses-name.js +65 -0
- package/workspace/public/pm/home-stage-card.js +94 -0
- package/workspace/public/pm/home-sweep.js +112 -0
- package/workspace/public/pm/home-today.js +7 -2
- package/workspace/public/pm/premium-initiative-head.js +8 -4
- package/workspace/public/pm/rename-press.js +24 -0
- package/workspace/public/pm/wf-page.css +3 -0
- package/workspace/public/pm/wf-page.js +2 -1
- package/workspace/public/premium-workflows.html +1 -0
- package/workspace/replaced-tests.json +101 -0
- package/workspace/server.js +133 -20
- package/workspace/session-names-test.js +144 -0
- package/workspace/skills/jira-push.skill +1 -0
- package/workspace/skills/morning-brief.skill +2 -1
- package/workspace/skills/report-daily.skill +1 -0
- package/workspace/skills/report-monthly.skill +1 -0
- package/workspace/skills/report-weekly.skill +1 -0
- package/workspace/skills/sources-read.skill +3 -2
- package/workspace/stage-card-test.js +203 -0
- package/workspace/test-lists/chat-asks.json +13 -0
- package/workspace/test-lists/chat-progress.json +13 -0
- package/workspace/test-lists/mentions-a-plus.json +9 -0
- package/workspace/test-lists/premium-chat-goal-setup.json +9 -0
- package/workspace/test-lists/session-files.json +5 -0
- package/workspace/test-lists/session-names.json +13 -0
- package/workspace/test-lists/stage-card.json +6 -0
- package/workspace/tk-tasks-test.js +1 -1
- package/workspace/workflows-setup-test.js +17 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* stage-card-test.js — the initiative's stage card as a live step list (agreed stage card D: canvas XscD on the phone, XscDDesk on a
|
|
4
|
+
* desktop; initiative premium-agreed-design). Two halves:
|
|
5
|
+
* P pure: home-stage-card.js (the order of the steps, the cap of 4 with "N more", the clock, the next stage's line) and headModel's
|
|
6
|
+
* bars (one a stage of the initiative's own workflow, a skipped one dashed), and cozy-steps.js (the shared step list).
|
|
7
|
+
* D the real page from the real server, its routes answered from the fixtures: the card's header, bars, steps and last node; the one
|
|
8
|
+
* primary; the done fold; the move popover under the line on a desktop and the sheet on the phone, with the switch, Move now (open
|
|
9
|
+
* steps ask for a note) and Back; the spinner only for a running session; every step done before a milestone: "Move to ◆ Deliver".
|
|
10
|
+
* PMOS_SHOTS=<dir> also saves a screenshot of each state there. */
|
|
11
|
+
const path = require('path');
|
|
12
|
+
const fs = require('fs');
|
|
13
|
+
const { spawn } = require('child_process');
|
|
14
|
+
const { pathToFileURL } = require('url');
|
|
15
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
16
|
+
const T = require('./test-run').configure({ name: 'stage-card' });
|
|
17
|
+
const IP = require('./lib/initiative-premium.js');
|
|
18
|
+
const F = require('./fixtures/initiative-premium-facts.js');
|
|
19
|
+
const BP = require('./lib/board-premium.js');
|
|
20
|
+
const BF = require('./fixtures/board-premium-facts.js');
|
|
21
|
+
const BRP = require('./lib/briefing-premium.js');
|
|
22
|
+
const BRF = require('./fixtures/briefing-premium-facts.js');
|
|
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 (;;) { const v = await fn(); 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} stage-card assertions passed`);
|
|
37
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
38
|
+
};
|
|
39
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
40
|
+
|
|
41
|
+
const mod = (f) => import(pathToFileURL(path.join(__dirname, 'public', 'pm', f)).href);
|
|
42
|
+
const allDone = { ...F.LADDER, next: null, steps: F.LADDER.steps.map((s) => ({ ...s, status: s.key === 'quality' ? 'unknown' : 'done' })) };
|
|
43
|
+
const doneItems = F.ITEMS.map((t) => (t.ini === 'self-serve-v2' && t.src === 'jira' ? { ...t, status: 'Done' } : t));
|
|
44
|
+
const SCEN = {
|
|
45
|
+
build: () => IP.build(F.facts()),
|
|
46
|
+
discover: () => IP.build(F.facts({ row: { ...F.ROW, stage: 'Discover' } })),
|
|
47
|
+
ready: () => IP.build(F.facts({ ladder: allDone, items: doneItems, sheet: { ...F.SHEET, waiting: null } })),
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
async function pure() {
|
|
51
|
+
const SC = await mod('home-stage-card.js');
|
|
52
|
+
const HD = await mod('premium-initiative-head.js');
|
|
53
|
+
const CS = await mod('cozy-steps.js');
|
|
54
|
+
const h = { done: [{ kind: 'done', label: 'PRD' }], rest: [
|
|
55
|
+
{ kind: 'agent', label: 'Claude drafts the note' }, { kind: 'risk', label: 'Rudi’s estimate is blocked', note: 'Late by 2 days' },
|
|
56
|
+
{ kind: 'jira', label: '8 of 12 tickets Done in Jira', jd: 8, jt: 12 }, { kind: 'you', label: 'Weigh the findings', note: '3 findings' },
|
|
57
|
+
{ kind: 'agent', label: 'Work breakdown' }, { kind: 'you', label: 'Your sign-off' }] };
|
|
58
|
+
const R = SC.stepRows(h, { run: { title: 'x', created: new Date(Date.now() - 6 * 6e4).toISOString() } });
|
|
59
|
+
ok('P1 the order: the PM\'s steps first, then the running agent, then late, then waiting', R.open.map((x) => x.state).join() === 'you,you,run,risk,wait,wait', JSON.stringify(R.open.map((x) => x.state)));
|
|
60
|
+
ok('P1 only the first of the PM\'s steps carries the go button (the one primary)', R.open.filter((x) => x.go).length === 1 && R.open[0].go, JSON.stringify(R.open[0]));
|
|
61
|
+
ok('P1 the running step says "Running · N min" with Claude\'s avatar; another agent step waits with a C', R.open[2].note === 'Running · 6 min' && R.open[2].owner.live && R.open.find((x) => x.label === 'Work breakdown').owner.kind === 'claude' && !R.open.find((x) => x.label === 'Work breakdown').owner.live);
|
|
62
|
+
ok('P1 more than 4 open steps show 4 and "N more"', R.shown.length === 4 && R.more === 2);
|
|
63
|
+
ok('P1 "N more" opens them all', SC.stepRows(h, { moreOpen: true }).more === 0);
|
|
64
|
+
const noRun = SC.stepRows(h, {});
|
|
65
|
+
ok('P1 with no session at work there is no spinner: an agent step waits', !noRun.open.some((x) => x.state === 'run'));
|
|
66
|
+
ok('P1 a session at work that no step names gets its own running line', SC.stepRows({ done: [], rest: [] }, { run: { title: 'Claude drafts the brief' } }).open[0].label === 'Claude drafts the brief');
|
|
67
|
+
ok('P1 a late or blocked step is amber with its reason', R.open[3].state === 'risk' && R.open[3].noteWarn && R.open[3].note === 'Late by 2 days');
|
|
68
|
+
ok('P1 a Jira step carries the ticket bar', R.open.find((x) => x.jira) && R.open.find((x) => x.jira).jira.total === 12);
|
|
69
|
+
ok('P2 the clock: "4 of ~6 days"; just the days with no usual time; nothing with no record', SC.clockText({ n: 4, usual: 6 }) === '4 of ~6 days' && SC.clockText({ n: 9, usual: null }) === '9 days' && SC.clockText(null) === '');
|
|
70
|
+
ok('P3 a conditional next stage says whether it runs and why', SC.nextNote({ next: { when: { mode: 'only', text: 'the contract is over $50k' }, reading: { runs: true, why: 'the BRD puts the contract at $80k' } } }, {}) === 'Runs: the BRD puts the contract at $80k.');
|
|
71
|
+
ok('P3 an unread condition says so, never guesses', /Not read yet/.test(SC.nextNote({ next: { when: { mode: 'only', text: 'x' } } }, {})));
|
|
72
|
+
ok('P3 a milestone next says it waits for you; another stage gives its payoff and the KR it moves', SC.nextNote({ next: { out: 'The release shipped.' }, anchor: 'KR 2.1' }, { ms: true }) === 'The release shipped. Moves KR 2.1. Waits for you.');
|
|
73
|
+
const tail = SC.tailOf({}, { next: 'Deliver', ms: true, canMove: true, allDone: true, auto: true });
|
|
74
|
+
ok('P4 every step done and a milestone next: the last node is the button "Move to ◆ Deliver"', /data-hi-move/.test(tail) && /Move to <i class="cz-ms"/.test(tail) && /Deliver/.test(tail));
|
|
75
|
+
const tail2 = SC.tailOf({}, { next: 'Plan', ms: false, canMove: true, allDone: false, auto: true });
|
|
76
|
+
ok('P4 otherwise the last node is the next stage with the moves-on-by-itself icon, a press opens the move sheet', /data-hi-next/.test(tail2) && /cz-auto/.test(tail2) && !/data-hi-move/.test(tail2));
|
|
77
|
+
ok('P4 a milestone next has no moves-on-by-itself icon', !/cz-auto/.test(SC.tailOf({}, { next: 'Deliver', ms: true, canMove: true, allDone: false, auto: true })));
|
|
78
|
+
// the bars come from the initiative's workflow: ten stages of Tender, a skipped one dashed
|
|
79
|
+
const wfStages = Array.from({ length: 10 }, (_, i) => ({ key: 's' + i, name: 'S' + i, milestone: i === 9, status: i < 3 ? 'done' : i === 3 ? 'skipped' : i === 4 ? 'current' : 'next' }));
|
|
80
|
+
const hm = HD.headModel({ wf: { id: 'tender', name: 'Tender' }, wfStages, wfStage: { key: 's4' }, head: {}, acts: {}, checks: [] });
|
|
81
|
+
ok('P5 one bar a stage of the workflow, the skipped one dashed', hm.steps.length === 10 && hm.steps[3].cls === 'skip' && hm.steps[4].cls === 'now' && hm.steps[2].cls === 'done', JSON.stringify(hm.steps.map((s) => s.cls)));
|
|
82
|
+
ok('P5 the next stage passes over the skipped one', hm.next && hm.next.label === 'S5');
|
|
83
|
+
const html = CS.stepsHtml([{ state: 'skip', label: 'Point', note: 'Skipped by you', act: { attr: 'data-u', icon: 'undo', label: 'Undo' } }, { state: 'run', label: 'Edit', code: 'Edit · planning/prd/x.md' }], {});
|
|
84
|
+
ok('P6 the shared list: a skipped step keeps its note and its own trailing button; a step can carry a mono code line', /cz-st sk/.test(html) && /<button type="button" class="cz-sact" data-u/.test(html) && /<code>Edit · planning\/prd\/x.md<\/code>/.test(html) && !/<button[^>]*>[^]*<button[^>]*cz-sact[^]*<\/button>[^]*<\/button>/.test(html.split('</li>')[0].replace(/<button type="button" class="cz-sact"[^]*$/, '')));
|
|
85
|
+
ok('P6 a lone node in 14 and 16 px for the chat progress line', /s14/.test(CS.nodeHtml('run', 14)) && /s16/.test(CS.nodeHtml('you', 16)));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
(async () => {
|
|
89
|
+
await pure();
|
|
90
|
+
const exe = findBrowser();
|
|
91
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
92
|
+
let chromium;
|
|
93
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
94
|
+
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, '..') }) });
|
|
95
|
+
await T.waitForServer(BASE);
|
|
96
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
97
|
+
const BOARD = BP.build(BF.facts()), BRIEF = BRP.build(BRF.facts());
|
|
98
|
+
if (SHOTS) fs.mkdirSync(SHOTS, { recursive: true });
|
|
99
|
+
|
|
100
|
+
const open = async ({ w = 1280, h = 900, theme = 'light', model = SCEN.build(), sessions = null, trail = null } = {}) => {
|
|
101
|
+
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
102
|
+
const page = await ctx.newPage();
|
|
103
|
+
const errors = [], posts = [];
|
|
104
|
+
page.on('pageerror', (e) => errors.push(String(e)));
|
|
105
|
+
page.on('request', (rq) => { if (rq.method() === 'POST') posts.push({ path: new URL(rq.url()).pathname, body: JSON.parse(rq.postData() || '{}') }); });
|
|
106
|
+
const json = (r, b) => r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify(b) });
|
|
107
|
+
await page.route('**/api/initiative-premium*', (r) => json(r, { ok: true, state: 'ready', model, as_of: Date.now() }));
|
|
108
|
+
await page.route(/\/api\/board-premium(\?.*)?$/, (r) => json(r, { ok: true, state: 'ready', model: BOARD, as_of: Date.now() }));
|
|
109
|
+
await page.route(/\/api\/briefing-premium(\?.*)?$/, (r) => json(r, { ok: true, state: 'ready', model: BRIEF, as_of: Date.now() }));
|
|
110
|
+
await page.route('**/api/briefing-premium/**', (r) => json(r, { ok: true, turns: [], working: false }));
|
|
111
|
+
for (const p of ['**/api/boards/move', '**/api/initiative-layout', '**/api/boards/ini-auto']) await page.route(p, (r) => (r.request().method() === 'POST' ? json(r, { ok: true, auto: false, held: [], by: 'stage', names: [], of: {}, stage: {}, sets: [] }) : r.fallback()));
|
|
112
|
+
if (sessions) await page.route(/\/api\/sessions(\?.*)?$/, (r) => json(r, { sessions }));
|
|
113
|
+
if (trail) await page.route('**/api/board-trail*', (r) => json(r, trail));
|
|
114
|
+
await page.goto(BASE + '/premium.html?ini=self-serve-v2&ws=w1&board=w1&theme=' + theme);
|
|
115
|
+
const up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer [data-hi-v="page"] .hm-sc .cz-sl')), 30000);
|
|
116
|
+
return { ctx, page, errors, posts, up };
|
|
117
|
+
};
|
|
118
|
+
const V = '#czViewer [data-hi-v="page"]';
|
|
119
|
+
const shot = async (p, name, sel) => { if (!SHOTS) return; await sleep(300); await (sel ? p.locator(sel).first() : p).screenshot({ path: path.join(SHOTS, name + '.png') }); };
|
|
120
|
+
const card = (p) => p.evaluate((v) => {
|
|
121
|
+
const c = document.querySelector(v + ' .hm-sc'); const t = (n) => (n ? n.textContent.replace(/\s+/g, ' ').trim() : '');
|
|
122
|
+
return { head: t(c.querySelector('.hm-sch')), stage: t(c.querySelector('.hm-sch > b')), of: t(c.querySelector('.hm-sch .of')), bars: c.querySelectorAll('.hm-bars i').length, now: c.querySelectorAll('.hm-bars i.now').length,
|
|
123
|
+
rows: [...c.querySelectorAll('.cz-sl > li')].map((li) => ({ cls: (li.querySelector('.cz-st') || {}).className || '', text: t(li) })), gob: c.querySelectorAll('.cz-gob').length,
|
|
124
|
+
cta: !!c.querySelector('[data-hm-cta]'), ov: !!c.querySelector('[data-hm-ov]'), sw: !!c.querySelector('.hi-sw'), tail: t(c.querySelector('.cz-sli.tail')), next: !!c.querySelector('[data-hi-next]'), move: t(c.querySelector('[data-hi-move]')) };
|
|
125
|
+
}, V);
|
|
126
|
+
|
|
127
|
+
/* D1 a desktop: the Build stage of the fixture (the contract waits for you, a Jira ticket open, Deliver next) */
|
|
128
|
+
{
|
|
129
|
+
const A = await open(), p = A.page;
|
|
130
|
+
ok('D1 the initiative\'s page draws the stage card D', A.up);
|
|
131
|
+
const c = await card(p);
|
|
132
|
+
ok('D1 the header: the stage and "N of M done"', c.stage === 'Build' && /^\d+ of \d+ done$/.test(c.of), JSON.stringify(c));
|
|
133
|
+
ok('D1 one bar a stage of the workflow, the current one marked', c.bars === 8 && c.now === 1, JSON.stringify(c));
|
|
134
|
+
ok('D1 the old CTA button, the C overview tile and the switch are gone from the card', !c.cta && !c.ov && !c.sw, JSON.stringify(c));
|
|
135
|
+
ok('D1 the PM\'s step comes first with the one blue go button', c.gob === 1 && /\bnow\b/.test(c.rows.find((r) => !/cz-fold/.test(r.cls)).cls), JSON.stringify(c.rows));
|
|
136
|
+
ok('D1 the Jira step is owned by Jira, with its ticket bar', await p.evaluate((v) => { const j = document.querySelector(v + ' .cz-jb'); return !!j && !!j.closest('.cz-st').querySelector('.cz-own.j'); }, V));
|
|
137
|
+
ok('D1 the last node is ◆ Deliver: the KR it moves, by the board\'s name, it waits for you, and it has no moves-on-by-itself icon', c.next && /Deliver/.test(c.tail) && /Moves KR 1\.1\. Waits for you/.test(c.tail) && await p.evaluate((v) => !!document.querySelector(v + ' .cz-sli.tail .cz-ms') && !document.querySelector(v + ' .cz-sli.tail .cz-auto'), V), c.tail);
|
|
138
|
+
ok('D1 with no session at work, no spinner', !(await p.evaluate((v) => !!document.querySelector(v + ' .cz-nd.run'), V)));
|
|
139
|
+
await shot(p, 'desk-build', V + ' .hm-sc');
|
|
140
|
+
if (await p.evaluate((v) => !!document.querySelector(v + ' [data-hm-done]'), V)) {
|
|
141
|
+
const before = (await card(p)).rows.length;
|
|
142
|
+
await p.click(V + ' [data-hm-done]');
|
|
143
|
+
ok('D1 the done steps open from their one line', await until(async () => (await card(p)).rows.length > before && await p.evaluate((v) => document.querySelector(v + ' [data-hm-done]').getAttribute('aria-expanded') === 'true', V)));
|
|
144
|
+
await p.click(V + ' [data-hm-done]');
|
|
145
|
+
}
|
|
146
|
+
// the move popover opens under the next-stage line
|
|
147
|
+
await p.click(V + ' [data-hi-next]');
|
|
148
|
+
const pop = await until(() => p.evaluate((v) => { const el = document.querySelector('.hi-pop'); const a = document.querySelector(v + ' [data-hi-next]'); if (!el || !a) return null; const r = el.getBoundingClientRect(), ar = a.getBoundingClientRect();
|
|
149
|
+
return { sheet: el.classList.contains('sheet'), text: el.textContent.replace(/\s+/g, ' ').trim(), under: r.top >= ar.bottom - 1, sw: !!el.querySelector('[data-hi-auto]'), go: !!el.querySelector('[data-hi-go]'), back: !!el.querySelector('[data-hi-goback]'), exp: a.getAttribute('aria-expanded') }; }, V));
|
|
150
|
+
ok('D2 a press on the next stage opens a popover under the line on a desktop, not a sheet', pop && !pop.sheet && pop.under && pop.exp === 'true', JSON.stringify(pop));
|
|
151
|
+
ok('D2 it says the next stage and why; a milestone has no switch and says it never moves in by itself', pop && /^Next: ?Deliver/.test(pop.text) && !pop.sw && /never moves into the Deliver milestone by itself/.test(pop.text), JSON.stringify(pop));
|
|
152
|
+
ok('D2 it holds Move now and Back, and says open steps take a note', pop && pop.go && pop.back && /Move to Deliver now/.test(pop.text) && /Back to Prioritize/.test(pop.text) && /still open\. You add a note when you move anyway\./.test(pop.text), JSON.stringify(pop));
|
|
153
|
+
await shot(p, 'desk-popover');
|
|
154
|
+
await p.click('.hi-pop [data-hi-go]');
|
|
155
|
+
ok('D2 Move now with open steps asks for a note first (Move anyway), and moves nothing yet', await until(() => p.evaluate(() => !!document.querySelector('.hi-pop [data-hi-go]') && /Move anyway/.test(document.querySelector('.hi-pop').textContent) && !!document.querySelector('.hi-pop #hiNote'))) && !A.posts.some((x) => x.path === '/api/boards/move'));
|
|
156
|
+
await p.click('.hi-pop [data-hi-x]');
|
|
157
|
+
await p.click(V + ' [data-hi-next]');
|
|
158
|
+
await until(() => p.evaluate(() => !!document.querySelector('.hi-pop [data-hi-goback]')));
|
|
159
|
+
await p.click('.hi-pop [data-hi-goback]');
|
|
160
|
+
ok('D2 Back asks for a reason', await until(() => p.evaluate(() => /Back a stage/.test((document.querySelector('.hi-pop') || {}).textContent || '') && document.querySelector('.hi-pop [data-hi-go]').disabled)));
|
|
161
|
+
await p.keyboard.press('Escape');
|
|
162
|
+
ok('D2 the page raised no error', A.errors.length === 0, A.errors.join(' | '));
|
|
163
|
+
await A.ctx.close();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* D3 the phone, dark: Discover, Plan next (moves on by itself), an agent at work, over its usual time */
|
|
167
|
+
{
|
|
168
|
+
const since = new Date(Date.now() - 9 * 864e5).toISOString().slice(0, 10);
|
|
169
|
+
const sessions = [{ id: 's1', name: 'chat: Claude drafts the stakeholder note', agent: 'claude', state: 'running', shown: 'working', origin: 'chat:init:self-serve-v2', created: new Date(Date.now() - 6 * 6e4).toISOString(), hx: { title: 'Claude drafts the stakeholder note' } }];
|
|
170
|
+
const trail = { ok: true, items: { 'self-serve-v2': { since } }, usual: { discover: { n: 5, days: 7 } }, usualBy: {} };
|
|
171
|
+
const A = await open({ w: 390, h: 844, theme: 'dark', model: SCEN.discover(), sessions, trail }), p = A.page;
|
|
172
|
+
ok('D3 the phone draws the same card', A.up);
|
|
173
|
+
const c = await card(p);
|
|
174
|
+
ok('D3 a session at work: a spinner with "Running · N min" and Claude\'s avatar', await p.evaluate((v) => { const n = document.querySelector(v + ' .cz-nd.run'); return !!n && /Running · \d+ min/.test(n.closest('.cz-st').textContent) && !!n.closest('.cz-st').querySelector('.cz-own.c'); }, V), JSON.stringify(c.rows));
|
|
175
|
+
ok('D3 the clock: "9 of ~7 days", amber when over', await p.evaluate((v) => { const t = document.querySelector(v + ' .hm-sct'); return !!t && /9 of ~7 days/.test(t.textContent) && t.classList.contains('over'); }, V), c.head);
|
|
176
|
+
ok('D3 the last node is Plan with the moves-on-by-itself icon', /Plan/.test(c.tail) && await p.evaluate((v) => !!document.querySelector(v + ' .cz-sli.tail .cz-auto'), V), c.tail);
|
|
177
|
+
await shot(p, 'phone-discover');
|
|
178
|
+
await p.click(V + ' [data-hi-next]');
|
|
179
|
+
const sh = await until(() => p.evaluate(() => { const el = document.querySelector('.hi-pop'); if (!el) return null; const s = el.querySelector('[data-hi-auto]'); const r = s && s.getBoundingClientRect(), tr = s && getComputedStyle(s, '::before');
|
|
180
|
+
return { sheet: el.classList.contains('sheet'), text: el.textContent.replace(/\s+/g, ' ').trim(), sw: r ? { w: Math.round(r.width), h: Math.round(r.height), track: tr.height, trackBg: tr.backgroundColor, blue: (() => { const x = document.createElement('i'); x.style.backgroundColor = 'var(--cz-blue)'; document.body.appendChild(x); const c = getComputedStyle(x).backgroundColor; x.remove(); return c; })(), bg: getComputedStyle(s).backgroundColor } : null, on: s && s.getAttribute('aria-checked') }; }));
|
|
181
|
+
ok('D4 on the phone the next stage opens a sheet', sh && sh.sheet, JSON.stringify(sh));
|
|
182
|
+
ok('D4 the sheet holds the switch as a switch (a 44 by 28 track in a 44 px press), not a big circle', sh && sh.sw && sh.sw.w === 44 && sh.sw.h === 44 && sh.sw.track === '28px' && /rgba\(0, 0, 0, 0\)|transparent/.test(sh.sw.bg) && (sh.on !== 'true' || sh.sw.trackBg === sh.sw.blue), JSON.stringify(sh));
|
|
183
|
+
ok('D4 the switch says when it moves and that Undo follows', sh && /Moves on by itself when/.test(sh.text) && /with Undo/.test(sh.text), JSON.stringify(sh));
|
|
184
|
+
await shot(p, 'phone-sheet');
|
|
185
|
+
await p.click('.hi-pop [data-hi-auto]');
|
|
186
|
+
ok('D4 the switch writes this initiative\'s choice to the file-mode record', await until(() => A.posts.some((x) => x.path === '/api/initiative-layout' && x.body.kind === 'auto' && x.body.on === false)), JSON.stringify(A.posts));
|
|
187
|
+
ok('D4 the page raised no error', A.errors.length === 0, A.errors.join(' | '));
|
|
188
|
+
await A.ctx.close();
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* D5 every step done, a milestone next: the last node is the one primary, "Move to ◆ Deliver" */
|
|
192
|
+
{
|
|
193
|
+
const A = await open({ model: SCEN.ready() }), p = A.page;
|
|
194
|
+
const c = await card(p);
|
|
195
|
+
ok('D5 every step done: the steps fold to one line and the last node is "Move to ◆ Deliver"', A.up && c.move === 'Move to Deliver' && await p.evaluate((v) => !!document.querySelector(v + ' [data-hi-move] .cz-ms'), V) && c.gob === 0 && c.rows.filter((r) => !/cz-fold|mvr/.test(r.cls)).length === 0, JSON.stringify(c));
|
|
196
|
+
await shot(p, 'desk-ready', V + ' .hm-sc');
|
|
197
|
+
await p.click(V + ' [data-hi-move]');
|
|
198
|
+
ok('D5 a press moves it to Deliver with nothing open, and says so with Undo', await until(() => A.posts.some((x) => x.path === '/api/boards/move' && x.body.to === 'Deliver')) && await until(() => p.evaluate(() => /Undo/.test((document.querySelector('#hiToast') || {}).textContent || ''))), JSON.stringify(A.posts));
|
|
199
|
+
ok('D5 the page raised no error', A.errors.length === 0, A.errors.join(' | '));
|
|
200
|
+
await A.ctx.close();
|
|
201
|
+
}
|
|
202
|
+
finish();
|
|
203
|
+
})();
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Every kind of ask as one card with icon answers, and the progress line wherever an agent works (canvas XcbOptions): the asks and sweep models (node), and the cards and the stopped-run divider in Home's real chat (browser).",
|
|
3
|
+
"modules": [
|
|
4
|
+
"chat-sweep.test.js"
|
|
5
|
+
],
|
|
6
|
+
"panels": [
|
|
7
|
+
"chat-asks-test.js"
|
|
8
|
+
],
|
|
9
|
+
"seconds": {
|
|
10
|
+
"chat-sweep.test.js": 1,
|
|
11
|
+
"chat-asks-test.js": 30
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "The chat progress line (canvas XcbOptions B): one line at the top of a chat for a goal or a session; dividers where a run ends; the Home row ring.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"chat-line.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"chat-line.test.js": 1,
|
|
8
|
+
"premium-chat-line-test.js": 45
|
|
9
|
+
},
|
|
10
|
+
"panels": [
|
|
11
|
+
"premium-chat-line-test.js"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "premium-agreed-design: Home's Mentions A+ (canvas XmsMentionsGrill, XmsDeskList/One/Refine): the mention store, GET /api/mentions and POST /api/mentions/act, pmos mention. Pure, node.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"mentions.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"mentions.test.js": 1
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "The goal before Start in a Home chat (XcbOptions B row 1): the method line with Change, the dots row, the plan card with Start / Change / Cancel as icons, the editor in place, skip and Undo, and the choice when /goal is typed while a goal works. Real server, 1280 light and 390 dark.",
|
|
3
|
+
"seconds": {
|
|
4
|
+
"premium-chat-goal-setup-test.js": 60
|
|
5
|
+
},
|
|
6
|
+
"panels": [
|
|
7
|
+
"premium-chat-goal-setup-test.js"
|
|
8
|
+
]
|
|
9
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "The viewer opens a file outside every workspace only when the chat's own session named it or keeps it in its scratchpad: read-only, one file per id, symlinks and traversals refused.",
|
|
3
|
+
"modules": ["session-files.test.js", "session-files-server.test.js"],
|
|
4
|
+
"seconds": { "session-files.test.js": 1, "session-files-server.test.js": 6 }
|
|
5
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "session names A (testing feedback 2026-10-25; canvas XmsNames): Claude names a session after its first real answer, the PM renames it by tapping the name, and the PM's name locks it.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"session-name.test.js"
|
|
5
|
+
],
|
|
6
|
+
"panels": [
|
|
7
|
+
"session-names-test.js"
|
|
8
|
+
],
|
|
9
|
+
"seconds": {
|
|
10
|
+
"session-name.test.js": 1,
|
|
11
|
+
"session-names-test.js": 40
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Stage card D (premium-agreed-design, agreed 2026-10-25): the initiative's stage as a live step list on its page, the shared step list (cozy-steps.js), the move popover on a desktop and the sheet on the phone (canvas XscD, XscDDesk). The panel suite holds the pure checks too and serves the real page.",
|
|
3
|
+
"modules": [],
|
|
4
|
+
"panels": ["stage-card-test.js"],
|
|
5
|
+
"seconds": { "stage-card-test.js": 30 }
|
|
6
|
+
}
|
|
@@ -82,7 +82,7 @@ const BRIEF = BRP.build(BRF.facts());
|
|
|
82
82
|
await page.route(/\/api\/boards\/items(\?.*)?$/, (r) => json(r, { ok: true, ws: 'w1', board: 'w1', jiraProjects: ['IDPF'], items: [], initiatives: [] }));
|
|
83
83
|
await page.route(/\/api\/jira\/(push|epic|edit|draft)$/, (r) => json(r, { ok: true, session: 's1', tickets: 7 }));
|
|
84
84
|
await page.goto(BASE + '/premium.html?ini=' + I + '&ws=w1&board=w1&theme=' + theme);
|
|
85
|
-
const up = await until(() => page.evaluate(() => !!document.querySelector('.hm-card
|
|
85
|
+
const up = await until(() => page.evaluate(() => !!document.querySelector('.hm-card .cz-sl')), 30000);
|
|
86
86
|
return { ctx, page, errors, posts, up, set: (v) => { cur = v; } };
|
|
87
87
|
};
|
|
88
88
|
const V = '#czViewer:not([hidden])';
|
|
@@ -271,6 +271,15 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
271
271
|
const NW = await until(() => q.evaluate(() => { const c = document.querySelector('#wfChat'); if (!c || c.hidden) return null; return { text: c.innerText, sel: (document.querySelector('#wfList .wfl.sel') || {}).innerText || '', main: document.querySelector('#wfMain').hidden }; }).then((x) => (x && /Tell me how this work goes/.test(x.text) ? x : null)));
|
|
272
272
|
ok('N + opens the normal chat scoped "New workflow", with the opening ask and "start blank or from a copy"', NW && NW.main && /New workflow/.test(NW.sel) && /draft/.test(NW.sel) && /You can also start blank or from a copy/.test(NW.text), JSON.stringify(NW));
|
|
273
273
|
await shot(q, 'wf-new-1440');
|
|
274
|
+
// bug 2026-10-25: #wfMain kept display:flex under [hidden], so the chat was a sliver beside the workflow and the composer's buttons overlapped
|
|
275
|
+
const geo = () => q.evaluate(() => {
|
|
276
|
+
const r = (e) => e.getBoundingClientRect(), c = document.querySelector('#wfChat');
|
|
277
|
+
const btns = [...c.querySelectorAll('#hmFoot button, #hmFoot .hm-scope, #hmFoot [class*="chip"]')].filter((b) => r(b).width > 0).map(r);
|
|
278
|
+
const hit = btns.some((a, i) => btns.some((b, j) => j > i && a.left < b.right - 1 && b.left < a.right - 1 && a.top < b.bottom - 1 && b.top < a.bottom - 1));
|
|
279
|
+
return { main: getComputedStyle(document.querySelector('#wfMain')).display, w: Math.round(r(c).width), hit, out: btns.some((b) => b.right > r(c).right + 1) };
|
|
280
|
+
});
|
|
281
|
+
const G1 = await geo();
|
|
282
|
+
ok('N the workflow is gone while New workflow shows; the chat has the column; the composer buttons do not overlap', G1.main === 'none' && G1.w >= 400 && !G1.hit && !G1.out, JSON.stringify(G1));
|
|
274
283
|
await q.fill('#wfChatIn textarea', 'We onboard a new supplier. Procurement checks the contract and the insurance first.');
|
|
275
284
|
await q.keyboard.press('Enter');
|
|
276
285
|
const ask = await until(() => N.posts.find((x) => x.path === '/api/briefing-premium/ask'));
|
|
@@ -280,6 +289,14 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
280
289
|
ok('N the draft shows in the Viewer as numbered stages per category, with Create workflow and Edit by hand', v && /To do\s*1\s*Triage/.test(v.text) && /In progress/.test(v.text) && /3\s*Security review/.test(v.text) && /Only when they touch customer data/.test(v.text) && /Done\s*6\s*◆ 90-day review/.test(v.text) && /Create workflow/.test(v.text) && /Edit by hand/.test(v.text), v && v.text);
|
|
281
290
|
ok('N the list row takes the draft\'s name', await q.evaluate(() => /Vendor onboarding/.test(document.querySelector('#wfList .wfl.sel').innerText)));
|
|
282
291
|
await shot(q, 'wf-draft-1440');
|
|
292
|
+
const G2 = await geo();
|
|
293
|
+
ok('N with the draft open beside it, the chat keeps a usable column and the composer does not overlap', G2.main === 'none' && G2.w >= 360 && !G2.hit && !G2.out, JSON.stringify(G2));
|
|
294
|
+
await q.setViewportSize({ width: 1180, height: 820 });
|
|
295
|
+
await q.waitForTimeout(200);
|
|
296
|
+
const G3 = await geo();
|
|
297
|
+
ok('N at 1180 wide with the draft open, the composer still does not overlap', G3.main === 'none' && G3.w >= 300 && !G3.hit && !G3.out, JSON.stringify(G3));
|
|
298
|
+
await shot(q, 'wf-draft-1180');
|
|
299
|
+
await q.setViewportSize({ width: 1440, height: 900 });
|
|
283
300
|
await q.click('#czViewer [data-wf-dcreate]');
|
|
284
301
|
await until(() => saves(N.posts).length);
|
|
285
302
|
const cw = lastWf(N.posts);
|