create-pmos 0.410.0 → 0.411.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 (79) hide show
  1. package/package.json +13 -18
  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 +1 -1
  7. package/workspace/briefing-premium-initiative-test.js +9 -15
  8. package/workspace/changelog.json +12 -0
  9. package/workspace/chat-asks-test.js +146 -0
  10. package/workspace/guide/briefing-premium.md +1 -1
  11. package/workspace/guide/home.md +24 -0
  12. package/workspace/home-rows-test.js +149 -56
  13. package/workspace/ini-workflow-test.js +4 -4
  14. package/workspace/lib/briefing-premium-agent.js +8 -1
  15. package/workspace/lib/engine/boards.js +3 -1
  16. package/workspace/lib/goal-chat.js +94 -30
  17. package/workspace/lib/mention-cli.js +70 -0
  18. package/workspace/lib/mention-store.js +307 -0
  19. package/workspace/lib/pmos-verbs.js +3 -0
  20. package/workspace/lib/routes-boards.js +12 -0
  21. package/workspace/lib/routes-briefing-premium.js +2 -2
  22. package/workspace/lib/routes-mentions.js +62 -9
  23. package/workspace/lib/session-files.js +132 -0
  24. package/workspace/lib/session-name.js +103 -0
  25. package/workspace/lib/source-reads.js +4 -1
  26. package/workspace/package-lock.json +2 -2
  27. package/workspace/package.json +1 -1
  28. package/workspace/premium-board-actions-test.js +10 -8
  29. package/workspace/premium-chat-goal-setup-test.js +203 -0
  30. package/workspace/premium-chat-goal-view-test.js +28 -23
  31. package/workspace/premium-chat-line-test.js +189 -0
  32. package/workspace/premium-vw-backlog-test.js +1 -1
  33. package/workspace/premium-vw-item-test.js +1 -1
  34. package/workspace/premium-vw-jira-test.js +1 -1
  35. package/workspace/public/pm/chat-ask.js +17 -9
  36. package/workspace/public/pm/cozy-home-rows.css +39 -1
  37. package/workspace/public/pm/cozy-home.css +112 -12
  38. package/workspace/public/pm/cozy-search.js +2 -1
  39. package/workspace/public/pm/cozy-steps.css +69 -0
  40. package/workspace/public/pm/cozy-steps.js +90 -0
  41. package/workspace/public/pm/goal-chat.js +141 -23
  42. package/workspace/public/pm/home-app.js +68 -35
  43. package/workspace/public/pm/home-ask.js +121 -0
  44. package/workspace/public/pm/home-chat.js +120 -68
  45. package/workspace/public/pm/home-data.js +10 -2
  46. package/workspace/public/pm/home-goal.js +159 -0
  47. package/workspace/public/pm/home-ini.css +35 -0
  48. package/workspace/public/pm/home-ini.js +50 -19
  49. package/workspace/public/pm/home-line.css +59 -0
  50. package/workspace/public/pm/home-line.js +200 -0
  51. package/workspace/public/pm/home-list.js +2 -2
  52. package/workspace/public/pm/home-mentions.js +303 -111
  53. package/workspace/public/pm/home-ses-name.js +65 -0
  54. package/workspace/public/pm/home-stage-card.js +94 -0
  55. package/workspace/public/pm/home-sweep.js +112 -0
  56. package/workspace/public/pm/home-today.js +7 -2
  57. package/workspace/public/pm/premium-initiative-head.js +8 -4
  58. package/workspace/public/pm/rename-press.js +24 -0
  59. package/workspace/public/pm/wf-page.css +3 -0
  60. package/workspace/public/pm/wf-page.js +2 -1
  61. package/workspace/public/premium-workflows.html +1 -0
  62. package/workspace/server.js +125 -11
  63. package/workspace/session-names-test.js +144 -0
  64. package/workspace/skills/jira-push.skill +1 -0
  65. package/workspace/skills/morning-brief.skill +2 -1
  66. package/workspace/skills/report-daily.skill +1 -0
  67. package/workspace/skills/report-monthly.skill +1 -0
  68. package/workspace/skills/report-weekly.skill +1 -0
  69. package/workspace/skills/sources-read.skill +3 -2
  70. package/workspace/stage-card-test.js +203 -0
  71. package/workspace/test-lists/chat-asks.json +13 -0
  72. package/workspace/test-lists/chat-progress.json +13 -0
  73. package/workspace/test-lists/mentions-a-plus.json +9 -0
  74. package/workspace/test-lists/premium-chat-goal-setup.json +9 -0
  75. package/workspace/test-lists/session-files.json +5 -0
  76. package/workspace/test-lists/session-names.json +13 -0
  77. package/workspace/test-lists/stage-card.json +6 -0
  78. package/workspace/tk-tasks-test.js +1 -1
  79. package/workspace/workflows-setup-test.js +17 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.410.0",
3
+ "version": "0.411.0",
4
4
  "description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -32,6 +32,18 @@
32
32
  "audit"
33
33
  ],
34
34
  "pmosChanges": [
35
+ {
36
+ "v": "0.411.0",
37
+ "at": "2026-10-25T04:42:12.945Z",
38
+ "f": 2,
39
+ "prs": [
40
+ {
41
+ "n": 1042,
42
+ "t": "Stage card, chat progress line, asks, goal setup, Mentions, session names, outside files",
43
+ "s": "Stage card, chat progress line, asks, goal setup, Mentions, session names, outside files"
44
+ }
45
+ ]
46
+ },
35
47
  {
36
48
  "v": "0.410.0",
37
49
  "at": "2026-10-25T04:00:26.037Z",
@@ -264,23 +276,6 @@
264
276
  "s": "Files Claude wrote in a git worktree open in the chat viewer"
265
277
  }
266
278
  ]
267
- },
268
- {
269
- "v": "0.391.0",
270
- "at": "2026-10-22T03:35:32.308Z",
271
- "f": 2,
272
- "prs": [
273
- {
274
- "n": 1004,
275
- "t": "Hide archived report cycles on Insights",
276
- "s": "Hide archived report cycles on Insights"
277
- },
278
- {
279
- "n": 1005,
280
- "t": "Keep recording through a phone lock",
281
- "s": "Keep recording through a phone lock"
282
- }
283
- ]
284
279
  }
285
280
  ]
286
281
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@9849ee4d
1
+ kernel-source: pmos@e87cb4f8
2
2
  assembled: 2026-10-25
3
3
  mode: vendor
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Eval calibration log"
4
4
  description: "Append-only record of every PM override of an evaluator verdict."
5
- generated: {by: process:create-pmos, at: "2026-10-25T04:00:23Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-25T04:42:10Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Health budgets"
4
4
  description: "Closed registry of health-budget anchors (D59), edited only by the PM."
5
- generated: {by: process:create-pmos, at: "2026-10-25T04:00:23Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-25T04:42:10Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Discoveries and friction log"
4
4
  description: "Append-only record of what runs discovered and where the process rubbed."
5
- generated: {by: process:create-pmos, at: "2026-10-25T04:00:23Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-25T04:42:10Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -35,7 +35,7 @@ const CUSTOM = [
35
35
  const PAGES = {
36
36
  board: { file: '/premium-board.html', api: '**/api/board-premium*', scope: 'board:w1', mk: (custom) => BP.build(BF.facts({ custom })), ready: '#ibBody .ini2', btn: '#addDoc', qs: '?theme=' },
37
37
  // the initiative is a layout inside Home (premium-agreed-design): Add a document is in its Overview, a minimal form in the Viewer (Waiting for design)
38
- initiative: { file: '/premium.html', api: '**/api/initiative-premium*', scope: 'initiative:self-serve-v2', mk: (custom) => IP.build(IF.facts({ custom })), ready: '.hm-card [data-hm-ov]', btn: '#czViewer [data-hi-v="docs"]', qs: '?ini=self-serve-v2&ws=w1&board=w1&theme=' },
38
+ initiative: { file: '/premium.html', api: '**/api/initiative-premium*', scope: 'initiative:self-serve-v2', mk: (custom) => IP.build(IF.facts({ custom })), ready: '.hm-card .cz-sl', btn: '#czViewer [data-hi-v="docs"]', qs: '?ini=self-serve-v2&ws=w1&board=w1&theme=' },
39
39
  };
40
40
 
41
41
  (async () => {
@@ -72,7 +72,7 @@ const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-
72
72
  const V = '#czViewer:not([hidden])';
73
73
  // ready: the initiative's page is open in the Viewer (canvas HbC), its kind line from the board's row (kind · anchor) and, when the
74
74
  // initiative reads, its card from the record (the ladder). Before the record reads, the page says it is reading.
75
- async function ready(page, full = true) { return until(() => page.evaluate((f) => /·/.test((document.querySelector('#czViewer:not([hidden]) .cz-vw-kind') || {}).textContent || '') && (!f || (!!document.querySelector('#czViewer .hm-card [data-hm-ov]') && !!((document.querySelector('#czViewer .hm-card .hm-lad b') || {}).textContent || '').trim())), full), 30000); }
75
+ async function ready(page, full = true) { return until(() => page.evaluate((f) => /·/.test((document.querySelector('#czViewer:not([hidden]) .cz-vw-kind') || {}).textContent || '') && (!f || (!!document.querySelector('#czViewer .hm-card .cz-sl') && !!((document.querySelector('#czViewer .hm-card .hm-sch > b') || {}).textContent || '').trim())), full), 30000); }
76
76
  const txt = (p, s) => p.evaluate((q) => ((document.querySelector(q) || {}).textContent || '').replace(/\s+/g, ' ').trim(), s);
77
77
  // the Overview opens on Tasks; a phone keeps the Tasks, Documents and Stage switch, and in shell A on a desktop the other views sit under ⋯ (XvATasks); view names the one to show
78
78
  const LABEL = { tasks: 'Tasks', docs: 'Documents', stage: 'Stage' };
@@ -119,23 +119,18 @@ const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-
119
119
  ok('I1 Menu > Home closes the page and clears the selection, without a reload', await until(() => p.evaluate(() => window.__noReload === 1 && !document.querySelector('#czViewer:not([hidden])') && !document.querySelector('#hmList .sel, #hmList [aria-current="true"]') && /^Message Claude$/.test(document.querySelector('#hmIn').placeholder))));
120
120
  await p.goto(BASE + '/premium.html?ini=self-serve-v2&ws=w1&board=w1&theme=light'); await ready(p);
121
121
 
122
- /* I3 header: the card */
122
+ /* I3 header: the card (stage card D: the stage as a live step list, canvas XscDDesk; stage-card-test.js holds its full behaviour) */
123
123
  const card = await p.evaluate(() => { const c = document.querySelector('#czViewer .hm-card'); const q = (s) => ((c.querySelector(s) || {}).textContent || '').replace(/\s+/g, ' ').trim(), d = (s) => ((document.querySelector(s) || {}).textContent || '').trim();
124
- return { kind: d('#czViewer .cz-vw-kind'), title: d('#czVwTitle'), turn: q('.hm-turn'), stage: q('.hm-br .st'), lad: q('.hm-lad'), cur: q('.hm-lad b'), bars: c.querySelectorAll('.hm-bars i').length, now: c.querySelectorAll('.hm-bars i.now').length, ckh: q('.hm-ckh'), items: [...c.querySelectorAll('.hm-it')].map((x) => x.textContent.replace(/\s+/g, ' ').trim()), then: q('.hm-then'), time: q('.hm-time'), cta: q('[data-hm-cta]') }; });
124
+ return { kind: d('#czViewer .cz-vw-kind'), title: d('#czVwTitle'), stage: q('.hm-sch > b'), of: q('.hm-sch .of'), bars: c.querySelectorAll('.hm-bars i').length, now: c.querySelectorAll('.hm-bars i.now').length, items: [...c.querySelectorAll('.cz-sl > li:not(.tail)')].map((x) => x.textContent.replace(/\s+/g, ' ').trim()), go: c.querySelectorAll('.cz-gob').length, tail: q('.cz-sli.tail'), cta: !!c.querySelector('[data-hm-cta]') }; });
125
125
  ok('I3 the page\'s header names the initiative, its workflow and its anchor (D99)', card.title === 'Self-serve onboarding v2' && /^Product feature · \S/.test(card.kind), JSON.stringify(card));
126
- ok('I3 the card shows the stage the workflow engine derives, with the ladder\'s current step and one bar a step', /Build/.test(card.stage + card.cur) && card.bars === 8 && card.now === 1, JSON.stringify(card));
127
- ok('I1 the card lists what finishes the step, says whose turn it is, and has one CTA', card.items.length > 0 && !!card.turn && !!card.cta && !/pull request|builder agent/i.test(card.items.join(' ')), JSON.stringify(card));
128
- ok('I1 the card has the payoff line and the time in the stage when the record has them', (!card.then || /^Then:/.test(card.then)) && (card.then || card.time), JSON.stringify(card));
126
+ ok('I3 the card shows the stage the workflow engine derives, with one bar a step and the current one marked', card.stage === 'Build' && card.bars === 8 && card.now === 1, JSON.stringify(card));
127
+ ok('I1 the card lists what finishes the step, with the PM\'s step as its one primary', card.items.length > 0 && card.go === 1 && !card.cta && /^\d+ of \d+ done$/.test(card.of) && !/pull request|builder agent/i.test(card.items.join(' ')), JSON.stringify(card));
128
+ ok('I1 the card ends on the next stage and its payoff', /^Deliver/.test(card.tail) && /Moves /.test(card.tail), JSON.stringify(card));
129
129
  if (await p.evaluate(() => !!document.querySelector('.hm-card [data-hm-done]'))) {
130
130
  await p.click('.hm-card [data-hm-done]');
131
131
  ok('I1 the done items open from their summary row', await until(() => p.evaluate(() => document.querySelector('.hm-card [data-hm-done]').getAttribute('aria-expanded') === 'true')));
132
132
  }
133
- ok('I3 Deliver is a milestone: the ladder and the checklist title carry the ◆ mark before it (Agreed design AgInitAgents)', await p.evaluate(() => !!document.querySelector('.hm-card .hm-lad .nx .cz-ms') && !!document.querySelector('.hm-card .hm-ckh .cz-ms') && /To reach Deliver/.test(document.querySelector('.hm-card .hm-ckh').textContent)));
134
- await p.click('.hm-card [data-hm-cfold]');
135
- const fold = await until(() => p.evaluate(() => { const c = document.querySelector('.hm-card'), f = c.querySelector('[data-hm-cfold]'); return f && f.getAttribute('aria-expanded') === 'false' ? { sum: f.textContent.replace(/\s+/g, ' ').trim(), items: c.querySelectorAll('.hm-it').length, then: !!c.querySelector('.hm-then'), time: !!c.querySelector('.hm-time'), cta: !!c.querySelector('[data-hm-cta]') } : null; }));
136
- ok('I3 the checklist folds to one line with its summary; Then and the time line hide, the CTA stays (AgInitSpec)', fold && /^To reach Deliver ?\d+ of \d+ done/.test(fold.sum) && fold.items === 0 && !fold.then && !fold.time && fold.cta, JSON.stringify(fold));
137
- await p.click('.hm-card [data-hm-cfold]');
138
- ok('I3 it unfolds again', await until(() => p.evaluate(() => document.querySelector('.hm-card [data-hm-cfold]').getAttribute('aria-expanded') === 'true' && document.querySelectorAll('.hm-card .hm-it').length > 0)));
133
+ ok('I3 Deliver is a milestone: the card\'s last node carries the ◆ mark before it (Agreed design AgInitAgents)', await p.evaluate(() => !!document.querySelector('.hm-card .cz-sli.tail .cz-ms')));
139
134
  ok('I1 the card wrote nothing on its own', writes(A).length === 0, JSON.stringify(writes(A)));
140
135
 
141
136
  /* I7 documents: the page's Documents shows the ones that need a look and "Show all N" drills into them all (HbCDesk, InDocs) */
@@ -152,8 +147,7 @@ const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-
152
147
  const tk = await p.evaluate((v) => { const o = document.querySelector(v); return { tasks: [...o.querySelectorAll('[data-ov-tkrow]')].map((r) => r.dataset.ovTkrow).sort(), checks: [...o.querySelectorAll('button[data-hi-chk]')].map((b) => b.dataset.hiChk).sort() }; }, V);
153
148
  await p.click('#czViewer [data-cz-vw="back"]');
154
149
  ok('I4 ← from Tasks comes back to the page (HbCDrill)', await until(() => p.evaluate((v) => !!document.querySelector(v + ' [data-hi-v="page"]'), V)));
155
- await p.click(`${V} .hm-card [data-hm-ov]`);
156
- ok('I4 Overview with Claude types the ask into the chat box and sends nothing', await until(() => p.evaluate(() => /^Give me an overview of Self-serve onboarding v2/.test(document.querySelector('#hmIn').value))));
150
+ ok('I4 the card has no Overview tile: the chat box on the page talks about the initiative (stage card D)', await p.evaluate((v) => !document.querySelector(v + ' .hm-card [data-hm-ov]') && /^Message Claude about Self-serve onboarding v2/.test(document.querySelector('#hmIn').placeholder), V));
157
151
  const pm = await moreLabels(p);
158
152
  ok('I4 the page\'s ⋯ holds the stage switch, the stakeholder, the program, the Board and the record, then hold and cancel last (HbCMore)', ['Moves on by itself', 'Add a stakeholder', 'Turn into a program', 'Open on the Board', 'The record', 'Put on hold', 'Cancel the initiative'].every((l) => pm.includes(l)) && pm[pm.length - 1] === 'Cancel the initiative', JSON.stringify(pm));
159
153
  await p.click(`${V} .hi-pgh [data-hi-addtask]`);
@@ -271,7 +265,7 @@ const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-
271
265
  const cs = (s) => { const e = document.querySelector(s); return e ? getComputedStyle(e) : null; };
272
266
  const fab = document.querySelector('#czFab'), fr = fab && fab.getBoundingClientRect();
273
267
  const c = document.querySelector('.hm-card').getBoundingClientRect();
274
- return { font: cs('body').fontFamily, cta: cs('.hm-card [data-hm-cta]').backgroundColor, ctaAlt: document.querySelector('.hm-card [data-hm-cta]').classList.contains('alt'), solid: tok('--cz-solid'), blue: tok('--cz-blue'), well: tok('--cz-well'), card: tok('--cz-card'), box: cs('.hm-card .hm-box').backgroundColor, rad: parseFloat(cs('.hm-card .hm-box').borderTopLeftRadius), fab: fr ? [Math.round(fr.width), Math.round(fr.height)] : null, over: document.documentElement.scrollWidth - innerWidth, cardW: Math.round(c.width) };
268
+ return { font: cs('body').fontFamily, cta: (cs('.hm-card .cz-gob') || cs('.hm-card .cz-mvb') || {}).backgroundColor, ctaAlt: !document.querySelector('.hm-card .cz-gob, .hm-card .cz-mvb'), solid: tok('--cz-solid'), blue: tok('--cz-blue'), well: tok('--cz-well'), card: tok('--cz-card'), box: cs('.hm-card .hm-box').backgroundColor, rad: parseFloat(cs('.hm-card .hm-box').borderTopLeftRadius), fab: fr ? [Math.round(fr.width), Math.round(fr.height)] : null, over: document.documentElement.scrollWidth - innerWidth, cardW: Math.round(c.width) };
275
269
  });
276
270
  const d = [];
277
271
  if (!/^Nunito/.test(g.font)) d.push('font ' + g.font);
@@ -1,4 +1,16 @@
1
1
  [
2
+ {
3
+ "v": "0.411.0",
4
+ "at": "2026-10-25T04:42:12.945Z",
5
+ "f": 2,
6
+ "prs": [
7
+ {
8
+ "n": 1042,
9
+ "t": "Stage card, chat progress line, asks, goal setup, Mentions, session names, outside files",
10
+ "s": "Stage card, chat progress line, asks, goal setup, Mentions, session names, outside files"
11
+ }
12
+ ]
13
+ },
2
14
  {
3
15
  "v": "0.410.0",
4
16
  "at": "2026-10-25T04:00:26.037Z",
@@ -0,0 +1,146 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* chat-asks-test.js — every kind of ask as one card in Home's chat, and a stopped run's divider (initiative premium-agreed-design; canvas
4
+ * XcbOptions "Every kind of ask" and "Routine · a failed run says where and what to do"). Serves the real Home from the real server; the
5
+ * conversation is routed, so each ask is drawn as the session would give it.
6
+ * A1 a file change: Allow and No icons, before → after, the press reaches the session · A2 something that leaves PMOS: Send and No
7
+ * A3 a choice: the recommended answer first, a tap sends it · A4 a point only the PM can judge: Yes, it's done sends the answer
8
+ * A5 something it cannot reach: Sign in opens Settings › Connectors, the paperclip opens the file picker
9
+ * A6 a run that stopped: the amber divider over Claude's last message, the fix under it, no second card · A7 phone, both themes */
10
+ const path = require('path');
11
+ const { spawn } = require('child_process');
12
+ const { findBrowser } = require('./lib/find-browser');
13
+ const T = require('./test-run').configure({ name: 'chat-asks' });
14
+
15
+ const BASE = T.BASE;
16
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
17
+ const until = async (fn, ms = 8000, step = 100) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
18
+ const results = [];
19
+ const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 400) : ''}`); };
20
+ let srv = null; let browser = null;
21
+ const finish = async (code) => {
22
+ if (browser) await browser.close().catch(() => {});
23
+ if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
24
+ T.killTmux();
25
+ const bad = results.filter((x) => !x.cond).length;
26
+ console.log(`\n${results.length - bad}/${results.length} chat-asks assertions passed`);
27
+ process.exit(code !== undefined ? code : (bad ? 1 : 0));
28
+ };
29
+ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
30
+ const SHOTS = process.env.ASKS_SHOTS || ''; // a folder: the suite also saves screenshots there for review
31
+ const shot = async (page, n) => { if (SHOTS) await page.screenshot({ path: path.join(SHOTS, n + '.png'), fullPage: false }); };
32
+ const KEY = 'work:asks-1';
33
+ const block = (tag, o) => '```' + tag + '\n' + JSON.stringify(o) + '\n```';
34
+ const OPTS = [{ n: '1', label: 'Yes' }, { n: '2', label: 'Yes, and don’t ask again' }, { n: '3', label: 'No, and tell Claude what to do differently' }];
35
+ const STEPS = [{ text: 'Calendar', state: 'done' }, { text: 'Mail', state: 'done' }, { text: 'Slack', state: 'done' }, { text: 'Jira', state: 'now' }, { text: 'Write the brief', state: 'next' }];
36
+
37
+ (async () => {
38
+ const exe = findBrowser();
39
+ if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
40
+ let chromium;
41
+ try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
42
+ srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
43
+ await T.waitForServer(BASE);
44
+ browser = await chromium.launch({ executablePath: exe });
45
+
46
+ const open = async ({ w = 1280, h = 900, scheme = 'light' } = {}) => {
47
+ const ctx = await browser.newContext({ viewport: { width: w, height: h }, colorScheme: scheme, hasTouch: w < 1000 });
48
+ const page = await ctx.newPage();
49
+ const errors = [], posts = [], st = { conv: { state: 'conv', turn: 'user', messages: [] } };
50
+ page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
51
+ await page.route('**/api/briefing-premium/**', (r) => { const rq = r.request(); if (rq.method() !== 'GET') posts.push({ path: new URL(rq.url()).pathname, body: JSON.parse(rq.postData() || '{}') }); r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, turns: [], working: false, session: 's-asks' }) }); });
52
+ await page.route('**/api/sessions/conversation**', (r) => r.fulfill({ json: { ok: true, ...st.conv } }));
53
+ await page.goto(BASE + '/premium-chat.html?about=' + encodeURIComponent(KEY), { waitUntil: 'domcontentloaded' });
54
+ await page.waitForFunction(() => !!document.querySelector('#hmIn'), null, { timeout: 15000 });
55
+ return { page, ctx, errors, posts, st };
56
+ };
57
+ const card = (page, kind) => until(async () => page.evaluate((k) => { const c = document.querySelector(`#hmLog .hm-askk[data-ask-kind="${k}"]`); if (!c) return null; const w = c.closest('.hm-askw, .hm-askc');
58
+ return { text: c.textContent.replace(/\s+/g, ' ').trim(), wrap: w ? w.className : '', btns: [...c.querySelectorAll('button')].map((b) => ({ label: b.getAttribute('aria-label') || '', title: b.title, words: b.textContent.trim(), h: Math.round(b.getBoundingClientRect().height), pri: b.classList.contains('pri') })) }; }, kind));
59
+
60
+ let { page, ctx, errors, posts, st } = await open();
61
+ /* A1 a change to the PM's files */
62
+ st.conv = { state: 'conv', turn: 'tool', messages: [{ role: 'user', text: 'Move SSO out of scope', at: '2026-10-25T03:00:00Z' }, { role: 'assistant', text: 'Moving SSO out of scope in the PRD.', at: '2026-10-25T03:00:05Z' }],
63
+ ask: { question: 'Do you want to make this edit to descope-parity.md?', options: OPTS }, change: { system: 'File', what: 'planning/prd/descope-parity.md', from: 'SSO: in scope', to: 'SSO: out of scope', tool: 'Edit' } };
64
+ const a1 = await card(page, 'file');
65
+ ok('A1 a file change: "Asks before it goes on", Edit <path>, before → after', !!a1 && /Asks before it goes on/.test(a1.text) && /Edit planning\/prd\/descope-parity\.md/.test(a1.text) && /SSO: in scope → SSO: out of scope/.test(a1.text), JSON.stringify(a1));
66
+ ok('A1 the answers are icons with names: Allow first and primary, then No, each a 44px target with no words', !!a1 && a1.btns[0].label === 'Allow' && a1.btns[0].title === 'Allow' && a1.btns[0].pri && a1.btns[1].label === 'No' && a1.btns.slice(0, 2).every((b) => b.words === '' && b.h >= 44), JSON.stringify(a1 && a1.btns));
67
+ ok('A1 the card sits in .hm-askw, the place the progress line scrolls to', !!a1 && /hm-askw/.test(a1.wrap));
68
+ await shot(page, 'ask-file-1280');
69
+ await page.click('#hmLog .hm-askk [aria-label="Allow"]');
70
+ ok('A1 Allow presses the prompt\'s first choice in the session', !!(await until(async () => posts.find((p) => p.path.endsWith('/press') && p.body.press === '1'))), JSON.stringify(posts));
71
+ /* A2 something that leaves PMOS */
72
+ st.conv = { ...st.conv, change: { system: 'Jira', what: 'Send 14 tickets to Jira PAY', from: '', to: '', tool: 'mcp__atlassian__createJiraIssue' }, ask: { question: 'Allow?', options: [OPTS[0], OPTS[2]] } };
73
+ const a2 = await card(page, 'send');
74
+ ok('A2 a write to Jira: "Asks before it sends to Jira", ✓ Send and × No', !!a2 && /Asks before it sends to Jira/.test(a2.text) && /Send 14 tickets to Jira PAY/.test(a2.text) && a2.btns[0].label === 'Send' && a2.btns[1].label === 'No', JSON.stringify(a2));
75
+ await page.click('#hmLog .hm-askk [aria-label="No"]');
76
+ ok('A2 No presses the prompt\'s No', !!(await until(async () => posts.find((p) => p.path.endsWith('/press') && p.body.press === '3'))));
77
+ /* A3 a choice only the PM can make */
78
+ st.conv = { state: 'conv', turn: 'user', messages: [{ role: 'user', text: 'Plan the Okta sync', at: '2026-10-25T03:01:00Z' },
79
+ { role: 'tool', at: '2026-10-25T03:01:05Z', tools: { AskUserQuestion: 1 }, calls: [{ tool: 'AskUserQuestion', target: '' }], ask: [{ question: 'Okta group sync: in this release or the next?', options: [{ label: 'This release' }, { label: 'Next release (Recommended)', detail: 'keeps Friday' }] }] }] };
80
+ const a3 = await card(page, 'choice');
81
+ ok('A3 a choice: the question, the recommended answer first with "recommended · keeps Friday"', !!a3 && /Okta group sync/.test(a3.text) && a3.btns[0].words.startsWith('Next release') && /recommended · keeps Friday/.test(a3.btns[0].words) && a3.btns[1].words === 'This release' && a3.btns.every((b) => b.h >= 44), JSON.stringify(a3));
82
+ ok('A3 the card sits in .hm-askc, with no avatar of its own', !!a3 && /hm-askc/.test(a3.wrap) && await page.evaluate(() => !document.querySelector('#hmLog .hm-askc .hm-av')));
83
+ await shot(page, 'ask-choice-1280');
84
+ await page.click('#hmLog .hm-askk[data-ask-kind="choice"] .chip2.rec');
85
+ ok('A3 a tap sends the answer without the "(Recommended)" mark', !!(await until(async () => posts.find((p) => p.path.endsWith('/ask') && p.body.text === 'Next release'))), JSON.stringify(posts.slice(-2)));
86
+ /* A4 a point only the PM can judge */
87
+ st.conv = { state: 'conv', turn: 'user', messages: [{ role: 'user', text: 'Start', at: '2026-10-25T03:02:00Z' },
88
+ { role: 'assistant', at: '2026-10-25T03:09:00Z', text: 'The draft is written; two open questions have owners.\n\n' + block('pmos-ask', { kind: 'judge', point: 'Ready for Dita\'s review', question: 'Is the draft ready for Dita?' }) }] };
89
+ const a4 = await card(page, 'judge');
90
+ ok('A4 a point Claude cannot check: the question, ✓ "Yes, it’s done" and × "Not yet"', !!a4 && /Is the draft ready for Dita\?/.test(a4.text) && a4.btns[0].label === 'Yes, it’s done' && a4.btns[1].label === 'Not yet', JSON.stringify(a4));
91
+ ok('A4 the block is not shown as text in the message', await page.evaluate(() => !/pmos-ask|"kind"/.test(document.querySelector('#hmLog').textContent)));
92
+ await page.click('#hmLog .hm-askk [aria-label="Yes, it’s done"]');
93
+ ok('A4 Yes sends the answer with the point', !!(await until(async () => posts.find((p) => p.path.endsWith('/ask') && p.body.text === 'Yes, it’s done: Ready for Dita\'s review'))), JSON.stringify(posts.slice(-2)));
94
+ /* A5 something it cannot reach */
95
+ st.conv = { state: 'conv', turn: 'user', messages: [{ role: 'user', text: 'Pull the PAY tickets', at: '2026-10-25T03:03:00Z' },
96
+ { role: 'assistant', at: '2026-10-25T03:03:20Z', text: 'I could not read Jira.\n' + block('pmos-ask', { kind: 'reach', what: 'Jira', why: 'sign-in expired' }) }] };
97
+ const a5 = await card(page, 'reach');
98
+ ok('A5 something it cannot reach: "Jira · sign-in expired", the key signs in, the paperclip attaches', !!a5 && /Jira · sign-in expired/.test(a5.text) && a5.btns[0].label === 'Sign in to Jira' && a5.btns[0].pri && a5.btns[1].label === 'Attach a file', JSON.stringify(a5));
99
+ await shot(page, 'ask-reach-1280');
100
+ const chooser = page.waitForEvent('filechooser', { timeout: 4000 }).catch(() => null);
101
+ await page.click('#hmLog .hm-askk [aria-label="Attach a file"]');
102
+ ok('A5 the paperclip opens the file picker of the chat', !!(await chooser));
103
+ await page.click('#hmLog .hm-askk [aria-label="Sign in to Jira"]');
104
+ ok('A5 Sign in opens Settings at Connectors', !!(await until(async () => page.evaluate(() => { const s = document.querySelector('#evSettings'); return !!s && !s.hidden; }))));
105
+ await page.keyboard.press('Escape');
106
+ /* A6 a run that stopped */
107
+ st.conv = { state: 'conv', turn: 'user', steps: STEPS, messages: [{ role: 'user', text: 'Run the morning brief.', at: '2026-10-25T03:04:00Z' },
108
+ { role: 'assistant', at: '2026-10-25T03:06:00Z', text: 'The brief has your calendar and mail; the Jira part is missing.\n' + block('pmos-ask', { kind: 'reach', what: 'Jira', why: 'sign-in expired', need: 'signin' }) }] };
109
+ const a6 = await until(async () => page.evaluate(() => { const d = document.querySelector('#hmLog .pl-dv.stop'); if (!d) return null; const next = d.nextElementSibling;
110
+ const fix = document.querySelector('#hmLog .hm-fix'); return { text: d.textContent.trim(), before: !!next && next.classList.contains('hm-a'), fix: fix ? [...fix.querySelectorAll('button')].map((b) => b.getAttribute('aria-label')) : [], cards: document.querySelectorAll('#hmLog .hm-askk').length, retry: !!document.querySelector('#hmLog .hm-tools [data-hm-retry]') }; }));
111
+ ok('A6 the amber divider says where and why, over Claude\'s last message', !!a6 && a6.text === 'Stopped at 3 of 5: Jira sign-in expired' && a6.before, JSON.stringify(a6));
112
+ ok('A6 the fix sits under the message as icons: Sign in to Jira, Run again; no second card or Retry says it again', !!a6 && a6.fix.join('|') === 'Sign in to Jira|Run again' && a6.cards === 0 && !a6.retry, JSON.stringify(a6));
113
+ await shot(page, 'run-stopped-1280');
114
+ await page.click('#hmLog .hm-fix [aria-label="Run again"]');
115
+ ok('A6 Run again sends the run\'s request again', !!(await until(async () => posts.find((p) => p.path.endsWith('/ask') && p.body.text === 'Run the morning brief.'))), JSON.stringify(posts.slice(-2)));
116
+ st.conv = { state: 'conv', turn: 'user', steps: STEPS, messages: [{ role: 'user', text: 'Run the morning brief.', at: '2026-10-25T03:04:00Z' }, { role: 'assistant', at: '2026-10-25T03:05:00Z', text: 'Which calendar should I read?' }] };
117
+ ok('A6 a pause to ask the PM is not a stop: no divider', !!(await until(async () => page.evaluate(() => /Which calendar/.test(document.querySelector('#hmLog').textContent) && !document.querySelector('#hmLog .pl-dv')))));
118
+ /* A8 the progress line: blue while a pmos-ask waits, a clock while Claude chases people */
119
+ st.conv = { state: 'conv', turn: 'user', messages: [{ role: 'user', text: 'Start', at: '2026-10-25T03:02:00Z' },
120
+ { role: 'assistant', at: '2026-10-25T03:09:00Z', text: 'The draft is written.\n' + block('pmos-ask', { kind: 'judge', point: 'Ready for Dita', question: 'Is the draft ready for Dita?' }) }] };
121
+ ok('A8 a point only the PM can judge turns the line blue: "Claude asks before it goes on"', !!(await until(async () => page.evaluate(() => { const l = document.querySelector('#hmPl .hm-pl'); return !!l && l.classList.contains('you') && /Claude asks before it goes on/.test(l.textContent); }))));
122
+ const chase = { state: 'chasing', what: 'Sign-off on the descope PRD', next: new Date(Date.now() + 2 * 86400000).toISOString(), people: [{ name: 'Dita', status: 'signed off', note: 'Fri 16:40, in Slack', replied: true }, { name: 'Raj', status: 'asked twice', note: 'last nudge Fri 10:00 · no reply' }, { name: 'Mei', status: 'asked once', note: 'out of office until Tue' }] };
123
+ st.conv = { state: 'conv', turn: 'user', messages: [{ role: 'user', text: 'Chase the sign-off', at: '2026-10-25T03:10:00Z' }, { role: 'assistant', at: '2026-10-25T03:10:30Z', text: 'I asked all three.\n' + block('pmos-chase', chase) }] };
124
+ const a8 = await until(async () => page.evaluate(() => { const l = document.querySelector('#hmPl .hm-pl[data-kind="chase"]'); return l ? { text: l.textContent.replace(/\s+/g, ' '), clock: !!l.querySelector('.pl-clk'), stop: (l.querySelector('[data-pl="stop"]') || {}).getAttribute('aria-label') } : null; }));
125
+ ok('A8 chasing people: a clock, "1 of 3 replied", Stop reads "Stop chasing"', !!a8 && a8.clock && /Sign-off on the descope PRD/.test(a8.text) && /1 of 3 replied/.test(a8.text) && a8.stop === 'Stop chasing', JSON.stringify(a8));
126
+ ok('A8 the pmos-chase block is not shown as text', await page.evaluate(() => !/pmos-chase|"people"/.test(document.querySelector('#hmLog').textContent)));
127
+ await shot(page, 'chase-1280');
128
+ await page.click('#hmPl [data-pl="stop"]');
129
+ ok('A8 Stop chasing tells Claude to stop, as a message', !!(await until(async () => posts.find((p) => p.path.endsWith('/ask') && /^Stop chasing: Sign-off on the descope PRD\./.test(p.body.text)))), JSON.stringify(posts.slice(-2)));
130
+ ok('A1-A6 no page errors', errors.length === 0, errors.join(' | '));
131
+ await ctx.close();
132
+
133
+ /* A7 phone, both themes */
134
+ for (const scheme of ['light', 'dark']) {
135
+ ({ page, ctx, errors, st } = await open({ w: 390, h: 844, scheme }));
136
+ st.conv = { state: 'conv', turn: 'tool', messages: [{ role: 'user', text: 'Move SSO out of scope', at: '2026-10-25T03:00:00Z' }, { role: 'assistant', text: 'Moving SSO out of scope in the PRD.', at: '2026-10-25T03:00:05Z' }],
137
+ ask: { question: 'Edit?', options: OPTS }, change: { system: 'File', what: 'planning/prd/a-rather-long-folder-name/descope-feature-parity-review-draft.md', from: 'SSO: in scope', to: 'SSO: out of scope', tool: 'Edit' } };
138
+ await card(page, 'file');
139
+ await shot(page, 'ask-file-390-' + scheme);
140
+ ok(`A7 ${scheme}: on a phone the card and its icons stay inside the width`, await page.evaluate(() => { const w = innerWidth; const c = document.querySelector('#hmLog .hm-askk'); const r = c.getBoundingClientRect(); return r.left >= 0 && r.right <= w + 1 && [...c.querySelectorAll('.acts > button')].every((b) => { const q = b.getBoundingClientRect(); return q.right <= w + 1 && q.height >= 36; }) && document.documentElement.scrollWidth <= w; }));
141
+ ok(`A7 ${scheme}: the primary icon reads against the card`, await page.evaluate(() => { const b = document.querySelector('#hmLog .hm-askk .hm-icb.pri'); const cs = getComputedStyle(b); return cs.backgroundColor !== cs.color; }));
142
+ ok(`A7 ${scheme}: no page errors`, errors.length === 0, errors.join(' | '));
143
+ await ctx.close();
144
+ }
145
+ finish();
146
+ })();
@@ -187,7 +187,7 @@ Not built in premium: translation, Present and the slides stage, Ask PMOS quietl
187
187
  Under Today, the **Around you** card holds what the agents and the outside world have left for you. It has six rows. A row opens a dialog and states what it found in one line. The caption says how many rows wait on you, or "quiet". If a source cannot be read, its row says so and gives the reason. It never reads as empty.
188
188
 
189
189
  - **Agent proposals.** Every open draft of the Initiative Driver, for initiatives and for Work items, when the agent mode for that kind is Approve. Each draft is one card: what it is, its target, and the draft in two lines, with **Read more** for the why and the sources. Press a card to choose it. The bar at the bottom acts on the chosen card. **Keep** is the main press, and **Send back** and **Drop** sit next to it. The notes about undo and the agent mode are behind the ⓘ line. **Keep** records that you accept it and applies it (a problem statement, a stage move, a next step). **Send back** needs a note and starts a new run. **Drop** counts as a correction. None of the three can be undone. A decided proposal stays in the list and says what was recorded.
190
- - **Mentions.** The people who named you in Slack, Jira, Confluence or mail, from today's morning brief. The row names who waits on a reply. **Make it a task** adds one Work item. **Mark read** hides the mention, and **Mark unread** brings it back. **Open in Slack** (or Jira, Confluence, mail) opens the original in a new tab. Nothing here replies, reacts or posts. The Mentions dialog has its own chat, like every popup.
190
+ - **Mentions.** The people who named you in Slack, Jira, Confluence or mail, from today's morning brief. (Home's own Mentions row keeps every unanswered ask and the last 7 days: see [Home](home.md).) The row names who waits on a reply. **Make it a task** adds one Work item. **Mark read** hides the mention, and **Mark unread** brings it back. **Open in Slack** (or Jira, Confluence, mail) opens the original in a new tab. Nothing here replies, reacts or posts. The Mentions dialog has its own chat, like every popup.
191
191
  - **Portfolio pulse.** How many initiatives are late or at risk, by the Calendar's own status: the promised date against the forecast, or the Jira read. It is read only and it is not a forecast of its own. **Open the initiative** goes to its page.
192
192
  - **Horizon scan.** When the scan last ran, when it runs next, its reports and their proposals. Each proposal says what **Approve** does before you press it. **Dismiss** asks for a reason and counts as a correction, and **Undo** takes a dismissal back. **Scan now** starts an agent that reads the public web and the repository, and says how many manual scans are left. The row on the card says it too, before you open the dialog. A scan that is switched off says so and the button stays off.
193
193
  - **Report found.** What the report finder found in your calendar, Slack and the subjects of mail you sent: each finding with its name, why, its evidence lines and how sure it is (Likely or Not sure). **Set up** creates the recurring report and drafts its first cycle on this machine. **Not a report** tells the finder not to raise it again. PMOS drafts only and nothing is sent. **Change first** and the finder settings stay in Insights and the console. A finder that is off says so.
@@ -24,6 +24,21 @@ Home is the page at `/premium.html`. It follows the Agreed design and the "Uncov
24
24
  - The microphone in the chat box turns what you say into text. Nothing is sent until you press send.
25
25
  - A link can open Home at one item: `?item=pt:<program>:<key>` selects a program task, and `?ask=program:<id>` opens the chat about that program. **Discuss in chat** on a program in the Board opens the same program chat. **New session** on an initiative starts a new chat about that initiative.
26
26
 
27
+ ## Mentions
28
+
29
+ **Mentions** is the first row of the list. Its badge counts the asks that wait on your reply. Reading a mention does not clear the badge: answering it does. When a new ask came in since you last opened Mentions, one line under the name says who asks what. With nothing waiting the row stays, with no badge.
30
+
31
+ Press the row to open Mentions in the Viewer (full screen on a phone).
32
+
33
+ - The summary says how many asks wait on you and how old the oldest one is, and who asks what. The round reply button opens the oldest ask.
34
+ - **Waiting on you** lists every ask you have not answered, whatever its age, oldest first. The age is the only signal: it turns amber after 2 days. The same person asking twice in one thread is one row with a count. With more than 5, the oldest 5 show and **Show all** shows the rest. An ask that waited 30 days or more asks once: "Did you answer this already?" ✓ clears it, × keeps it waiting and asks again in 30 days.
35
+ - **Last 7 days** lists what does not wait on you, by day: Today, Yesterday with its date, then dated days. An FYI has a blue dot until you open it. A mention to @channel, @here, a team or from a bot is for your information and never counts as an ask. A mention you answered says how: you replied in the thread, or you marked it answered.
36
+ - What PMOS could not read is said once at the end: a source that is not connected (with Connect), and a check that has not run today (with Check now). When the workspace does not answer, Mentions keeps the last list and says when it is from. It never says that nobody mentioned you because a read failed.
37
+
38
+ One mention shows what is asked and by when, where it is, and its initiative and stage. Four icons act in one press, each with Undo in the toast: **Mark answered** (you answered it somewhere PMOS cannot see), **Remind me tomorrow** (hidden until 09:00 tomorrow, then back with its age), **Make it a task** ("Reply to <name>" on the mention's initiative, or in your own tasks when it has none; the task closes itself when you reply in the source) and **Not an ask**. **What I found** lists what the brief found that answers it. **Proposed reply** is the reply Claude proposes. The pencil opens the chat "Reply to <name>" to change it with Claude; the reply in the Viewer updates while you talk. The send button copies the reply and opens the source. PMOS never posts: the mention keeps waiting, with "Your draft is ready", until you send it there. The messages of the source are folded at the bottom.
39
+
40
+ A reply PMOS sees in the thread clears the ask on the next read. A new ask after your reply makes it wait again, and its age counts from the new ask. Mentions has its own store, so the brief's limit of 30 items cannot crowd a mention out. `pmos mention list` prints what waits on you and the last 7 days. Claude saves a changed reply with `pmos mention draft <id> --text "<reply>"`. Neither command posts anything.
41
+
27
42
  ## An initiative
28
43
 
29
44
  Press an initiative's name in the list, or open `?ini=<id>`. The list stays as it is and the initiative's row is selected. The chat talks about the initiative, and its page opens in the Viewer.
@@ -50,6 +65,15 @@ Press the name in the Viewer's header. The name becomes a field.
50
65
  - A program has no Jira box. Its goal stays as it is.
51
66
  - A Jira ticket keeps its Jira name. Rename it in Jira.
52
67
 
68
+ ## Session names
69
+
70
+ Claude names a session after its first real answer. It does not ask. It changes the name again only when the job changes.
71
+
72
+ - To rename a session, press its name in the chat header. On a phone, press the name in the top bar. Enter saves and Esc cancels, as above.
73
+ - Your name always wins. After you rename a session, Claude does not rename it again.
74
+ - **Undo** gives back the name that Claude gave, and Claude names the session again.
75
+ - The Home row shows the same name.
76
+
53
77
  Some features are still not designed. Home keeps each one usable as a plain card in the Viewer with the label **Waiting for design**. The label means that the card works, but its look is not final.
54
78
 
55
79
  ## New for you, Search, Sources and Settings