create-pmos 0.415.0 → 0.417.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 +25 -25
  2. package/payload/KIT-VERSION +2 -2
  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/payload/state/log.md +1 -1
  7. package/workspace/briefing-premium-adddoc-test.js +3 -3
  8. package/workspace/briefing-premium-board-test.js +72 -43
  9. package/workspace/briefing-premium-doc-edit-test.js +2 -2
  10. package/workspace/briefing-premium-initiative-test.js +19 -22
  11. package/workspace/briefing-premium-insights-test.js +28 -17
  12. package/workspace/changelog.json +24 -0
  13. package/workspace/core-docs-workflow-test.js +1 -1
  14. package/workspace/guide/workflows.md +4 -3
  15. package/workspace/ini-workflow-test.js +11 -11
  16. package/workspace/lib/board-premium.js +7 -2
  17. package/workspace/lib/board-trail.js +6 -1
  18. package/workspace/lib/engine/boards.js +8 -2
  19. package/workspace/lib/initiative-chat.js +4 -3
  20. package/workspace/lib/initiative-premium.js +5 -3
  21. package/workspace/lib/insights-premium.js +9 -1
  22. package/workspace/lib/pmos-verbs.js +1 -1
  23. package/workspace/lib/route-modules.js +1 -0
  24. package/workspace/lib/routes-boards.js +73 -6
  25. package/workspace/lib/routes-live.js +53 -0
  26. package/workspace/lib/task-cli.js +88 -24
  27. package/workspace/lib/task-items.js +3 -1
  28. package/workspace/lib/workflow-cli.js +10 -4
  29. package/workspace/milestone-suggest-test.js +2 -1
  30. package/workspace/package-lock.json +2 -2
  31. package/workspace/package.json +1 -1
  32. package/workspace/premium-board-actions-test.js +12 -8
  33. package/workspace/premium-chat-report-tab-test.js +13 -5
  34. package/workspace/premium-core-doc-issue-test.js +1 -1
  35. package/workspace/premium-report-read-test.js +66 -51
  36. package/workspace/premium-vw-backlog-test.js +3 -3
  37. package/workspace/premium-vw-doc-test.js +3 -3
  38. package/workspace/premium-vw-item-test.js +4 -4
  39. package/workspace/premium-vw-jira-test.js +14 -13
  40. package/workspace/premium-vw-slides-test.js +7 -5
  41. package/workspace/program-panel-test.js +1 -1
  42. package/workspace/public/pm/bd-ini-panel.js +68 -230
  43. package/workspace/public/pm/cozy-insights.css +15 -0
  44. package/workspace/public/pm/cozy-live-pill.css +48 -0
  45. package/workspace/public/pm/cozy-live-pill.js +141 -0
  46. package/workspace/public/pm/cozy-viewer.js +4 -3
  47. package/workspace/public/pm/cozy-vw-rp.css +48 -0
  48. package/workspace/public/pm/home-app.js +45 -8
  49. package/workspace/public/pm/home-chat.js +5 -2
  50. package/workspace/public/pm/home-ini.js +57 -22
  51. package/workspace/public/pm/home-task.js +16 -5
  52. package/workspace/public/pm/ini-view-model.js +277 -0
  53. package/workspace/public/pm/ini-view.css +122 -0
  54. package/workspace/public/pm/ini-view.js +180 -0
  55. package/workspace/public/pm/live-model.js +104 -0
  56. package/workspace/public/pm/ov-view.css +44 -0
  57. package/workspace/public/pm/premium-board.js +15 -16
  58. package/workspace/public/pm/premium-insights.js +61 -35
  59. package/workspace/public/pm/premium-report-read.js +74 -50
  60. package/workspace/public/pm/premium-report-tab.js +36 -15
  61. package/workspace/public/pm/premium-shell.js +1 -1
  62. package/workspace/public/pm/premium-vw-item-model.js +6 -3
  63. package/workspace/public/pm/premium-vw-item.js +25 -6
  64. package/workspace/public/pm/premium-vw-jira.js +17 -15
  65. package/workspace/public/pm/rp-parts.js +75 -12
  66. package/workspace/public/pm/task-card.css +24 -49
  67. package/workspace/public/pm/task-card.js +90 -64
  68. package/workspace/public/pm/tk-view.css +21 -0
  69. package/workspace/public/pm/tk-view.js +216 -0
  70. package/workspace/public/pm/wf-page.js +2 -0
  71. package/workspace/server.js +24 -1
  72. package/workspace/stage-card-test.js +49 -41
  73. package/workspace/task-card-test.js +83 -38
  74. package/workspace/test-files.json +3 -1
  75. package/workspace/test-lists/bd-ini-panel.json +3 -3
  76. package/workspace/tk-tasks-test.js +3 -3
  77. package/workspace/public/pm/bd-ini-model.js +0 -81
  78. package/workspace/public/pm/cozy-rec-pill.css +0 -12
  79. package/workspace/public/pm/cozy-rec-pill.js +0 -46
@@ -22,6 +22,16 @@ const F = require('./fixtures/insights-premium-facts.js');
22
22
 
23
23
  const BASE = T.BASE;
24
24
  const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
25
+ /* SHOTS_1B=<dir>: the Viewer as it is now, light and dark, at 1440 and 390 wide (batch 6 item 1b's screenshots); the page is put back after. */
26
+ const four = async (p, name) => {
27
+ const dir = process.env.SHOTS_1B; if (!dir) return;
28
+ const vp = p.viewportSize();
29
+ for (const [w, h, tag] of [[1440, 900, 'desktop'], [390, 844, 'phone']]) for (const sch of ['light', 'dark']) {
30
+ await p.setViewportSize({ width: w, height: h }); await p.emulateMedia({ colorScheme: sch }); await new Promise((r) => setTimeout(r, 350));
31
+ await p.screenshot({ path: require('path').join(dir, `${name}-${tag}-${sch}.png`) });
32
+ }
33
+ await p.setViewportSize(vp); await p.emulateMedia({ colorScheme: null }); await new Promise((r) => setTimeout(r, 250));
34
+ };
25
35
  const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
26
36
  const results = [];
27
37
  const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
@@ -66,6 +76,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
66
76
  };
67
77
  /* the Viewer card (pm/cozy-viewer.js): its title, and the feature its "Waiting for design" card names */
68
78
  const vw = (pg) => pg.evaluate(() => { const v = document.querySelector('#czViewer'); if (!v || v.hidden) return null; const ph = v.querySelector('[data-cz-placeholder]'); return { title: (v.querySelector('.cz-vw-title') || {}).textContent || '', wait: ph ? ph.dataset.czPlaceholder : null, text: v.querySelector('.cz-vw-body').textContent }; });
79
+ const vwMoreItem = async (pg, label) => { await pg.click('#czViewer [data-cz-vw="more"]'); await sleep(80); await pg.click(`.cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${label}"))`); await sleep(80); };
69
80
  const vwClose = async (pg) => { await pg.evaluate(() => window.czViewer && window.czViewer.close()); await until(() => pg.evaluate(() => { const v = document.querySelector('#czViewer'); return !v || v.hidden; })); };
70
81
 
71
82
  const A = await open();
@@ -166,33 +177,33 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
166
177
  await q.route('**/api/premium-dashboards/save', (r) => { saved.push(JSON.parse(r.request().postData() || '{}')); r.fulfill({ contentType: 'application/json', body: '{"ok":true}' }); });
167
178
  await q.click('#goalTbl [data-goal="krm-act"] .nm');
168
179
  const v = await until(() => vw(q));
169
- /* re-pointed (viewer-shell-a, XvAInsight): the goal is the shell's summary card, the chart, then the folding rows Readings, Moved by and
170
- * On your dashboards; Edit chart is under ⋯; Readings opens on a press */
180
+ /* re-pointed (batch 6 item 1b, canvas OvViewers "Goal"): the summary (on course or not, the source and how fresh, the words), the big
181
+ * number and its target over the chart (the target line, the milestones that move it), Moved by shown open, then the folds Readings and
182
+ * On dashboards. No primary: Add a reading and Edit chart are under ⋯. Readings opens on a press */
171
183
  await q.click('#czViewer [data-czs-fold="read"]'); await sleep(80);
172
- const d = await q.evaluate(() => ({ kind: (document.querySelector('#czViewer .cz-vw-kind') || {}).textContent, tabs: [...document.querySelectorAll('#czViewer .czs-row b')].map((t) => t.textContent).join(), more: !!document.querySelector('#czViewer [data-cz-vw="more"]'), sub: document.querySelector('#czViewer .czs-line').textContent, pri: (document.querySelector('#czViewer .czs-pri') || {}).textContent, tg: (document.querySelector('#czViewer .ins-gch .tgl') || {}).textContent, ship: (document.querySelector('#czViewer .ins-gch .shipl') || {}).textContent, pts: document.querySelectorAll('#czViewer .ins-gch .pt').length, rows: document.querySelectorAll('#czViewer .ins-rd3').length, all: (document.querySelector('#czViewer [data-gx="all"]') || {}).textContent, moved: (document.querySelector('#czViewer [data-czs-fold="moved"] .czs-n') || {}).textContent, sw: [...document.querySelectorAll('#czViewer [data-gx="dash"]')].map((b) => b.getAttribute('aria-label') + ':' + b.getAttribute('aria-checked')).join(), dlg: !!document.querySelector('#dlg') }));
173
- ok('G1 on All goals a goal press opens its detail: the now and target line, Add a reading as the one primary, the rows Readings, Moved by and On your dashboards, and ⋯; no "Waiting for design" (XvAInsight)', v && v.title === 'KR 1.1 · Partner activation' && !v.wait && d.kind === 'Goal' && d.tabs === 'Readings,Moved by,On your dashboards' && d.more && d.sub === '28% now · target 50% by Dec 31' && d.pri === 'Add a reading' && /Down 2% since Oct 1\./.test(v.text) && !d.dlg, JSON.stringify([v, d]));
174
- ok('G1 the chart draws each reading, the target with its value and the ship date of the work that moves it', d.tg === 'Target 50%' && d.ship === 'SSO for partners shipped' && d.pts === 4, JSON.stringify(d));
175
- ok('G1 the newest three readings show with their source, then All 4 readings; Moved by counts the work', d.rows === 3 && d.all === 'All 4 readings' && d.moved === '2', JSON.stringify(d));
184
+ const d = await q.evaluate(() => ({ kind: (document.querySelector('#czViewer .cz-vw-kind') || {}).textContent, tabs: [...document.querySelectorAll('#czViewer .czs-row b')].map((t) => t.textContent).join(), more: !!document.querySelector('#czViewer [data-cz-vw="more"]'), line: (document.querySelector('#czViewer .czs-line > span:not(.czs-dot):not(.czs-r)') || {}).textContent, right: (document.querySelector('#czViewer .czs-line .czs-r') || {}).textContent, sumText: (document.querySelector('#czViewer .czs-p') || {}).textContent, big: (document.querySelector('#czViewer .ins-gnum') || {}).textContent, pri: (document.querySelector('#czViewer .czs-pri') || {}).textContent, tg: (document.querySelector('#czViewer .ins-gch .tgl') || {}).textContent, ship: (document.querySelector('#czViewer .ins-gch .shipl') || {}).textContent, ms: [...document.querySelectorAll('#czViewer .ins-gch .msl')].map((x) => x.textContent).join('|'), now: document.querySelectorAll('#czViewer .ins-gch .pt.now').length, rows: document.querySelectorAll('#czViewer .ins-rd3').length, all: (document.querySelector('#czViewer [data-gx="all"]') || {}).textContent, moved: (document.querySelector('#czViewer .ins-mvh span') || {}).textContent, mv: [...document.querySelectorAll('#czViewer .ins-mvr')].map((a) => a.textContent.replace(/\s+/g, ' ').trim()), sw: [...document.querySelectorAll('#czViewer [data-gx="dash"]')].map((b) => b.getAttribute('aria-label') + ':' + b.getAttribute('aria-checked')).join(), dlg: !!document.querySelector('#dlg') }));
185
+ ok('G1 on All goals a goal press opens its detail: the state line with where the reading comes from and how fresh, the words, the folds Readings and On dashboards, and ⋯; no primary; no "Waiting for design" (OvViewers "Goal")', v && v.title === 'KR 1.1 · Partner activation' && !v.wait && d.kind === 'Goal' && d.tabs === 'Readings,On dashboards' && d.more && d.line === 'Off course' && /^Insights · read /.test(d.right || '') && /^28% now, 50% by Dec 31\. Up 8 points since July\. ≈34% by Dec 31, 16 pts short at this pace\.$/.test(d.sumText || '') && !d.pri && !d.dlg, JSON.stringify([v, d]));
186
+ ok('G1 the big number and its target sit over the chart; the chart draws the target with its value, the ship date of the work that moves it and the latest reading', d.big === '28%target 50% by Dec 31' && d.tg === 'Target 50%' && d.ship === 'SSO for partners shipped' && d.now === 1 && d.ms === 'Evaluate, Oct 23|Deliver, Oct 10', JSON.stringify(d));
187
+ ok('G1 the newest three readings show with their source, then All 4 readings; Moved by is open and counts the work, each with its milestone or stage and plan date', d.rows === 3 && d.all === 'All 4 readings' && d.moved === '2' && d.mv.join('|') === 'SSO for partnersEvaluate, plan Oct 23|Self-serve onboarding v2Deliver, plan Oct 10', JSON.stringify(d));
188
+ await four(q, 'goal');
176
189
  await q.click('#czViewer [data-czs-fold="dash"]'); await sleep(80);
177
190
  const sw = await q.evaluate(() => [...document.querySelectorAll('#czViewer [data-gx="dash"]')].map((b) => b.getAttribute('aria-label') + ':' + b.getAttribute('aria-checked')).join());
178
191
  ok('G1 On your dashboards has a switch for each saved dashboard, on where the goal is', sw === 'On Weekly partner review:true', sw);
179
192
  await q.click('#czViewer [data-cz-vw="more"]'); await sleep(80);
180
193
  const mi = await q.evaluate(() => [...document.querySelectorAll('.cz-vw-menu [role="menuitem"]')].map((b) => b.textContent.trim()).join('|'));
181
- ok('G1 ⋯ holds Edit chart, then Copy link and Copy as text (xvMore order)', /^Edit chart\|Copy link\|Copy as text/.test(mi), mi);
194
+ ok('G1 ⋯ holds Add a reading and Edit chart, then Copy link and Copy as text (xvMore order)', /^Add a reading\|Edit chart\|Copy link\|Copy as text/.test(mi), mi);
182
195
  await q.click('#czViewer .cz-vw-title'); await sleep(80); // a press outside the menu closes it
183
196
  await q.click('#czViewer [data-gx="all"]'); ok('G1 All readings shows every reading', (await q.evaluate(() => document.querySelectorAll('#czViewer .ins-rd3').length)) === 4);
184
- await q.click('#czViewer [data-czs-act="add"]'); await q.fill('#czViewer [data-rdf] [name="v"]', '31'); await q.click('#czViewer [data-rdf] button[type="submit"]'); await until(() => sent.length > 0, 4000);
197
+ await vwMoreItem(q, 'Add a reading'); await q.fill('#czViewer [data-rdf] [name="v"]', '31'); await q.click('#czViewer [data-rdf] button[type="submit"]'); await until(() => sent.length > 0, 4000);
185
198
  ok('G1 Add a reading posts the date and the number to the KR metric reading route', sent.length === 1 && sent[0].rid === 'krm-act' && sent[0].value === 31 && sent[0].at === '2026-10-18' && sent[0].ws === 'w1', JSON.stringify(sent));
186
199
  await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-gx="dash"]')), 4000);
187
200
  await q.click('#czViewer [data-gx="dash"]'); await until(() => saved.length > 0, 4000);
188
201
  ok('G1 the dashboard switch saves that dashboard without the goal', saved[0] && saved[0].id === 'pd-1' && saved[0].charts.join() === 'krm-ttfc,krm-gone' && saved[0].ws === 'w1', JSON.stringify(saved));
189
- if (!(await q.evaluate(() => { const b = document.querySelector('#czViewer [data-czs-fold="moved"]'); return b && b.getAttribute('aria-expanded') === 'true'; }))) await q.click('#czViewer [data-czs-fold="moved"]');
190
- await sleep(100);
191
- ok('G1 Moved by lists the initiatives on their lifecycle track', (await q.evaluate(() => document.querySelectorAll('#czViewer [data-czs-id="moved"] .ins-ini').length)) === 2);
202
+ ok('G1 Moved by lists the initiatives, each a link to it', (await q.evaluate(() => [...document.querySelectorAll('#czViewer .ins-mvb a.ins-mvr')].filter((a) => /premium-initiative\.html/.test(a.href)).length)) === 2);
192
203
  await vwClose(q);
193
204
  await q.click('#goalTbl [data-goal="krm-nps"] .nm'); await until(() => vw(q));
194
- const e1 = await txt('#czViewer .ins-etr', q), p1 = await txt('#czViewer .czs-pri', q);
195
- /* re-pointed (viewer-shell-a): Add a reading is the summary card's one primary, so the empty trend does not repeat it */
205
+ const e1 = await txt('#czViewer .ins-etr', q), p1 = await txt('#czViewer .ins-etr [data-gx="add"]', q);
206
+ /* re-pointed (batch 6 item 1b): the goal Viewer has no primary, so the empty trend carries Add a reading, its next action */
196
207
  ok('G1 a goal with one reading says a trend needs 2 readings and where the next comes from, with Add a reading (IsMenus)', /A trend needs 2 readings\./.test(e1) && p1 === 'Add a reading', e1 + ' | ' + p1);
197
208
  await R.ctx.close();
198
209
  }
@@ -379,7 +390,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
379
390
  ok('L3 a dashboard card opens Goals on that view', (await txt('#viewName', q)) === 'Reliability' && (await q.evaluate(() => document.querySelector('#tabGoals').getAttribute('aria-selected'))) === 'true' && (await q.evaluate(() => [...document.querySelectorAll('#goalTbl [data-goal]')].map((r) => r.dataset.goal).join())) === 'krm-up,krm-churn');
380
391
  await q.click('#tabLibrary'); await q.locator('#listRows [data-rpt]').first().click(); // a report file with no setup opens straight in the reader
381
392
  ok('L4 a report opens in the page\'s reader, not the console (premium-report-read R1; re-pointed by premium-agreed-design: the reader is the report panel in the Viewer card)', await until(() => q.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) .vz-rp0')), 5000) && /premium-insights\.html/.test(q.url()), q.url());
382
- ok('L4 a draft report has Issue in the reader, so nothing sends you to the console to issue it', await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vz-rp0 .czs-sum [data-czs-act="issue"]')), 8000) && await q.evaluate(() => !document.querySelector('#czViewer a[href*="console.html"]')));
393
+ ok('L4 a draft report has Issue it in the reader, so nothing sends you to the console to issue it', await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vz-rp0 .rp-sum [data-r="issue"]')), 8000) && await q.evaluate(() => !document.querySelector('#czViewer a[href*="console.html"]')));
383
394
  await R.ctx.close();
384
395
  const lead = { 'planning/reports/biweekly/2026-10-14.md': 'Activation slipped to 28% this fortnight.' };
385
396
  const R2 = await open({ model: mk({ leads: lead }) });
@@ -537,9 +548,9 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
537
548
  {
538
549
  const R = await open({ w: 390, h: 844 }), q = R.page;
539
550
  await q.click('#goalCards [data-goal="krm-act"]'); await until(() => vw(q));
540
- /* re-pointed (viewer-shell-a, XvAInsight): on a phone it is the same shell, full screen: the summary with Add a reading, the chart, the rows */
541
- const ph = await q.evaluate(() => { const v = document.querySelector('#czViewer').getBoundingClientRect(), b = document.querySelector('#czViewer .cz-vw-body'); return { w: Math.round(v.width), tabs: [...document.querySelectorAll('#czViewer .czs-row b')].map((t) => t.textContent).join(), first: b.firstElementChild.className, add: (document.querySelector('#czViewer .czs-pri') || {}).textContent, over: document.documentElement.scrollWidth > innerWidth }; });
542
- ok('P1 on a phone the goal detail covers the screen: the summary with Add a reading first, then Readings, Moved by and On your dashboards', ph.w === 390 && ph.tabs === 'Readings,Moved by,On your dashboards' && ph.first === 'czs-sum' && ph.add === 'Add a reading' && !ph.over, JSON.stringify(ph));
551
+ /* re-pointed (batch 6 item 1b, OvViewers phone): the same Viewer, full screen: the summary first, the big number and chart, Moved by, the folds */
552
+ const ph = await q.evaluate(() => { const v = document.querySelector('#czViewer').getBoundingClientRect(), b = document.querySelector('#czViewer .cz-vw-body'); return { w: Math.round(v.width), tabs: [...document.querySelectorAll('#czViewer .czs-row b')].map((t) => t.textContent).join(), first: b.firstElementChild.className, order: [...b.children].map((x) => x.className.split(' ')[0]).join(), over: document.documentElement.scrollWidth > innerWidth }; });
553
+ ok('P1 on a phone the goal detail covers the screen: the summary first, the big number and chart, Moved by, then Readings and On dashboards', ph.w === 390 && ph.tabs === 'Readings,On dashboards' && ph.first === 'czs-sum' && /^czs-sum,ins-gbig,ins-mvb,czs-secs/.test(ph.order) && !ph.over, JSON.stringify(ph));
543
554
  await q.click('#czViewer [data-czs-fold="dash"]'); await sleep(80);
544
555
  ok('P1 the On your dashboards row holds the switches', (await q.evaluate(() => document.querySelectorAll('#czViewer [data-czs-id="dash"] [data-gx="dash"]').length)) === 1);
545
556
  await vwClose(q);
@@ -1,4 +1,28 @@
1
1
  [
2
+ {
3
+ "v": "0.417.0",
4
+ "at": "2026-10-26T01:02:52.959Z",
5
+ "f": 2,
6
+ "prs": [
7
+ {
8
+ "n": 1053,
9
+ "t": "Stage moves land on the stage asked for (hotfix)",
10
+ "s": "Pmos workflow move and Board drops land on the Product feature stage you ask for, by key, by name, or by number, even when the board merges two stages into one column."
11
+ }
12
+ ]
13
+ },
14
+ {
15
+ "v": "0.416.0",
16
+ "at": "2026-10-26T00:23:58.708Z",
17
+ "f": 2,
18
+ "prs": [
19
+ {
20
+ "n": 1050,
21
+ "t": "Sixth testing feedback batch (items 1–5)",
22
+ "s": "Sixth testing feedback batch (items 1–5)"
23
+ }
24
+ ]
25
+ },
2
26
  {
3
27
  "v": "0.415.0",
4
28
  "at": "2026-10-25T15:54:44.873Z",
@@ -102,7 +102,7 @@ const OLD = new Map([['initiative:' + ID + '|risks', { drafts: [], issued: { at:
102
102
  await page.goto(BASE + '/premium.html?ini=' + ID + '&ws=w1&board=w1&theme=' + theme);
103
103
  let up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]')), 30000);
104
104
  if (up) {
105
- if (await page.$('#czViewer [data-hi-v="page"] [data-hi-open="docs"]')) await page.click('#czViewer [data-hi-open="docs"]');
105
+ if (await page.$('#czViewer [data-hi-v="page"] [data-iv-docs]')) await page.click('#czViewer [data-iv-docs]');
106
106
  else { await page.click('#czViewer [data-cz-vw="more"]'); await until(() => page.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); await page.click('#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("Documents"))'); }
107
107
  up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v="docs"] .czs-secs')), 15000);
108
108
  }
@@ -2,7 +2,7 @@
2
2
  type: Guide
3
3
  title: "Workflows: the stages each kind of initiative goes through"
4
4
  description: "Settings › Workflows: the workflow list, one numbered list of stages across To do, In progress and Done, the stage panel, Only when conditions, removing a stage in use, New workflow in the chat, and the pmos workflow commands."
5
- timestamp: 2026-10-25
5
+ timestamp: 2026-10-26
6
6
  ---
7
7
 
8
8
  # Workflows
@@ -57,7 +57,7 @@ An agent writes a draft or a reading with these commands, and moves an initiativ
57
57
  - `pmos workflow show-draft` shows the draft that is open.
58
58
  - `pmos workflow judge --board <id> --id <initiative> --stage <key> --runs yes|no|unsure --why <reason> --cite <where>` records PMOS's reading of an Only when stage. **unsure** makes PMOS ask you. `--undo` takes a reading back.
59
59
  - `pmos workflow of <initiative>` shows the workflow the initiative runs, its current stage, and each stage numbered as done, current or skipped. It reads the same row as the Board.
60
- - `pmos workflow move <initiative> --stage <key|name>` moves the initiative to a stage of its own workflow. `--why` adds the reason. The move writes the same line as a move on the Board, under the agent's name.
60
+ - `pmos workflow move <initiative> --stage <key|name|number>` moves the initiative to a stage of its own workflow. A number counts from 1 in the workflow's order, so `--stage 5` is the fifth stage. `--why` adds the reason. The move writes the same line as a move on the Board, under the agent's name. On a board whose columns join two stages, such as **Build & Deliver**, the initiative still goes to the stage you name, and the joined column name means its first stage.
61
61
  - `pmos workflow switch <initiative> --to <workflow id>` puts the initiative on another workflow. `--stage` picks the stage it lands in; without it, the stage is the one the Board's switch picks.
62
62
 
63
63
  ### Workflow stage and task state
@@ -68,8 +68,9 @@ An initiative's **workflow stage** is the stage on its stage card and on the Boa
68
68
 
69
69
  An agent adds and closes tasks when you ask, so you do not have to find the task on the Board yourself. There is one kind of task: the tasks in the initiative's Tasks section. The older breakdown items (`pmos item`) and the To finish entries of the current stage are tasks too, and these commands list and close them.
70
70
 
71
- - `pmos task add <initiative> "<title>"` adds a task. `--due` and `--start` set its days, `--owner` its owner and `--notes` its notes. The task is the same as one added with Add a task on the page, under the agent's name.
71
+ - `pmos task add <initiative> "<title>"` adds a task. `--stage` puts it under a stage, `--due` and `--start` set its days, `--owner` its owner and `--notes` its notes. The task is the same as one added with Add a task on the page, under the agent's name.
72
72
  - `pmos task list <initiative>` lists the initiative's open tasks (To do and In progress) with their ids. `--all` adds the Done, Won't do and Archived tasks.
73
73
  - `pmos task state <task> [<task> …] --to <state>` sets the state of one or more tasks: To do, In progress, Done, Won't do or Archived. `--why` adds the reason, and for Done it is the evidence you read. Each change writes the same line as the page's press, under the agent's name. Won't do on a breakdown item withdraws it, and it cannot come back.
74
+ - `pmos task set <task> [<task> …] --stage <stage>` puts one or more tasks under a stage of the initiative's workflow, by the stage's key or name. `--stage none` takes them out of every stage. The Tasks section groups the tasks by these stages. A task's stage is its place in the plan: it does not change the task's state, and it does not move the initiative. `set` also takes `--due`, `--start`, `--owner` and `--notes`; `--due none` and `--start none` clear a day.
74
75
 
75
76
  When an initiative reaches a stage, each entry of that stage's To finish list becomes one task, once. Closing that task, on the stage card, in the Tasks section or with `pmos task state`, marks the entry done on the stage card.
@@ -86,7 +86,7 @@ const BRIEF = BRP.build(BRF.facts());
86
86
  for (const p of ['ini-wf', 'wontdo', 'archive', 'ini-auto', 'move']) await page.route('**/api/boards/' + p, (r) => json(r, { ok: true, row: {} }));
87
87
  if (!fresh) await page.addInitScript(() => { try { localStorage.setItem('pmos.wf.seen', JSON.stringify({ 'self-serve-v2|tender': 1 })); } catch { /* none */ } });
88
88
  await page.goto(BASE + '/premium.html?ini=' + ID + '&ws=w1&board=w1&theme=' + theme);
89
- const up = await until(() => page.evaluate(() => /Tender/.test((document.querySelector('#czViewer:not([hidden]) .cz-vw-kind') || {}).textContent || '') && !!document.querySelector('#czViewer [data-hi-v="page"] .hm-card [data-hm-wf]')), 30000);
89
+ const up = await until(() => page.evaluate(() => /Tender/.test((document.querySelector('#czViewer:not([hidden]) .cz-vw-kind') || {}).textContent || '') && !!document.querySelector('#czViewer [data-hi-v="page"] .iv-meta [data-iv-wf]')), 30000);
90
90
  return { ctx, page, errors, posts, up, S };
91
91
  };
92
92
  const V = '#czViewer:not([hidden])';
@@ -95,19 +95,19 @@ const BRIEF = BRP.build(BRF.facts());
95
95
  const pickMore = async (p, label) => { await p.click('#czViewer [data-cz-vw="more"]'); await until(() => p.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); await p.click(`#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${label}"))`); };
96
96
 
97
97
  const A = await open(), p = A.page;
98
- ok('W1 the page opens on the initiative with the workflow\'s icon on its card', A.up, await txt(p, V + ' .cz-vw-kind'));
98
+ ok('W1 the page opens on the initiative with the workflow on its meta line', A.up, await txt(p, V + ' .cz-vw-kind'));
99
99
  ok('W1 the kind line names the workflow and the anchor: "Tender · KR 1.1" (Kind becomes Workflow)', /^Tender · KR 1\.1$/.test(await txt(p, V + ' .cz-vw-kind')), await txt(p, V + ' .cz-vw-kind'));
100
- ok('W1 the card names the stage of that workflow: Triage', (await txt(p, V + ' .hm-card .hm-sch > b')) === 'Triage', await txt(p, V + ' .hm-card .hm-sch'));
101
- ok('W1 the ladder draws the ten stages of Tender, three of them milestones', await p.evaluate((v) => document.querySelectorAll(v + ' .hm-card .hm-bars i').length === 10, V));
102
- ok('W1 the next stage is Tender\'s own: the card\'s last node is Requirements', /^Requirements/.test(await txt(p, V + ' .hm-card .cz-sli.tail')), await txt(p, V + ' .hm-card .cz-sli.tail'));
103
- ok('W1 the icon names the workflow for a screen reader', await p.evaluate((v) => /Workflow: Tender/.test(document.querySelector(v + ' [data-hm-wf]').getAttribute('aria-label')), V));
100
+ ok('W1 the card names the stage of that workflow: Triage', (await txt(p, V + ' .iv-sch > b')) === 'Triage', await txt(p, V + ' .iv-sch'));
101
+ ok('W1 the ladder draws the ten stages of Tender, three of them milestones', await p.evaluate((v) => document.querySelectorAll(v + ' .iv-lad i').length === 10 && document.querySelectorAll(v + ' .iv-lad i.ms').length === 3, V));
102
+ ok('W1 the next stage is Tender\'s own: the card\'s last line is Requirements', /^Requirements/.test(await txt(p, V + ' .iv-nx')), await txt(p, V + ' .iv-nx'));
103
+ ok('W1 the icon names the workflow for a screen reader', await p.evaluate((v) => /Workflow: Tender/.test(document.querySelector(v + ' [data-iv-wf]').getAttribute('aria-label')), V));
104
104
  ok('W2 PMOS set it from the BRD: the toast says so, with Undo (WfTriage)', await until(() => p.evaluate(() => { const t = document.getElementById('hiToast'); return !!t && !t.hidden && /Set to Tender from the BRD/.test(t.textContent) && !!t.querySelector('[data-hi-undo]'); })));
105
105
  await shot(p, 'triage-1440');
106
106
  await p.click('#hiToast [data-hi-undo]');
107
107
  ok('W2 Undo puts it back on the workflow it ran before', await until(() => A.posts.some((x) => x.path === '/api/boards/ini-wf' && x.body.wf === 'product-feature' && x.body.id === ID)), JSON.stringify(A.posts));
108
108
 
109
109
  // W3 the Change picker
110
- await p.click(V + ' [data-hm-wf]');
110
+ await p.click(V + ' [data-iv-wf]');
111
111
  const pick = await until(() => p.evaluate(() => { const el = document.querySelector('.hi-pop[role="listbox"]'); if (!el) return null; return { opts: [...el.querySelectorAll('[role="option"]')].map((o) => o.textContent.replace(/\s+/g, ' ').trim() + (o.getAttribute('aria-selected') === 'true' ? '*' : '')), text: el.textContent }; }));
112
112
  ok('W3 the picker lists every workflow with its stage count, Tender picked', pick && JSON.stringify(pick.opts) === JSON.stringify(['Product feature8', 'Tender10*']), JSON.stringify(pick));
113
113
  ok('W3 it offers New workflow…, shows Tender\'s stage chain and why PMOS picked it', pick && /New workflow…/.test(pick.text) && /Triage → Requirements → ◆\sRFP out/.test(pick.text) && /Why: “choose a vendor/.test(pick.text), pick && pick.text);
@@ -139,7 +139,7 @@ const BRIEF = BRP.build(BRF.facts());
139
139
  await p.reload();
140
140
  await until(() => p.evaluate((v) => !!document.querySelector(v + ' .hi-end'), V), 30000);
141
141
  ok('W7 the page of a Won’t do says why, and offers Back to Triage', /Won't do · No budget: Moved to next year’s budget\./.test(await txt(p, V + ' .hi-end')), await txt(p, V + ' .hi-end'));
142
- ok('W7 its stage does not move: the card says how to bring it back', /bring it back to Triage/.test(await txt(p, V + ' .hm-card .cz-sli.tail')) && !(await p.evaluate((v) => !!document.querySelector(v + ' .hm-card [data-hi-next], ' + v + ' .hm-card [data-hi-move]'), V)), await txt(p, V + ' .hm-card .cz-sli.tail'));
142
+ ok('W7 its stage does not move: the card has no next stage to move to', !(await p.evaluate((v) => !!document.querySelector(v + ' .iv-sc .iv-nx, ' + v + ' [data-iv-next]'), V)), await txt(p, V + ' .iv-sc'));
143
143
  ok('W7 ⋯ has Back to Triage in place of Won’t do', await moreLabels(p).then((l) => l.includes('Back to Triage') && !l.includes('Won’t do')));
144
144
  await shot(p, 'wontdo-page-1440');
145
145
  await p.click(V + ' .hi-end [data-wf-back]');
@@ -149,10 +149,10 @@ const BRIEF = BRP.build(BRF.facts());
149
149
 
150
150
  // W8 the phone, and dark
151
151
  const P = await open({ w: 390, h: 844, fresh: false, B: board('requirements') });
152
- ok('W8 the phone opens the page with the workflow at Requirements, the second of its ten bars', P.up && (await txt(P.page, V + ' .hm-card .hm-sch > b')) === 'Requirements' && await P.page.evaluate((v) => { const b = [...document.querySelectorAll(v + ' .hm-card .hm-bars i')]; return b.length === 10 && b[1].classList.contains('now'); }, V));
152
+ ok('W8 the phone opens the page with the workflow at Requirements, the second of its ten bars', P.up && (await txt(P.page, V + ' .iv-sch > b')) === 'Requirements' && await P.page.evaluate((v) => { const b = [...document.querySelectorAll(v + ' .iv-lad i')]; return b.length === 10 && b[1].classList.contains('now'); }, V));
153
153
  ok('W8 the toast shows once only: seen before, not again', !(await P.page.evaluate(() => { const t = document.getElementById('hiToast'); return !!t && !t.hidden; })));
154
154
  await shot(P.page, 'page-390');
155
- await P.page.click(V + ' [data-hm-wf]');
155
+ await P.page.click(V + ' [data-iv-wf]');
156
156
  await until(() => P.page.evaluate(() => !!document.querySelector('.hi-pop[role="listbox"]')));
157
157
  await shot(P.page, 'picker-390');
158
158
  await P.page.click('.hi-pop [data-wf-pick="product-feature"]');
@@ -166,7 +166,7 @@ const BRIEF = BRP.build(BRF.facts());
166
166
  ok('W8 no page error on the phone', !P.errors.length, P.errors.join(' | '));
167
167
  await P.ctx.close();
168
168
  const D = await open({ theme: 'dark', fresh: false });
169
- await D.page.click(V + ' [data-hm-wf]');
169
+ await D.page.click(V + ' [data-iv-wf]');
170
170
  await until(() => D.page.evaluate(() => !!document.querySelector('.hi-pop[role="listbox"]')));
171
171
  await shot(D.page, 'picker-1440-dark');
172
172
  ok('W8 dark: the picker draws, no page error', D.up && !D.errors.length, D.errors.join(' | '));
@@ -270,6 +270,8 @@ function rowOf(r, wf, today) {
270
270
  };
271
271
  }
272
272
 
273
+ const TASK_MAX = 400; // the tasks one initiative's view reads (a WBS of a few hundred lines)
274
+
273
275
  function build(f) {
274
276
  const now = f.now || Date.now();
275
277
  const today = new Date(now); const todayIso = today.getFullYear() + '-' + pad(today.getMonth() + 1) + '-' + pad(today.getDate());
@@ -296,9 +298,12 @@ function build(f) {
296
298
  for (const w of f.items || []) {
297
299
  if (!w || w.src !== 'pmos' || w.kind === 'Epic' || !w.ini || !w.uid || w.status === 'Archived') continue;
298
300
  if (!taskBy.has(w.ini)) taskBy.set(w.ini, []);
299
- taskBy.get(w.ini).push({ uid: w.uid, title: clip(w.title || '', 160), status: w.status || 'To do', owner: w.owner || '', end: w.end || '', ...(w.from ? { from: { stage: w.from.stage, finish: w.from.finish } } : {}) });
301
+ taskBy.get(w.ini).push({ uid: w.uid, title: clip(w.title || '', 160), status: w.status || 'To do', owner: w.owner || '', end: w.end || '', ...(w.from ? { from: { stage: w.from.stage, finish: w.from.finish } } : {}),
302
+ // one view (feedback batch 6 item 1): its place in the breakdown, and a breakdown item's own stage and order
303
+ ...(typeof w.section === 'string' ? { section: w.section } : {}), ...(w.itemStage ? { itemStage: w.itemStage } : {}), ...(Number.isFinite(w.order) ? { order: w.order } : {}), ...(w.store === 'item' ? { item: true } : {}) });
300
304
  }
301
- for (const r of rows.concat(stageRows, gone.cancelled, gone.archived)) if (!r.tasks) r.tasks = (taskBy.get(r.id) || []).slice(0, 60);
305
+ // every task, not the first 60: the Board's panel and Home count the same tasks (feedback batch 6 item 1: Board said 56 done, Home 61)
306
+ for (const r of rows.concat(stageRows, gone.cancelled, gone.archived)) if (!r.tasks) r.tasks = (taskBy.get(r.id) || []).slice(0, TASK_MAX);
302
307
  for (const r of rows.concat(stageRows, gone.cancelled, gone.archived)) if (!r.track) {
303
308
  r.track = trackOf(r, tkBy.get(r.id), todayIso, relOfIni.get(r.id)); r.theme = themeOf(r.anchor);
304
309
  if (epicBy.has(r.id) && !r.epics.includes(epicBy.get(r.id))) r.epics.unshift(epicBy.get(r.id));
@@ -5,6 +5,7 @@
5
5
  * trail({ root, ids, rows, moves, now, io }) → { ok, at, usual, themes, items: { [id]: item } }
6
6
  *
7
7
  * Everything is DERIVED from what the repository already holds. Nothing here writes:
8
+ * · the stages it ran its board moves of the current workflow, oldest first ({ to, at }), for the one view's stage dates
8
9
  * · days in the current stage the last board move into the stage (the board ledger), else the first appearance in git of
9
10
  * the newest artifact on the initiative's ladder (record, PRD, rubric, evaluation)
10
11
  * · "usually N days" per stage the median days past initiatives spent in that stage, from the same dates (record → PRD is
@@ -223,8 +224,12 @@ function trail({ root, ids, rows = [], moves = [], now = Date.now(), io } = {})
223
224
  const tickets = {};
224
225
  for (const t of tks) if (t.key && t.jira) tickets[t.key] = { subtasks: t.jira.subtasks || null, reason: t.jira.reason || null, flagged: !!t.jira.flagged };
225
226
 
227
+ // the moves of its current workflow, oldest first: the one view dates each stage it ran (feedback batch 6 item 1)
228
+ const mvAll = (byIni.get(id) || []).slice().sort((a, b) => String(a.at).localeCompare(String(b.at)));
229
+ let mvFrom = 0; if (wk) for (let i = 0; i < mvAll.length; i++) if (mvAll[i].via === 'ini-wf') mvFrom = i;
230
+ const ran = mvAll.slice(mvFrom).filter((m) => m.to && m.at).slice(-40).map((m) => ({ to: String(m.to), at: dayIso(Date.parse(m.at)) }));
226
231
  items[id] = {
227
- since: since ? dayIso(since) : null, sinceFrom, days: since ? Math.max(0, Math.floor((now - since) / DAY)) : null,
232
+ since: since ? dayIso(since) : null, sinceFrom, days: since ? Math.max(0, Math.floor((now - since) / DAY)) : null, moves: ran,
228
233
  skipped, parts, next: parts ? (parts.find((p) => !p.done) || {}).name || null : null, you,
229
234
  links: { prd: prdRel, prdVersion: prdRel && (typeof prdFm.version === 'string' || typeof prdFm.version === 'number') && String(prdFm.version).trim() ? String(prdFm.version).trim().slice(0, 12) : null,
230
235
  rubric: rubRel, evaluation: evals[0] || null, epic: jv && jv.ok && jv.epic && jv.epic.key ? jv.epic.key : null },
@@ -38,6 +38,9 @@
38
38
  * task { task, type: Task|Epic, initiative, title, epic, owner, state, start, due } a PMOS task (or PMOS epic) on the board
39
39
  * task-update { task, state?, start?, due?, title?, owner?, notes?, initiative?, why } a status move, a reschedule, a rename or an edit in the Viewer
40
40
  * ticket-note { ref, notes } the PM's own notes on a Jira ticket (Jira keeps its fields)
41
+ * task-section { task, section } a task's place in the breakdown (one view, feedback batch 6 item 1): the key
42
+ * of a stage of its initiative's workflow, '' for "Not in a stage". It is the task's place, never its state, and moving a task
43
+ * never moves the initiative. `task` is a Board task or a breakdown item; the last line wins.
41
44
  * Nothing is deleted. A line that is not an object with a known kind is skipped.
42
45
  *
43
46
  * STAGE OF AN INITIATIVE on a team board: the last move recorded for it on that board (a workflow edit's `moved` and an
@@ -158,7 +161,7 @@ function foundOf(f) {
158
161
  const sources = Array.isArray(f.sources) ? f.sources.filter((x) => x && typeof x.ref === 'string').slice(0, 8).map((x) => ({ label: String(x.label || ''), ref: x.ref })) : [];
159
162
  return { why: typeof f.why === 'string' ? f.why : '', sources, match: typeof f.match === 'string' && f.match ? f.match : null, scan: typeof f.scan === 'string' ? f.scan : null, run: typeof f.run === 'string' ? f.run : null };
160
163
  }
161
- const KINDS = new Set(['board', 'workflow', 'move', 'assign', 'ask', 'ask-accept', 'ask-decline', 'ask-more', 'ini-workflow', 'task', 'task-update', 'task-remove', 'ticket-note', 'ini-epics', 'ini-archive', 'ini-notdup', 'ini-wf', 'ini-end', 'stage-judge', 'ini-auto']);
164
+ const KINDS = new Set(['board', 'workflow', 'move', 'assign', 'ask', 'ask-accept', 'ask-decline', 'ask-more', 'ini-workflow', 'task', 'task-update', 'task-remove', 'ticket-note', 'ini-epics', 'ini-archive', 'ini-notdup', 'ini-wf', 'ini-end', 'stage-judge', 'ini-auto', 'task-section']);
162
165
  // A task's state is its only stage (Wawan, 2026-10-25): the same five every workflow ends in. An old 'In review' reads as In progress (taskState).
163
166
  const TASK_STATES = Object.freeze(['To do', 'In progress', 'Done', "Won't do", 'Archived']);
164
167
  const taskState = (s) => (s === 'In review' ? 'In progress' : TASK_STATES.includes(s) ? s : null);
@@ -187,6 +190,7 @@ function fold(events) {
187
190
  const stages = new Map(); // key(board, id) → stage name (the last move)
188
191
  const iniWorkflows = new Map(); // key(board, id) → { template, stages } (the initiative's own workflow)
189
192
  const tasks = new Map(); // task id → { id, board, initiative, title, epic, owner, state, start, due, at, by, history }
193
+ const sections = new Map(); // task id → the stage key its breakdown section is ('' = Not in a stage); the last task-section line wins
190
194
  const ticketNotes = new Map(); // key(board, Jira key) → the PM's notes on that ticket (the last ticket-note line wins)
191
195
  const epics = new Map(); // initiative id → the Jira epic keys the PM linked to it (the last ini-epics line wins)
192
196
  const archives = new Map(); // initiative id → { at, by, reason, into, moved } while archived (an `archived: false` line restores it)
@@ -268,6 +272,8 @@ function fold(events) {
268
272
  if (typeof e.owner === 'string') t.owner = e.owner.trim() || null; // the Viewer's edits (canvas XetX1Rest); '' clears
269
273
  if (typeof e.notes === 'string') t.notes = e.notes;
270
274
  t.history.push({ at: e.at || null, by: e.by || null, state: e.state || null, start: e.start || null, due: e.due || null, why: e.why || '' });
275
+ } else if (e.kind === 'task-section' && typeof e.task === 'string' && e.task && typeof e.section === 'string') {
276
+ sections.set(e.task, e.section);
271
277
  } else if (e.kind === 'ticket-note' && b && typeof e.ref === 'string' && typeof e.notes === 'string') {
272
278
  if (e.notes) ticketNotes.set(key(b, e.ref), e.notes); else ticketNotes.delete(key(b, e.ref));
273
279
  } else if (e.kind === 'task-remove' && typeof e.task === 'string' && tasks.has(e.task)) {
@@ -310,7 +316,7 @@ function fold(events) {
310
316
  Object.assign(a, { state: 'declined', why: e.why || '', closedAt: e.at || null });
311
317
  }
312
318
  }
313
- return { boards, moves, assigns, asks, stages, iniWorkflows, tasks, ticketNotes, epics, archives, notDup, iniWf, ends, judged, autoOver, events: list };
319
+ return { boards, moves, assigns, asks, stages, iniWorkflows, tasks, sections, ticketNotes, epics, archives, notDup, iniWf, ends, judged, autoOver, events: list };
314
320
  }
315
321
 
316
322
  /** The stages an initiative runs on a board: its own workflow when one is recorded, else the board's. */
@@ -4,7 +4,8 @@
4
4
  * names an initiative's workflow, said the initiative was "not attached" to it, read the task stages of `pmos item` (lib/plan-tree.js) as
5
5
  * the board's columns and moved 47 tasks. Two things are kept apart here, in the words the agent gets:
6
6
  * the WORKFLOW stage is on the initiative (the stage card, the Board; `pmos workflow of|move|switch`, lib/workflow-cli.js);
7
- * a task has no workflow stage: its only stage is its state (To do, In progress, Done, Won't do, Archived; Wawan, 2026-10-25).
7
+ * a task's state is To do, In progress, Done, Won't do or Archived (Wawan, 2026-10-25); its group in the Tasks section is a workflow stage
8
+ * (`pmos task set --stage`, feedback batch 6), never its state.
8
9
  * The chat's opening states the initiative's workflow and current stage (lib/briefing-premium-agent.js openingFor); in a live session, a
9
10
  * message about a stage, a workflow or a move reaches the session with this rule first, read fresh, as lib/program-chat.js does for programs.
10
11
  *
@@ -39,8 +40,8 @@ function rule(info, id) {
39
40
  out.push(
40
41
  `The workflow stage is on the initiative: the stage card and the Board show it. \`pmos workflow of ${ini}\` reads it. When the PM asks to move the initiative, run \`pmos workflow move ${ini} --stage <key> --why "<reason>"\`. When the PM asks to change its workflow, run \`pmos workflow switch ${ini} --to <workflow id>\`. Both write what the page's press writes, under your name.`,
41
42
  'There is one kind of task: the ones the PM sees in the initiative\'s Tasks section. The stage card\'s To finish entries and the older breakdown items are tasks too. '
42
- + 'A task has no workflow stage. Its only stage is its state: To do, In progress, Done, Won\'t do or Archived. When the PM asks to add, close or change a task, '
43
- + `do it yourself, never send the PM to the Board: \`pmos task add ${ini} "<title>" [--due YYYY-MM-DD]\` adds one, \`pmos task list ${ini}\` names them all and \`pmos task state <task> [<task> …] --to "<state>" --why "<what shows it>"\` sets them. Never use \`pmos item add\` for new work. Never set a task's stage, and never change tasks to move the initiative.`,
43
+ + 'A task\'s state is To do, In progress, Done, Won\'t do or Archived. The Tasks section groups the tasks under the stages of this initiative\'s workflow: a task\'s group is its place in the breakdown, never its state. When the PM asks to add, close, group or change a task, '
44
+ + `do it yourself, never send the PM to the Board: \`pmos task add ${ini} "<title>" [--stage <stage>] [--due YYYY-MM-DD]\` adds one, \`pmos task list ${ini}\` names them all, \`pmos task state <task> [<task> …] --to "<state>" --why "<what shows it>"\` sets their state and \`pmos task set <task> [<task> …] --stage <stage>|none\` groups them (it also takes --due, --start, --owner, --notes; none clears a date). Never use \`pmos item add\` for new work, and never change tasks to move the initiative.`,
44
45
  );
45
46
  return out;
46
47
  }
@@ -47,13 +47,15 @@ function build(f) {
47
47
  if (!f.ladder && !missing.includes('workflow steps')) missing.push('workflow steps');
48
48
  // D99: the stages are the initiative's own workflow (row.wfStages, routes-boards workflowRowOf): the strip and the phase read them, and on a
49
49
  // library workflow so does a move (bug 2026-10-25: a Tender initiative offered the old board stages Discover, Plan, Build & Deliver,
50
- // Monitor & Evaluate). A move on Product feature still names the board's stages, which POST /api/boards/move checks. Tasks have no stage.
50
+ // Monitor & Evaluate). Tasks have no stage.
51
51
  const boardWf = (row.workflow && row.workflow.length ? row.workflow : board.workflow) || [];
52
52
  const own = Array.isArray(row.wfStages) && row.wfStages.length && row.wfStage ? row.wfStages.filter((s) => s.status !== 'skipped' || s.key === row.wfStage.key) : null;
53
53
  const ownWf = !!(own && row.wf && row.wf.id && row.wf.id !== 'product-feature');
54
54
  const names = own ? own.map((s) => s.name) : boardWf.map((s) => s.name);
55
55
  const cur = own ? own.findIndex((s) => s.key === row.wfStage.key) : names.indexOf(row.stage);
56
- const moveNames = own && !ownWf ? boardWf.map((s) => s.name) : names;
56
+ // batch 7 item 4: Product feature moves name its eight stages too, never an older board's merged columns (Build & Deliver); POST
57
+ // /api/boards/move pins the initiative to the stage a column does not name
58
+ const moveNames = names;
57
59
  const id = row.id || '';
58
60
  const key = 'init:' + id;
59
61
 
@@ -155,7 +157,7 @@ function build(f) {
155
157
  id, key, title: clip(row.title || id, 160), lane: row.lane || '', anchor: row.anchor || '',
156
158
  // the bar's presses (initiative premium-board-actions): the workflow, the lifecycle and the archive entry the row holds
157
159
  acts: {
158
- self: !!board.self, stages: moveNames, stage: (ownWf ? names[cur] : row.stage) || null,
160
+ self: !!board.self, stages: moveNames, stage: (own ? names[cur] : row.stage) || null,
159
161
  life: status === 'on hold' ? 'hold' : status === 'cancelled' ? 'cancelled' : null,
160
162
  reason: (status === 'on hold' || status === 'cancelled') && row.stopped ? clip(row.stopped.reason || '', 300) : '',
161
163
  back: status === 'on hold' && row.stopped && row.stopped.back ? shortDate(row.stopped.back) : '', backDay: status === 'on hold' && row.stopped && row.stopped.back ? String(row.stopped.back).slice(0, 10) : null,
@@ -288,7 +288,15 @@ function initOf(r) {
288
288
  const i = lifeIndex(r.stage);
289
289
  return { id: String(r.id), title: clip(r.title || r.id, 120), stage: r.stage || '', idx: i, stageLabel: i >= 0 ? LIFE_LABEL[i] : (r.stage || ''), status: r.status || '', lane: r.lane || '',
290
290
  owner: r.owner || '', end: r.end ? shortDate(r.end) : '', endAt: r.end ? String(r.end).slice(0, 10) : null, anchor: r.anchor || '',
291
- startAt: r.start ? String(r.start).slice(0, 10) : null, skipped: IG.skippedOf(r.warnings) };
291
+ startAt: r.start ? String(r.start).slice(0, 10) : null, skipped: IG.skippedOf(r.warnings), milestone: milestoneOf(r, i) };
292
+ }
293
+ /** The milestone an initiative works toward next, for the goal Viewer's "Moved by" (canvas OvViewers "Goal"): the first milestone stage of its
294
+ * own workflow that is not done or skipped (the board row's wfStages), else the lifecycle's next one (Deliver, then Evaluate). null when its
295
+ * milestones are all behind it. Its date is the initiative's planned finish, said as "plan Nov 4". */
296
+ function milestoneOf(r, i) {
297
+ const S = Array.isArray(r.wfStages) ? r.wfStages : null;
298
+ if (S && S.some((s) => s.milestone)) { const m = S.find((s) => s.milestone && s.status !== 'done' && s.status !== 'skipped'); return m ? { name: clip(m.name, 60) } : null; }
299
+ return i < 5 ? { name: LIFE_LABEL[5] } : i < 7 ? { name: LIFE_LABEL[7] } : null;
292
300
  }
293
301
  /** One goal per KR metric record, with or without a series. `today` is a day in ms (UTC midnight). */
294
302
  function goalsOf(outcomes, charts, inits, today, meta) {
@@ -67,7 +67,7 @@ const VERBS = Object.freeze({
67
67
  help: 'pmos workflow list|show|draft|show-draft|judge|of|move|switch … — the workflows of this repository, the New workflow draft, a reading of an Only-when stage, and an initiative\'s workflow stage (pmos workflow help)' }),
68
68
  // Not a pm-os-absorb verb (run: null): feedback batch 4 (Wawan, 2026-10-25) added it through the same table.
69
69
  task: Object.freeze({ module: 'task-cli.js', run: null, guide: 'workflows.md',
70
- help: 'pmos task add|list|state … — an initiative\'s tasks: add one, list them, set their state when the PM asks (pmos task help)' }),
70
+ help: 'pmos task add|list|state|set … — an initiative\'s tasks: add one, list them, set their state or group them under a stage when the PM asks (pmos task help)' }),
71
71
  // Not a pm-os-absorb verb (run: null): feedback batch 4 item 6 (Claude suggests program milestones) added it through the same table.
72
72
  program: Object.freeze({ module: 'program-cli.js', run: null, guide: 'programs.md',
73
73
  help: 'pmos program suggest — Claude\'s milestone suggestions for a program, filed by its review run (pmos program help)' }),
@@ -53,6 +53,7 @@ const MODULES = Object.freeze([
53
53
  'routes-board-grill', // premium-uncovered-features (Board): a new initiative's Why, material and first questions (page press; file mode)
54
54
  'routes-insights-premium', // briefing-premium-insights: the premium Insights page's model from the KR metric records and report files (read-only)
55
55
  'routes-home-desk', // premium-agreed-design (Home): seen marks, queued messages, the weekly update's recipients and sends, stakeholders (page press; file mode)
56
+ 'routes-live', // batch 6 item 2: the Live pill's sessions and the titles of their initiatives (read-only)
56
57
  'routes-home-review', // premium-uncovered-features (Home): the weekly review's four steps and the untouched work looked at (page press; file mode)
57
58
  'routes-initiative-premium', // briefing-premium-initiative: the premium initiative page's model from the Initiatives sheet's own routes (read-only)
58
59
  'routes-initiative-layout', // premium-uncovered-features (Initiative): Moves on by itself, held stages, task groups and saved group sets (page press; file mode)