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.
Files changed (87) hide show
  1. package/package.json +25 -25
  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/adler-seasons-art-test.js +106 -0
  7. package/workspace/adler-seasons-test.js +111 -0
  8. package/workspace/briefing-premium-board-test.js +19 -17
  9. package/workspace/briefing-premium-initiative-test.js +7 -4
  10. package/workspace/changelog.json +24 -0
  11. package/workspace/goals-clear-ui-test.js +249 -0
  12. package/workspace/guide/adler.md +10 -0
  13. package/workspace/guide/home.md +8 -1
  14. package/workspace/guide/metric-drafts.md +8 -2
  15. package/workspace/home-railcard-test.js +193 -0
  16. package/workspace/ini-workflow-test.js +6 -2
  17. package/workspace/intelligence-gaps-ui-test.js +16 -14
  18. package/workspace/lib/engine/records/index.js +9 -2
  19. package/workspace/lib/initiative-layout.js +3 -1
  20. package/workspace/lib/insights-premium.js +22 -1
  21. package/workspace/lib/metric-drafts.js +37 -10
  22. package/workspace/lib/metric-read-runs.js +20 -13
  23. package/workspace/lib/metric-reads.js +208 -23
  24. package/workspace/lib/metrics-cli.js +62 -5
  25. package/workspace/lib/routes-goal-status.js +89 -6
  26. package/workspace/lib/routes-insights-premium.js +1 -1
  27. package/workspace/lib/routes-metric-drafts.js +26 -3
  28. package/workspace/lib/settings-store.js +38 -0
  29. package/workspace/metric-drafts-ui-test.js +7 -4
  30. package/workspace/okr-goals-ui-test.js +7 -5
  31. package/workspace/package-lock.json +2 -2
  32. package/workspace/package.json +1 -1
  33. package/workspace/premium-board-actions-test.js +2 -1
  34. package/workspace/premium-chat-attach-test.js +2 -0
  35. package/workspace/program-panel-test.js +1 -1
  36. package/workspace/public/pm/bd-ini-panel.js +2 -2
  37. package/workspace/public/pm/c3-ini-ui.js +1 -1
  38. package/workspace/public/pm/cozy-adler.css +21 -0
  39. package/workspace/public/pm/cozy-adler.js +415 -8
  40. package/workspace/public/pm/cozy-ev.css +16 -1
  41. package/workspace/public/pm/cozy-home.css +8 -0
  42. package/workspace/public/pm/cozy-insights.css +82 -0
  43. package/workspace/public/pm/cozy-live-pill.css +5 -0
  44. package/workspace/public/pm/cozy-news.js +1 -1
  45. package/workspace/public/pm/cozy-seasons.js +318 -0
  46. package/workspace/public/pm/cozy-settings.js +88 -5
  47. package/workspace/public/pm/cozy-today.css +15 -0
  48. package/workspace/public/pm/cozy-viewer.js +50 -18
  49. package/workspace/public/pm/cozy-vw-shell.css +4 -0
  50. package/workspace/public/pm/cozy.css +65 -0
  51. package/workspace/public/pm/dash-view.js +4 -2
  52. package/workspace/public/pm/goals-clear.js +258 -0
  53. package/workspace/public/pm/home-app.js +59 -5
  54. package/workspace/public/pm/home-chat.js +1 -1
  55. package/workspace/public/pm/home-day.js +7 -4
  56. package/workspace/public/pm/home-ini.js +2 -2
  57. package/workspace/public/pm/home-mentions.js +1 -1
  58. package/workspace/public/pm/home-today.js +51 -10
  59. package/workspace/public/pm/impact.js +1 -1
  60. package/workspace/public/pm/ini-groups.js +28 -17
  61. package/workspace/public/pm/ini-links.js +1 -1
  62. package/workspace/public/pm/ini-tasks.js +246 -48
  63. package/workspace/public/pm/ini-view-model.js +45 -16
  64. package/workspace/public/pm/ini-view.css +330 -1
  65. package/workspace/public/pm/ini-view.js +196 -83
  66. package/workspace/public/pm/metric-drafts.js +4 -1
  67. package/workspace/public/pm/mission.js +238 -0
  68. package/workspace/public/pm/premium-board.js +1 -1
  69. package/workspace/public/pm/premium-insights.js +178 -24
  70. package/workspace/public/pm/premium-welcome.js +2 -2
  71. package/workspace/public/pm/split-merge.js +1 -1
  72. package/workspace/public/pm/stage-line.js +2 -2
  73. package/workspace/server.js +6 -2
  74. package/workspace/skills/metric-read.skill +7 -5
  75. package/workspace/split-merge-ui-test.js +1 -1
  76. package/workspace/stage-card-test.js +56 -11
  77. package/workspace/task-links-test.js +2 -0
  78. package/workspace/task-milestones-test.js +5 -1
  79. package/workspace/task-plans-test.js +3 -3
  80. package/workspace/task-views-test.js +279 -37
  81. package/workspace/test-lists/adler-seasons-art.json +13 -0
  82. package/workspace/test-lists/batch18-adler-seasons.json +13 -0
  83. package/workspace/test-lists/goals-clear.json +15 -0
  84. package/workspace/test-lists/home-railcard.json +9 -0
  85. package/workspace/test-lists/mission.json +5 -0
  86. package/workspace/test-lists/viewer-tasks.json +5 -0
  87. package/workspace/tk-tasks-test.js +27 -32
@@ -100,7 +100,7 @@ const err = () => (S.error ? `<p class="wl-err" role="alert">${esc(S.error)}</p>
100
100
  function viewAbout() {
101
101
  const a = S.about;
102
102
  const f = (k, text, hint, max) => `<label>${text}<input data-f="${k}" maxlength="${max}" value="${esc(a[k])}" placeholder="${esc(hint)}" autocomplete="off"></label>`;
103
- return `<div class="wl-ad">${adlerScene('morning', 'needs-you', { label: 'Adler says hello' })}</div>${adPrefs()['adler.amount'] === 'off' ? '' : '<p class="wl-hi">Hi, I’m Adler. I do the boring bits, so you get the calls only you can make.</p>'}<h1 id="wlH" tabindex="-1">Welcome to PMOS</h1><p class="wl-lede">Tell PMOS who you are, so your Briefing knows what matters to you. Every field is optional, and you can change them later in the console's Settings.</p>
103
+ return `<div class="wl-ad">${adlerScene('morning', 'needs-you', { label: 'Adler says hello', dress: true })}</div>${adPrefs()['adler.amount'] === 'off' ? '' : '<p class="wl-hi">Hi, I’m Adler. I do the boring bits, so you get the calls only you can make.</p>'}<h1 id="wlH" tabindex="-1">Welcome to PMOS</h1><p class="wl-lede">Tell PMOS who you are, so your Briefing knows what matters to you. Every field is optional, and you can change them later in the console's Settings.</p>
104
104
  <div class="wl-f">${f('name', 'Your name', 'For example: Dana', 40)}${f('role', 'Your role', 'For example: Senior PM, Payments', 80)}${f('work', 'What you do', 'In one line, for example: I run checkout and the payment methods', 200)}
105
105
  <label>Your job description<textarea data-f="duties" maxlength="1000" placeholder="What you own, decide and deliver. Paste it from your job description if you have one.">${esc(a.duties)}</textarea></label></div>${err()}`
106
106
  + foot('', btn('about', 'Continue', { busy: 'about', busyText: 'Saving' }));
@@ -116,7 +116,7 @@ function viewSources() {
116
116
  const rows = [`<li class="wl-row"><span class="wl-ic">${I.folder}</span><span><b>${esc(f.name || 'This folder')}</b><span class="path">${esc(f.root)}</span></span><span class="chip">this folder</span></li>`]
117
117
  .concat(S.added.map((a) => `<li class="wl-row"><span class="wl-ic">${I.folder}</span><span><b>${esc(a.name)}</b><span class="path">${esc(a.root)}</span></span><span></span></li>`)).join('');
118
118
  if (S.busy === 'scan') {
119
- return `<div class="wl-ad">${adlerScene('think', 'thinking', { label: false })}</div><h1 id="wlH" tabindex="-1">Reading ${esc(f.name || 'your folder')}</h1><p class="wl-lede">A large folder can take a minute or two. The rest of PMOS keeps working.</p>
119
+ return `<div class="wl-ad">${adlerScene('think', 'thinking', { label: false, dress: true })}</div><h1 id="wlH" tabindex="-1">Reading ${esc(f.name || 'your folder')}</h1><p class="wl-lede">A large folder can take a minute or two. The rest of PMOS keeps working.</p>
120
120
  <div class="wl-scan" role="status"><div>${spin('Starting the tools you ticked, then reading the folder')}</div></div>`;
121
121
  }
122
122
  return `<h1 id="wlH" tabindex="-1">Where does your work live?</h1><p class="wl-lede">PMOS reads your folders and the tools you tick, then shows you your initiatives, your documents and what needs you first.</p>
@@ -32,7 +32,7 @@ export const ICON = {
32
32
  merge: 'M5 4v3a5 5 0 0 0 5 5h9M5 20v-3a5 5 0 0 1 5-5M16 9l3 3-3 3',
33
33
  stay: 'M5 12l5 5 9-10',
34
34
  x: 'M6 6l12 12M18 6L6 18', edit: 'M4 20h4L19 9l-4-4L4 16zM14 6l4 4', ok: 'M5 12.5l4.5 4.5L19 7.5',
35
- swap: 'M7 4L3 8l4 4M3 8h14M17 20l4-4-4-4M21 16H7', down: 'M7 10l5 5 5-5', jira: 'M12 3l9 9-9 9-9-9z', doc: 'M7 3h7l5 5v13H7zM14 3v5h5', task: 'M5 5h14v14H5z',
35
+ swap: 'M7 4L3 8l4 4M3 8h14M17 20l4-4-4-4M21 16H7', down: 'M7 10l5 5 5-5', jira: 'M4 7h16v3a2 2 0 0 0 0 4v3H4v-3a2 2 0 0 0 0-4z', doc: 'M7 3h7l5 5v13H7zM14 3v5h5', task: 'M5 5h14v14H5z',
36
36
  };
37
37
  const plural = (n, one, many) => n + ' ' + (n === 1 ? one : many);
38
38
  /** "3 tasks · 1 ticket · 1 doc": zero is silence. */
@@ -235,12 +235,12 @@ export function lineOf(r, o = {}) {
235
235
  const clash = openHold && openHold.kind === 'open' && E && openHold.b > E ? md(openHold.b, t) : '';
236
236
  const L = MS.filter((m) => !endTask || m.id !== endTask.id);
237
237
  const reach = Math.max(1, Math.round(((D1 - D0) / DAY) * (NEAR / 100)));
238
- const C = mergeClose(L.map((m) => ({ ...m })), reach).map((c) => ({ x: X(day(c.date)), n: c.n, items: c.items.map((m) => ({ id: m.id, name: m.name, date: md(m.d, t), done: m.done, late: m.late, ago: m.ago })),
238
+ const C = mergeClose(L.map((m) => ({ ...m })), reach).map((c) => ({ x: X(day(c.date)), n: c.n, items: c.items.map((m) => ({ id: m.id, name: m.name, date: md(m.d, t), done: m.done, late: m.late, ago: m.ago, left: !m.done && m.d >= t ? days(t, m.d) : 0 })),
239
239
  name: c.n > 1 ? plural(c.n, 'milestone', 'milestones') : c.first.name, date: md(day(c.date), t), done: c.done, late: c.late, dash: !!draft }));
240
240
  const ms = C.slice();
241
241
  if (E && !draft) {
242
242
  const ED = endTask ? endTask.d : E;
243
- ms.push({ x: X(ED), n: 1, end: true, atEnd: +ED === +E, items: endTask ? [{ id: endTask.id, name: endTask.name, date: md(ED, t), done: endTask.done, late: endTask.late, ago: endTask.ago }] : [],
243
+ ms.push({ x: X(ED), n: 1, end: true, atEnd: +ED === +E, items: endTask ? [{ id: endTask.id, name: endTask.name, date: md(ED, t), done: endTask.done, late: endTask.late, ago: endTask.ago, left: !endTask.done && ED >= t ? days(t, ED) : 0 }] : [],
244
244
  name: endTask ? endTask.name : '', date: md(ED, t), done: finished || !!(endTask && endTask.done), late: !finished && (over || !!clash || !!(endTask && endTask.late)) });
245
245
  } else if (draft && E) ms.push({ x: X(E), n: 1, end: true, items: [], name: '', date: md(E, t), done: false, late: false, dash: true });
246
246
  ms.sort((p, q) => p.x - q.x);
@@ -2970,6 +2970,8 @@ const impactTick = () => { try { impactRuns.tick({}); } catch (e) { warnWriteFai
2970
2970
  // the goal's notify is push. At most 2 runs at once, one per product. PMOS_METRIC_READ=off.
2971
2971
  const krMetricsOf = (w) => require(require('./lib/repo-script.js').repoScript('records/index.js')).list(require('./lib/records-dir.js').recordsDirFor(metricDraftCtx(), w.id), 'kr-metrics');
2972
2972
  const goalAlertTell = (w, rec, reading) => tellNeed(w.id, 'goal-alert-' + rec.rid + '-' + reading.at, String(rec.metric || rec.rid), String(rec.metric || rec.rid) + ' broke its limit: ' + reading.txt + ' against its ' + reading.line + ' on ' + reading.at + '. The rollback ticket is drafted on Intelligence.');
2973
+ /** The working hours an hourly goal is read in: the day-check window of Settings (batch 18 item 11). */
2974
+ const metricReadHours = () => { try { const dc = proSettings().dayCheck || {}; return dc.start && dc.end ? { start: dc.start, end: dc.end } : undefined; } catch { return undefined; } };
2973
2975
  const metricReadRuns = require('./lib/metric-read-runs.js').create({
2974
2976
  workspaces: () => [...workspaces.values()],
2975
2977
  isLead: (w) => isPlanNeedsTree(w),
@@ -2980,10 +2982,12 @@ const metricReadRuns = require('./lib/metric-read-runs.js').create({
2980
2982
  testItems: (w, rids) => {
2981
2983
  const d = stateDirFor(w); if (!d) return [];
2982
2984
  const MDx = require('./lib/metric-drafts.js'), S = MDx.read(d).scopes.get(MDx.keyOf('product', w.id));
2983
- return (rids || []).map((id) => S && S.rows.get(id)).filter((r) => r && r.recipe).map((r) => ({ rid: r.id, title: (r.metric && r.metric.name) || r.text, unit: (r.metric && r.metric.unit) || '', recipe: r.recipe }));
2985
+ return (rids || []).map((id) => S && S.rows.get(id)).filter((r) => r && r.recipe).map((r) => ({ rid: r.id, title: (r.metric && r.metric.name) || r.name || r.text, unit: (r.metric && r.metric.unit) || r.unit || '', recipe: r.recipe }));
2984
2986
  },
2985
2987
  afterRead: (w, rids, now) => require('./lib/routes-goal-status.js').afterRead({ getWs, stateDirFor, workspaceList: () => [...workspaces.values()], runtimeDir: STATE, tellGoalAlert: goalAlertTell }, w, rids, now),
2986
2988
  open: deepOpenNow, // batch 18 item 9: deep work runs at night or when the PM is idle (lib/driver-run.js deepOpen)
2989
+ workOpen: (now) => require('./lib/driver-run.js').dayCheckOpen(proSettings(), now, (n, q) => proactiveLib.inQuietHours(n, q)), // batch 18 item 11: hourly goals
2990
+ hours: () => metricReadHours(),
2987
2991
  headlessOff: () => headlessLib.switchedOff(process.env),
2988
2992
  env: process.env,
2989
2993
  promptFor: (skillId) => { const h = homeWorkspace(); const t = taskById(skillId, h ? h.root : SELF_ROOT); return t && t.prompt ? t.prompt : null; },
@@ -10289,7 +10293,7 @@ async function handleRequest(req, res) {
10289
10293
  // pm-os-absorb Runs 2–5 — the planning layer's routes, one file per run (lib/route-modules.js). Last, so none shadows a route above.
10290
10294
  // meeting-notes Run 1: the Notes routes keep notes in the per-user runtime directory and start the agent-summary session.
10291
10295
  if (req.method === 'POST' && !(req.headers && req.headers['x-pmos-session'])) orchGate.touch(); // agent-orchestrator: a page press by the PM
10292
- if (await routeModules.dispatch(req, res, url, { orchestrator: { gate: orchGate, running: () => orchSpawn.running(), health: orchHealth, keepRate: orchKeepRate }, proposalRuns, metricDraftRuns, metricReadRuns, tellGoalAlert: goalAlertTell, json, readBody, getWs, invalidateNeedsAgg, boardCache, consoleState, stateDirFor, sessionList, initiativeIndex,
10296
+ if (await routeModules.dispatch(req, res, url, { orchestrator: { gate: orchGate, running: () => orchSpawn.running(), health: orchHealth, keepRate: orchKeepRate }, proposalRuns, metricDraftRuns, metricReadRuns, metricReadHours, tellGoalAlert: goalAlertTell, json, readBody, getWs, invalidateNeedsAgg, boardCache, consoleState, stateDirFor, sessionList, initiativeIndex,
10293
10297
  runtimeDir: STATE, homeRoot: HOME_ENABLED ? SELF_ROOT : null, spawnSession, jevModelOpts, sendToSession, endSupersededRuns, proSettings,
10294
10298
  // premium-chat-session: every premium chat panel is an interactive Claude Code session the PM talks to (text as typed, `/` kept)
10295
10299
  chatSessions,
@@ -22,11 +22,13 @@ Rules that always hold:
22
22
 
23
23
  Procedure:
24
24
  1. Run `pmos metrics reading list` to see the goals of this run.
25
- 2. For each goal, read its recipe's query through its connector. Take the value for the latest complete period of its cadence (yesterday for daily, last week for weekly, last month for monthly).
26
- 3. File it: `pmos metrics reading <rid> <value> --source "<connector> · <what you read, one line>" [--day YYYY-MM-DD]`. --day is the last day of the period the value counts, when it is not today.
27
- 4. A goal you cannot read: `pmos metrics reading <rid> --cant "<why, one line>"` with its fix (rule 6).
28
- 5. Stop when every goal of the run is read or said.
25
+ 2. For each goal, read its recipe's query through its connector. Take the value for the latest complete period of its cadence (the last full hour for hourly, yesterday for daily, last week for weekly, last month for monthly).
26
+ 3. File it: `pmos metrics reading <rid> <value> --source "<connector> · <what you read, one line>" [--day YYYY-MM-DD] [--num N --den D] [--segments "<part>=<num>/<den>,…"] [--period "<week of 19 Oct>"]`. --day is the last day of the period the value counts, when it is not today. When the goal is a rate, give its two counts with --num and --den, and its parts (for example web and app) with --segments when the source splits them. A goal that says how it is counted ("counted as") is read exactly that way.
27
+ 4. PMOS checks every value before it is drawn (a part that reads 0, a jump of more than 3 times, too small a count, a value it cannot be). A value a check fails on is HELD: it is said, not drawn. File the value the source gives anyway; never change it to pass a check.
28
+ 5. A goal you cannot read: `pmos metrics reading <rid> --cant "<why, one line>"` with its fix (rule 6).
29
+ 6. A COMPARE run (the line says the PM's number differs from yours): read the goal your way and the PM's likely way, find why they differ, and file once: `pmos metrics reading <rid> --why "<why, one or two sentences>" --suggest mine|yours --suggest-text "<which to keep and why, one line>" --yours-what "<how the PM counts it, one sentence>" --yours-query "<a query that counts it that way>"`. File no value in a compare run.
30
+ 7. Stop when every goal of the run is read or said.
29
31
 
30
32
  Output contract: produce EXACTLY these sections in your final message:
31
- - Read (each goal, its value and its source)
33
+ - Read (each goal, its value and its source; say a held value as held)
32
34
  - Not read (each goal you could not read, why, and the fix you drafted)
@@ -89,7 +89,7 @@ const shot = (p, name) => (SHOTS ? p.screenshot({ path: path.join(SHOTS, name) }
89
89
  if (!(await p.evaluate(() => !!document.querySelector('#ibBody .sm-dot')))) return finish(1);
90
90
  const key = await p.evaluate(() => { const d = document.querySelector('#ibBody .sm-dot'); const b = d && d.closest('[data-key]'); return b ? b.dataset.key : null; });
91
91
  await p.click(`#ibBody [data-key="${key}"]`);
92
- const card = await until(() => p.evaluate(() => { const c = document.querySelector('#czViewer .sm-card'); return c ? { title: c.querySelector('.sm-h b').textContent, btns: [...c.querySelectorAll('[data-sm]')].map((b) => b.getAttribute('aria-label')), after: !!(c.previousElementSibling && c.previousElementSibling.classList.contains('iv-sum')) } : null; }));
92
+ const card = await until(() => p.evaluate(() => { const c = document.querySelector('#czViewer .sm-card'); return c ? { title: c.querySelector('.sm-h b').textContent, btns: [...c.querySelectorAll('[data-sm]')].map((b) => b.getAttribute('aria-label')), after: !!c.closest('.iv-cl') && !!(c.previousElementSibling && c.previousElementSibling.classList.contains('iv-card')) } : null; }));
93
93
  ok('B the card under the summary: the spark title and ✕ Not now, ✎ Change it first, ✓ Split as suggested', card && /^Split off .+\?$/.test(card.title) && card.btns.join('|') === 'Not now|Change it first|Split as suggested' && card.after, JSON.stringify(card));
94
94
  await shot(p, 'board-suggest.png');
95
95
  await p.click('#czViewer [data-sm="edit"]');
@@ -119,27 +119,35 @@ async function pure() {
119
119
  };
120
120
  const V = '#czViewer [data-hi-v="page"]';
121
121
  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') }); };
122
- /* re-pointed (batch 11 item 21, the stage card as a timeline): the header says the stage, "N of M done", the day clock and → the next
123
- * stage; under it one line holds a part a stage (a press shows it in Tasks), the ◇ milestones and Today. The steps are said once, in Tasks */
122
+ /* re-pointed (batch 18 item 1, the card and the mission): the card's head names the stage; the mission draws a strip part a stage with the
123
+ * current one marked; a tap on the picture opens in place "N of M done", ⋯ (the stage picker) and → the next stage, then the stages and
124
+ * milestones with their dates. The steps are said once, in Tasks */
125
+ // the dates line shows when it is drawn: always on a desktop (Wawan 11:58), after the picture's tap on a phone
126
+ const miShown = (p) => p.evaluate((v) => { const m = document.querySelector(v + ' .iv-mio'); return !!m && getComputedStyle(m).display !== 'none'; }, V);
127
+ const openMi = async (p) => { if (!(await miShown(p))) await p.click(V + ' [data-iv-mi]', { position: { x: 8, y: 8 } }); await until(() => miShown(p)); };
124
128
  const card = (p) => p.evaluate((v) => {
125
129
  const c = document.querySelector(v + ' .iv-sc'); const t = (n) => (n ? n.textContent.replace(/\s+/g, ' ').trim() : '');
126
- const parts = [...c.querySelectorAll('.iv-tl .iv-tlp')], keys = [...new Set(parts.map((x) => x.dataset.ivStage))], go = c.querySelector('.iv-scgo');
127
- return { head: t(c.querySelector('.iv-sch')), stage: t(c.querySelector('.iv-sch > b, .iv-sch .iv-stc b')), chip: !!c.querySelector('.iv-sch [data-iv-stagepick]'), bars: keys.length + c.querySelectorAll('.iv-tl .iv-tl-sk').length, now: new Set(parts.filter((x) => x.classList.contains('now')).map((x) => x.dataset.ivStage)).size,
128
- titles: keys.map((k) => parts.find((x) => x.dataset.ivStage === k).title), steps: document.querySelectorAll(v + ' .cz-sl').length, pri: document.querySelectorAll(v + ' [data-iv-primary]').length,
129
- cta: !!document.querySelector(v + ' [data-hm-cta]'), ov: !!document.querySelector(v + ' [data-hm-ov]'), sw: !!c.querySelector('.hi-sw'), tail: go ? go.getAttribute('aria-label') : '', next: !!c.querySelector('[data-iv-next]'), ms: !!(go && go.dataset.ms), ready: !!(go && go.classList.contains('on')), clock: t(c.querySelector('.iv-clk')), late: !!c.querySelector('.iv-clk.w') };
130
+ const go = c.querySelector('.iv-scgo');
131
+ return { head: t(c.querySelector('.iv-sch')), stage: t(c.querySelector('.iv-sch > b, .iv-sch .iv-stc b')), chip: !!c.querySelector('.iv-sch [data-iv-stagepick]'),
132
+ bars: c.querySelectorAll('.mi-svg .mi-st, .mi-svg .mi-dsh').length, now: c.querySelectorAll('.mi-svg :is(.mi-st, .mi-dsh):is(.nw, .late, .hold)').length, more: !!c.querySelector('.iv-mio .iv-mo[data-iv-stagepick]'), stageRows: c.querySelectorAll('.iv-mio [data-iv-stage]').length,
133
+ steps: document.querySelectorAll(v + ' .cz-sl').length, pri: document.querySelectorAll(v + ' [data-iv-primary]').length,
134
+ cta: !!document.querySelector(v + ' [data-hm-cta]'), ov: !!document.querySelector(v + ' [data-hm-ov]'), sw: !!c.querySelector('.hi-sw'), tail: go ? go.getAttribute('aria-label') : '', next: !!c.querySelector('[data-iv-next]'), nextTxt: t(go), ms: !!(go && go.dataset.ms), ready: !!(go && go.classList.contains('on')) };
130
135
  }, V);
131
136
 
132
137
  /* D1 a desktop: the Build stage of the fixture (the contract waits for you, a Jira ticket open, Deliver next) */
133
138
  {
134
139
  const A = await open(), p = A.page;
135
140
  ok('D1 the initiative\'s page draws the one view\'s stage card', A.up);
141
+ const c0 = await card(p);
142
+ ok('D1 the header names the stage', c0.stage === 'Build', JSON.stringify(c0));
143
+ ok('D1 the mission\'s strip holds one part a stage of the workflow, the current one marked', c0.bars === 8 && c0.now === 1, JSON.stringify(c0));
144
+ ok('D1 the next stage waits in place until the picture is tapped while the Viewer is one column (one primary: the ask\'s)', !(await miShown(p)), JSON.stringify(c0));
145
+ await openMi(p);
136
146
  const c = await card(p);
137
- ok('D1 the header names the stage', c.stage === 'Build', JSON.stringify(c));
138
- ok('D1 the line holds one part a stage of the workflow, the current one marked', c.bars === 8 && c.now === 1, JSON.stringify(c));
139
- ok('D1 every part names its stage on hover (the current one says now)', c.titles.length >= 7 && c.titles.every(Boolean) && c.titles.some((x) => /^Build · .*now$/.test(x)), JSON.stringify(c.titles));
147
+ ok('D1 a tap on the picture opens in place: ⋯ for the stage and the next stage; no list of the stages, the picture shows them (Wawan 10:59)', c.more && c.stageRows === 0, JSON.stringify(c));
140
148
  ok('D1 the old CTA button, the C overview tile, the switch and the step list are gone from the card; at most one primary on the page', !c.cta && !c.ov && !c.sw && c.steps === 0 && c.pri <= 1, JSON.stringify(c));
141
149
  ok('D1 the → names ◆ Deliver, the next stage', c.next && /^Next: ◆ Deliver\. Move to Deliver$/.test(c.tail) && c.ms, c.tail);
142
- ok('D1 batch 14 item 11: the button shows the next stage\'s name with the → ("◆ Deliver"), not a bare arrow', /◆ Deliver$/.test(c.head), c.head);
150
+ ok('D1 batch 14 item 11: the button shows the next stage\'s name with the → ("◆ Deliver"), not a bare arrow', /◆ Deliver$/.test(c.nextTxt), c.nextTxt);
143
151
  await shot(p, 'desk-build', V + ' .iv-sc');
144
152
  // batch 16 item 5c (FmI2Stage): the stage's name is a chip; it opens every stage, the switch, then hold, Won't do and Archive (no Cancel)
145
153
  ok('D1 batch 16 item 5c: the stage is a chip that changes it', c.chip, JSON.stringify(c));
@@ -170,6 +178,41 @@ async function pure() {
170
178
  await A.ctx.close();
171
179
  }
172
180
 
181
+ /* D1b Wawan 10:53 (canvas v586): on a desktop wide enough for two columns the milestones are their own card under the card, always shown:
182
+ * "Milestones N of M done", a tick on each done one, the next one marked, the release said; a row opens its task */
183
+ {
184
+ const TASKS = [{ uid: 'b', title: 'Brief signed off', status: 'Done', end: '2026-07-20', milestone: true, section: 'discover' }, { uid: 'w', title: 'Build the flow', status: 'In progress', start: '2026-09-01', end: '2026-11-20', section: 'build' },
185
+ { uid: 'r', title: 'Rollout to all workspaces', status: 'To do', end: '2026-12-01', milestone: true, section: 'deliver' }, { uid: 'e', title: 'Did it work?', status: 'To do', end: '2027-02-01', milestone: true, section: 'evaluate' }];
186
+ const f = BF.facts(); f.rows = f.rows.map((r) => (r.id === 'self-serve-v2' ? { ...r, stage: 'Build', start: '2026-06-01', end: '2027-02-01', status: 'on track' } : r));
187
+ const B = BP.build(f), row = B.rows.find((x) => x.id === 'self-serve-v2'); row.tasks = TASKS; row.start = '2026-06-01'; row.end = '2027-02-01';
188
+ const A = await open({ w: 1440, h: 900, board: B }), p = A.page;
189
+ if (!(await p.evaluate((v) => document.querySelector(v + ' .iv').getBoundingClientRect().width >= 820, V))) await p.click('#czViewer [data-cz-vw="wide"]');
190
+ const mc = await until(() => p.evaluate((v) => { const m = document.querySelector(v + ' .iv-cl > .iv-msc'); if (!m || !m.offsetParent) return null; const rows = [...m.querySelectorAll('.iv-msr')];
191
+ return { head: m.querySelector('.iv-msh').textContent.replace(/\s+/g, ' ').trim(), rows: rows.map((r) => r.className.replace('iv-msr', '').trim() + ':' + r.textContent.replace(/\s+/g, ' ').trim()), tick: m.querySelectorAll('.iv-msr.dn .iv-msk.dn svg').length,
192
+ press: rows.every((r) => r.dataset.ivMs && /Open its task$/.test(r.getAttribute('aria-label'))), after: !!(m.previousElementSibling && m.previousElementSibling.classList.contains('iv-card')) }; }, V));
193
+ ok('D1b the Milestones card sits under the card: "Milestones 1 of 3 done", the done one ticked', !!mc && mc.after && /^Milestones ?1 of 3 done$/.test(mc.head) && mc.tick === 1 && /^dn:Brief signed off/.test(mc.rows[0]), JSON.stringify(mc));
194
+ ok('D1b the next one is marked with "in N days", and the release says so', !!mc && /^up:Rollout to all workspacesDec 1 · in \d+ days · release$/.test(mc.rows[1]) && /^:Did it work\?Feb 1/.test(mc.rows[2]), JSON.stringify(mc && mc.rows));
195
+ ok('D1b each row is a press for its task', !!mc && mc.press, JSON.stringify(mc));
196
+ // Wawan 11:58 (0.442.0 hotfix): in two columns the dates line, ⋯ and the next stage show under the picture without a tap, and the
197
+ // milestones are said once, in this card; a tap on the picture does not list them again
198
+ ok('D1b in two columns the dates line and the next stage show under the picture at once', await miShown(p) && await p.evaluate((v) => { const n = document.querySelector(v + ' .iv-sc [data-iv-next]'); return !!n && !!n.offsetParent; }, V));
199
+ const once = () => p.evaluate((v) => [...document.querySelectorAll(v + ' .iv-msl')].filter((l) => l.offsetParent).length, V);
200
+ const n0 = await once(); await p.click(V + ' [data-iv-mi]', { position: { x: 8, y: 8 } }); await sleep(300);
201
+ ok('D1b in two columns the milestones are listed once, before and after a tap on the picture', n0 === 1 && await once() === 1, String(n0));
202
+ await shot(p, 'desk-milestones');
203
+ // the phone: the same list behind a tap on the mission, under the stage's dates, ⋯ and the next stage (XvpE2Stages, Wawan 10:59)
204
+ const Q = await open({ w: 390, h: 844, board: B }), q = Q.page;
205
+ ok('D1b a phone has no Milestones card', await q.evaluate((v) => { const m = document.querySelector(v + ' .iv-msc'); return !m || !m.offsetParent; }, V));
206
+ await openMi(q);
207
+ const ph = await q.evaluate((v) => { const o = document.querySelector(v + ' .iv-mio'); return { head: o.querySelector('.iv-msh') ? o.querySelector('.iv-msh').textContent.replace(/\s+/g, ' ').trim() : '', rows: [...o.querySelectorAll('.iv-msr')].map((r) => r.className.replace('iv-msr', '').trim() + ':' + r.textContent.replace(/\s+/g, ' ').trim()), more: !!o.querySelector('.iv-mo'), over: document.documentElement.scrollWidth - innerWidth }; }, V);
208
+ ok('D1b a tap on the phone\'s mission opens the same milestones list, under ⋯', /^Milestones ?1 of 3 done$/.test(ph.head) && JSON.stringify(ph.rows) === JSON.stringify(mc && mc.rows) && ph.more && ph.over <= 0, JSON.stringify(ph));
209
+ await shot(q, 'phone-milestones');
210
+ ok('D1b the phone raised no error', Q.errors.length === 0, Q.errors.join(' | '));
211
+ await Q.ctx.close();
212
+ ok('D1b the page raised no error', A.errors.length === 0, A.errors.join(' | '));
213
+ await A.ctx.close();
214
+ }
215
+
173
216
  /* D3 the phone, dark: Discover, Plan next (moves on by itself), an agent at work, over its usual time */
174
217
  {
175
218
  const DB = boardAt('Discover'), since = new Date(Date.parse(DB.today + 'T12:00:00Z') - 9 * 864e5).toISOString().slice(0, 10); // 9 days before the board's own day
@@ -177,8 +220,9 @@ async function pure() {
177
220
  const trail = { ok: true, items: { 'self-serve-v2': { since } }, usual: { discover: { n: 5, days: 7 } }, usualBy: {} };
178
221
  const A = await open({ w: 390, h: 844, theme: 'dark', model: SCEN.discover(), board: DB, sessions, trail }), p = A.page;
179
222
  ok('D3 the phone draws the same card', A.up);
223
+ ok('D3 a phone keeps the milestones behind a tap on the mission: no Milestones card', await p.evaluate((v) => { const m = document.querySelector(v + ' .iv-msc'); return !m || !m.offsetParent; }, V));
224
+ await openMi(p);
180
225
  const c = await card(p);
181
- ok('D3 the clock: "9 of ~7 days", amber when over', c.clock === '9 of ~7 days' && c.late, c.head);
182
226
  ok('D3 the → names Plan, the next stage', /^Next: Plan/.test(c.tail) && c.next && !c.ms, c.tail);
183
227
  await shot(p, 'phone-discover');
184
228
  await p.click(V + ' [data-iv-next]');
@@ -219,6 +263,7 @@ async function pure() {
219
263
  /* D5 every step done, a milestone next: the next stage is ◆ Deliver; its sheet moves it with nothing open, and says so with Undo */
220
264
  {
221
265
  const A = await open({ model: SCEN.ready() }), p = A.page;
266
+ if (!(await p.evaluate((v) => { const n = document.querySelector(v + ' [data-iv-next]'); return !!(n && n.offsetParent); }, V))) await openMi(p); // the next stage shows: in the head, or under the picture once it is open
222
267
  const c = await card(p);
223
268
  ok('D5 every step done: the → names ◆ Deliver', A.up && /^Next: ◆ Deliver/.test(c.tail) && c.ms, JSON.stringify(c));
224
269
  await shot(p, 'desk-ready', V + ' .iv-sc');
@@ -204,6 +204,8 @@ function model() {
204
204
  for (const view of ['list', 'kanban']) {
205
205
  const { ctx, page, errors } = await open({ view });
206
206
  if (view === 'kanban') { await page.locator('#czViewer [data-iv-kstage]').click(); await page.locator('.tkc.ivq [data-ivq-i="1"]').click(); await page.waitForTimeout(300); }
207
+ // the List folds a stage after 3 tasks (batch 18 item 1): "2 more" shows the rest
208
+ if (view === 'list') { await page.locator('#czViewer .iv-wl > .iv-more').first().click(); await page.waitForTimeout(300); }
207
209
  const m = await page.evaluate(() => [...document.querySelectorAll('#czViewer .lk-mt')].map((x) => x.textContent.trim()));
208
210
  ok(`L1 ${view}: the link icon and the first task it waits on`, m.includes('Draft the limits spec') && m.includes('Ship the limits API'), JSON.stringify(m));
209
211
  await page.locator('#czViewer .lk-mt[data-lk-meta="task-c"]').first().click();
@@ -159,7 +159,11 @@ const ITEMS = [
159
159
  await p.click('.ivq-st .ivq-ms'); await p.waitForTimeout(300);
160
160
  ok('F pressing ◇ writes milestone true for that task', posts.length === 1 && posts[0].task === 'task-api' && posts[0].milestone === true, JSON.stringify(posts));
161
161
  // the Tasks Timeline
162
- await p.evaluate(() => { const b = document.querySelector('[data-iv-view="timeline"]'); if (b) b.click(); });
162
+ // the view sheet (batch 18 item 1): the view button, then Timeline
163
+ await p.evaluate(() => { const b = document.querySelector('#czViewer [data-iv-vbtn]'); if (b) b.click(); });
164
+ await p.waitForSelector('.tkc.ivq .ivs', { timeout: 5000 });
165
+ await p.click('.tkc.ivq .ivs [data-ivs-view="timeline"]');
166
+ await p.keyboard.press('Escape');
163
167
  await p.waitForSelector('.ivt', { timeout: 5000 });
164
168
  await unfold('.ivt-gh[data-iv-fold^="sec:"][aria-expanded="false"]');
165
169
  const tv = await p.evaluate(() => ({ ms: [...document.querySelectorAll('.ivt-ms')].map((x) => x.className + '|' + x.textContent), guides: document.querySelectorAll('.ivt-grid i.ms').length, lg: (document.querySelector('.ivt-lg') || {}).textContent || '' }));
@@ -167,11 +167,11 @@ function model() {
167
167
  await page.waitForSelector('.vs-pop.sheet', { timeout: 4000 });
168
168
  const P = await page.evaluate(() => { const r = document.querySelector('.vs-pop.sheet').getBoundingClientRect(); return { bottom: Math.round(r.bottom), w: Math.round(r.width), scroll: document.documentElement.scrollWidth }; });
169
169
  ok('P1 on a phone the menu is a bottom sheet the width of the screen; no sideways scroll', P.bottom === 844 && P.w === 390 && P.scroll <= 390, JSON.stringify(P));
170
- // batch 11 item 20: the 390 px Tasks header holds the group icon, the view switch, + and a draft's Make live, all in the Viewer
170
+ // batch 11 item 20, batch 18 item 1: the 390 px Tasks header holds the view button, + and a draft's Make live, all in the Viewer
171
171
  await page.locator('.vs-pop [data-vs-show="draft-c1"]').click();
172
172
  await page.waitForSelector('#czViewer [data-vs-live]', { timeout: 4000 });
173
- const H = await page.evaluate(() => { const v = document.querySelector('#czViewer'), b = v.querySelector('.cz-vw-body').getBoundingClientRect(), h = v.querySelector('.iv-th'); const ins = (s) => { const e = h.querySelector(s); if (!e) return 'none'; const r = e.getBoundingClientRect(); return r.width > 0 && r.left >= b.left && r.right <= b.right + 0.5 ? 'in' : 'out'; }; return { by: ins('[data-ig-by]'), view: ins('.ivx-seg'), seal: ins('[data-vs-live]'), add: h.querySelector('[data-iv-add]') ? ins('[data-iv-add]') : 'in', head: h.scrollWidth - Math.round(h.getBoundingClientRect().width), scroll: document.documentElement.scrollWidth }; });
174
- ok('P3 on a phone the Tasks header fits the group icon, the view switch, + and Make live', H.by === 'in' && H.view === 'in' && H.seal === 'in' && H.add === 'in' && H.head <= 1 && H.scroll <= 390, JSON.stringify(H));
173
+ const H = await page.evaluate(() => { const v = document.querySelector('#czViewer'), b = v.querySelector('.cz-vw-body').getBoundingClientRect(), h = v.querySelector('.iv-th'); const ins = (s) => { const e = h.querySelector(s); if (!e) return 'none'; const r = e.getBoundingClientRect(); return r.width > 0 && r.left >= b.left && r.right <= b.right + 0.5 ? 'in' : 'out'; }; return { view: ins('[data-iv-vbtn]'), seal: ins('[data-vs-live]'), add: h.querySelector('[data-iv-add]') ? ins('[data-iv-add]') : 'in', head: h.scrollWidth - Math.round(h.getBoundingClientRect().width), scroll: document.documentElement.scrollWidth }; });
174
+ ok('P3 on a phone the Tasks header fits the view button, + and Make live', H.view === 'in' && H.seal === 'in' && H.add === 'in' && H.head <= 1 && H.scroll <= 390, JSON.stringify(H));
175
175
  await shot(page, 'PvaBuild6PhoneDraft', '#czViewer .iv-th');
176
176
  ok('P2 no page error', errors.length === 0, errors.join(' | '));
177
177
  await shot(page, 'PvaBuild5Phone');