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.
Files changed (131) hide show
  1. package/package.json +25 -30
  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-adddoc-test.js +2 -2
  7. package/workspace/briefing-premium-initiative-test.js +9 -15
  8. package/workspace/briefing-premium-insights-test.js +2 -2
  9. package/workspace/briefing-premium-test.js +3 -3
  10. package/workspace/changelog.json +24 -0
  11. package/workspace/chat-asks-test.js +146 -0
  12. package/workspace/guide/board.md +1 -1
  13. package/workspace/guide/breakdown.md +6 -13
  14. package/workspace/guide/briefing-premium.md +1 -1
  15. package/workspace/guide/home.md +24 -0
  16. package/workspace/guide/index.md +1 -1
  17. package/workspace/guide/initiative-driver.md +1 -1
  18. package/workspace/guide/initiatives-screen.md +1 -1
  19. package/workspace/guide/pm-only-acts.md +23 -24
  20. package/workspace/guide/today.md +1 -1
  21. package/workspace/home-rows-test.js +149 -56
  22. package/workspace/ini-workflow-test.js +4 -4
  23. package/workspace/lib/briefing-premium-agent.js +8 -1
  24. package/workspace/lib/briefing-premium-writes.js +5 -4
  25. package/workspace/lib/coredoc-cli.js +1 -1
  26. package/workspace/lib/driver-cli.js +2 -1
  27. package/workspace/lib/driver-decide.js +3 -2
  28. package/workspace/lib/driver.js +2 -1
  29. package/workspace/lib/engine/boards.js +3 -1
  30. package/workspace/lib/goal-chat.js +94 -30
  31. package/workspace/lib/grant-mint.js +3 -2
  32. package/workspace/lib/initiative-cli.js +9 -9
  33. package/workspace/lib/issues.js +5 -4
  34. package/workspace/lib/mention-cli.js +70 -0
  35. package/workspace/lib/mention-store.js +307 -0
  36. package/workspace/lib/people-store.js +1 -1
  37. package/workspace/lib/people.js +3 -1
  38. package/workspace/lib/placements.js +13 -15
  39. package/workspace/lib/plan-items.js +17 -48
  40. package/workspace/lib/pm-guard.js +18 -5
  41. package/workspace/lib/pm-lines-needs.js +9 -5
  42. package/workspace/lib/pmos-verbs.js +3 -0
  43. package/workspace/lib/report-cli.js +2 -2
  44. package/workspace/lib/routes-board-metric-targets.js +0 -1
  45. package/workspace/lib/routes-boards.js +12 -0
  46. package/workspace/lib/routes-briefing-premium.js +5 -7
  47. package/workspace/lib/routes-core-docs.js +0 -1
  48. package/workspace/lib/routes-custom-docs.js +0 -1
  49. package/workspace/lib/routes-driver.js +0 -1
  50. package/workspace/lib/routes-home-desk.js +1 -1
  51. package/workspace/lib/routes-home-review.js +1 -1
  52. package/workspace/lib/routes-initiative-layout.js +1 -1
  53. package/workspace/lib/routes-insights-records.js +0 -1
  54. package/workspace/lib/routes-meeting-material.js +0 -1
  55. package/workspace/lib/routes-mentions.js +62 -9
  56. package/workspace/lib/routes-onboarding.js +3 -1
  57. package/workspace/lib/routes-orchestrator.js +0 -1
  58. package/workspace/lib/routes-premium-charts.js +0 -1
  59. package/workspace/lib/routes-premium-dashboards.js +0 -1
  60. package/workspace/lib/routes-programs.js +1 -1
  61. package/workspace/lib/routes-records.js +1 -1
  62. package/workspace/lib/routes-report-design.js +7 -3
  63. package/workspace/lib/routes-report-setups.js +0 -1
  64. package/workspace/lib/routes-report-structure.js +0 -1
  65. package/workspace/lib/routes-runs.js +2 -5
  66. package/workspace/lib/routes-scan.js +0 -1
  67. package/workspace/lib/routes-sources.js +1 -1
  68. package/workspace/lib/run-answers.js +14 -5
  69. package/workspace/lib/scan-cli.js +2 -1
  70. package/workspace/lib/scan.js +2 -1
  71. package/workspace/lib/session-files.js +132 -0
  72. package/workspace/lib/session-name.js +103 -0
  73. package/workspace/lib/source-reads.js +4 -1
  74. package/workspace/lib/vendor/scripts/onboarding/proposals.js +7 -3
  75. package/workspace/package-lock.json +2 -2
  76. package/workspace/package.json +1 -1
  77. package/workspace/premium-board-actions-test.js +10 -8
  78. package/workspace/premium-chat-goal-setup-test.js +203 -0
  79. package/workspace/premium-chat-goal-view-test.js +28 -23
  80. package/workspace/premium-chat-line-test.js +189 -0
  81. package/workspace/premium-core-doc-issue-test.js +1 -1
  82. package/workspace/premium-viewer-share-test.js +5 -2
  83. package/workspace/premium-vw-backlog-test.js +1 -1
  84. package/workspace/premium-vw-item-test.js +1 -1
  85. package/workspace/premium-vw-jira-test.js +1 -1
  86. package/workspace/public/pm/chat-ask.js +17 -9
  87. package/workspace/public/pm/cozy-home-rows.css +39 -1
  88. package/workspace/public/pm/cozy-home.css +112 -12
  89. package/workspace/public/pm/cozy-search.js +2 -1
  90. package/workspace/public/pm/cozy-steps.css +69 -0
  91. package/workspace/public/pm/cozy-steps.js +90 -0
  92. package/workspace/public/pm/goal-chat.js +141 -23
  93. package/workspace/public/pm/home-app.js +68 -35
  94. package/workspace/public/pm/home-ask.js +121 -0
  95. package/workspace/public/pm/home-chat.js +120 -68
  96. package/workspace/public/pm/home-data.js +10 -2
  97. package/workspace/public/pm/home-goal.js +159 -0
  98. package/workspace/public/pm/home-ini.css +35 -0
  99. package/workspace/public/pm/home-ini.js +50 -19
  100. package/workspace/public/pm/home-line.css +59 -0
  101. package/workspace/public/pm/home-line.js +200 -0
  102. package/workspace/public/pm/home-list.js +2 -2
  103. package/workspace/public/pm/home-mentions.js +303 -111
  104. package/workspace/public/pm/home-ses-name.js +65 -0
  105. package/workspace/public/pm/home-stage-card.js +94 -0
  106. package/workspace/public/pm/home-sweep.js +112 -0
  107. package/workspace/public/pm/home-today.js +7 -2
  108. package/workspace/public/pm/premium-initiative-head.js +8 -4
  109. package/workspace/public/pm/rename-press.js +24 -0
  110. package/workspace/public/pm/wf-page.css +3 -0
  111. package/workspace/public/pm/wf-page.js +2 -1
  112. package/workspace/public/premium-workflows.html +1 -0
  113. package/workspace/replaced-tests.json +101 -0
  114. package/workspace/server.js +133 -20
  115. package/workspace/session-names-test.js +144 -0
  116. package/workspace/skills/jira-push.skill +1 -0
  117. package/workspace/skills/morning-brief.skill +2 -1
  118. package/workspace/skills/report-daily.skill +1 -0
  119. package/workspace/skills/report-monthly.skill +1 -0
  120. package/workspace/skills/report-weekly.skill +1 -0
  121. package/workspace/skills/sources-read.skill +3 -2
  122. package/workspace/stage-card-test.js +203 -0
  123. package/workspace/test-lists/chat-asks.json +13 -0
  124. package/workspace/test-lists/chat-progress.json +13 -0
  125. package/workspace/test-lists/mentions-a-plus.json +9 -0
  126. package/workspace/test-lists/premium-chat-goal-setup.json +9 -0
  127. package/workspace/test-lists/session-files.json +5 -0
  128. package/workspace/test-lists/session-names.json +13 -0
  129. package/workspace/test-lists/stage-card.json +6 -0
  130. package/workspace/tk-tasks-test.js +1 -1
  131. package/workspace/workflows-setup-test.js +17 -0
@@ -2,11 +2,12 @@
2
2
  'use strict';
3
3
  /* premium-chat-goal-view-test.js — the /goal card lives in the viewer, not in the conversation (initiative premium-chat-session, goal in the viewer).
4
4
  * A real server on a scratch repository (c3-scan-fixture.js); the thread and the session's conversation are routed, so the goal's state is set here.
5
- * G1 at 1280 a stopped goal draws no card in the conversation, only a small Goal chip; the chip opens a Goal tab with the card
6
- * G2 a goal that changes state opens the Goal tab by itself on a desktop, and the open tab follows the next change
7
- * G3 a ready goal: the conversation shows only the chip; the plan, SMART and Start / Change / Cancel are in the Goal tab
8
- * G4 Stop the goal is in the Goal tab and reaches the server
9
- * G5 at 390 the chip shows the Goal tab on the popup's Detail tab; a change offers the goal in the bar over the box
5
+ * G1 at 1280 a stopped goal draws no card in the conversation, only the amber divider where it stopped; the divider opens a Goal tab with the card
6
+ * G2 a goal at work is the progress line at the top (XcbOptions B): it opens nothing by itself; a tap opens its steps in the Goal tab,
7
+ * and the open tab follows the next change
8
+ * G3 a ready goal: the plan card is in the conversation with Start / Change / Cancel as icons (XcbOptions B); the whole plan still opens in the Goal tab
9
+ * G4 Stop the goal is in the Goal tab and on the line, and reaches the server
10
+ * G5 at 390 the line opens in place, not in the Viewer; a goal that waits on the PM turns the line blue, with no bar over the box
10
11
  * (premium-agreed-design: /premium-chat.html opens Home; the Goal tab is the Viewer card, and on a phone the Viewer covers the chat page)
11
12
  * Set GOAL_VIEW_SHOTS=<dir> to save the page at 1280 and 390, light and dark. */
12
13
  const { findBrowser } = require('./lib/find-browser');
@@ -41,11 +42,13 @@ const look = () => {
41
42
  const vw = document.querySelector('#czViewer:not([hidden])'), gp = vw ? vw.querySelector('.obody.vw[data-vw="goal"]') : null;
42
43
  const peek = document.querySelector('#hmPeek');
43
44
  return { tab: vw ? 'out' : 'chat', shut: !gp, layer: false, out: vw ? Math.round(vw.getBoundingClientRect().width) : 0, vh: innerHeight,
44
- cardInChat: !!document.querySelector('#hmLog .gcard'), chip: (document.querySelector('#hmLog [data-goal-open]') || {}).textContent || null,
45
- smart: !!document.querySelector('#hmLog .smart'), start: !!document.querySelector('#hmLog [data-goal="start"]'),
45
+ cardInChat: !!document.querySelector('#hmLog .gcard'), chip: (document.querySelector('#hmLog .ctxchip[data-goal-open]') || {}).textContent || null,
46
+ smart: !!document.querySelector('#hmLog .smart'), start: !!document.querySelector('#hmLog [data-goal="start"]'), planInChat: !!document.querySelector('#hmLog .gplan'),
46
47
  tabs: gp ? ['Goal'] : [], on: vw ? (vw.querySelector('.cz-vw-kind') || vw.querySelector('.cz-vw-title') || {}).textContent || null : null, // a kind that repeats the title is not drawn
47
48
  pane: gp ? gp.textContent.replace(/\s+/g, ' ').trim() : null, stop: !!document.querySelector('#czViewer [data-goal="stop"]'),
48
49
  peek: peek && !peek.hidden ? peek.textContent.trim() : null,
50
+ line: (document.querySelector('#hmPl:not([hidden]) .hm-pl') || {}).textContent || null, lineCls: (document.querySelector('#hmPl .hm-pl') || {}).className || '',
51
+ divider: (document.querySelector('#hmLog .pl-dv') || {}).textContent || null,
49
52
  railOff: !document.querySelector('nav.rail'), wide: document.documentElement.scrollWidth > innerWidth + 1 };
50
53
  };
51
54
 
@@ -74,33 +77,36 @@ const look = () => {
74
77
 
75
78
  { const { p, ctx, errs, st } = await open(1280, 'light', { goal: goalOf('stopped', { reason: 'pm' }), messages: working });
76
79
  const s0 = await p.evaluate(look);
77
- ok('G1 at 1280 a stopped goal draws no card in the conversation, only a small Goal chip', !s0.cardInChat && /Stopped/.test(s0.chip || '') && /0 of 3/.test(s0.chip || ''), JSON.stringify(s0));
80
+ ok('G1 at 1280 a stopped goal draws no card and no line, only the amber divider that says why', !s0.cardInChat && !s0.chip && !s0.line && /Goal stopped: you stopped it/.test(s0.divider || ''), JSON.stringify(s0));
78
81
  ok('G1 opening the chat with a goal opens nothing by itself', s0.shut, JSON.stringify(s0));
79
82
  if (shots) await p.screenshot({ path: `${shots}/chip-1280-light.png` });
80
- await p.click('#hmLog [data-goal-open]');
83
+ await p.click('#hmLog .pl-dv [data-goal-open]');
81
84
  const s1 = await until(async () => { const v = await p.evaluate(look); return !v.shut && v.pane ? v : null; }) || await p.evaluate(look);
82
85
  ok('G1 the chip opens a Goal tab with the goal, its done points and why it stopped', /Goal/.test(s1.on || '') && /Stopped/.test(s1.pane || '') && /0 of 3 done points met/.test(s1.pane || '') && /Totals match GA4/.test(s1.pane || '') && /You stopped it/.test(s1.pane || ''), JSON.stringify(s1));
83
86
  await p.click('#czViewer [data-cz-vw="close"]'); await until(() => p.evaluate(() => !document.querySelector('#czViewer:not([hidden])')));
84
87
  st.goal = goalOf('started', { met: [DRAFT.done[0]] });
88
+ const s1b = await until(async () => { const v = await p.evaluate(look); return v.line ? v : null; }) || await p.evaluate(look);
89
+ ok('G2 a goal at work is the line at the top, and opens nothing by itself', /Each drop has a reason label/.test(s1b.line || '') && /1 of 3 done/.test(s1b.line || '') && s1b.shut && !s1b.chip, JSON.stringify(s1b));
90
+ await p.click('#hmPl [data-pl="toggle"]');
85
91
  const s2 = await until(async () => { const v = await p.evaluate(look); return v.pane && /round 3/.test(v.pane) ? v : null; }) || await p.evaluate(look);
86
- ok('G2 a goal that changes state opens the Goal tab by itself', !s2.shut && /Goal/.test(s2.on || '') && /1 of 3 done points met/.test(s2.pane || ''), JSON.stringify(s2));
87
- ok('G4 Stop the goal is in the Goal tab, not in the conversation', s2.stop && !(await p.evaluate(() => !!document.querySelector('#hmLog [data-goal="stop"]'))), JSON.stringify(s2));
92
+ ok('G2 a tap on the line opens the goal\'s steps in the Goal tab, and the line is tinted while it shows', !s2.shut && /Goal/.test(s2.on || '') && /1 of 3 points met · round 3 of 12/.test(s2.pane || '') && /\bon\b/.test(s2.lineCls), JSON.stringify(s2));
93
+ ok('G4 Stop is in the Goal tab and on the line, not in the conversation', await p.evaluate(() => !!document.querySelector('#czViewer [data-pl="stop"]') && !!document.querySelector('#hmPl [data-pl="stop"]') && !document.querySelector('#hmLog [data-goal="stop"]')), JSON.stringify(s2));
88
94
  if (shots) await p.screenshot({ path: `${shots}/goal-1280-light.png` });
89
- await p.click('#czViewer [data-goal="stop"]');
95
+ await p.click('#czViewer [data-pl="stop"]');
90
96
  const posted = await until(() => st.posts.find((x) => x.act === 'stop'));
91
97
  ok('G4 Stop reaches the server for this goal', posted && posted.id === 'g1', JSON.stringify(st.posts));
92
98
  st.goal = goalOf('done', { met: DRAFT.done });
93
99
  const s3 = await until(async () => { const v = await p.evaluate(look); return v.pane && /Done, as Claude reports it/.test(v.pane) ? v : null; }) || await p.evaluate(look);
94
- ok('G2 the open Goal tab follows the next change', /3 of 3 done points met/.test(s3.pane || '') && !s3.stop, JSON.stringify(s3));
100
+ ok('G2 the open Goal tab follows the next change; the line goes and "Goal done" stays where it finished', /3 of 3 done points met/.test(s3.pane || '') && !s3.stop && !s3.line && /Goal done/.test(s3.divider || ''), JSON.stringify(s3));
95
101
  ok('F1 no page error and no sideways scroll', !errs.length && !s3.wide, errs.join(' | '));
96
102
  await ctx.close(); }
97
103
 
98
104
  { const { p, ctx, errs, st } = await open(1280, 'dark', { goal: goalOf('grilling'), messages: [{ role: 'user', text: '[PMOS /goal] The PM set a goal: Enrich the Lightbox reports\n' }, { role: 'assistant', text: READY }] });
99
105
  const s0 = await p.evaluate(look);
100
- ok('G3 a ready goal is one chip in the conversation: no card, no SMART row, no buttons', !s0.smart && !s0.start && !s0.cardInChat && /Not started/.test(s0.chip || ''), JSON.stringify(s0));
101
- await p.click('#hmLog [data-goal-open]');
106
+ ok('G3 a ready goal is the plan card in the conversation, with Start, Change and Cancel as icons (XcbOptions B)', !s0.smart && s0.start && s0.planInChat && !s0.cardInChat, JSON.stringify(s0));
107
+ await p.click('#hmLog .gplan [data-goal-open]');
102
108
  const s1 = await until(async () => { const v = await p.evaluate(look); return v.pane ? v : null; }) || await p.evaluate(look);
103
- ok('G3 the Goal tab shows the plan: done when, may, serves, by', /Done when/.test(s1.pane || '') && /It may/.test(s1.pane || '') && /Serves/.test(s1.pane || '') && /Not started/.test(s1.pane || ''), JSON.stringify(s1));
109
+ ok('G3 the whole plan still opens in the Viewer: done when, may, serves, by', /Done when/.test(s1.pane || '') && /It may/.test(s1.pane || '') && /Serves/.test(s1.pane || '') && /Not started/.test(s1.pane || ''), JSON.stringify(s1));
104
110
  await p.click('#czViewer [data-goal="start"]');
105
111
  const sent = await until(() => st.posts.find((x) => x.act === 'start'));
106
112
  ok('G3 Start in the Goal tab sends the ready draft for this goal', sent && sent.id === 'g1' && sent.draft && sent.draft.goal === DRAFT.goal, JSON.stringify(st.posts));
@@ -111,16 +117,15 @@ const look = () => {
111
117
  for (const scheme of ['light', 'dark']) {
112
118
  const { p, ctx, errs, st } = await open(390, scheme, { goal: goalOf('started', { met: [DRAFT.done[0]] }), messages: working });
113
119
  const s0 = await p.evaluate(look);
114
- ok(`G5 (${scheme}) at 390 the conversation shows the chip, not the card`, !s0.cardInChat && /Working/.test(s0.chip || '') && !s0.layer && s0.tab === 'chat', JSON.stringify(s0));
120
+ ok(`G5 (${scheme}) at 390 the conversation shows the line, not the card or a chip`, !s0.cardInChat && !s0.chip && /1 of 3 done/.test(s0.line || '') && !s0.layer && s0.tab === 'chat', JSON.stringify(s0));
115
121
  if (shots) await p.screenshot({ path: `${shots}/chip-390-${scheme}.png` });
116
- await p.click('#hmLog [data-goal-open]');
117
- const s1 = await until(async () => { const v = await p.evaluate(look); return v.tab === 'out' && v.pane ? v : null; }) || await p.evaluate(look);
118
- ok(`G5 (${scheme}) the chip shows the Goal tab on the popup's Detail tab, the popup's full width`, s1.tab === 'out' && s1.out >= 340 && /1 of 3 done points met/.test(s1.pane || ''), JSON.stringify(s1));
122
+ await p.click('#hmPl [data-pl="toggle"]');
123
+ const s1 = await until(async () => { const v = await p.evaluate(look); return /points met/.test(v.line || '') ? v : null; }) || await p.evaluate(look);
124
+ ok(`G5 (${scheme}) a tap opens the line in place with the goal's points, not the Viewer`, s1.tab === 'chat' && /1 of 3 points met/.test(s1.line || '') && /Totals match GA4/.test(s1.line || ''), JSON.stringify(s1));
119
125
  if (shots) await p.screenshot({ path: `${shots}/goal-390-${scheme}.png` });
120
- await p.click('#czViewer [data-cz-vw="back"]'); await until(() => p.evaluate(() => !document.querySelector('#czViewer:not([hidden])'))); // the popup is phone-wide here: shell A shows ← there, no ×
121
126
  st.goal = goalOf('waiting', { met: [DRAFT.done[0]] });
122
- const s2 = await until(async () => { const v = await p.evaluate(look); return v.peek ? v : null; }) || await p.evaluate(look);
123
- ok(`G5 (${scheme}) a change offers the goal in the bar over the box, without covering the conversation`, /Needs you/.test(s2.peek || '') && !s2.layer && s2.tab === 'chat', JSON.stringify(s2));
127
+ const s2 = await until(async () => { const v = await p.evaluate(look); return /asks before it goes on/.test(v.line || '') ? v : null; }) || await p.evaluate(look);
128
+ ok(`G5 (${scheme}) a goal that waits turns the line blue, with no bar over the box`, /\byou\b/.test(s2.lineCls) && !s2.peek && !s2.layer && s2.tab === 'chat', JSON.stringify(s2));
124
129
  ok(`F1 (${scheme}) no page error and no sideways scroll at 390`, !errs.length && !s2.wide, errs.join(' | '));
125
130
  await ctx.close();
126
131
  }
@@ -0,0 +1,189 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* premium-chat-line-test.js — the chat progress line in the real page (initiative premium-agreed-design; canvas XcbOptions B, cases 1–9).
4
+ * A real server on a scratch repository (c3-scan-fixture.js); the thread, the conversation, the sessions, the queue and the notes are routed.
5
+ * P1 (390) a goal at work: one line at the top with the point it is on, "1 of 4 done" and Stop; no run strip, no live card, no goal chip,
6
+ * no @ and no / button, no floating menu; a message sent while it works waits as "Claude reads it after this tool call, in seconds" with ×
7
+ * P2 (390) a tap opens the line in place: the head line, every point, the Now row and Watch its terminal; Stop reaches the server;
8
+ * the line stays at the top while the page scrolls
9
+ * P3 (390) a session with no step list: "Working · m:ss", no count; a session with its own steps: its step and "1 of 3 done"
10
+ * P4 (390) Claude asks: the line is blue, "Claude asks before it goes on"; a tap scrolls to the ask, not to the Viewer
11
+ * P5/P6 a finished goal: no line; "Goal done" over Claude's result, or the amber "Goal stopped: …" and the box says how to go on
12
+ * P7 (390) a meeting records: the pill is in the chat's top bar, which shows ← and the title only
13
+ * P8 (390) Home: a running row's ring fills as its steps are met, no number; a running row with no steps has the plain ring
14
+ * P9 (1280) the line sits over the chat column; a tap opens the steps in the Viewer and the line is tinted while it shows them
15
+ * Set CHAT_LINE_SHOTS=<dir> to save the pages. */
16
+ const { findBrowser } = require('./lib/find-browser');
17
+ require('./test-run').configure({ name: 'premium-chat-line' });
18
+ const Fx = require('./c3-scan-fixture.js');
19
+
20
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
21
+ const until = async (fn, ms = 8000, step = 100) => { const t0 = Date.now(); for (;;) { let v; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
22
+ const results = [];
23
+ const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 700) : ''}`); };
24
+ let F = null, browser = null;
25
+ const finish = async (code) => {
26
+ if (browser) await browser.close().catch(() => {});
27
+ if (F) F.stop();
28
+ const bad = results.filter((x) => !x.cond).length;
29
+ console.log(`\n${results.length - bad}/${results.length} premium-chat-line assertions passed`);
30
+ process.exit(code !== undefined ? code : (bad ? 1 : 0));
31
+ };
32
+ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
33
+
34
+ const DRAFT = { goal: 'Bring the descope-feature-parity PRD to a review-ready draft', done: ['Parity table: every Descope feature against ours', 'Open questions, each with an owner', 'Out-of-scope list, with SSO on it', "Ready for Dita's review"], by: 'Fri', limit: 12 };
35
+ const ago = (m) => new Date(Date.now() - m * 60000).toISOString();
36
+ const BASE = [{ role: 'user', text: '[PMOS /goal start] Start', at: ago(4) }, { role: 'assistant', text: 'SSO goes on the out-of-scope list; the date stays.', at: ago(3) }, { role: 'tool', tools: { Edit: 1 }, calls: [{ tool: 'Edit', target: 'planning/prd/descope-parity.md' }], at: ago(2) }];
37
+ const LONG = Array.from({ length: 14 }, (_, i) => ({ role: i % 2 ? 'assistant' : 'user', text: 'Message ' + i + ' with enough words to take a line or two of room in the chat.', at: ago(30 - i) }));
38
+ const goal = (state, extra = {}) => ({ id: 'g1', state, draft: DRAFT, met: [DRAFT.done[0]], rounds: 1, at: ago(1), ...extra });
39
+
40
+ const look = () => {
41
+ const line = document.querySelector('#hmPl:not([hidden]) .hm-pl'), vw = document.querySelector('#czViewer:not([hidden])');
42
+ const fab = document.querySelector('.cz-fabw'), rec = document.querySelector('#hmRecTop:not([hidden])'), sub = document.querySelector('#hmTopSub');
43
+ const r = line ? line.getBoundingClientRect() : null;
44
+ return {
45
+ line: line ? line.textContent.replace(/\s+/g, ' ').trim() : null, cls: line ? line.className : '', top: r ? Math.round(r.top) : null,
46
+ open: !!(line && line.querySelector('.pl-body')), stop: !!(line && line.querySelector('[data-pl="stop"]')), term: !!(line && line.querySelector('[data-pl="term"]')),
47
+ strip: !!document.querySelector('.hm-run'), live: !!document.querySelector('.hm-live'), chip: !!document.querySelector('#hmLog .ctxchip[data-goal-open]'),
48
+ at: !!document.querySelector('[data-hm-at]'), slash: !!document.querySelector('[data-hm-slash]'), peek: !!document.querySelector('#hmPeek:not([hidden])'),
49
+ fab: !!(fab && fab.offsetParent !== null && getComputedStyle(fab).display !== 'none'),
50
+ queued: (document.querySelector('.hm-qn') || {}).textContent || null, qx: !!document.querySelector('.hm-qn [data-hm-qdel]'),
51
+ divider: [...document.querySelectorAll('#hmLog .pl-dv')].map((d) => d.textContent.trim()).join(' | ') || null,
52
+ dividerNext: (() => { const d = document.querySelector('#hmLog .pl-dv'); const n = d && d.nextElementSibling; return n ? n.textContent.replace(/\s+/g, ' ').trim().slice(0, 80) : null; })(),
53
+ ph: (document.querySelector('#hmIn') || {}).placeholder || null,
54
+ vw: vw ? vw.textContent.replace(/\s+/g, ' ').trim() : null,
55
+ rec: rec ? rec.textContent.trim() : null, sub: sub ? getComputedStyle(sub).display : null,
56
+ wide: document.documentElement.scrollWidth > innerWidth + 1,
57
+ };
58
+ };
59
+
60
+ (async () => {
61
+ const exe = findBrowser();
62
+ if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
63
+ let chromium;
64
+ try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
65
+ F = await Fx.start({ name: 'premium-chat-line' });
66
+ browser = await chromium.launch({ executablePath: exe, headless: true, args: ['--no-sandbox'] });
67
+ const shots = process.env.CHAT_LINE_SHOTS;
68
+ const chat = `${F.BASE}/premium-chat.html?ws=${encodeURIComponent(F.ws)}&about=work:line-test`;
69
+ const open = async (width, st, url = chat) => {
70
+ st.posts = [];
71
+ const ctx = await browser.newContext({ viewport: { width, height: width < 1000 ? 844 : 800 }, hasTouch: width < 1000 });
72
+ const p = await ctx.newPage(); const errs = []; p.on('pageerror', (e) => errs.push(String(e)));
73
+ await p.route('**/api/briefing-premium/thread?**', (r) => r.fulfill({ json: { ok: true, turns: [], session: 's-line', goal: st.goal || null } }));
74
+ await p.route('**/api/sessions/conversation?**', (r) => r.fulfill({ json: { ok: true, state: 'conv', ...st.conv } }));
75
+ await p.route('**/api/briefing-premium/goal**', (r) => { st.posts.push({ goal: JSON.parse(r.request().postData() || '{}') }); r.fulfill({ json: { ok: true } }); });
76
+ await p.route('**/api/session/keys', (r) => { st.posts.push({ keys: JSON.parse(r.request().postData() || '{}') }); r.fulfill({ json: { ok: true } }); });
77
+ await p.route('**/api/briefing-premium/press**', (r) => { st.posts.push({ keys: JSON.parse(r.request().postData() || '{}') }); r.fulfill({ json: { ok: true } }); });
78
+ if (st.queued) await p.route(/\/api\/home-desk(\?|$)/, async (r) => { const res = await r.fetch(); const j = await res.json().catch(() => ({})); j.ok = true; j.queued = { 's-line': st.queued }; r.fulfill({ json: j }); });
79
+ if (st.sessions) await p.route(/\/api\/sessions(\?|$)/, async (r) => { const res = await r.fetch(); const j = await res.json().catch(() => ({})); j.sessions = (j.sessions || []).concat(st.sessions); r.fulfill({ json: j }); });
80
+ if (st.notes) await p.route('**/api/notes', (r) => r.fulfill({ json: { ok: true, notes: st.notes } }));
81
+ await p.goto(url);
82
+ await until(() => p.evaluate(() => !!document.querySelector('#hmLog .hm-a, #hmLog .hm-u, #hmList .hm-r')));
83
+ await sleep(600);
84
+ return { p, ctx, errs };
85
+ };
86
+
87
+ /* P1, P2, P7: a goal at work on a phone, with a queued message and a recording */
88
+ { const st = { goal: goal('started'), conv: { turn: 'tool', messages: LONG.concat(BASE) }, queued: [{ text: 'Also add the Okta gap to the open questions.', at: ago(0.2) }],
89
+ notes: [{ id: 'n1', state: 'recording', title: 'CIAM weekly sync', meeting_ms: 724000 }] };
90
+ const { p, ctx, errs } = await open(390, st);
91
+ const s0 = await until(async () => { const v = await p.evaluate(look); return v.line && v.queued ? v : null; }) || await p.evaluate(look);
92
+ ok('P1 a goal at work: one line with the point it is on, "1 of 4 done" and Stop', /Open questions, each with an owner/.test(s0.line || '') && /1 of 4 done/.test(s0.line || '') && s0.stop && !s0.open, JSON.stringify(s0));
93
+ ok('P1 the line replaces the run strip, the live card, the goal chip and the goal bar', !s0.strip && !s0.live && !s0.chip && !s0.peek, JSON.stringify(s0));
94
+ ok('P1 the box has no @ and no / button, and a phone chat has no floating menu', !s0.at && !s0.slash && !s0.fab, JSON.stringify(s0));
95
+ ok('P1 a message sent while it works says Claude reads it after this tool call, with × to take it back', /reads it after this tool call, in seconds/.test(s0.queued || '') && s0.qx, JSON.stringify(s0));
96
+ const s7 = await until(async () => { const v = await p.evaluate(look); return v.rec ? v : null; }) || await p.evaluate(look);
97
+ ok('P7 a meeting records: the pill with its clock is in the chat\'s top bar, which shows the title only', /^\d+:\d\d/.test(s7.rec || '') && s7.sub === 'none', JSON.stringify(s7));
98
+ if (shots) await p.screenshot({ path: `${shots}/line-390.png` });
99
+ await p.click('#hmPl [data-pl="toggle"]');
100
+ const s1 = await until(async () => { const v = await p.evaluate(look); return v.open ? v : null; }) || await p.evaluate(look);
101
+ ok('P2 a tap opens it in place: the goal, "1 of 4 points met · round 2 of 12", every point, Now and the terminal',
102
+ /Bring the descope-feature-parity PRD/.test(s1.line || '') && /1 of 4 points met · round 2 of 12/.test(s1.line || '') && /Ready for Dita's review/.test(s1.line || '') && /Now\s*Edit · planning\/prd\/descope-parity.md/.test(s1.line || '') && s1.term && !s1.vw, JSON.stringify(s1));
103
+ if (shots) await p.screenshot({ path: `${shots}/line-390-open.png` });
104
+ await p.click('#hmPl [data-pl="toggle"]');
105
+ await p.evaluate(() => { const se = document.scrollingElement; se.scrollTop = 0; });
106
+ await sleep(200);
107
+ const s2 = await p.evaluate(look);
108
+ ok('P2 the line stays at the top while the page scrolls', s2.top != null && s2.top >= 40 && s2.top < 140, JSON.stringify(s2));
109
+ await p.click('#hmPl [data-pl="stop"]');
110
+ const posted = await until(() => st.posts.find((x) => x.goal && x.goal.act === 'stop'));
111
+ ok('P2 Stop on the line stops the goal', posted && posted.goal.id === 'g1', JSON.stringify(st.posts));
112
+ ok('F1 (390) no page error and no sideways scroll', !errs.length && !s2.wide, errs.join(' | '));
113
+ await ctx.close(); }
114
+
115
+ /* P3: sessions with and without a step list */
116
+ { const st = { conv: { turn: 'agent', messages: BASE } };
117
+ const { p, ctx, errs } = await open(390, st);
118
+ const s0 = await until(async () => { const v = await p.evaluate(look); return v.line ? v : null; }) || await p.evaluate(look);
119
+ ok('P3 a session with no step list: "Working · m:ss", never an invented count', /Working · \d+:\d\d/.test(s0.line || '') && !/ of \d+ done/.test(s0.line || ''), JSON.stringify(s0));
120
+ st.conv = { turn: 'agent', messages: BASE, steps: [{ text: 'Read the funnel export', state: 'done' }, { text: 'Find the step that moved', state: 'now', call: 'Read · funnel.csv' }, { text: 'Write it up', state: 'next' }] };
121
+ const s1 = await until(async () => { const v = await p.evaluate(look); return /Find the step/.test(v.line || '') ? v : null; }) || await p.evaluate(look);
122
+ ok('P3 a session with its own steps: its step and "1 of 3 done"', /Find the step that moved/.test(s1.line || '') && /1 of 3 done/.test(s1.line || ''), JSON.stringify(s1));
123
+ await p.click('#hmPl [data-pl="stop"]');
124
+ const esc = await until(() => st.posts.find((x) => x.keys && x.keys.press === 'esc'));
125
+ ok('P3 Stop on a session line presses Esc in it', !!esc, JSON.stringify(st.posts));
126
+ st.conv = { turn: 'pm', messages: BASE.concat([{ role: 'assistant', text: 'The checkout step moved.', at: ago(0) }]) };
127
+ const s2 = await until(async () => { const v = await p.evaluate(look); return !v.line ? v : null; }) || await p.evaluate(look);
128
+ ok('P3 when the run ends the line goes away (zero is silence)', !s2.line, JSON.stringify(s2));
129
+ ok('F1 (sessions) no page error', !errs.length, errs.join(' | '));
130
+ await ctx.close(); }
131
+
132
+ /* P4: Claude asks */
133
+ { const st = { goal: goal('waiting'), conv: { turn: 'pm', messages: LONG.concat(BASE, [{ role: 'assistant', text: 'Is the draft ready for Dita?', at: ago(0.5) }]) } };
134
+ const { p, ctx, errs } = await open(390, st);
135
+ const s0 = await until(async () => { const v = await p.evaluate(look); return v.line ? v : null; }) || await p.evaluate(look);
136
+ ok('P4 Claude needs the PM: the line is blue and says "Claude asks before it goes on", Stop stays', /\byou\b/.test(s0.cls) && /Claude asks before it goes on/.test(s0.line || '') && s0.stop && !/ of \d+ done/.test(s0.line || ''), JSON.stringify(s0));
137
+ if (shots) await p.screenshot({ path: `${shots}/line-390-ask.png` });
138
+ await p.click('#hmPl [data-pl="toggle"]'); await sleep(500);
139
+ const s1 = await p.evaluate(look);
140
+ ok('P4 a tap goes to the ask in the conversation, not to a panel', !s1.open && !s1.vw, JSON.stringify(s1));
141
+ ok('F1 (ask) no page error', !errs.length, errs.join(' | '));
142
+ await ctx.close(); }
143
+
144
+ /* P5, P6: a goal that finished */
145
+ { const st = { goal: goal('done', { met: DRAFT.done, at: ago(0.2) }), conv: { turn: 'pm', messages: BASE.concat([{ role: 'assistant', text: 'The draft is ready for Dita; 2 open questions have owners.', at: ago(0.5) }]) } };
146
+ const { p, ctx, errs } = await open(1280, st);
147
+ const s0 = await until(async () => { const v = await p.evaluate(look); return v.divider ? v : null; }) || await p.evaluate(look);
148
+ ok('P5 a goal that is done: no line; "Goal done" sits over Claude\'s result', !s0.line && /Goal done/.test(s0.divider || '') && /The draft is ready for Dita/.test(s0.dividerNext || ''), JSON.stringify(s0));
149
+ await p.click('#hmLog .pl-dv [data-goal-open]');
150
+ const s1 = await until(async () => { const v = await p.evaluate(look); return v.vw ? v : null; }) || await p.evaluate(look);
151
+ ok('P5 a tap opens the points, with the note that Claude checked them itself', /4 of 4 done points met/.test(s1.vw || '') && /Claude checked its own points/.test(s1.vw || ''), JSON.stringify(s1));
152
+ st.goal = goal('stopped', { reason: 'deadline', at: ago(0.2) });
153
+ const s2 = await until(async () => { const v = await p.evaluate(look); return /Goal stopped/.test(v.divider || '') ? v : null; }) || await p.evaluate(look);
154
+ ok('P6 a goal that stopped: the amber divider says why, and the box says how to go on', /Goal stopped: the deadline passed/.test(s2.divider || '') && s2.ph === 'Reply to go on, or /goal for a new goal' && !s2.line, JSON.stringify(s2));
155
+ if (shots) await p.screenshot({ path: `${shots}/line-1280-stopped.png` });
156
+ ok('F1 (finished) no page error', !errs.length, errs.join(' | '));
157
+ await ctx.close(); }
158
+
159
+ /* P9: a desktop */
160
+ { const st = { goal: goal('started'), conv: { turn: 'tool', messages: BASE } };
161
+ const { p, ctx, errs } = await open(1280, st);
162
+ const s0 = await until(async () => { const v = await p.evaluate(look); return v.line ? v : null; }) || await p.evaluate(look);
163
+ ok('P9 a desktop: the same line over the chat column, opening nothing by itself', /1 of 4 done/.test(s0.line || '') && !s0.vw, JSON.stringify(s0));
164
+ await p.click('#hmPl [data-pl="toggle"]');
165
+ const s1 = await until(async () => { const v = await p.evaluate(look); return v.vw && /\bon\b/.test(v.cls) ? v : null; }) || await p.evaluate(look);
166
+ ok('P9 a tap opens the steps in the Viewer (the goal, the round, every point, Now) and the line stays tinted', /round 2 of 12/.test(s1.vw || '') && /Ready for Dita's review/.test(s1.vw || '') && /Now/.test(s1.vw || '') && !s1.open && /\bon\b/.test(s1.cls), JSON.stringify(s1));
167
+ if (shots) await p.screenshot({ path: `${shots}/line-1280-viewer.png` });
168
+ await p.click('#hmPl [data-pl="toggle"]');
169
+ const s2 = await until(async () => { const v = await p.evaluate(look); return !v.vw ? v : null; }) || await p.evaluate(look);
170
+ ok('P9 a second tap closes the Viewer and the tint goes', !s2.vw && !/\bon\b/.test(s2.cls), JSON.stringify(s2));
171
+ ok('F1 (1280) no page error and no sideways scroll', !errs.length && !s2.wide, errs.join(' | '));
172
+ await ctx.close(); }
173
+
174
+ /* P8: Home's rings */
175
+ { const st = { sessions: [
176
+ { id: 'ring-a', name: 'Weekly update draft', agent: 'claude', state: 'running', shown: 'working', created: ago(10), hx: { title: 'Weekly update draft' }, progress: { done: 3, n: 5 } },
177
+ { id: 'ring-b', name: 'Checkout drop-off', agent: 'claude', state: 'running', shown: 'working', created: ago(9), hx: { title: 'Checkout drop-off' }, progress: null },
178
+ ] };
179
+ const { p, ctx, errs } = await open(390, st, `${F.BASE}/premium.html?ws=${encodeURIComponent(F.ws)}`);
180
+ await until(() => p.evaluate(() => !!document.querySelector('#hmList [data-hm-pg="loose"]')));
181
+ await p.evaluate(() => { const g = document.querySelector('#hmList [data-hm-pg="loose"]'); if (g && g.getAttribute('aria-expanded') !== 'true') g.click(); });
182
+ const rows = await until(() => p.evaluate(() => { const a = [...document.querySelectorAll('#hmList .hm-r')].find((r) => /Weekly update draft/.test(r.textContent)), b = [...document.querySelectorAll('#hmList .hm-r')].find((r) => /Checkout drop-off/.test(r.textContent)); return a && b ? { a: a.innerHTML, at: a.textContent, b: b.innerHTML } : null; })) || {};
183
+ ok('P8 a running row with steps has a ring that fills (3 of 5), with no number on the row', /hv-ring/.test(rows.a || '') && /3 of 5 done/.test(rows.a || '') && !/3\/5/.test(rows.at || ''), (rows.a || '').slice(0, 600));
184
+ ok('P8 a running row with no steps has the plain ring', /hv-d run/.test(rows.b || '') && !/hv-ring/.test(rows.b || ''), (rows.b || '').slice(0, 400));
185
+ if (shots) await p.screenshot({ path: `${shots}/home-390-rings.png` });
186
+ ok('F1 (Home) no page error', !errs.length, errs.join(' | '));
187
+ await ctx.close(); }
188
+ return finish();
189
+ })();
@@ -170,7 +170,7 @@ const BODY = '## Purpose\n\nWhy this board exists.\n\n## Scope\n\nWhat it covers
170
170
  const bare = await fetch(BASE + '/api/core-docs/issue', { method: 'POST', headers: { 'Content-Type': 'application/json', Origin: BASE }, body: JSON.stringify({ ws: B.ws, scope: bscope, key: bkey, slot: d1.slot }) });
171
171
  ok('P3 a press without the launch nonce is refused', bare.status === 403);
172
172
  const agent = await fetch(BASE + '/api/core-docs/issue', { method: 'POST', headers: { ...H, 'x-pmos-session': 's1' }, body: JSON.stringify({ ws: B.ws, scope: bscope, key: bkey, slot: d1.slot }) });
173
- ok('P4 an agent session gets 403', agent.status === 403);
173
+ ok('P4 D98: an agent session is not refused as an agent (the press is checked like the PM\'s)', agent.status !== 403, String(agent.status));
174
174
  ok('P5 no script error on any page', !P.errors.length && !I.errors.length && !J.errors.length, P.errors.concat(I.errors, J.errors).join(' | '));
175
175
  await J.ctx.close();
176
176
 
@@ -4,7 +4,7 @@
4
4
  * but I can set password)"). lib/share-store.js keeps the copies, POST /api/shares makes one on a page press, share-server.js serves them.
5
5
  * K1 the store: 22-character ids, a scrypt hash and never the password, five wrong tries lock for 15 minutes, a link past its end is deleted,
6
6
  * the cookie is signed per link and a changed one fails
7
- * K2 the routes: an agent session and a request without the page's press headers are refused; a file with a secret is refused and the answer
7
+ * K2 the routes: a request without the page's press headers is refused; an agent session makes and turns off a link (D98); a file with a secret is refused and the answer
8
8
  * names the rule only; 1, 7 or 30 days only; a made link is listed with its password flag and no hash
9
9
  * K3 the share server: the password page names neither the file nor PMOS; a wrong password counts down, five lock, the right one opens; the copy
10
10
  * is under a sandbox CSP; Download gives the file's own text; every answer is noindex, no-store, no-referrer; any other path is 404
@@ -83,7 +83,10 @@ const SHOTS = process.env.PMOS_SHOTS || '';
83
83
  // K2 the routes
84
84
  {
85
85
  ok('K2 a POST without the page\'s press headers is refused', (await req(BASE + '/api/shares', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ path: PRD, days: 7 }) })).status === 403);
86
- ok('K2 an agent session cannot make a link', (await post('/api/shares', { path: PRD, days: 7 }, { 'x-pmos-session': 'sess-1' })).status === 403);
86
+ const agentMk = await post('/api/shares', { path: PRD, days: 7 }, { 'x-pmos-session': 'sess-1' });
87
+ const agentId = (JSON.parse(agentMk.text || '{}')).id;
88
+ const agentOff = await post('/api/shares/off', { id: agentId }, { 'x-pmos-session': 'sess-1' });
89
+ ok('K2 D98: an agent session makes a link (the secret scan still runs) and turns it off', agentMk.status === 200 && !!agentId && agentOff.status === 200, agentMk.text);
87
90
  fs.writeFileSync(path.join(REPO, SECRET_REL), '# Keys\n\naws ' + 'AKIA' + 'ABCDEFGHIJKLMNOP' + ' here\n');
88
91
  const sec = await post('/api/shares', { path: SECRET_REL, days: 7, password: null });
89
92
  ok('K2 a file with a secret is refused, naming the rule and not the text', sec.status === 422 && /aws-access-key/.test(sec.text) && !/AKIAABCD/.test(sec.text), sec.status + ' ' + sec.text);
@@ -57,7 +57,7 @@ const SPRINTS = { ok: true, source: 'jira', readAt: '2026-10-19T09:00:00Z', velo
57
57
  await page.route('**/api/initiative-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: IMODEL, as_of: Date.now() }) }));
58
58
  await page.goto(BASE + '/premium-initiative.html?id=self-serve-v2&ws=w1&board=w1&theme=' + theme);
59
59
  // the Board's expand link lands on Home's initiative layout (premium-agreed-design); its Overview has the Sprint press, and the Viewer shows one item at a time
60
- S.up = await until(() => page.evaluate(() => !!document.querySelector('.hm-card [data-hm-ov]') && !!window.__premiumViewer && !!window.__premiumVwJira), 20000);
60
+ S.up = await until(() => page.evaluate(() => !!document.querySelector('.hm-card .cz-sl') && !!window.__premiumViewer && !!window.__premiumVwJira), 20000);
61
61
  if (S.up) { await (async (g) => { const P = '#czViewer:not([hidden]) [data-hi-v="page"]', r = '#hmList [data-hm-sel^="i:"][aria-current="true"]'; for (let i = 0; i < 4 && !(await g.$(P)) && (await g.$('#czViewer:not([hidden]) [data-cz-vw="back"]')); i++) { await g.click('#czViewer [data-cz-vw="back"]'); await g.waitForTimeout(150); } if (await g.$(P)) return; if (await g.$(r)) await g.click(r); else await g.reload(); await g.waitForSelector(P + ' .hi-pgh [data-hi-addtask]', { timeout: 30000 }); })(page); /* ← back to the initiative's page, else its row, else the address again (an initiative the list does not show) */ await page.click('#czViewer .hi-pgh [data-hi-addtask]'); /* the initiative's page (canvas HbC): its + drills into Tasks */ S.up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]'))); }
62
62
  S.reads.length = 0;
63
63
  return { page, ctx, S };
@@ -48,7 +48,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
48
48
  await page.route('**/api/initiative-premium*', (r) => { const u = r.request().url(); S.gets.push(u); if (!r.request().headers()['x-pmos-nonce']) S.vgets.push(u); const a = answer ? answer(u, S.gets.filter((x) => x === u).length) : { status: 200, body: { ok: true, state: 'ready', model: MODEL, as_of: Date.now() } }; r.fulfill({ status: a.status, contentType: 'application/json', body: JSON.stringify(a.body) }); });
49
49
  await page.route('**/api/briefing-premium/**', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, turns: [], working: false }) }));
50
50
  await page.goto(BASE + '/premium.html?ini=self-serve-v2&ws=w1&board=w1&theme=' + theme);
51
- S.up = await until(() => page.evaluate(() => !!document.querySelector('.hm-card [data-hm-ov]') && !!window.__premiumWorkItem), 20000);
51
+ S.up = await until(() => page.evaluate(() => !!document.querySelector('.hm-card .cz-sl') && !!window.__premiumWorkItem), 20000);
52
52
  return { page, ctx, S };
53
53
  };
54
54
  const viaMore = async (pg, label) => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); await pg.click(`#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${label}"))`); }; // the Overview's other views, Open the full record and Sprint sit under ⋯ (XvATasks)
@@ -87,7 +87,7 @@ const TICKETS = {
87
87
  await page.route('**/api/initiative-premium*', (r) => json(r, { ok: true, state: 'ready', model: IMODEL, as_of: Date.now() }));
88
88
  await page.route('**/api/briefing-premium/**', (r) => json(r, { ok: true, turns: [], working: false }));
89
89
  await page.goto(BASE + '/premium-initiative.html?id=self-serve-v2&ws=w1&board=w1&theme=' + theme); // the Board's expand link: Home with the initiative
90
- await until(() => page.evaluate(() => !!document.querySelector('.hm-card [data-hm-ov]') && !!window.__premiumVwJira), 20000);
90
+ await until(() => page.evaluate(() => !!document.querySelector('.hm-card .cz-sl') && !!window.__premiumVwJira), 20000);
91
91
  await overview(page);
92
92
  await sleep(300); reads.length = 0; posts.length = 0; // Home's own reads; the checks below are about the sprint view's
93
93
  return { ctx, page, errors, posts, reads };
@@ -7,29 +7,37 @@ const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&':
7
7
  /** True when one press answers the whole card: one question that takes one answer. */
8
8
  export const oneTap = (ask) => Array.isArray(ask) && ask.length === 1 && !ask[0].multi;
9
9
 
10
+ /** An option's label without Claude Code's "(Recommended)" mark, and whether it carried it (or the option says recommended: true). */
11
+ const REC = /\s*\(recommended\)\s*$/i;
12
+ export const bare = (o) => String((o && o.label) || '').replace(REC, '');
13
+ export const isRec = (o) => !!o && (o.recommended === true || REC.test(String(o.label || '')));
14
+
10
15
  /** The PM's answer as one message. picked: { '<q>': [option index, …] }. Empty when a question has no answer yet. */
11
16
  export function answerText(ask, picked) {
12
17
  const qs = Array.isArray(ask) ? ask : [];
13
- const parts = qs.map((q, i) => (picked && picked[i] || []).map((k) => q.options[k] && q.options[k].label).filter(Boolean));
18
+ const parts = qs.map((q, i) => (picked && picked[i] || []).map((k) => q.options[k] && bare(q.options[k])).filter(Boolean));
14
19
  if (!qs.length || parts.some((p) => !p.length)) return '';
15
20
  if (qs.length === 1) return parts[0].join(', ');
16
21
  return qs.map((q, i) => (q.header || q.question) + ': ' + parts[i].join(', ')).join('; ');
17
22
  }
18
23
 
19
- /** The card. live: the PM can still answer (nothing was written after the question); picked: the toggled options of a multi card. */
24
+ /** The card, in the one shape every ask takes (canvas XcbOptions "Every kind of ask", kind 3: a choice only the PM can make): the header,
25
+ * the question, then tap answers with the recommended one first and "recommended" under it. live: the PM can still answer (nothing was
26
+ * written after the question); picked: the toggled options of a multi card. The box under the chat already says the PM can write their own. */
20
27
  export function askCardHtml(ask, { live = false, picked = {}, at = '' } = {}) {
21
28
  const qs = Array.isArray(ask) ? ask : [];
22
29
  if (!qs.length) return '';
23
30
  const one = oneTap(qs);
24
31
  const body = qs.map((q, i) => {
25
- const opts = q.options.map((o, k) => {
26
- const on = (picked[i] || []).includes(k);
27
- const act = one ? `data-chat-say="${esc(o.label)}"` : `data-ask-pick="${i}:${k}" aria-pressed="${on}"`;
28
- return `<button type="button" class="chip${on ? ' on' : ''}" ${act}${o.detail ? ` title="${esc(o.detail)}"` : ''}${live ? '' : ' disabled'}>${esc(o.label)}</button>`;
32
+ const order = q.options.map((o, k) => k).sort((a, b) => (isRec(q.options[b]) ? 1 : 0) - (isRec(q.options[a]) ? 1 : 0));
33
+ const opts = order.map((k) => {
34
+ const o = q.options[k], on = (picked[i] || []).includes(k), rec = isRec(o);
35
+ const act = one ? `data-chat-say="${esc(bare(o))}"` : `data-ask-pick="${i}:${k}" aria-pressed="${on}"`;
36
+ const small = rec ? `<small>recommended${o.detail ? ' · ' + esc(o.detail) : ''}</small>` : '';
37
+ return `<button type="button" class="chip chip2${rec ? ' rec' : ''}${on ? ' on' : ''}" ${act}${o.detail ? ` title="${esc(o.detail)}"` : ''}${live ? '' : ' disabled'}>${esc(bare(o))}${small}</button>`;
29
38
  }).join('');
30
- return `<div class="askq">${q.header ? `<p class="askh">${esc(q.header)}${q.multi ? ' · pick any' : ''}</p>` : ''}<p class="tt"><b>${esc(q.question)}</b></p><div class="chips">${opts}</div></div>`;
39
+ return `<div class="askq"><p class="k">${esc(q.header || 'Claude asks')}${q.multi ? ' · pick any' : ''}</p><b class="q">${esc(q.question)}</b><div class="chips2">${opts}</div></div>`;
31
40
  }).join('');
32
41
  const send = !one && live ? `<div class="chatopts"><button type="button" class="cta" data-ask-send="${esc(at)}"${answerText(qs, picked) ? '' : ' disabled'}>Send answers</button></div>` : '';
33
- const foot = live ? '<p class="askfoot">Or write your own answer below.</p>' : '';
34
- return `<p class="agtag">Claude asks</p>${body}${send}${foot}`;
42
+ return `${body}${send}`;
35
43
  }
@@ -1,4 +1,4 @@
1
- /* pm/cozy-home-rows.css — the two rows at the top of Home and the Mentions Viewer (Viewer kit; canvas XvANew, XvAMention*, XvARecHome).
1
+ /* pm/cozy-home-rows.css — the two rows at the top of Home and the Mentions Viewer (Viewer kit; canvas XmsMentionsGrill, XmsDeskList/One/Refine, XvARecHome).
2
2
  * Loaded once by home-mentions.js. Token variables only (cozy.css). The rows reuse Home's row (.hv-card, .hv-r, .hm-rm). */
3
3
 
4
4
  /* ── the rows on Home ── */
@@ -8,6 +8,9 @@
8
8
  .hr-at { color: var(--cz-blueink); font-weight: 800; font-size: 15px; }
9
9
  .hr-men:not(.new) .hr-at { color: var(--cz-ink3); }
10
10
  .hr-new { color: var(--cz-blueink); font-weight: 700; }
11
+ /* the badge counts the asks that wait on the PM (XmsMentionsGrill 4); a new ask adds one line under the name */
12
+ .hr-bd { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--cz-blue); color: var(--cz-onsolid); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; box-sizing: border-box; margin-left: auto; }
13
+ .hr-sub { display: block; font-size: 12.5px; font-weight: 600; color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
11
14
  .hr-rec-card { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--cz-red) 32%, var(--cz-card)); }
12
15
  .hr-rdot { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--cz-dot-red); }
13
16
  .hr-rst { color: var(--cz-red); font-weight: 700; font-variant-numeric: tabular-nums; }
@@ -52,3 +55,38 @@
52
55
  .hr-chk > b { font-size: 13px; color: var(--cz-ink2); }
53
56
  .hr-cl { display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; }
54
57
  .hr-ok { color: var(--cz-ok); flex: none; display: inline-flex; padding-top: 1px; }
58
+
59
+ /* ── Mentions A+ (XmsMentionsGrill, XmsDeskList, XmsDeskOne) ── */
60
+ .hr-sum { background: color-mix(in srgb, var(--cz-well) 60%, var(--cz-card)); border-radius: 20px; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
61
+ .hr-sumb { display: flex; align-items: center; gap: 12px; }
62
+ .hr-sumb .czs-p { flex: 1; min-width: 0; }
63
+ .hr-old { color: var(--cz-risk); font-weight: 700; }
64
+ .hr-rp { width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--cz-solid); color: var(--cz-onsolid); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
65
+ .hr-rp:focus-visible, .hr-ckb:focus-visible, .hr-all:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
66
+ .hr-mi.hr-w8 { align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }
67
+ .hr-mi .hr-mw > span { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
68
+ .hr-mw b { display: flex; align-items: center; gap: 6px; }
69
+ .hr-cn { font-style: normal; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--cz-well); color: var(--cz-ink2); font-size: 11.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
70
+ .hr-age { flex: none; font-size: 12.5px; font-weight: 700; color: var(--cz-ink3); white-space: nowrap; }
71
+ .hr-age.late { color: var(--cz-risk); }
72
+ .hr-dr { font-style: normal; font-weight: 700; color: var(--cz-blueink); }
73
+ .hr-nc { font-style: normal; color: var(--cz-ink3); }
74
+ .hr-st { color: var(--cz-ink3); }
75
+ .hr-rd .hr-mw b { color: var(--cz-ink2); }
76
+ .hr-day { margin: 10px 10px 2px; font-size: 12.5px; font-weight: 800; color: var(--cz-ink3); }
77
+ .hr-day:first-child { margin-top: 2px; }
78
+ .hr-all { display: block; width: 100%; min-height: 44px; border: 0; border-top: 1px solid var(--cz-hair); background: none; font: inherit; font-size: 13.5px; font-weight: 800; color: var(--cz-blueink); cursor: pointer; }
79
+ .hr-ck { display: flex; align-items: center; gap: 6px; margin: 0 4px 8px; padding: 4px 4px 4px 12px; border-radius: 12px; background: var(--cz-riskbg); color: var(--cz-risk); font-size: 13px; font-weight: 700; }
80
+ .hr-ck span { flex: 1; min-width: 0; }
81
+ .hr-ckb { width: 36px; height: 36px; border-radius: 999px; border: 0; background: var(--cz-card); color: var(--cz-ink2); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
82
+ .hr-gap { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; border-radius: 16px; border: 1.5px dashed var(--cz-hair); font-size: 13px; line-height: 1.45; color: var(--cz-ink2); }
83
+ .hr-gap p { margin: 0; flex: 1; min-width: 0; }
84
+ .hr-gap b { color: var(--cz-ink); }
85
+ .hr-acts { justify-content: flex-end; }
86
+ .hr-ia { background: var(--cz-well); }
87
+ .hr-card2 { background: color-mix(in srgb, var(--cz-well) 60%, var(--cz-card)); border-radius: 20px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; line-height: 1.5; }
88
+ .hr-h { font-size: 13px; color: var(--cz-ink2); }
89
+ .hr-found ul { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 6px; }
90
+ .hr-rtxt { margin: 0; border-left: 3px solid var(--cz-blue); padding: 2px 0 2px 12px; font-size: 14px; color: var(--cz-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
91
+ .hr-none { margin: 0; color: var(--cz-ink3); }
92
+ .hr-racts { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }