create-pmos 0.408.0 → 0.409.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 (75) hide show
  1. package/package.json +13 -13
  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/board-programs-test.js +1 -1
  7. package/workspace/board-wf-shot.js +45 -0
  8. package/workspace/board-workflows-test.js +186 -0
  9. package/workspace/briefing-premium-board-test.js +2 -2
  10. package/workspace/briefing-premium-initiative-test.js +1 -1
  11. package/workspace/changelog.json +12 -0
  12. package/workspace/fixtures/board-workflows-facts.js +49 -0
  13. package/workspace/fixtures/workflows-facts.js +53 -0
  14. package/workspace/guide/index.md +1 -0
  15. package/workspace/guide/workflows.md +58 -0
  16. package/workspace/ini-workflow-test.js +177 -0
  17. package/workspace/lib/board-premium.js +30 -5
  18. package/workspace/lib/board-trail.js +24 -7
  19. package/workspace/lib/briefing-premium-agent.js +3 -0
  20. package/workspace/lib/engine/boards.js +30 -2
  21. package/workspace/lib/engine/workflows.js +204 -0
  22. package/workspace/lib/pmos-verbs.js +3 -0
  23. package/workspace/lib/programs.js +22 -7
  24. package/workspace/lib/route-modules.js +1 -0
  25. package/workspace/lib/routes-boards.js +157 -7
  26. package/workspace/lib/routes-programs.js +5 -0
  27. package/workspace/lib/routes-workflows.js +105 -0
  28. package/workspace/lib/workflow-chat.js +26 -0
  29. package/workspace/lib/workflow-cli.js +141 -0
  30. package/workspace/lib/workflows-store.js +108 -0
  31. package/workspace/package-lock.json +2 -2
  32. package/workspace/package.json +1 -1
  33. package/workspace/program-charter-test.js +243 -0
  34. package/workspace/program-panel-test.js +1 -1
  35. package/workspace/public/pm/bd-acts.js +10 -5
  36. package/workspace/public/pm/bd-asks.js +2 -2
  37. package/workspace/public/pm/bd-prog-panel.js +33 -14
  38. package/workspace/public/pm/bd-prog.js +11 -3
  39. package/workspace/public/pm/bd-views.js +128 -45
  40. package/workspace/public/pm/bd-wf.js +99 -0
  41. package/workspace/public/pm/cozy-board.css +67 -6
  42. package/workspace/public/pm/cozy-evmodel.js +1 -1
  43. package/workspace/public/pm/cozy-panel.css +12 -6
  44. package/workspace/public/pm/cozy-settings.js +4 -2
  45. package/workspace/public/pm/cozy-viewer.js +36 -9
  46. package/workspace/public/pm/cozy-vw-shell.css +8 -0
  47. package/workspace/public/pm/goal-chat.js +1 -1
  48. package/workspace/public/pm/home-app.js +14 -9
  49. package/workspace/public/pm/home-ini-model.js +2 -2
  50. package/workspace/public/pm/home-ini.css +30 -0
  51. package/workspace/public/pm/home-ini.js +52 -9
  52. package/workspace/public/pm/home-list.js +5 -3
  53. package/workspace/public/pm/home-today.js +4 -4
  54. package/workspace/public/pm/ini-wf-model.js +91 -0
  55. package/workspace/public/pm/ini-wf.js +160 -0
  56. package/workspace/public/pm/premium-board.js +98 -30
  57. package/workspace/public/pm/premium-initiative-head.js +18 -8
  58. package/workspace/public/pm/program-charter.css +135 -0
  59. package/workspace/public/pm/program-charter.js +333 -0
  60. package/workspace/public/pm/program-model.js +44 -4
  61. package/workspace/public/pm/wf-edit.js +119 -0
  62. package/workspace/public/pm/wf-model.js +48 -0
  63. package/workspace/public/pm/wf-page.css +162 -0
  64. package/workspace/public/pm/wf-page.js +398 -0
  65. package/workspace/public/pm/wf-stage.js +187 -0
  66. package/workspace/public/premium-workflows.html +31 -0
  67. package/workspace/public/premium.html +1 -0
  68. package/workspace/server.js +1 -1
  69. package/workspace/skills/workflow-setup.skill +57 -0
  70. package/workspace/test-lists/ini-workflow.json +6 -0
  71. package/workspace/test-lists/program-charter.json +9 -0
  72. package/workspace/test-lists/workflows-board.json +13 -0
  73. package/workspace/test-lists/workflows-setup.json +13 -0
  74. package/workspace/test-lists/workflows.json +5 -0
  75. package/workspace/workflows-setup-test.js +346 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.408.0",
3
+ "version": "0.409.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.409.0",
37
+ "at": "2026-10-25T03:28:25.142Z",
38
+ "f": 2,
39
+ "prs": [
40
+ {
41
+ "n": 1038,
42
+ "t": "Program milestones in the charter, and a workflow per initiative (D99)",
43
+ "s": "Program milestones in the charter, and a workflow per initiative"
44
+ }
45
+ ]
46
+ },
35
47
  {
36
48
  "v": "0.408.0",
37
49
  "at": "2026-10-25T02:55:03.294Z",
@@ -269,18 +281,6 @@
269
281
  "s": "One report editor with Brief tab and one Insights row per report"
270
282
  }
271
283
  ]
272
- },
273
- {
274
- "v": "0.389.0",
275
- "at": "2026-10-21T22:57:56.719Z",
276
- "f": 2,
277
- "prs": [
278
- {
279
- "n": 1001,
280
- "t": "Reports, charts and dashboards from any chat; the Insight Studio is removed",
281
- "s": "Reports, charts and dashboards from any chat; the Insight Studio is removed"
282
- }
283
- ]
284
284
  }
285
285
  ]
286
286
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@4610a840
1
+ kernel-source: pmos@7184a749
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-25T02:54:59Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-25T03:28:22Z"}
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-25T02:54:59Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-25T03:28:22Z"}
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-25T02:54:59Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-25T03:28:22Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -173,7 +173,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
173
173
  {
174
174
  const { ctx, page: p } = await open({ view: 'list' });
175
175
  const head = await p.evaluate(() => [...document.querySelectorAll('#ibBody .bd-lt.h [role="columnheader"]')].map((h) => h.textContent).join('|'));
176
- ok('L the List has Product and Program columns after the initiative', /^Initiative · sorted by need\|Product\|Program\|Kind\|/.test(head), head);
176
+ ok('L the List has Product and Program columns after the initiative', /^Initiative · sorted by need\|Product\|Program\|Workflow\|Stage\|Category\|/.test(head), head);
177
177
  await p.click('#ibBody [data-sort="program"]');
178
178
  const L = await p.evaluate(() => ({ sort: document.querySelector('#ibBody [data-sort="program"]').getAttribute('aria-sort'), rows: [...document.querySelectorAll('#ibBody .bd-lt[data-row]')].map((r) => r.querySelector('.bd-ltn b').textContent + ':' + r.querySelectorAll('.bd-pt')[1].textContent) }));
179
179
  ok('L pressing Program sorts by program: the program\'s rows first, a row with no program leaves the cell empty', L.sort === 'ascending' && L.rows[0].endsWith(':Project Ascent') && L.rows[1].endsWith(':Project Ascent') && L.rows[2] === 'Usage-based billing:', JSON.stringify(L));
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* board-wf-shot.js — screenshots of the Board with workflows (workflows-per-initiative, workstream B: WfABoard, WfABoardOne, WfATrack,
4
+ * WfAElse, WfAPhone) at 1440x900 and 390x844, light and dark, against fixtures/board-workflows-facts.js. Not a suite: a look at the page.
5
+ * OUT=<dir> names where the PNGs go (default: the state folder of this run). SHOTS=stages-all,stages-tender,… picks the shots. */
6
+ const fs = require('fs');
7
+ const path = require('path');
8
+ const { spawn } = require('child_process');
9
+ const { findBrowser } = require('./lib/find-browser');
10
+ const T = require('./test-run').configure({ name: 'board-wf-shot' });
11
+ const BP = require('./lib/board-premium.js');
12
+ const W = require('./fixtures/board-workflows-facts.js');
13
+ const OUT = process.env.OUT || T.STATE_DIR;
14
+ // [name, view, picked workflow ('' = All), phone too]
15
+ const ALL_SHOTS = [['stages-all', 'stages', ''], ['stages-tender', 'stages', 'tender'], ['stages-feature', 'stages', 'product-feature'], ['track-all', 'track', ''],
16
+ ['track-tender', 'track', 'tender'], ['list', 'list', ''], ['phone-stages', 'stages', '', 'phone'], ['phone-track', 'track', '', 'phone'], ['phone-list', 'list', '', 'phone']];
17
+ (async () => {
18
+ const { chromium } = require('playwright-core');
19
+ const srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
20
+ await T.waitForServer(T.BASE);
21
+ const browser = await chromium.launch({ executablePath: findBrowser() });
22
+ const want = process.env.SHOTS ? process.env.SHOTS.split(',') : null;
23
+ const errs = [];
24
+ for (const dark of [false, true]) {
25
+ for (const [name, view, pick, phone] of ALL_SHOTS) {
26
+ if (want && !want.includes(name)) continue;
27
+ const [w, h] = phone ? [390, 844] : [1440, 900];
28
+ const ctx = await browser.newContext({ viewport: { width: w, height: h }, colorScheme: dark ? 'dark' : 'light' });
29
+ await ctx.route('**/api/board-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: BP.build(W.facts()), as_of: Date.now() }) }));
30
+ await ctx.route('**/api/workflows*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, workflows: W.WORKFLOWS }) }));
31
+ await ctx.route('**/api/programs', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, programs: [] }) }));
32
+ await ctx.addInitScript(([v, p, ph]) => { try { localStorage.setItem(ph ? 'pmos.board.pview' : 'pmos.board.view', v); localStorage.setItem('pmos.board.wf', p || 'all'); } catch { /* none */ } }, [view, pick, !!phone]);
33
+ const p = await ctx.newPage();
34
+ p.on('pageerror', (e) => errs.push(name + ': ' + e.message));
35
+ await p.goto(T.BASE + '/premium-board.html' + (dark ? '?theme=dark' : ''));
36
+ await p.waitForTimeout(2000);
37
+ fs.mkdirSync(OUT, { recursive: true });
38
+ await p.screenshot({ path: path.join(OUT, 'board-' + name + '-' + w + (dark ? '-dark' : '') + '.png'), fullPage: !!phone });
39
+ await ctx.close();
40
+ }
41
+ if (!process.env.DARK_TOO) break;
42
+ }
43
+ console.log(errs.join('\n') || 'no page errors');
44
+ await browser.close(); srv.kill('SIGKILL'); T.killTmux(); process.exit(0);
45
+ })();
@@ -0,0 +1,186 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* board-workflows-test.js — the Board with workflows (workflows-per-initiative, workstream B; canvas WfABoard, WfABoardOne, WfATrack, WfAElse,
4
+ * WfAPhone). Serves the real page from the real server and answers GET /api/board-premium with the model lib/board-premium.js builds from
5
+ * fixtures/board-workflows-facts.js (four workflows, one row in Won't do) and GET /api/workflows with its definitions.
6
+ * W1 the chip row · W2 By stage, All · W3 By stage, one workflow · W4 a drag names the workflow's stage · W5 the track, All · W6 the track,
7
+ * one workflow · W7 the List and Filter · W8 the phone · W9 a board with only Product feature · W10 dark, and no page error.
8
+ * The screenshots of the same views come from board-wf-shot.js (not a suite). */
9
+ const path = require('path');
10
+ const { spawn } = require('child_process');
11
+ const { findBrowser } = require('./lib/find-browser');
12
+ const T = require('./test-run').configure({ name: 'board-workflows' });
13
+ const BP = require('./lib/board-premium.js');
14
+ const W = require('./fixtures/board-workflows-facts.js');
15
+
16
+ const BASE = T.BASE;
17
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
18
+ 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); } };
19
+ const results = [];
20
+ const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
21
+ let srv = null; let browser = null;
22
+ const finish = async (code) => {
23
+ if (browser) await browser.close().catch(() => {});
24
+ if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
25
+ T.killTmux();
26
+ const bad = results.filter((x) => !x.cond).length;
27
+ console.log(`\n${results.length - bad}/${results.length} board-workflows assertions passed`);
28
+ process.exit(code !== undefined ? code : (bad ? 1 : 0));
29
+ };
30
+ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
31
+
32
+ (async () => {
33
+ const exe = findBrowser();
34
+ if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
35
+ let chromium;
36
+ try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
37
+ srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT), PMOS_SELF_ROOT: path.resolve(__dirname, '..') }) });
38
+ await T.waitForServer(BASE);
39
+ browser = await chromium.launch({ executablePath: exe });
40
+ const errors = [];
41
+
42
+ /** The Board in a fresh context: `view` and `pick` go into the page's store before it loads. */
43
+ const open = async ({ w = 1440, h = 900, view = 'stages', pick = 'all', facts = W.facts(), theme = 'light' } = {}) => {
44
+ const ctx = await browser.newContext({ viewport: { width: w, height: h } });
45
+ const page = await ctx.newPage(), posts = [];
46
+ page.on('pageerror', (e) => errors.push(String((e && e.stack) || e)));
47
+ await page.route('**/api/board-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: BP.build(facts), as_of: Date.now() }) }));
48
+ await page.route('**/api/workflows*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, workflows: W.WORKFLOWS }) }));
49
+ await page.route('**/api/programs', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, programs: [] }) }));
50
+ await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'not in this check' }) }));
51
+ await page.route(/\/api\/boards\//, (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 }) }); });
52
+ await ctx.addInitScript(([v, p, phone]) => { try { if (!sessionStorage.getItem('seeded')) { localStorage.setItem(phone ? 'pmos.board.pview' : 'pmos.board.view', v); localStorage.setItem('pmos.board.wf', p); sessionStorage.setItem('seeded', '1'); } } catch { /* none */ } }, [view, pick, w <= 720]);
53
+ await page.goto(BASE + '/premium-board.html?theme=' + theme);
54
+ await until(() => page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 20000);
55
+ return { ctx, page, posts };
56
+ };
57
+ const q = (p, fn, arg) => p.evaluate(fn, arg);
58
+
59
+ /* W1 + W2 By stage, All */
60
+ {
61
+ const { ctx, page: p } = await open();
62
+ const chips = await q(p, () => [...document.querySelectorAll('#ibBody .bd-wfchips [data-wfpick]')].map((b) => [b.dataset.wfpick, b.textContent.trim(), b.getAttribute('aria-label')]));
63
+ ok('W1 the chip row: All, then each workflow as its icon and count, Product feature first, then by count', JSON.stringify(chips.map((c) => c[0])) === JSON.stringify(['', 'product-feature', 'procurement', 'tender', 'migration'])
64
+ && chips[1][1] === '7' && chips[3][2] === 'Tender only, 2' && chips[0][1] === 'All', JSON.stringify(chips));
65
+ const cols = await q(p, () => [...document.querySelectorAll('#ibBody .bd-kb > .bd-kh, #ibBody .bd-kb > .bd-kstrip')].map((h) => h.getAttribute('aria-label')));
66
+ ok('W2 All draws To do, In progress and Done, then Won\'t do as a folded strip', JSON.stringify(cols) === JSON.stringify(['To do, 1. Fold the column', 'In progress, 10. Fold the column', 'Done, 21. Fold the column', 'Show Won\'t do, 1']), JSON.stringify(cols));
67
+ const wide = await q(p, () => { const c = document.querySelector('#ibBody .bd-kc.wide'); return c ? { label: c.getAttribute('aria-label'), titles: [...c.querySelectorAll('.bd-bc .t')].map((t) => t.textContent), cols: getComputedStyle(c).gridTemplateColumns.split(' ').length } : null; });
68
+ ok('W2 In progress is the wide column, its cards three across in stage order', wide && wide.label === 'In progress' && wide.cols === 3 && wide.titles[0] === 'Usage-based billing' && wide.titles.indexOf('Office network tender') < wide.titles.indexOf('Print fleet tender') && wide.titles[wide.titles.length - 1] === 'Audit log export', JSON.stringify(wide));
69
+ const card = await q(p, () => { const c = document.querySelector('#ibBody .bd-bc[data-key="board:print-fleet"]'); return c ? { cm: c.querySelector('.cm').textContent, icon: (c.querySelector('.cm .wfi') || {}).title, drag: c.getAttribute('draggable') } : null; });
70
+ ok('W2 a card names its own stage with its workflow\'s icon, and does not drag between categories', card && card.cm === 'Bids' && card.icon === 'Tender' && card.drag === null, JSON.stringify(card));
71
+ await p.click('#ibBody [data-colfold="end:wontdo"]'); await sleep(150);
72
+ const ended = await q(p, () => [...document.querySelectorAll('#ibBody .bd-kc[aria-label="Won\'t do"] .bd-bc .t')].map((t) => t.textContent));
73
+ ok('W2 the Won\'t do strip opens to its cards', JSON.stringify(ended) === '["Catering contract"]', JSON.stringify(ended));
74
+ await ctx.close();
75
+ }
76
+ /* W3 + W4 one workflow picked */
77
+ {
78
+ const { ctx, page: p, posts } = await open();
79
+ await p.click('#ibBody [data-wfpick="tender"]'); await sleep(200);
80
+ const s = await q(p, () => ({ on: (document.querySelector('#ibBody .bd-wfchips .bd-chip.on') || {}).textContent, edit: (document.querySelector('#ibBody .bd-wfedit') || {}).getAttribute && document.querySelector('#ibBody .bd-wfedit').getAttribute('href'),
81
+ heads: [...document.querySelectorAll('#ibBody .bd-kb > .bd-kh .l, #ibBody .bd-kb > .bd-kstrip span')].map((x) => x.textContent), strips: [...document.querySelectorAll('#ibBody .bd-kb > .bd-kstrip span')].map((x) => x.textContent),
82
+ cats: [...document.querySelectorAll('#ibBody .bd-kcat')].map((x) => x.textContent), stored: localStorage.getItem('pmos.board.wf') }));
83
+ ok('W3 a picked workflow names itself on its chip, with an edit icon to the Workflows page', s.on && s.on.trim() === 'Tender · 2' && s.edit === '/premium-workflows.html?wf=tender', JSON.stringify(s));
84
+ ok('W3 its own stages are the columns, then Won\'t do', JSON.stringify(s.heads.map((x) => x.trim())) === JSON.stringify(['Triage', 'Requirements', 'RFP out', 'Bids', 'Evaluate bids', 'Award', 'Contract', 'Review', 'Won\'t do']), JSON.stringify(s.heads));
85
+ ok('W3 the empty stages start as strips', ['Triage', 'RFP out', 'Evaluate bids', 'Contract', 'Review'].every((x) => s.strips.includes(x)) && !s.strips.includes('Bids'), JSON.stringify(s.strips));
86
+ ok('W3 the category bar sits under the stages', JSON.stringify(s.cats) === JSON.stringify(['To do', 'In progress', 'Done']), JSON.stringify(s.cats));
87
+ ok('W3 the pick is remembered', s.stored === 'tender', s.stored);
88
+ // W4 a card dragged to another stage of its workflow moves there by the stage's name
89
+ await q(p, () => {
90
+ const c = document.querySelector('#ibBody .bd-bc[data-key="board:office-network"]'), to = document.querySelector('#ibBody .bd-kc[data-wfstage="bids"]');
91
+ const dt = new DataTransfer();
92
+ c.dispatchEvent(new DragEvent('dragstart', { bubbles: true, dataTransfer: dt }));
93
+ to.dispatchEvent(new DragEvent('dragover', { bubbles: true, cancelable: true, dataTransfer: dt }));
94
+ to.dispatchEvent(new DragEvent('drop', { bubbles: true, cancelable: true, dataTransfer: dt }));
95
+ });
96
+ await until(() => posts.some((x) => x.path === '/api/boards/move'), 3000);
97
+ const mv = posts.find((x) => x.path === '/api/boards/move');
98
+ ok('W4 a drag to another stage of the workflow moves the initiative there by that stage\'s name', mv && mv.body.id === 'office-network' && mv.body.to === 'Bids', JSON.stringify(posts));
99
+ await p.reload(); await until(() => p.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 20000);
100
+ const kept = await q(p, () => (document.querySelector('#ibBody .bd-wfchips .bd-chip.on') || {}).textContent || '');
101
+ ok('W3 after a reload the Board still shows the picked workflow', kept.trim() === 'Tender · 2', kept);
102
+ await p.click('#ibBody [data-wfpick=""]'); await sleep(150);
103
+ const all = await q(p, () => ({ on: (document.querySelector('#ibBody .bd-wfchips .bd-chip.on') || {}).textContent, stored: localStorage.getItem('pmos.board.wf') }));
104
+ ok('W1 All goes back to the categories', all.on === 'All' && all.stored === 'all', JSON.stringify(all));
105
+ await ctx.close();
106
+ }
107
+ /* W5 + W6 the track */
108
+ {
109
+ const { ctx, page: p } = await open({ view: 'track' });
110
+ const t = await q(p, () => {
111
+ const head = [...document.querySelectorAll('.bt-h .bt-cells [role="columnheader"] .bt-hl')].map((x) => x.textContent);
112
+ const row = (k) => document.querySelector(`.bt-l[data-row="${k}"]`);
113
+ const pf = row('board:print-fleet'), cb = row('board:cloud-backup'), ss = row('board:sso-partners');
114
+ const bands = (r) => [...r.querySelectorAll('.bnd')].map((b) => [...b.children].map((x) => x.className || '-').join(','));
115
+ return { head, bandsPF: bands(pf), em: (pf.querySelector('.bnd .nw em') || {}).textContent, icon: (pf.querySelector('.bt-nm .wfi') || {}).title, skip: (cb.querySelector('.bnd .k') || {}).title, sso: bands(ss), steps: !!document.querySelector('.bt-h [data-steps]') };
116
+ });
117
+ ok('W5 with All the header is the three categories', JSON.stringify(t.head) === '["To do","In progress","Done"]' && !t.steps, JSON.stringify(t));
118
+ ok('W5 each row draws its own stages in their band: done, the current one with its name, a milestone as ◆', JSON.stringify(t.bandsPF) === JSON.stringify(['dn', 'dn,dn,nw,-,m,-', '-']) && /^Bids · /.test(t.em || '') && t.icon === 'Tender', JSON.stringify(t));
119
+ ok('W5 a stage PMOS judged not to run is drawn as skipped, with the reason', /^Approve skipped: No bids needed/.test(t.skip || ''), JSON.stringify(t.skip));
120
+ ok('W5 a Product feature row keeps its eight steps across the bands', JSON.stringify(t.sso) === JSON.stringify(['dn', 'dn,dn,dn,dn,m nw,-', 'm']), JSON.stringify(t.sso));
121
+ await p.click('[data-wfpick="tender"]'); await sleep(200);
122
+ const o = await q(p, () => ({ head: [...document.querySelectorAll('.bt-h .bt-cells [role="columnheader"] .bt-hl')].map((x) => x.textContent), n: document.querySelector('.bt-h .bt-cells').style.getPropertyValue('--n'), rows: [...document.querySelectorAll('.bt-l')].map((r) => r.dataset.row), cur: (document.querySelector('.bt-l[data-row="board:print-fleet"] .sc.c') || {}).title }));
123
+ ok('W6 one workflow picked: the header is its stage names, as the eight steps are today', JSON.stringify(o.head) === JSON.stringify(['Triage', 'Requirements', 'RFP out', 'Bids', 'Evaluate bids', 'Award', 'Contract', 'Review']) && o.n === '8', JSON.stringify(o));
124
+ ok('W6 only that workflow\'s initiatives show, each at its own stage', JSON.stringify(o.rows) === '["board:office-network","board:print-fleet"]' && /^Bids · /.test(o.cur || ''), JSON.stringify(o));
125
+ await p.click('[data-wfpick="product-feature"]'); await sleep(200);
126
+ const f = await q(p, () => ({ head: [...document.querySelectorAll('.bt-h .bt-cells [role="columnheader"] .bt-hl')].map((x) => x.textContent).join('|'), help: !!document.querySelector('.bt-h [data-steps]') }));
127
+ ok('W6 Product feature picked: the track is the eight steps with their help, as before', f.head === 'Triage|Discover|Plan|Prioritize|Build|Deliver|Monitor|Evaluate' && f.help, JSON.stringify(f));
128
+ await ctx.close();
129
+ }
130
+ /* W7 the List and Filter */
131
+ {
132
+ const { ctx, page: p } = await open({ view: 'list' });
133
+ const l = await q(p, () => ({ chips: !!document.querySelector('#ibBody .bd-wfchips'), cell: (() => { const r = document.querySelector('.bd-lt[data-row="board:print-fleet"]'); return [...r.children].slice(1, 4).map((c) => c.textContent.trim()); })(), icon: (document.querySelector('.bd-lt[data-row="board:print-fleet"] .bd-wfn .wfi') || {}).title }));
134
+ ok('W7 the List shows Workflow (icon and name), Stage and Category, with no chip row', !l.chips && JSON.stringify(l.cell) === '["Tender","Bids","In progress"]' && l.icon === 'Tender', JSON.stringify(l));
135
+ await p.click('[data-sort="cat"]'); await sleep(150);
136
+ const byCat = await q(p, () => [...document.querySelectorAll('.bd-lt[data-row] .bd-ltn b')][0].textContent);
137
+ ok('W7 sorting by Category puts To do first', byCat === 'Laptop refresh', byCat);
138
+ await p.click('[data-sort="wf"]'); await sleep(150);
139
+ const byWf = await q(p, () => [...document.querySelectorAll('.bd-lt[data-row] .bd-wfn')].map((c) => c.textContent.trim()));
140
+ ok('W7 sorting by Workflow puts Product feature first, then the others by name', byWf[0] === 'Product feature' && byWf.indexOf('Migration') > byWf.lastIndexOf('Product feature') && byWf.indexOf('Tender') > byWf.indexOf('Procurement'), JSON.stringify(byWf));
141
+ await p.click('#bdFilter'); await sleep(200);
142
+ const fl = await q(p, () => { const pop = document.querySelector('#bdPop'); return { txt: pop ? pop.textContent : '', wf: [...document.querySelectorAll('#bdPop [data-fwf]')].map((b) => b.textContent) }; });
143
+ ok('W7 Filter: Kind became Workflow and Category', /Workflow/.test(fl.txt) && /Category/.test(fl.txt) && !/Kind/.test(fl.txt) && JSON.stringify(fl.wf) === '["Product feature","Procurement","Tender","Migration"]', JSON.stringify(fl));
144
+ await p.click('#bdPop [data-fwf="tender"]'); await sleep(200);
145
+ const nar = await q(p, () => ({ rows: [...document.querySelectorAll('.bd-lt[data-row] .bd-ltn b')].map((b) => b.textContent), showing: (document.querySelector('#bdShowing') || {}).textContent || '' }));
146
+ ok('W7 picking Tender in Filter narrows the List and says so in the Showing bar', JSON.stringify(nar.rows.sort()) === '["Office network tender","Print fleet tender"]' && /Workflow: Tender/.test(nar.showing), JSON.stringify(nar));
147
+ await p.click('#bdPop [data-fwf="tender"]').catch(() => {}); await sleep(150);
148
+ await p.evaluate(() => { const b = document.querySelector('#bdPop [data-flt="cats"][data-v="todo"]'); if (b) b.click(); }); await sleep(200);
149
+ const cat = await q(p, () => ({ rows: [...document.querySelectorAll('.bd-lt[data-row] .bd-ltn b')].map((b) => b.textContent), showing: (document.querySelector('#bdShowing') || {}).textContent || '' }));
150
+ ok('W7 a Category in Filter narrows the List to it', JSON.stringify(cat.rows) === '["Laptop refresh"]' && /Category: To do/.test(cat.showing), JSON.stringify(cat));
151
+ await ctx.close();
152
+ }
153
+ /* W8 the phone */
154
+ {
155
+ const { ctx, page: p } = await open({ w: 390, h: 844, view: 'stages' });
156
+ const ph = await q(p, () => ({ secs: [...document.querySelectorAll('#ibBody .bd-pcat')].map((b) => [b.textContent.trim(), b.getAttribute('aria-expanded')]), rows: [...document.querySelectorAll('#ibBody .bd-pcats .bd-lrow')].length,
157
+ more: (document.querySelector('#ibBody [data-pmore]') || {}).textContent, icons: [...document.querySelectorAll('#ibBody .bd-pcats .bd-lrow .wfi')].length, chips: document.querySelectorAll('#ibBody .bd-wfchips [data-wfpick]').length }));
158
+ ok('W8 the phone shows category sections, In progress open, Won\'t do at the foot', JSON.stringify(ph.secs) === JSON.stringify([['To do1', 'false'], ['In progress10', 'true'], ['Done21', 'false'], ['Won\'t do1', 'false']]), JSON.stringify(ph));
159
+ ok('W8 a section lists five rows, then "N more"; each row carries its workflow icon; the chips are there', ph.rows === 5 && ph.more === '5 more' && ph.icons === 5 && ph.chips === 5, JSON.stringify(ph));
160
+ await p.click('#ibBody [data-pcat="todo"]'); await sleep(150);
161
+ await p.click('#ibBody [data-pmore="doing"]'); await sleep(150);
162
+ const ph2 = await q(p, () => ({ todo: document.querySelector('#ibBody [data-pcat="todo"]').getAttribute('aria-expanded'), rows: [...document.querySelectorAll('#ibBody .bd-pcats .bd-lrow')].length, stored: localStorage.getItem('pmos.board.pcats') }));
163
+ ok('W8 a section opens on a press, and stays open; "N more" lists the rest', ph2.todo === 'true' && ph2.rows === 11 && /"todo":"open"/.test(ph2.stored || ''), JSON.stringify(ph2));
164
+ await ctx.close();
165
+ }
166
+ /* W9 a board with only Product feature */
167
+ {
168
+ const { ctx, page: p } = await open({ facts: W.pfOnly() });
169
+ const s = await q(p, () => ({ chips: !!document.querySelector('#ibBody .bd-wfchips'), cols: [...document.querySelectorAll('#ibBody .bd-kb > .bd-kh .l, #ibBody .bd-kb > .bd-kstrip span')].map((x) => x.textContent.trim()), cm: document.querySelectorAll('#ibBody .bd-bc .cm').length }));
170
+ ok('W9 with only Product feature there is no chip row, and By stage keeps the eight steps', !s.chips && JSON.stringify(s.cols) === JSON.stringify(['Triage', 'Discover', 'Plan', 'Prioritize', 'Build', 'Deliver', 'Monitor', 'Evaluate']) && s.cm === 0, JSON.stringify(s));
171
+ await ctx.close();
172
+ const ph = await open({ w: 390, h: 844, view: 'list', facts: W.pfOnly() });
173
+ const icons = await q(ph.page, () => document.querySelectorAll('#ibBody .bd-lrow .wfi').length);
174
+ ok('W9 a phone row draws no workflow icon when the board has one workflow (say it once)', icons === 0, String(icons));
175
+ await ph.ctx.close();
176
+ }
177
+ /* W10 dark */
178
+ {
179
+ const { ctx, page: p } = await open({ theme: 'dark', view: 'track' });
180
+ const bg = await q(p, () => getComputedStyle(document.querySelector('.bnd span.nw')).backgroundColor);
181
+ ok('W10 the current stage bar reads in dark', bg && bg !== 'rgba(0, 0, 0, 0)', bg);
182
+ await ctx.close();
183
+ }
184
+ ok('W10 no page error in any check', errors.length === 0, errors.slice(0, 3).join(' | '));
185
+ finish();
186
+ })();
@@ -174,7 +174,7 @@ const mk = (o) => BP.build(F.facts(o));
174
174
  ok('B1 the Jira chip reads Jira again', await until(() => R.posts.slice(n1).some((x) => x.path === '/api/sources/refresh' && x.body.source === 'jira')));
175
175
  /* the chips and tools open their designed popovers (BdAsks, BdSprint, BdFilter) and New initiative its panel (BdNew), with no "Waiting for design" tag */
176
176
  const waits = [];
177
- for (const [sel, name, body] of [['#chAsks', 'New asks', /1 new ask.*Finance wants a CSV of failed payouts.*Accept to Triage/], ['#chSprint', 'Sprints and releases', /Sprints · from Jira.*Sprint 24.*Releases.*Backlog/], ['#bdFind', 'Find', /Find stays in the Board/], ['#bdFilter', 'Filter', /Owner.*Dara.*Lee.*No owner.*Kind.*Feature.*Applies as you pick/]]) {
177
+ for (const [sel, name, body] of [['#chAsks', 'New asks', /1 new ask.*Finance wants a CSV of failed payouts.*Accept to Triage/], ['#chSprint', 'Sprints and releases', /Sprints · from Jira.*Sprint 24.*Releases.*Backlog/], ['#bdFind', 'Find', /Find stays in the Board/], ['#bdFilter', 'Filter', /Owner.*Dara.*Lee.*No owner.*Category.*In progress.*Done.*Applies as you pick/]]) {
178
178
  await q.click(sel);
179
179
  waits.push(await until(() => q.evaluate(([nm, re]) => { const k = document.querySelector('#bdPop'); if (!k || k.hidden) return null; return k.getAttribute('aria-label') === nm && !k.querySelector('.bd-wtag') && new RegExp(re).test(k.textContent) ? nm : null; }, [name, body.source])) || 'missing ' + name);
180
180
  await q.keyboard.press('Escape');
@@ -231,7 +231,7 @@ const mk = (o) => BP.build(F.facts(o));
231
231
  await view(p, 'list');
232
232
  const listOf = () => p.evaluate(() => ({ tag: !!document.querySelector('#ibBody .bd-wtag'), rows: [...document.querySelectorAll('#ibBody .bd-lt[data-row] .bd-ltn b')].map((b) => b.textContent), ss: ((document.querySelector('#ibBody .bd-lt[data-row="board:self-serve-v2"]') || {}).textContent || '').replace(/\s+/g, ' '), head: [...document.querySelectorAll('#ibBody .bd-lt.h [role="columnheader"]')].map((h) => h.textContent).join('|'), foot: (document.querySelector('#ibBody .bd-lt.foot') || {}).textContent || '', v: document.querySelector('#ibTabs [aria-pressed="true"]').dataset.v }));
233
233
  const lv = await listOf();
234
- ok('B4 the List view lists the initiatives with kind, stage, status, owner, next, finish and output, sorted by need; Monitor and Evaluate fold below', !lv.tag && lv.rows.length === 5 && lv.head === 'Initiative · sorted by need|Kind|Stage|Status|Owner|Next|Finish|Output|' && /Self-serve onboarding v2.*Feature.*Build.*7 days over.*10 Oct/.test(lv.ss) && /2 more in Monitor and Evaluate/.test(lv.foot) && lv.v === 'list', JSON.stringify(lv));
234
+ ok('B4 the List view lists the initiatives with workflow, stage, category, status, owner, next, finish and output, sorted by need; Monitor and Evaluate fold below', !lv.tag && lv.rows.length === 5 && lv.head === 'Initiative · sorted by need|Workflow|Stage|Category|Status|Owner|Next|Finish|Output|' && /Self-serve onboarding v2.*Product feature.*Build.*In progress.*7 days over.*10 Oct/.test(lv.ss) && /2 more in Monitor and Evaluate/.test(lv.foot) && lv.v === 'list', JSON.stringify(lv));
235
235
  await p.click('#ibBody [data-sort="title"]');
236
236
  const lt = await listOf();
237
237
  ok('B4 a column title sorts the list', lt.rows[0] === 'Docs search' && lt.rows.join() === lt.rows.slice().sort((a, b) => a.localeCompare(b)).join(), JSON.stringify(lt.rows));
@@ -122,7 +122,7 @@ const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-
122
122
  /* I3 header: the card */
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
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]') }; });
125
- ok('I3 the page\'s header names the initiative, its lane and its anchor', card.title === 'Self-serve onboarding v2' && /^Feature · \S/.test(card.kind), JSON.stringify(card));
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
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
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
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));
@@ -1,4 +1,16 @@
1
1
  [
2
+ {
3
+ "v": "0.409.0",
4
+ "at": "2026-10-25T03:28:25.142Z",
5
+ "f": 2,
6
+ "prs": [
7
+ {
8
+ "n": 1038,
9
+ "t": "Program milestones in the charter, and a workflow per initiative (D99)",
10
+ "s": "Program milestones in the charter, and a workflow per initiative"
11
+ }
12
+ ]
13
+ },
2
14
  {
3
15
  "v": "0.408.0",
4
16
  "at": "2026-10-25T02:55:03.294Z",
@@ -0,0 +1,49 @@
1
+ 'use strict';
2
+ /* fixtures/board-workflows-facts.js — a board with initiatives on four workflows (workflows-per-initiative, workstream B), for the Board's
3
+ * workflow views. Built on fixtures/board-premium-facts.js (17 Oct 2026): its seven Product feature rows keep no `wf` (so they read as
4
+ * Product feature, as a row from before workflows does), and five rows are on PM-made workflows with the row fields the routes give (D99,
5
+ * lib/routes-boards.js workflowRowOf): wf, wfStage, wfStages (each with its status and PMOS's reading), ended. One Tender row ended in Won't do. WORKFLOWS is what GET /api/workflows answers. */
6
+ const F = require('./board-premium-facts.js');
7
+
8
+ const st = (key, name, cat, milestone = false) => ({ key, name, cat, milestone, when: { mode: 'always' } });
9
+ const WORKFLOWS = [
10
+ { id: 'tender', name: 'Tender', icon: 'doc', decide: 'pmos', stages: [st('triage', 'Triage', 'todo'), st('requirements', 'Requirements', 'doing'), st('rfp-out', 'RFP out', 'doing'),
11
+ st('bids', 'Bids', 'doing'), st('evaluate-bids', 'Evaluate bids', 'doing'), st('award', 'Award', 'doing', true), st('contract', 'Contract', 'doing'), st('review', 'Review', 'done')] },
12
+ { id: 'procurement', name: 'Procurement', icon: 'cart', decide: 'confirm', stages: [st('triage', 'Triage', 'todo'), st('quotes', 'Quotes', 'doing'), st('approve', 'Approve', 'doing'),
13
+ st('order', 'Order', 'doing'), st('received', 'Received', 'doing', true), st('close', 'Close', 'done')] },
14
+ { id: 'migration', name: 'Migration', icon: 'swap', decide: 'pmos', stages: [st('triage', 'Triage', 'todo'), st('plan', 'Plan', 'doing'), st('rehearse', 'Rehearse', 'doing'),
15
+ st('migrate', 'Migrate', 'doing'), st('cutover', 'Cutover', 'doing', true), st('review', 'Review', 'done')] },
16
+ ];
17
+ const WF_OF = Object.fromEntries(WORKFLOWS.map((w) => [w.id, w]));
18
+ /** A row on a PM-made workflow, standing in `key`; `skip` lists stage keys PMOS judged not to run. */
19
+ function on(wfId, key, o = {}, skip = []) {
20
+ const w = WF_OF[wfId], i = w.stages.findIndex((s) => s.key === key), s = w.stages[i];
21
+ return F.row(o.id, o.title, {
22
+ stage: s.name, cat: s.cat, lane: 'feature', ...o,
23
+ wf: { id: w.id, name: w.name, icon: w.icon },
24
+ wfStage: { key: s.key, name: s.name, cat: s.cat, milestone: s.milestone, n: i + 1, of: w.stages.length },
25
+ // as lib/routes-boards.js workflowRowOf gives them (scripts/workflows.js stagesOf): a status, and PMOS's reading where it judged one
26
+ wfStages: w.stages.map((x, j) => (skip.includes(x.key) ? { ...x, status: 'skipped', reading: { runs: false, why: 'No bids needed under the threshold', cite: 'BRD §2' } }
27
+ : { ...x, status: j < i ? 'done' : j === i ? 'current' : 'next', reading: null })),
28
+ });
29
+ }
30
+ const WF_ROWS = [
31
+ on('tender', 'requirements', { id: 'office-network', title: 'Office network tender', owner: 'Mei', status: 'on track' }),
32
+ on('tender', 'bids', { id: 'print-fleet', title: 'Print fleet tender', owner: 'Mei', status: 'at risk' }),
33
+ on('procurement', 'triage', { id: 'laptop-refresh', title: 'Laptop refresh', status: 'on track' }),
34
+ on('procurement', 'quotes', { id: 'cloud-backup', title: 'Cloud backup licences', owner: 'Lee', status: 'on track' }, ['approve']),
35
+ on('migration', 'migrate', { id: 'billing-move', title: 'Billing data move', owner: 'Dara', status: 'late', end: '2026-10-12' }),
36
+ ];
37
+ const WONT = on('tender', 'requirements', { id: 'catering', title: 'Catering contract', status: 'cancelled' });
38
+ WONT.ended = { as: 'wontdo', reason: 'budget', note: 'Not this year', at: '2026-10-10' };
39
+
40
+ /** The board's facts with the workflow rows added; o goes to F.facts. */
41
+ function facts(o = {}) {
42
+ const base = F.facts();
43
+ const rows = base.rows.concat(WF_ROWS.map((r) => ({ ...r })));
44
+ return F.facts({ rows, total: rows.length, columns: base.columns, cancelled: [{ ...WONT }],
45
+ counts: { ...base.counts, open: base.counts.open + WF_ROWS.length }, ...o });
46
+ }
47
+ /** Only Product feature rows: the board as it is before any other workflow exists. */
48
+ const pfOnly = (o = {}) => F.facts(o);
49
+ module.exports = { facts, pfOnly, WORKFLOWS, WF_ROWS, WONT };
@@ -0,0 +1,53 @@
1
+ 'use strict';
2
+ /* workflows-facts.js — the workflows the Workflows page suite serves (canvas WfAModel: Product feature, Tender, Procurement, Migration).
3
+ * Shapes are scripts/workflows.js's (D99). Product feature is the built-in one; Tender is the canvas's ten stages with an Optional and an
4
+ * Only-when stage; the rest are short. draft() is WfADraft's Vendor onboarding, the way the chat leaves it with `pmos workflow draft`. */
5
+ const st = (key, name, cat, out, o = {}) => ({ key, name, cat, output: { name: out, kind: o.kind || 'doc', ...(o.template ? { template: o.template } : {}) }, finish: o.finish || [], milestone: !!o.milestone, auto: !!o.auto,
6
+ when: o.when || { mode: 'always' }, then: o.then || null, unless: o.unless || [] });
7
+
8
+ function productFeature() {
9
+ return { id: 'product-feature', name: 'Product feature', icon: 'feature', builtin: true, decide: 'pmos', count: 12, stages: [
10
+ st('triage', 'Triage', 'todo', 'BRD'), st('discover', 'Discover', 'doing', 'PRD'), st('plan', 'Plan', 'doing', 'Scope, timeline and work breakdown'),
11
+ st('prioritize', 'Prioritize', 'doing', 'Ranked on the roadmap', { kind: 'checklist' }), st('build', 'Build', 'doing', 'Delivered features', { kind: 'jira' }),
12
+ st('deliver', 'Deliver', 'done', 'Release shipped', { kind: 'signoff', milestone: true }), st('monitor', 'Monitor', 'done', 'Outcome report'),
13
+ st('evaluate', 'Evaluate', 'done', 'Keep, iterate or stop', { kind: 'signoff', milestone: true })] };
14
+ }
15
+ function tender() {
16
+ return { id: 'tender', name: 'Tender', icon: 'doc', decide: 'pmos', count: 4, stages: [
17
+ st('triage', 'Triage', 'todo', 'BRD'), st('requirements', 'Requirements', 'doing', 'Terms of reference'), st('rfp-out', 'RFP out', 'doing', 'RFP published', { milestone: true }),
18
+ st('qa-session', 'Q&A session', 'doing', 'Questions answered', { when: { mode: 'optional' }, kind: 'checklist' }), st('bids', 'Bids', 'doing', 'Bids in', { kind: 'checklist' }),
19
+ st('evaluate-bids', 'Evaluate bids', 'doing', 'Scored shortlist', { template: 'Bid scoring sheet', finish: ['A score from each of the 3 panelists', 'Legal checks the top 2 bids'], auto: true, unless: [{ text: 'no bid scores above 60', to: 'bids' }] }),
20
+ st('legal-review', 'Legal review', 'doing', 'Top bids checked', { kind: 'signoff', when: { mode: 'only', text: 'value over $50k' } }),
21
+ st('award', 'Award', 'doing', 'Winner signed off', { kind: 'signoff', milestone: true }), st('contract', 'Contract', 'doing', 'Contract signed', { kind: 'signoff' }),
22
+ st('review', 'Review', 'done', 'Supplier review at 90 days', { milestone: true })] };
23
+ }
24
+ function procurement() {
25
+ return { id: 'procurement', name: 'Procurement', icon: 'cart', decide: 'confirm', count: 3, stages: [
26
+ st('triage', 'Triage', 'todo', 'Request and need'), st('quotes', 'Quotes', 'doing', 'Three quotes', { kind: 'checklist' }), st('approve', 'Approve', 'doing', 'Budget owner signs', { kind: 'signoff', milestone: true }),
27
+ st('order', 'Order', 'done', 'Purchase order sent', { kind: 'checklist' })] };
28
+ }
29
+ function migration() {
30
+ return { id: 'migration', name: 'Migration', icon: 'swap', decide: 'pmos', count: 2, stages: [
31
+ st('triage', 'Triage', 'todo', 'BRD'), st('inventory', 'Inventory', 'doing', 'What moves'), st('dry-run', 'Dry run', 'doing', 'Test move done', { kind: 'checklist' }),
32
+ st('cutover', 'Cutover', 'doing', 'Moved', { kind: 'jira', milestone: true }), st('retire', 'Retire', 'done', 'Old system off', { kind: 'checklist' })] };
33
+ }
34
+ const all = () => [productFeature(), tender(), procurement(), migration()];
35
+ function draft() {
36
+ return { id: 'vendor-onboarding', name: 'Vendor onboarding', icon: 'people', decide: 'pmos', stages: [
37
+ st('triage', 'Triage', 'todo', 'Request and need'), st('contract-check', 'Contract check', 'doing', 'Contract and insurance checked', { kind: 'checklist' }),
38
+ st('security-review', 'Security review', 'doing', 'Security sign-off', { kind: 'signoff', when: { mode: 'only', text: 'they touch customer data' } }),
39
+ st('finance-sign-off', 'Finance sign-off', 'doing', 'Finance approves', { kind: 'signoff' }), st('account-setup', 'Account setup', 'doing', 'Accounts opened', { kind: 'jira' }),
40
+ st('90-day-review', '90-day review', 'done', 'Supplier review', { milestone: true })] };
41
+ }
42
+ /** Board rows on Tender for WfACond's "How it reads today". */
43
+ function rows() {
44
+ const t = tender();
45
+ const stages = (extra) => t.stages.map((s) => ({ key: s.key, name: s.name, cat: s.cat, milestone: s.milestone, when: s.when, ...(extra[s.key] || {}) }));
46
+ return [
47
+ { id: 'office-network', title: 'Office network tender', wf: { id: 'tender', name: 'Tender', icon: 'doc' }, wfStage: { key: 'evaluate-bids', name: 'Evaluate bids', cat: 'doing', n: 6, of: 10 }, wfStages: stages({ 'legal-review': { reading: { runs: true, why: 'The BRD puts the contract at $80k (section 3).' } } }) },
48
+ { id: 'catering', title: 'Catering contract', wf: { id: 'tender', name: 'Tender', icon: 'doc' }, wfStage: { key: 'bids', name: 'Bids', cat: 'doing', n: 5, of: 10 }, wfStages: stages({ 'legal-review': { status: 'skipped', reading: { runs: false, why: '$18k, no personal data.', cite: 'BRD §2' } } }) },
49
+ { id: 'print-fleet', title: 'Print fleet tender', wf: { id: 'tender', name: 'Tender', icon: 'doc' }, wfStage: { key: 'requirements', name: 'Requirements', cat: 'doing', n: 2, of: 10 }, wfStages: stages({ 'legal-review': { reading: { runs: null, why: 'No value in the BRD yet.' } } }) },
50
+ { id: 'checkout', title: 'Checkout redesign', wf: { id: 'product-feature', name: 'Product feature', icon: 'feature' }, wfStage: { key: 'build', name: 'Build', cat: 'doing', n: 5, of: 8 }, wfStages: [] },
51
+ ];
52
+ }
53
+ module.exports = { all, productFeature, tender, procurement, migration, draft, rows };
@@ -71,6 +71,7 @@ On a desktop the workspace is one frame. [Layout](layout.md) explains each part.
71
71
  - [PM-only lines: how the workspace checks your acts](pm-only-lines.md): how each act is recorded, what the Today card "A PM-only line is not attested" means, and the grants for a bulk lifecycle change and a Release.
72
72
  - [Breakdown › Timeline](timeline.md): an initiative's items on a time axis, split by stage, with milestones, today, and the at-risk flag when an item starts before its predecessor ends.
73
73
  - [Initiatives › Timeline](initiatives-timeline.md): when each initiative runs, one row per initiative, and how to reorder rows by their grip.
74
+ - [Workflows](workflows.md): Settings › Workflows, the stages each kind of initiative goes through, New workflow in the chat, and `pmos workflow`.
74
75
  - [Programs on the Board](programs.md): All products, programs first then products, By product, the program panel and its milestones, and the 60 % side panels.
75
76
  - [Board](board.md): one Kanban for the items of every initiative, its filters, Release, and `pmos board`.
76
77
  - [The lifecycle](lifecycle.md): the six stages and two milestones of an initiative, what each makes, which steps each lane uses, and how the step is read from the records.
@@ -0,0 +1,58 @@
1
+ ---
2
+ type: Guide
3
+ title: "Workflows: the stages each kind of initiative goes through"
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
6
+ ---
7
+
8
+ # Workflows
9
+
10
+ A **workflow** is the list of stages that one kind of initiative goes through ([D99](/DECISIONS.md)). PMOS ships one workflow, **Product feature**: Triage, Discover, Plan, Prioritize, Build, ◆ Deliver, Monitor and ◆ Evaluate. You make any other workflow, for example a tender or a vendor onboarding.
11
+
12
+ Open it from **Menu › Settings › Workflows**. The address is `/premium-workflows.html`.
13
+
14
+ ## The page
15
+
16
+ - **The list** on the left shows each workflow and how many initiatives use it. **+** starts a new workflow. An archived workflow shows last, under **Archived**.
17
+ - **The workflow** is one numbered list of stages, in three columns: **To do**, **In progress** and **Done**. Drag a stage to change its place or its column. **Add a stage** adds one at the end of that column. The dashed **Won't do · Archived** column is in every workflow: any initiative can go there from any stage, and come back to Triage.
18
+ - **Triage** is always the first stage, in To do.
19
+ - Tap the name of the workflow to rename it. **⋯** has **Copy** and **Archive**. You cannot archive a workflow that initiatives use.
20
+ - **Product feature** cannot change. **Copy it** to make a workflow of your own from it.
21
+
22
+ ## A stage
23
+
24
+ Tap a stage to open it in the side panel. Tap its name at the top to rename it. The panel has:
25
+
26
+ - **Category**: To do, In progress or Done.
27
+ - **Output**: what finishes the stage, and its kind. **Document** (PMOS drafts it from the template), **Jira tickets**, **Sign-off** or **Checklist only**. The kind sets how the Board counts progress.
28
+ - **To finish**: the list of items to do before the stage is done.
29
+ - **When it runs**: **Always**, **Optional** (you can skip it) or **Only when** a condition holds.
30
+ - **Then**: the next stage in the list, or a stage you pick. **Unless … go to …** adds a jump or a loop, in plain words.
31
+ - **Milestone**: a ◆ checkpoint with a date. **Moves on by itself**: the initiative goes to the next stage when every item is done.
32
+ - **⋯** has **Move up**, **Move down** and **Remove this stage**.
33
+
34
+ ### Only when
35
+
36
+ Write the condition in your own words, for example "the contract is over $50k". There is no rule builder. PMOS reads the initiative's documents when it reaches the stage before, and decides. **How it reads today** shows what PMOS read for each initiative on the workflow. **Who decides** is set per workflow: **PMOS, and tells you why**, or **PMOS suggests, you confirm**. The stage card always shows the reason, and you can undo a skip.
37
+
38
+ ### Removing a stage in use
39
+
40
+ If initiatives are in the stage, PMOS asks where they move. **Move and remove** moves them and then removes the stage. Initiatives that already passed the stage keep it in their history.
41
+
42
+ ## New workflow
43
+
44
+ Press **+**. The chat opens, scoped **New workflow**. Tell Claude how the work goes, in your own words, and add a policy or an old checklist if you have one. Claude drafts the stages and shows the draft beside the chat, with a reason for each choice. Answer its question or ask for a change, and it drafts again.
45
+
46
+ - **Create workflow** saves the draft.
47
+ - **Edit by hand** opens the draft on the page, so you can change it before you create it.
48
+ - You can also start **blank** (only Triage) or **from a copy** of a workflow.
49
+
50
+ ## The pmos workflow commands
51
+
52
+ An agent writes a draft or a reading with these commands. It never saves, copies or archives a workflow: those are your presses on the page.
53
+
54
+ - `pmos workflow list` names the workflows of this repository.
55
+ - `pmos workflow show <id>` shows one workflow, its stages numbered.
56
+ - `pmos workflow draft --file <path>` writes the draft that the New workflow chat shows. `--note` adds a line.
57
+ - `pmos workflow show-draft` shows the draft that is open.
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.