create-pmos 0.478.0 → 0.480.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.
Files changed (40) hide show
  1. package/package.json +26 -27
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-initiative-test.js +1 -1
  7. package/workspace/changelog.json +25 -0
  8. package/workspace/guide/briefing-premium.md +3 -2
  9. package/workspace/guide/home.md +2 -1
  10. package/workspace/guide/programs.md +15 -5
  11. package/workspace/lib/board-pack-route.js +10 -1
  12. package/workspace/lib/board-pack.js +31 -2
  13. package/workspace/lib/briefing-premium-products.js +5 -2
  14. package/workspace/lib/briefing-premium.js +5 -3
  15. package/workspace/lib/ready-reports.js +31 -6
  16. package/workspace/lib/report-chat.js +7 -4
  17. package/workspace/lib/report-draft.js +14 -5
  18. package/workspace/lib/report-structure.js +35 -1
  19. package/workspace/lib/routes-report-setups.js +24 -4
  20. package/workspace/metric-drafts-ui-test.js +2 -1
  21. package/workspace/milestone-suggest-test.js +12 -6
  22. package/workspace/package-lock.json +2 -2
  23. package/workspace/package.json +1 -1
  24. package/workspace/program-charter-test.js +5 -5
  25. package/workspace/program-panel-test.js +28 -25
  26. package/workspace/public/pm/bd-prog-panel.js +84 -60
  27. package/workspace/public/pm/chat-md.js +5 -2
  28. package/workspace/public/pm/cozy-home.css +3 -0
  29. package/workspace/public/pm/dash-view.js +9 -5
  30. package/workspace/public/pm/goal-chat.js +3 -1
  31. package/workspace/public/pm/home-app.js +53 -21
  32. package/workspace/public/pm/home-chat.js +2 -2
  33. package/workspace/public/pm/premium-report-read.js +8 -1
  34. package/workspace/public/pm/premium-report-tab.js +34 -20
  35. package/workspace/public/pm/premium.css +1 -0
  36. package/workspace/public/pm/prog-page.css +76 -0
  37. package/workspace/public/pm/prog-page.js +112 -0
  38. package/workspace/public/pm/readonly.js +8 -1
  39. package/workspace/public/pm/report-chat.js +14 -3
  40. package/workspace/ready-dash-ui-test.js +53 -73
@@ -10,7 +10,8 @@
10
10
  * POST /api/report-setups/ask { ws, text } → { ok, id } starts the report-setup run (headless)
11
11
  * POST /api/report-setups/change { ws, id, text } → { ok } a correction to a proposal; a second run revises it
12
12
  * POST /api/report-setups/cancel { ws, id } → { ok }
13
- * POST /api/report-setups/setup { ws, ask? | finding?, proposal? } → { ok, setup, first_draft, drafted } THE press that sets a report up; drafts the first cycle
13
+ * POST /api/report-setups/setup { ws, ask? | finding?, proposal?, sections? } → { ok, setup, first_draft, drafted, structure? } THE press that sets a report up; drafts the first cycle.
14
+ * sections (the titles the PM named in the chat) are saved as S1 and the first draft follows them (drafted.drafting)
14
15
  * POST /api/report-setups/draft { ws, id } → { ok, drafted: { slot, path }, id } Draft it now (the next cycle)
15
16
  * POST /api/report-setups/dismiss { ws, finding } → { ok } "Not a report"
16
17
  * POST /api/report-setups/pause | resume { ws, id } → { ok, setup }
@@ -54,6 +55,7 @@ const RC = require('./report-checks.js');
54
55
  const RX = require('./report-export.js');
55
56
  const RF = require('./report-finder.js');
56
57
  const RD = require('./report-draft.js');
58
+ const RSt = require('./report-structure.js');
57
59
  const logic = require('./schedule-logic.js');
58
60
  const docSync = require('./doc-sync.js');
59
61
  const headless = require('./headless.js');
@@ -415,14 +417,32 @@ async function handle(req, res, url, ctx) {
415
417
  else if (body.finding) { const l = RS.lookupFinding(st, text(body.finding), text(body.name)); if (!l.ok) return send({ status: l.status, body: { ok: false, error: l.error, reason: l.reason } }); from = { finding: l.finding.id }; base = l.finding.proposal; }
416
418
  const proposal = body.proposal && typeof body.proposal === 'object' && !Array.isArray(body.proposal) ? body.proposal : base;
417
419
  if (!proposal) return send(bad(400, 'say which request or finding to set up, or give the proposal'));
420
+ // The sections the PM named in the chat (report-chat `sections`), checked before anything is written: a bad list sets nothing up.
421
+ let shaped = null;
422
+ if (body.sections !== undefined) {
423
+ shaped = RSt.planFromSections(body.sections, { readers: text(proposal.audience), decision: text(proposal.purpose) });
424
+ if (!shaped.ok) return fail(shaped);
425
+ }
418
426
  const r = RS.setUp(root, { ...proposal, ...(from ? { from } : {}) }, opts);
419
427
  if (!r.ok) return fail(r);
428
+ // The PM saw those sections in the tab and pressed Set it up: that press saves them as S1, so the first draft already follows them
429
+ // (Wawan, 2026-11-01: a report set up from chat kept the standard sections and a draft written before the change landed).
430
+ let structured = null;
431
+ if (shaped && r.setup.source === 'work') {
432
+ const v = RSt.landVersion(root, r.setup.id, shaped.plan, { turn: 'The sections named in the chat.', answer: 'Made S1 from the sections you named.', from: 'chat', actor: g.actor });
433
+ if (v.ok) { RSt.append(root, r.setup.id, { ev: 'accept', n: v.n, charts: [] }, { actor: g.actor }); RSt.writeBrief(root, r.setup.id, r.setup); structured = v.n; }
434
+ }
420
435
  // The first cycle is drafted now, at the slot of its first scheduled draft, so the PM has a document to read the moment it is set up
421
436
  // (the approved mockup's "Sample draft made when you set up"). The schedule later redrafts the same slot. A failed draft leaves the set-up
422
- // in place and says why; Draft it now on the row tries again.
423
- const drafted = firstDraft(root, r, g.actor);
437
+ // in place and says why; Draft it now on the row tries again. A report with saved sections is drafted by the session that follows them.
438
+ let drafted = null;
439
+ if (structured != null && typeof ctx.structureDraft === 'function') {
440
+ let sd = null; try { sd = ctx.structureDraft(w, r.setup.id); } catch (e) { sd = { structured: true, status: 500, error: String((e && e.message) || e) }; }
441
+ if (sd && sd.structured) drafted = sd.status ? { error: sd.error } : { drafting: true, held: !!sd.held };
442
+ }
443
+ if (!drafted) drafted = firstDraft(root, r, g.actor);
424
444
  if (drafted.path) ctx.invalidateNeedsAgg && ctx.invalidateNeedsAgg();
425
- return send({ status: 200, body: { ok: true, setup: setupOut(r.setup, new Date(), documentsOf(ctx, w), copyIndex(root), root), first_draft: r.first_draft, drafted } });
445
+ return send({ status: 200, body: { ok: true, setup: setupOut(r.setup, new Date(), documentsOf(ctx, w), copyIndex(root), root), first_draft: r.first_draft, drafted, ...(structured != null ? { structure: structured } : {}) } });
426
446
  }
427
447
  if (sub === 'dismiss') {
428
448
  const r = RS.dismissFinding(file, { id: text(body.finding), name: text(body.name), by: g.actor });
@@ -126,7 +126,8 @@ const INITIATIVE = () => ({
126
126
  ok('P the read names the program and its product', D.gets.some((g) => g.scope === 'program' && g.id === 'project-ascent' && g.ws === 'idpf'), JSON.stringify(D.gets));
127
127
  const ps = await sizes(p, '#czViewer .md-card');
128
128
  ok('S the card uses the type scale only', ps.length && ps.every((x) => SCALE.has(x)), ps.join());
129
- ok('P the rest of the panel is as before: the summary, the goals and the folding rows follow', await p.evaluate(() => { const b = document.querySelector('#czViewer .pp-vw'); return !!b.querySelector('.md-card + .czs-sum') && !!b.querySelector('.czs-sum ~ .pp-goal') && !!b.querySelector('[data-czs-fold="tree"]'); }));
129
+ // batch 21 item 2: the panel is one page (prog-page.js): the proposed goal sits in the goal card, then the tabs with Initiatives open
130
+ ok('P the rest of the panel is the one page: the tabs follow, Initiatives open by default', await p.evaluate(() => { const b = document.querySelector('#czViewer .pp-vw'); return !!b.querySelector('.pv .md-card') && !!b.querySelector('.pv-tabs [data-pv="tab"][data-k="initiatives"][aria-selected="true"]') && !!b.querySelector('#pvp'); }));
130
131
  await shot(p, 'Iq9Program-proposed-built');
131
132
 
132
133
  /* ── K: ✓ keeps all ── */
@@ -74,7 +74,7 @@ const withReview = (open, o = {}) => F.programs().map((p) => ({ ...p, ...(o.empt
74
74
  await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: '{"ok":false,"error":"not in this check"}' }));
75
75
  if (home) { await page.goto(BASE + '/premium.html?ws=idpf'); return { page, ctx: c, errors, posts }; }
76
76
  await page.goto(BASE + '/premium-board.html?ws=idpf&program=' + programs[0].id);
77
- await until(() => page.evaluate(() => { const v = document.querySelector('#czViewer'); return !!v && !v.hidden && !!v.querySelector('.pp-vw .czs-sum'); }));
77
+ await until(() => page.evaluate(() => { const v = document.querySelector('#czViewer'); return !!v && !v.hidden && !!v.querySelector('.pp-vw .pv'); }));
78
78
  await until(() => page.evaluate(() => !/reading its board/.test((document.querySelector('#czViewer [data-czs-id="tree"]') || {}).textContent || '')), 6000);
79
79
  return { page, ctx: c, errors, posts };
80
80
  };
@@ -102,10 +102,14 @@ const withReview = (open, o = {}) => F.programs().map((p) => ({ ...p, ...(o.empt
102
102
  /* ── W: later changes in Waits on you ── */
103
103
  const D = await open();
104
104
  const p = D.page;
105
- const w = await rows(p, '#czViewer [data-czs-id="needs"]');
106
- const cnt = await p.evaluate(() => (document.querySelector('#czViewer [data-czs-fold="needs"] .czs-n, #czViewer [data-czs-id="needs"] .czs-n') || {}).textContent || '');
107
- ok('W the changes lead Waits on you, in plain words, each with why and its source', w.map((r) => r.t).join('|') === 'Move Pilot live to Dec 2|Partner SSO cut-over|Mark Legacy IdP off at risk' && w[0].src === 'Jira, read 2h ago' && /DSC-41/.test(w[0].why), JSON.stringify(w));
108
- ok('W the Waits on you count includes them', /^\d+$/.test(cnt.trim()) && Number(cnt) >= 3, cnt);
105
+ // batch 21 item 2: on the one page the changes lead the folded proposals row (✦ n), which opens in place
106
+ const sub = await p.evaluate(() => (document.querySelector('#czViewer [data-pv="props"]') || {}).textContent || '');
107
+ await p.click('#czViewer [data-pv="props"]');
108
+ await until(() => p.evaluate(() => !!document.querySelector('#czViewer .pv-props .msg-r')), 4000);
109
+ const w = await rows(p, '#czViewer .pv-props');
110
+ const cnt = (/(\d+)/.exec(sub) || [, ''])[1];
111
+ ok('W the changes lead the proposals, in plain words, each with why and its source', w.map((r) => r.t).join('|') === 'Move Pilot live to Dec 2|Partner SSO cut-over|Mark Legacy IdP off at risk' && w[0].src === 'Jira, read 2h ago' && /DSC-41/.test(w[0].why), JSON.stringify(w));
112
+ ok('W the proposals count includes them', /^\d+$/.test(cnt.trim()) && Number(cnt) >= 3, cnt);
109
113
  ok('W the track stays as it is until the PM keeps a change', await p.evaluate(() => !!document.querySelector('#czViewer .pp-mt') && !document.querySelector('#czViewer .msg-box')));
110
114
  ok('K the ◆ dates the page reads are reported once, so a moved date asks Claude for a review', await until(() => D.posts.filter((x) => x.path === '/api/programs/facts').length === 1, 4000) && /descope-parity:\d{4}-\d{2}-\d{2}/.test((D.posts.find((x) => x.path === '/api/programs/facts') || { body: {} }).body.fp || ''), JSON.stringify(D.posts.filter((x) => x.path === '/api/programs/facts')));
111
115
  await shot(p, 'XmsgB-asks-built');
@@ -148,7 +152,7 @@ const withReview = (open, o = {}) => F.programs().map((p) => ({ ...p, ...(o.empt
148
152
  ok('M Home\'s program card has one line for its milestone changes, first', hm === '3 milestone changes · Pilot live to Dec 2', String(hm));
149
153
  if (hm) {
150
154
  await M.page.click('[data-hm-sel="ms:project-ascent"]');
151
- ok('M a tap opens the program, where the changes lead Waits on you', !!(await until(() => M.page.evaluate(() => !!document.querySelector('#czViewer [data-czs-id="needs"] .msg-r')), 8000)));
155
+ ok('M a tap opens the program, where the changes lead its proposals', !!(await until(() => M.page.evaluate(() => { const b = document.querySelector('#czViewer [data-pv="props"]'); if (b && b.getAttribute('aria-expanded') !== 'true') b.click(); return !!document.querySelector('#czViewer .pv-props .msg-r'); }), 8000)));
152
156
  }
153
157
  // batch 16: on a desktop the greeting opens Your day in the Viewer, as on a phone; the calendar is under ⋯
154
158
  if (await M.page.$('[data-hm-day]')) {
@@ -161,6 +165,8 @@ const withReview = (open, o = {}) => F.programs().map((p) => ({ ...p, ...(o.empt
161
165
 
162
166
  /* ── H: a phone ── */
163
167
  const S = await open({ w: 390, h: 844 });
168
+ await S.page.click('#czViewer [data-pv="props"]');
169
+ await until(() => S.page.evaluate(() => !!document.querySelector('#czViewer [data-ms-act="keep"]')), 4000);
164
170
  const sp = await S.page.evaluate(() => { const b = document.querySelector('#czViewer [data-ms-act="keep"]'); const r = b && b.getBoundingClientRect(); return { size: r ? Math.round(r.width) : 0, wide: document.documentElement.scrollWidth <= innerWidth + 1 }; });
165
171
  ok('H on a phone the presses are 40 px and nothing scrolls sideways', sp.size >= 40 && sp.wide, JSON.stringify(sp));
166
172
  await S.page.evaluate(() => { const r = document.querySelector('#czViewer [data-czs-id="needs"]'); if (r) r.scrollIntoView(); });
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.478.0",
3
+ "version": "0.480.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.478.0",
9
+ "version": "0.480.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@anthropic-ai/sdk": "^1.3.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.478.0",
3
+ "version": "0.480.0",
4
4
  "private": true,
5
5
  "description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
6
6
  "license": "MIT",
@@ -60,7 +60,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
60
60
  await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: '{"ok":false,"error":"not in this check"}' }));
61
61
  if (home) { await page.goto(BASE + '/premium.html?ws=idpf'); return { page, ctx: c, errors, posts }; }
62
62
  await page.goto(BASE + '/premium-board.html?ws=idpf&program=' + programs[0].id);
63
- await until(() => page.evaluate(() => { const v = document.querySelector('#czViewer'); return !!v && !v.hidden && !!v.querySelector('.pp-vw .czs-sum'); }));
63
+ await until(() => page.evaluate(() => { const v = document.querySelector('#czViewer'); return !!v && !v.hidden && !!v.querySelector('.pp-vw .pv'); }));
64
64
  // the other product's board lands after the panel opens: the charter lists its initiative once it is read
65
65
  await until(() => page.evaluate(() => !/reading its board/.test((document.querySelector('#czViewer [data-czs-id="tree"]') || {}).textContent || '')), 6000);
66
66
  return { page, ctx: c, errors, posts };
@@ -71,7 +71,8 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
71
71
  const rowsOf = (p) => p.evaluate(() => [...document.querySelectorAll('#czViewer .pc-ln[data-m]')].map((r) => ({ id: r.dataset.m, name: r.querySelector('[data-f="name"]').value, day: r.querySelector('.pc-fd span').textContent, when: (r.querySelector('.pc-wch span:not(.sq):not(.bx)') || r.querySelector('.pc-via, .pc-mini') || {}).textContent || '', draft: r.classList.contains('sug') })));
72
72
 
73
73
  // into the charter by the Milestones pencil: the section is opened first when it is folded
74
- const toCharter = async (p) => { await p.evaluate(() => { const b = document.querySelector('#czViewer [data-czs-fold="ms"]'); if (b && b.getAttribute('aria-expanded') !== 'true') b.click(); }); await p.click('#czViewer [data-czs-id="ms"] [data-pp="edit"]'); };
74
+ // batch 21 item 2: the one page keeps the pencil beside "Program milestones" in the goal card
75
+ const toCharter = async (p) => { await p.click('#czViewer .pv-gc [data-pp="edit"]'); };
75
76
 
76
77
  /* ── desktop: the ways in, the fields, Save ── */
77
78
  const D = await open();
@@ -83,8 +84,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
83
84
  ok('W ⋯ holds no "Open the charter"', !(await p.evaluate(() => [...document.querySelectorAll('.cz-vw-menu button')].some((b) => /charter/i.test(b.textContent)))));
84
85
  await p.keyboard.press('Escape');
85
86
  await shot(p, 'MsB0Entry-built-track');
86
- await p.evaluate(() => { const b = document.querySelector('#czViewer [data-czs-fold="ms"]'); if (b && b.getAttribute('aria-expanded') !== 'true') b.click(); });
87
- ok('W the Milestones row carries a pencil', await p.evaluate(() => !!document.querySelector('#czViewer [data-czs-id="ms"] .czs-tail [data-pp="edit"]')));
87
+ ok('W the goal card\'s Program milestones carries a pencil', await p.evaluate(() => !!document.querySelector('#czViewer .pv-gc .pp-lh [data-pp="edit"][aria-label="Edit the milestones in the charter"]')));
88
88
  await shot(p, 'MsB0Entry-built');
89
89
  await p.click('#czViewer [data-pp="edit"]');
90
90
  ok('W the pencil opens the charter as a drill-in (← back to the program)', await charterShown(p));
@@ -231,7 +231,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
231
231
  const M = await open({ home: true });
232
232
  const prog = await until(() => M.page.$('#hmList [data-hm-prog]'), 10000);
233
233
  if (prog) await prog.click();
234
- const hp = await until(() => M.page.evaluate(() => { const v = document.querySelector('#czViewer'); if (!v || v.hidden || !v.querySelector('.pp-vw .czs-sum')) return null; return { tile: getComputedStyle(v.querySelector('.cz-vw-tile')).backgroundColor, prog: getComputedStyle(document.body).getPropertyValue('--pp-prog').trim() }; }));
234
+ const hp = await until(() => M.page.evaluate(() => { const v = document.querySelector('#czViewer'); if (!v || v.hidden || !v.querySelector('.pp-vw .pv')) return null; return { tile: getComputedStyle(v.querySelector('.cz-vw-tile')).backgroundColor, prog: getComputedStyle(document.body).getPropertyValue('--pp-prog').trim() }; }));
235
235
  ok('M on Home the program heading opens the program panel with its own purple (cozy-panel.css is on Home)', !!hp && !!hp.prog && !/rgba\(0, 0, 0, 0\)|transparent/.test(hp.tile), JSON.stringify(hp));
236
236
  if (hp) await toCharter(M.page);
237
237
  ok('M the charter opens from the panel on Home too', !!hp && !!(await charterShown(M.page)));
@@ -4,6 +4,8 @@
4
4
  * into the Viewer's shell A by the second kit (initiative viewer-shell-a, V9; canvas XvABoard). Serves the real page from the real server;
5
5
  * GET /api/board-premium answers each product of Project Ascent (fixtures/program-ascent.js through fixtures/board-premium-facts.js
6
6
  * programFacts), GET /api/programs its programs, and the program writes are captured, not written.
7
+ * Batch 21 item 2 made the panel ONE page (pm/prog-page.js): the ✦ line, the goal card with the track, then the tabs Tasks, Initiatives
8
+ * (open first), Reports, Documents; these checks read that page.
7
9
  * P open on ?program=, the shell's header, no chat box · G goals per half, each KR's name and whether it is met · M the track and the
8
10
  * Milestones row · W waits on you, in Home · T the initiatives per product, another product read from its board · K every task by level,
9
11
  * and the sort card after Turn into a program · F folds kept · O the Board's program row opens it, an initiative opens the Board's
@@ -60,8 +62,9 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
60
62
  await page.goto(BASE + '/premium-board.html' + qs);
61
63
  return { page, ctx: c, errors, posts };
62
64
  };
63
- const shown = (p) => until(() => p.evaluate(() => { const v = document.querySelector('#czViewer'); return !!v && !v.hidden && /^Viewer: Program/.test(v.getAttribute('aria-label') || '') && !!v.querySelector('.pp-vw .czs-sum'); }));
65
+ const shown = (p) => until(() => p.evaluate(() => { const v = document.querySelector('#czViewer'); return !!v && !v.hidden && /^Viewer: Program/.test(v.getAttribute('aria-label') || '') && !!v.querySelector('.pp-vw .pv'); }));
64
66
  const fold = (p, id) => p.click(`#czViewer [data-czs-fold="${id}"]`);
67
+ const tab = (p, k) => p.click(`#czViewer [data-pv="tab"][data-k="${k}"]`); // batch 21 item 2: the one page's tabs
65
68
  const isOpen = (p, id) => p.evaluate((k) => { const b = document.querySelector(`#czViewer [data-czs-fold="${k}"]`); return !!b && b.getAttribute('aria-expanded') === 'true'; }, id);
66
69
 
67
70
  /* ── desktop ── */
@@ -70,11 +73,11 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
70
73
  ok('P ?program=<id> opens the program in the Viewer once the board and the programs are read', await shown(p));
71
74
  await sleep(1500); // the other product's board and the program reads land after the program opened: none of them opens it again
72
75
  ok('P ?program=<id> sends bd:program once: one path opens the program', await p.evaluate(() => window.__bdp) === 1, String(await p.evaluate(() => window.__bdp)));
73
- const hd = await p.evaluate(() => { const v = document.querySelector('#czViewer'); const r = v.getBoundingClientRect(); return { t: v.querySelector('.cz-vw-title').textContent, kind: (v.querySelector('.cz-vw-kind') || {}).textContent, meta: (v.querySelector('.czs-meta') || {}).textContent, tools: [...v.querySelectorAll('.cz-vw-head [data-cz-vw], [data-cz-vw]')].filter((b) => b.closest('#czViewer') && !b.classList.contains('cz-vw-grip')).map((b) => b.getAttribute('aria-label')), input: v.querySelectorAll('.cz-vw-body input, .cz-vw-body textarea').length, tabs: v.querySelectorAll('.pp-tab, [role="tab"]').length, w: Math.round(r.width), right: Math.round(innerWidth - r.right), sel: !!document.querySelector('#ibBody [data-prow="project-ascent"].sel') }; });
74
- ok('P the shell\'s header names it once ("title · goal"), with Discuss in chat, the Dashboard toggle once the dashboard reads (it took the charter icon\'s place, batch 17 PbH1Header; the charter stays in ⋯ and on the Milestones pencil), ⋯, ⧉ Arrange (in place of Open wide, panels on Board and Intelligence) and Close; the summary says the owner and the span; there is no chat box and no tab', hd.t === 'Project Ascent · CIAM migration' && hd.kind === 'Program' && hd.meta === 'Wawan · Sep 2026 to Jun 2028' && /^Discuss in chat\|(Show the dashboard\|)?More\|Arrange\|Close the viewer$/.test([...new Set(hd.tools)].join('|')) && hd.input === 0 && hd.tabs === 0, JSON.stringify(hd));
76
+ const hd = await p.evaluate(() => { const v = document.querySelector('#czViewer'); const r = v.getBoundingClientRect(); return { t: v.querySelector('.cz-vw-title').textContent, kind: (v.querySelector('.cz-vw-kind') || {}).textContent, tools: [...v.querySelectorAll('.cz-vw-head [data-cz-vw], [data-cz-vw]')].filter((b) => b.closest('#czViewer') && !b.classList.contains('cz-vw-grip')).map((b) => b.getAttribute('aria-label')), input: v.querySelectorAll('.cz-vw-body input, .cz-vw-body textarea').length, tabs: [...v.querySelectorAll('[data-pv="tab"]')].map((t) => t.dataset.k + (t.getAttribute('aria-selected') === 'true' ? '*' : '')), w: Math.round(r.width), right: Math.round(innerWidth - r.right), sel: !!document.querySelector('#ibBody [data-prow="project-ascent"].sel') }; });
77
+ ok('P the shell\'s header names it once ("title · goal"), with Discuss in chat, ⋯, ⧉ Arrange and Close, and no Work | Dashboard toggle (batch 21 item 2: one page); no chat box; the tabs Tasks, Initiatives (open first), Reports, Documents', hd.t === 'Project Ascent · CIAM migration' && hd.kind === 'Program' && [...new Set(hd.tools)].join('|') === 'Discuss in chat|More|Arrange|Close the viewer' && hd.input === 0 && hd.tabs.join() === 'tasks,initiatives*,reports,documents', JSON.stringify(hd));
75
78
  ok('V the program opens beside the page, at the right edge, no wider than leaves the Board its 880 px (506 at 1440), and its band row on the Board is selected', hd.w === 506 && hd.right < 40 && hd.sel && await p.evaluate(() => !document.querySelector('#czViewer.cz-vw-float') && !!document.querySelector('.cz-pn-div')), JSON.stringify(hd));
76
- const sm = await p.evaluate(() => ({ line: (document.querySelector('#czViewer .czs-line') || {}).textContent, pri: (document.querySelector('#czViewer .czs-pri') || {}).textContent || '' }));
77
- ok('P the summary line is the next milestone (Waits on you counts itself in its row, said once); no primary while every task has a level', /^Next: Pilot live/.test(sm.line) && sm.pri === '', JSON.stringify(sm));
79
+ const sm = await p.evaluate(() => ({ line: (document.querySelector('#czViewer .pv-line') || {}).textContent || '', pri: (document.querySelector('#czViewer .czs-pri') || {}).textContent || '' }));
80
+ ok('P the ✦ line leads with the next milestone and says what waits on you once; no sort primary while every task has a level', /Next: Pilot live/.test(sm.line) && /One thing waits on you/.test(sm.line) && sm.pri === '', JSON.stringify(sm));
78
81
  const g = await p.evaluate(() => ({ per: document.querySelector('#czViewer .pp-per').textContent.trim(), krs: [...document.querySelectorAll('#czViewer .pp-goal .pp-kr:not(.ghost) b')].map((b) => b.textContent) }));
79
82
  ok('G the goals are the KRs its initiatives anchor to, once each, for the current half', g.per === 'H2 2026' && g.krs.slice().sort().join() === 'KR 1.2,KR 2.1,KR 2.3', JSON.stringify(g));
80
83
  const gn = await until(() => p.evaluate(() => { const c = [...document.querySelectorAll('#czViewer .pp-goal .pp-kr:not(.ghost)')].map((k) => ({ kr: k.querySelector('b').textContent, text: k.textContent, dot: k.querySelector('.pp-gd') ? (k.querySelector('.pp-gd.off') ? 'off' : 'ok') : '', label: k.getAttribute('aria-label') || '' })); return c.length && c.every((x) => x.dot) ? c : null; }));
@@ -83,40 +86,40 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
83
86
  && /KR 2\.1Sign-in success 99\.5%$/.test(kr('KR 2.1').text) && /Retire legacy IdP$/.test(kr('KR 2.3').text) && /Microsite conversion \+8%$/.test(kr('KR 1.2').text)
84
87
  && kr('KR 1.2').dot === 'ok' && /, met$/.test(kr('KR 1.2').label) && kr('KR 2.1').dot === 'ok' && /on course$/.test(kr('KR 2.1').label) && kr('KR 2.3').dot === 'off' && /behind$/.test(kr('KR 2.3').label), JSON.stringify(gn));
85
88
  const mt = await p.evaluate(() => { const t = document.querySelector('#czViewer .pp-mt'); return { caps: [...t.querySelectorAll('.pp-cap')].map((c) => c.textContent.trim()), ms: [...t.querySelectorAll('.pp-m b')].map((b) => b.textContent), next: (t.querySelector('.pp-dm.n') || {}).parentElement && t.querySelector('.pp-dm.n').parentElement.querySelector('b').textContent, rd: (t.querySelector('.pp-rd') || {}).getAttribute && t.querySelector('.pp-rd').getAttribute('aria-label') }; });
86
- ok('M the track shows 3 milestones between a done cluster and an "N more" cluster; the next one is marked and counts its initiatives', mt.caps.join('|') === '1 done|4 more' && mt.ms.join('|') === 'Charter approved|Pilot live|Pilot users invited' && mt.next === 'Pilot live' && mt.rd === '0 of 2 initiatives ready', JSON.stringify(mt));
87
- const rows = await until(() => p.evaluate(() => { const r = [...document.querySelectorAll('#czViewer .czs-row')].map((b) => b.querySelector('b').textContent + ':' + ((b.querySelector('.czs-n') || {}).textContent || '')); return r.length >= 7 ? r : null; }));
88
- ok('P the tabs are folding rows: Waits on you, On the program, On its initiatives, On their epics, Initiatives, Milestones, Documents, each with its count', !!rows && /^Waits on you:1\|On the program:2\|On its initiatives:\d+\|On their epics:\d+\|Initiatives:3\|Milestones:8\|Documents:\d+$/.test(rows.join('|')), JSON.stringify(rows));
89
+ ok('M the goal card\'s track shows 3 milestones between a done cluster and an "N more" cluster; the next one is marked and counts its initiatives', mt.caps.join('|') === '1 done|4 more' && mt.ms.join('|') === 'Charter approved|Pilot live|Pilot users invited' && mt.next === 'Pilot live' && mt.rd === '0 of 2 initiatives ready', JSON.stringify(mt));
90
+ const tn = await p.evaluate(() => [...document.querySelectorAll('#czViewer [data-pv="tab"]')].map((t) => t.dataset.k + ':' + ((t.querySelector('.pv-n') || {}).textContent || '')));
91
+ ok('P each tab counts what it holds, and zero is silence: Tasks 7, Initiatives 3, Reports, Documents', tn.join('|') === 'tasks:7|initiatives:3|reports:|documents:1', JSON.stringify(tn));
89
92
  await p.click('#czViewer .pp-cap:not(.dn)');
90
- const ml = await until(() => p.evaluate(() => { const l = document.querySelector('#czViewer [data-czs-id="ms"] .pp-ml'); return l && !l.closest('[hidden]') ? { groups: [...l.querySelectorAll('.pp-mg')].map((x) => x.textContent.trim()), check: [...l.querySelectorAll('.pp-mr')].filter((x) => /A program check/.test(x.textContent)).map((x) => x.querySelector('b').textContent) } : null; }));
91
- ok('M "N more" opens the Milestones row: Done, Next and Later, and a milestone with no initiative is a program check', !!ml && ml.groups.join('|') === 'Done · 2|Next · 1|Later · 5' && ml.check.join() === 'Support ready,Program review', JSON.stringify(ml));
93
+ const ml = await until(() => p.evaluate(() => { const l = document.querySelector('#czViewer .pv-gc .pp-ml'); return l ? { groups: [...l.querySelectorAll('.pp-mg')].map((x) => x.textContent.trim()), check: [...l.querySelectorAll('.pp-mr')].filter((x) => /A program check/.test(x.textContent)).map((x) => x.querySelector('b').textContent) } : null; }));
94
+ ok('M "N more" opens every milestone in the goal card: Done, Next and Later, and a milestone with no initiative is a program check', !!ml && ml.groups.join('|') === 'Done · 2|Next · 1|Later · 5' && ml.check.join() === 'Support ready,Program review', JSON.stringify(ml));
92
95
  await p.click('#czViewer .pp-mr button.pp-dm[data-ms="support-ready"]');
93
96
  const ck = await until(() => D.posts.find((x) => x.path === '/api/programs/check'));
94
97
  ok('X a program check\'s diamond marks it done (POST /api/programs/check)', !!ck && ck.body.program === 'project-ascent' && ck.body.milestone === 'support-ready' && ck.body.done === true, JSON.stringify(ck));
95
- const nr = await p.evaluate(() => [...document.querySelectorAll('#czViewer .pp-needs .pp-nr')].map((a) => ({ t: a.querySelector('b').textContent, href: a.getAttribute('href'), box: !!a.querySelector('.pp-ck'), sub: a.querySelector('.t span').textContent })));
96
- ok('W waits on you lists your program task as a check box, and it opens in Home at that item; Dara\'s task is not yours', nr.length === 1 && nr[0].t === 'Sign the CIAM vendor order form' && nr[0].box && /^\/premium\.html\?/.test(nr[0].href) && /item=pt%3Aproject-ascent%3Apt-vendor-form/.test(nr[0].href) && /^On the program · /.test(nr[0].sub), JSON.stringify(nr));
97
- const tr = await until(() => p.evaluate(() => { const t = document.querySelector('#czViewer [data-czs-id="tree"] .pp-tree[role="tree"]'); if (!t || /reading its board|not read/.test(t.textContent)) return null; return { rows: [...t.querySelectorAll('.pp-nd.ini .x, .pp-nd.prd2')].map((x) => (x.classList.contains('prd2') ? x.lastChild.textContent : x.textContent).trim()), here: [...t.querySelectorAll('button.pp-open')].map((b) => b.textContent), away: [...t.querySelectorAll('a.pp-open')].map((a) => a.getAttribute('href')) }; }));
98
- ok('T Initiatives lists each product with its initiatives; the other product\'s initiative is read from its own board and links there', !!tr && tr.rows[0] === 'IDPF' && tr.rows.indexOf('Microsites') > tr.rows.indexOf('IDPF') && tr.rows.includes('Microsite sign-in on CIAM') && tr.here.length === 2 && tr.away.length === 1 && /ws=microsites&focus=microsite-signin/.test(tr.away[0]), JSON.stringify(tr));
99
- const tk = await until(() => p.evaluate(() => { const one = (k) => { const s = document.querySelector(`#czViewer [data-czs-id="${k}"]`); return s ? { n: (s.querySelector('.czs-n') || {}).textContent || '', rows: [...s.querySelectorAll('a.pp-tk')].map((a) => ({ t: a.querySelector('.x').textContent, href: a.getAttribute('href') })) } : null; };
98
+ const tr = await until(() => p.evaluate(() => { const t = document.querySelector('#czViewer #pvp .pp-tree[role="tree"]'); if (!t || /reading its board|not read/.test(t.textContent)) return null; return { rows: [...t.querySelectorAll('.pp-nd.ini .x, .pp-nd.prd2')].map((x) => (x.classList.contains('prd2') ? x.lastChild.textContent : x.textContent).trim()), here: [...t.querySelectorAll('button.pp-open')].map((b) => b.textContent), away: [...t.querySelectorAll('a.pp-open')].map((a) => a.getAttribute('href')) }; }));
99
+ ok('T the Initiatives tab lists each product with its initiatives; the other product\'s initiative is read from its own board and links there', !!tr && tr.rows[0] === 'IDPF' && tr.rows.indexOf('Microsites') > tr.rows.indexOf('IDPF') && tr.rows.includes('Microsite sign-in on CIAM') && tr.here.length === 2 && tr.away.length === 1 && /ws=microsites&focus=microsite-signin/.test(tr.away[0]), JSON.stringify(tr));
100
+ await tab(p, 'tasks');
101
+ const nr = await until(() => p.evaluate(() => { const L = [...document.querySelectorAll('#czViewer .pp-needs .pp-nr')]; return L.length ? L.map((a) => ({ t: a.querySelector('b').textContent, href: a.getAttribute('href'), box: !!a.querySelector('.pp-ck'), sub: a.querySelector('.t span').textContent })) : null; }), 4000) || [];
102
+ ok('W the Tasks tab leads with what waits on you: your program task as a check box, opening in Home at that item; Dara\'s task is not yours', nr.length === 1 && nr[0].t === 'Sign the CIAM vendor order form' && nr[0].box && /^\/premium\.html\?/.test(nr[0].href) && /item=pt%3Aproject-ascent%3Apt-vendor-form/.test(nr[0].href) && /^On the program · /.test(nr[0].sub), JSON.stringify(nr));
103
+ const tk = await until(() => p.evaluate(() => { const one = (k) => { const s = document.querySelector(`#czViewer [data-czs-id="${k}"]`); return s ? { n: (s.querySelector('.czs-n') || {}).textContent || '' } : null; };
100
104
  const i = one('itasks'), e = one('etasks'); return i && e ? { i, e, sort: !!(document.querySelector('#czViewer .czs-pri') || {}).textContent } : null; }));
101
- if (tk) { await fold(p, 'itasks'); await fold(p, 'etasks'); }
105
+ if (tk) { if (!(await isOpen(p, 'itasks'))) await fold(p, 'itasks'); if (!(await isOpen(p, 'etasks'))) await fold(p, 'etasks'); }
102
106
  const tk2 = await p.evaluate(() => [...document.querySelectorAll('#czViewer [data-czs-id="itasks"] a.pp-tk, #czViewer [data-czs-id="etasks"] a.pp-tk')].map((a) => ({ t: a.querySelector('.x').textContent, href: a.getAttribute('href') })));
103
- ok('K every open task of its initiatives has a row by level, On its initiatives and On their epics (with On the program, 7); an initiative\'s task opens in Home; no sort primary without Turn into a program', !!tk && +tk.i.n + +tk.e.n === 5
107
+ ok('K every open task of its initiatives has a row by level, On its initiatives and On their epics; an initiative\'s task opens in Home; no sort primary without Turn into a program', !!tk && +tk.i.n + +tk.e.n === 5
104
108
  && tk2.length === 5 && tk2.some((x) => x.t === 'Pick the sign-in widget') && !tk2.some((x) => /Not in the program|Read the Descope docs/.test(x.t)) && /^\/premium\.html\?ws=idpf&ini=legacy-idp-sunset$/.test((tk2.find((x) => x.t === 'Draft the cutover plan') || {}).href) && !tk.sort, JSON.stringify({ tk, tk2 }));
105
- await fold(p, 'itasks'); await fold(p, 'etasks');
106
- await fold(p, 'tree');
107
- ok('F a row folds', await until(() => p.evaluate(() => document.querySelector('#czViewer [data-czs-fold="tree"]').getAttribute('aria-expanded') === 'false')));
109
+ await fold(p, 'etasks');
110
+ ok('F a row folds', await until(async () => !(await isOpen(p, 'etasks'))));
108
111
  await p.click('#czViewer [data-cz-vw="close"]');
109
112
  ok('P Close closes the Viewer', await until(() => p.evaluate(() => document.querySelector('#czViewer').hidden)));
110
113
  ok('P Close takes the program out of the address (batch 14 item 7: the address follows the Viewer)', !new URL(p.url()).searchParams.get('program'), p.url());
111
114
  await p.goto(BASE + '/premium-board.html?ws=idpf&program=project-ascent'); // the program's own link again
112
115
  await shown(p);
113
- ok('F the folds are kept after a reload', await until(async () => !(await isOpen(p, 'tree')) && await isOpen(p, 'ms')));
114
- await fold(p, 'tasks');
116
+ ok('F the last tab and the folds are kept after a reload', await until(async () => (await p.evaluate(() => { const t = document.querySelector('#czViewer [data-pv="tab"][aria-selected="true"]'); return t && t.dataset.k === 'tasks'; })) && !(await isOpen(p, 'etasks')) && await isOpen(p, 'itasks')));
117
+ if (!(await isOpen(p, 'tasks'))) await fold(p, 'tasks');
115
118
  await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-pp="done"][data-key="pt-vendor-form"]')));
116
119
  await p.click('#czViewer [data-pp="done"][data-key="pt-vendor-form"]');
117
120
  const dn = await until(() => D.posts.find((x) => x.path === '/api/programs/task-done'));
118
121
  ok('X a program task\'s check box marks it done (POST /api/programs/task-done)', !!dn && dn.body.key === 'pt-vendor-form' && dn.body.done === true && dn.body.program === 'project-ascent', JSON.stringify(dn));
119
- await fold(p, 'tree');
122
+ await tab(p, 'initiatives');
120
123
  await until(() => p.evaluate(() => !!document.querySelector('#czViewer button.pp-open[data-ini="descope-parity"]')));
121
124
  await p.click('#czViewer button.pp-open[data-ini="descope-parity"]');
122
125
  const ip = await until(() => p.evaluate(() => { const v = document.querySelector('#czViewer'); if (!v || v.hidden || !/Initiative/.test(v.getAttribute('aria-label') || '')) return null; return { t: v.querySelector('.cz-vw-title').textContent, peek: !document.querySelector('#peek'), stg: +((/^Stage \d+ of (\d+)/.exec(((v.querySelector('.iv-tel') || { getAttribute: () => '' }).getAttribute('aria-label')) || '') || [])[1] || 0) }; }));
@@ -137,8 +140,8 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
137
140
  /* ── Turn into a program: the sort card counts the tasks of the initiative it came from that have no level, and sorting starts in Home ── */
138
141
  const U = await open({ programs: F.programs().map((x) => ({ ...x, from: 'legacy-idp-sunset' })) });
139
142
  await shown(U.page);
140
- const so = await until(() => U.page.evaluate(() => { const c = document.querySelector('#czViewer a.czs-pri'); return c ? { t: (document.querySelector('#czViewer .czs-p') || {}).textContent || '', label: c.textContent, href: c.getAttribute('href') } : null; }));
141
- ok('K after Turn into a program the summary counts the tasks from before the split (not the one already on an epic), and its primary opens the sorting in Home', !!so && /^2 tasks from before the split have no level yet\./.test(so.t) && so.label === 'Review the suggested homes' && /^\/premium\.html\?ws=idpf&ask=program%3Aproject-ascent&q=/.test(so.href), JSON.stringify(so));
143
+ const so = await until(() => U.page.evaluate(() => { const c = document.querySelector('#czViewer .pv a.czs-pri'); return c ? { t: (c.closest('.pv-card').querySelector('.czs-p') || {}).textContent || '', label: c.textContent, href: c.getAttribute('href') } : null; }));
144
+ ok('K after Turn into a program a card on the page counts the tasks from before the split (not the one already on an epic), and its primary opens the sorting in Home', !!so && /^2 tasks from before the split have no level yet\./.test(so.t) && so.label === 'Review the suggested homes' && /^\/premium\.html\?ws=idpf&ask=program%3Aproject-ascent&q=/.test(so.href), JSON.stringify(so));
142
145
  ok('0 no page error after Turn into a program', U.errors.length === 0, U.errors.join(' | '));
143
146
  await U.ctx.close();
144
147