create-pmos 0.692.0 → 0.694.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 (110) hide show
  1. package/package.json +22 -16
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/adler-moments-test.js +3 -35
  7. package/workspace/adler-seasons-test.js +1 -1
  8. package/workspace/briefing-premium-adddoc-test.js +1 -1
  9. package/workspace/briefing-premium-board-test.js +1 -1
  10. package/workspace/briefing-premium-doc-edit-test.js +1 -1
  11. package/workspace/briefing-premium-work-test.js +2 -2
  12. package/workspace/changelog.json +21 -2
  13. package/workspace/chat-asks-test.js +1 -1
  14. package/workspace/core-docs-workflow-test.js +1 -1
  15. package/workspace/ev-everywhere-test.js +3 -14
  16. package/workspace/guide/home.md +2 -2
  17. package/workspace/guide/layout.md +2 -2
  18. package/workspace/guide/settings-and-switches.md +0 -1
  19. package/workspace/impact-screens-test.js +2 -47
  20. package/workspace/ini-workflow-test.js +1 -1
  21. package/workspace/lib/board-grill.js +17 -24
  22. package/workspace/lib/discovery-questions.js +36 -0
  23. package/workspace/lib/routes-board-grill.js +31 -3
  24. package/workspace/live-pill-round-test.js +6 -18
  25. package/workspace/milestone-suggest-test.js +4 -28
  26. package/workspace/news-viewers-test.js +3 -29
  27. package/workspace/package-lock.json +2 -2
  28. package/workspace/package.json +1 -1
  29. package/workspace/premium-board-actions-test.js +3 -3
  30. package/workspace/premium-briefing-depth-test.js +4 -4
  31. package/workspace/premium-chat-attach-test.js +3 -2
  32. package/workspace/premium-chat-chart-tab-test.js +8 -7
  33. package/workspace/premium-chat-context-test.js +3 -1
  34. package/workspace/premium-chat-goal-view-test.js +3 -1
  35. package/workspace/premium-chat-line-test.js +8 -6
  36. package/workspace/premium-chat-report-tab-test.js +13 -5
  37. package/workspace/premium-chat-term-test.js +2 -2
  38. package/workspace/premium-chat-viewer-test.js +10 -16
  39. package/workspace/premium-core-doc-issue-test.js +7 -2
  40. package/workspace/premium-discuss-landing-test.js +9 -5
  41. package/workspace/premium-html-viewer-test.js +7 -3
  42. package/workspace/premium-link-suggest-test.js +6 -10
  43. package/workspace/premium-phone-card-test.js +2 -2
  44. package/workspace/premium-viewer-download-test.js +1 -1
  45. package/workspace/premium-viewer-flicker-test.js +1 -1
  46. package/workspace/premium-viewer-share-test.js +2 -2
  47. package/workspace/premium-viewer-test.js +1 -1
  48. package/workspace/premium-vw-cal-test.js +1 -1
  49. package/workspace/premium-vw-copy-test.js +3 -3
  50. package/workspace/premium-vw-doc-test.js +1 -1
  51. package/workspace/premium-vw-item-test.js +1 -1
  52. package/workspace/premium-work-depth-test.js +2 -2
  53. package/workspace/program-charter-test.js +1 -12
  54. package/workspace/program-leave-test.js +2 -2
  55. package/workspace/program-order-test.js +3 -65
  56. package/workspace/project-onboard-flow-test.js +5 -5
  57. package/workspace/public/pm/bd-asks.js +6 -5
  58. package/workspace/public/pm/cozy-home.css +0 -6
  59. package/workspace/public/pm/cozy-panels.js +2 -6
  60. package/workspace/public/pm/cozy-popup.css +1 -0
  61. package/workspace/public/pm/cozy-popup.js +15 -2
  62. package/workspace/public/pm/cozy-today-page.css +1 -1
  63. package/workspace/public/pm/cozy-today.css +0 -14
  64. package/workspace/public/pm/cozy-viewer.js +14 -38
  65. package/workspace/public/pm/goal-chat.js +2 -2
  66. package/workspace/public/pm/home-app.js +8 -67
  67. package/workspace/public/pm/home-chat.js +1 -1
  68. package/workspace/public/pm/home-ses-name.js +3 -2
  69. package/workspace/public/pm/home-today.js +4 -18
  70. package/workspace/public/pm/ini-view-model.js +2 -2
  71. package/workspace/public/pm/premium-board.js +1 -1
  72. package/workspace/public/premium-intelligence.html +1 -1
  73. package/workspace/public/premium-viewer.html +1 -1
  74. package/workspace/public/premium-workflows.html +1 -1
  75. package/workspace/ready-dash-ui-test.js +1 -1
  76. package/workspace/rename-test.js +2 -2
  77. package/workspace/server.js +11 -12
  78. package/workspace/session-names-test.js +34 -56
  79. package/workspace/sort-order-test.js +2 -71
  80. package/workspace/split-merge-ui-test.js +1 -1
  81. package/workspace/stage-card-tasks-test.js +1 -1
  82. package/workspace/stage-card-test.js +1 -1
  83. package/workspace/task-card-test.js +1 -1
  84. package/workspace/task-press-test.js +1 -1
  85. package/workspace/task-views-test.js +1 -1
  86. package/workspace/test-lists/adler-seasons-art.json +3 -6
  87. package/workspace/test-lists/batch18-asks.json +1 -1
  88. package/workspace/test-lists/briefing-premium.json +1 -11
  89. package/workspace/test-lists/discovery-three-questions.json +5 -0
  90. package/workspace/test-lists/premium-agreed-viewer.json +1 -1
  91. package/workspace/test-run.js +0 -2
  92. package/workspace/test-timings.json +0 -4
  93. package/workspace/tk-tasks-test.js +3 -17
  94. package/workspace/viewer-trail-test.js +2 -2
  95. package/workspace/workflows-setup-test.js +4 -2
  96. package/workspace/adler-seasons-art-test.js +0 -116
  97. package/workspace/briefing-premium-initiative-test.js +0 -289
  98. package/workspace/briefing-premium-products-test.js +0 -209
  99. package/workspace/briefing-premium-sources-test.js +0 -250
  100. package/workspace/briefing-premium-test.js +0 -282
  101. package/workspace/home-other-product-test.js +0 -197
  102. package/workspace/home-pill-test.js +0 -138
  103. package/workspace/home-railcard-test.js +0 -196
  104. package/workspace/home-rows-test.js +0 -389
  105. package/workspace/panels-test.js +0 -454
  106. package/workspace/public/premium.html +0 -48
  107. package/workspace/test-lists/batch18-panels.json +0 -9
  108. package/workspace/test-lists/home-railcard.json +0 -9
  109. package/workspace/test-lists/home-sessions-pill.json +0 -6
  110. package/workspace/test-lists/viewer-home-rows.json +0 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.692.0",
3
+ "version": "0.694.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": {
@@ -34,8 +34,21 @@
34
34
  ],
35
35
  "pmosChanges": [
36
36
  {
37
- "v": "0.692.0",
38
- "at": "2026-11-22T09:33:00.888Z",
37
+ "v": "0.694.0",
38
+ "at": "2026-11-22T09:46:19.118Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1514,
43
+ "t": "Discovery in three questions on a new initiative (A459)",
44
+ "s": "Discovery in three questions on a new initiative (A459)",
45
+ "k": "new"
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "v": "0.693.0",
51
+ "at": "2026-11-22T09:36:04.094Z",
39
52
  "f": 4,
40
53
  "prs": [
41
54
  {
@@ -43,6 +56,12 @@
43
56
  "t": "Show who raised each initiative (Raised by column, group, sort and filter on Work)",
44
57
  "s": "Show who raised each initiative (Raised by column, group, sort and filter on Work)",
45
58
  "k": "new"
59
+ },
60
+ {
61
+ "n": 1490,
62
+ "t": "Delete Home's desk page, its fold and its rail card (home-page-retire slice 1b)",
63
+ "s": "Delete Home's desk page, its fold and its rail card (home-page-retire slice 1b)",
64
+ "k": "imp"
46
65
  }
47
66
  ]
48
67
  },
@@ -405,19 +424,6 @@
405
424
  "k": "x"
406
425
  }
407
426
  ]
408
- },
409
- {
410
- "v": "0.652.0",
411
- "at": "2026-11-20T09:04:15.002Z",
412
- "f": 4,
413
- "prs": [
414
- {
415
- "n": 1434,
416
- "t": "A done merge resolves its ✦, merged artefacts fold the old files, stage bars follow task dates",
417
- "s": "A done merge resolves its ✦, merged artefacts fold the old files, stage bars follow task dates",
418
- "k": "fix"
419
- }
420
- ]
421
427
  }
422
428
  ]
423
429
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@083c7b32
1
+ kernel-source: pmos@d4fea2c6
2
2
  assembled: 2026-11-22
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-11-22T09:32:57Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T09:46:15Z"}
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-11-22T09:32:57Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T09:46:15Z"}
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-11-22T09:32:57Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T09:46:15Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,12 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
  /* adler-moments-test.js — Adler on the phone and in Settings, in the real pages (feedback batch 17 item 4-B; canvas AdP2, AdP5, AdP6, AdM4).
4
- * The real Home from the real server, at 390 px with touch; the board and briefing are the fixtures, and GET /api/sources is stubbed with
4
+ * Today from the real server (Your day's checks, F1, F2 and P1, went with Home's list: home-desk-layout-delete), at 390 px with touch; the board and briefing are the fixtures, and GET /api/sources is stubbed with
5
5
  * Jira failed. POST /api/sources/refresh is recorded.
6
6
  * E1 no ears over the menu button (chief-of-staff delete list); the button's name says a call is the PM's
7
- * F1 Your day (Good morning) says "Jira isn't answering." in one quiet line with its read-again icon; no rain cloud
8
- * F2 its icon reads Jira again (POST /api/sources/refresh with source jira)
9
- * P1 a pull from the top of Your day lets Adler peek up, says it reads again, and reads Home again
10
7
  * S1 Settings > Updates: a face on the updates card; General: one face only
11
8
  * N no page error
12
9
  * PMOS_SHOTS=<dir> also saves the screenshots. */
@@ -75,8 +72,8 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
75
72
  await page.route(/\/api\/sources\/refresh$/, (rq) => json(rq, { ok: true, started: 'local' }));
76
73
  // the night scene would hide nothing here, but keep the test on the day: Quiet after off
77
74
  await page.addInitScript(() => { try { localStorage.setItem('pmos.adler', JSON.stringify({ 'adler.quiet': 'never' })); } catch { /* none */ } });
78
- await page.goto(BASE + '/premium.html');
79
- await until(() => page.evaluate(() => !!document.querySelector('#hmList [data-hm-day]')), 30000);
75
+ await page.goto(BASE + '/today.html');
76
+ await until(() => page.evaluate(() => !!document.getElementById('czFab')), 30000);
80
77
 
81
78
  /* E1 — chief-of-staff (UI grill delete list): no ears over the menu button; the one dot says a call is the PM's, and the name says it */
82
79
  await page.evaluate(() => document.dispatchEvent(new CustomEvent('cz:calls', { detail: { count: 1 } })));
@@ -84,35 +81,6 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
84
81
  ok('E1 no ears over the menu button; its name says one call is yours', !!ears && !ears.ears, JSON.stringify(ears));
85
82
  await shot(page, 'ears');
86
83
 
87
- /* F1-F2 */
88
- await page.click('#hmList [data-hm-day]');
89
- // Good morning (batch 27 item 10, frames G1-G3): a failed source is one quiet line under the lead, never the lead and never the rain cloud
90
- const f1 = await until(() => page.evaluate(() => { const b = document.querySelector('#czViewer .gm-lead .yd-open'); const q = b && b.querySelector('.gm-src'); if (!q) return null; return { quiet: q.querySelector('span').textContent, line: b.querySelector('.yd-ht b').textContent, rain: !!b.querySelector('.k-rain, .yd-scene'), sync: !!q.querySelector('[data-yd="sync"][aria-label="Read Jira again"]') }; }), 15000);
91
- ok('F1 Your day says "Jira isn\'t answering." in one quiet line with its read-again icon; no rain cloud, and the lead is the day\'s own line', f1 && /^Jira isn’t answering\./.test(f1.quiet) && !/answering/.test(f1.line) && !f1.rain && f1.sync, JSON.stringify(f1));
92
- await shot(page, 'sync-fail');
93
- await page.click('#czViewer [data-yd="sync"]');
94
- const f2 = await until(() => posts.find((p) => p.path === '/api/sources/refresh'));
95
- ok('F2 the icon reads Jira again', f2 && /"source":"jira"/.test(f2.body), JSON.stringify(f2));
96
-
97
- /* P1 — a pull from the top of the body, as a finger would */
98
- const reads = () => page.evaluate(() => performance.getEntriesByType('resource').filter((e) => /\/api\/home-review/.test(e.name)).length);
99
- const before = await reads();
100
- const peek = await page.evaluate(async () => {
101
- const body = document.querySelector('#czViewer .cz-vw-body') || document.querySelector('#czViewer [data-cz-pull]');
102
- const el = document.querySelector('[data-cz-pull]') || body;
103
- const t = (y) => new Touch({ identifier: 1, target: el, clientX: 200, clientY: y });
104
- el.dispatchEvent(new TouchEvent('touchstart', { touches: [t(120)], bubbles: true }));
105
- for (let y = 130; y <= 300; y += 20) el.dispatchEvent(new TouchEvent('touchmove', { touches: [t(y)], bubbles: true }));
106
- const mid = !!el.querySelector('.cz-pull .ad-svg');
107
- el.dispatchEvent(new TouchEvent('touchend', { touches: [], changedTouches: [t(300)], bubbles: true }));
108
- await new Promise((r) => setTimeout(r, 50));
109
- const p = el.querySelector('.cz-pull'); return { mid, reading: p ? p.querySelector('.cz-pull-t').textContent : '' };
110
- });
111
- ok('P1 a pull lets Adler peek up, and he says he reads your day again', peek.mid && peek.reading === 'Reading your day again', JSON.stringify(peek));
112
- await shot(page, 'pull');
113
- const after = await until(async () => ((await reads()) > before ? true : null), 15000);
114
- ok('P1 and Home reads again', after);
115
-
116
84
  /* S1 */
117
85
  await page.evaluate(() => import('/pm/cozy-settings.js').then((M) => M.openSettings('updates')));
118
86
  const s1 = await until(() => page.evaluate(() => { const m = document.querySelector('#evSettings .ev-st-main'); return m && m.querySelector('.ev-upd') ? { faces: m.querySelectorAll('.ev-ad svg, .ev-ad .ad-dot').length } : null; }), 15000);
@@ -53,7 +53,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
53
53
  page.on('request', (rq) => { if (rq.method() === 'POST' && new URL(rq.url()).pathname === '/api/settings') { try { posts.push(JSON.parse(rq.postData() || '{}')); } catch { /* not JSON */ } } });
54
54
  // the clock: Date.now and new Date() read 3 Nov 2026 (timers keep running)
55
55
  await page.addInitScript((t) => { const D = Date, off = t - D.now(); class F extends D { constructor(...a) { super(...(a.length ? a : [D.now() + off])); } static now() { return D.now() + off; } } window.Date = F; }, NOW);
56
- await page.goto(BASE + '/premium.html');
56
+ await page.goto(BASE + '/today.html');
57
57
  await until(() => page.evaluate(() => !!document.querySelector('#hmList')), 30000);
58
58
  // each viewport starts from the defaults (the server keeps a press between the two)
59
59
  await page.evaluate(() => import('/pm/http.js').then((M) => Promise.all(['adler.dress.days', 'adler.dress.wear', 'adler.dress.on'].map((key) => M.pmPost('/api/settings', { key, reset: true })))));
@@ -36,7 +36,7 @@ const CUSTOM = [
36
36
  ];
37
37
  const PAGES = {
38
38
  // the initiative is a layout inside Home (premium-agreed-design): Add a document is in its Overview, a minimal form in the Viewer (Waiting for design)
39
- initiative: { file: '/premium.html', api: '**/api/initiative-premium*', scope: 'initiative:self-serve-v2', mk: (custom) => IP.build(IF.facts({ custom })), ready: '#czViewer .iv-mc', btn: '#czViewer [data-hi-v="docs"]', qs: '?ini=self-serve-v2&ws=w1&board=w1&theme=' },
39
+ initiative: { file: '/today.html', api: '**/api/initiative-premium*', scope: 'initiative:self-serve-v2', mk: (custom) => IP.build(IF.facts({ custom })), ready: '#czViewer .iv-mc', btn: '#czViewer [data-hi-v="docs"]', qs: '?ini=self-serve-v2&ws=w1&board=w1&theme=' },
40
40
  };
41
41
 
42
42
  (async () => {
@@ -308,7 +308,7 @@ const IVREAD = () => {
308
308
  const pri = await q.evaluate(() => [...document.querySelectorAll('#czViewer [data-iv-primary]')].map((b) => ({ act: b.dataset.ivPrimary, label: b.getAttribute('aria-label'), text: b.textContent.trim() })));
309
309
  ok('B1 the panel puts the sign-off first, with the sign-off as the one icon-only primary', !!nb && /sign-off can wait|Every release ticket is done/.test(nb.why || '') && pri.length === 1 && pri[0].act === 'page' && pri[0].label === 'Your sign-off · v2.4' && pri[0].text === '', JSON.stringify([nb && nb.why, pri]));
310
310
  await Promise.all([q.waitForURL(/[?&]ini=sso-partners/, { timeout: 8000 }).catch(() => {}), q.click('#czViewer [data-iv-primary]')]);
311
- ok('B1 signing off goes to the initiative\'s page on Home, where the sign-off is', /\/premium\.html\?.*\bini=sso-partners/.test(q.url()), q.url());
311
+ ok('B1 signing off goes to the initiative\'s page on Home, where the sign-off is', /\/today\.html\?.*\bini=sso-partners/.test(q.url()), q.url());
312
312
  await R.ctx.close();
313
313
  }
314
314
 
@@ -78,7 +78,7 @@ const prop = (o) => Object.assign({ id: 'prop-a', state: 'proposed', prompt: 'ad
78
78
  });
79
79
  await page.route('**/api/docs/library*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, kinds: [], files: [{ path: PATH, title: 'Self-serve PRD' }], edges: [] }) }));
80
80
  await page.route('**/api/docs?*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, docs: [{ path: PATH, links: [] }] }) }));
81
- await page.goto(BASE + '/premium.html?ini=self-serve-v2&ws=w1&theme=' + theme);
81
+ await page.goto(BASE + '/today.html?ini=self-serve-v2&ws=w1&theme=' + theme);
82
82
  if (w <= 760) await everyPart(page);
83
83
  // the initiative's page in the Viewer (canvas HbC): its Documents' "Show all N" opens every document there
84
84
  await until(() => page.evaluate(() => !!document.querySelector('#czViewer [data-iv-docs]')), 15000);
@@ -57,7 +57,7 @@ const view = () => { const v = document.querySelector('#czViewer:not([hidden])')
57
57
  await page.route('**/api/pm-items/**', (r) => { const rq = r.request(); posts.push({ path: new URL(rq.url()).pathname, body: JSON.parse(rq.postData() || '{}'), headers: rq.headers() }); r.fulfill({ status: answer.status, contentType: 'application/json', body: JSON.stringify(answer.body) }); });
58
58
  }
59
59
  await page.goto(BASE + '/premium-work.html?theme=' + theme);
60
- await until(() => page.evaluate(() => /\/premium\.html$/.test(location.pathname) && !!document.querySelector('#czFab')), 15000);
60
+ await until(() => page.evaluate(() => /\/today\.html$/.test(location.pathname) && !!document.querySelector('#czFab')), 15000);
61
61
  await sleep(600);
62
62
  await page.evaluate(() => import('/pm/home-work.js').then((M) => { M.openMyWork(); })); // the page itself: Home no longer opens it (testing fixes); an item and Focus open alone
63
63
  const up = await until(() => page.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); return !!v && /My work/.test(v.textContent) && !/Reading your list/.test(v.textContent); }), 15000);
@@ -70,7 +70,7 @@ const view = () => { const v = document.querySelector('#czViewer:not([hidden])')
70
70
  ok('0 My work opens in the Viewer', !!A.up);
71
71
  if (!A.up) return finish(1);
72
72
  /* M1 */
73
- ok('M1 /premium-work.html opens Today (Home), the place menu marks Today and nothing on the page is the old My work page', await p.evaluate(() => /\/premium\.html$/.test(location.pathname) && /Today/.test((document.querySelector('#czMenu [aria-current="page"]') || {}).textContent || '') && !document.querySelector('#qBody, #capIn, nav.rail')));
73
+ ok('M1 /premium-work.html opens Today (Home), the place menu marks Today and nothing on the page is the old My work page', await p.evaluate(() => /\/today\.html$/.test(location.pathname) && /Today/.test((document.querySelector('#czMenu [aria-current="page"]') || {}).textContent || '') && !document.querySelector('#qBody, #capIn, nav.rail')));
74
74
  ok('M1 the page is still served at /premium-work and /premium-work.html', (await fetch(BASE + '/premium-work', { redirect: 'manual' })).status === 302 && (await fetch(BASE + '/premium-work.html')).status === 200);
75
75
  /* M4 */
76
76
  const v0 = await p.evaluate(view);
@@ -1,7 +1,20 @@
1
1
  [
2
2
  {
3
- "v": "0.692.0",
4
- "at": "2026-11-22T09:33:00.888Z",
3
+ "v": "0.694.0",
4
+ "at": "2026-11-22T09:46:19.118Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1514,
9
+ "t": "Discovery in three questions on a new initiative (A459)",
10
+ "s": "Discovery in three questions on a new initiative (A459)",
11
+ "k": "new"
12
+ }
13
+ ]
14
+ },
15
+ {
16
+ "v": "0.693.0",
17
+ "at": "2026-11-22T09:36:04.094Z",
5
18
  "f": 4,
6
19
  "prs": [
7
20
  {
@@ -9,6 +22,12 @@
9
22
  "t": "Show who raised each initiative (Raised by column, group, sort and filter on Work)",
10
23
  "s": "Show who raised each initiative (Raised by column, group, sort and filter on Work)",
11
24
  "k": "new"
25
+ },
26
+ {
27
+ "n": 1490,
28
+ "t": "Delete Home's desk page, its fold and its rail card (home-page-retire slice 1b)",
29
+ "s": "Delete Home's desk page, its fold and its rail card (home-page-retire slice 1b)",
30
+ "k": "imp"
12
31
  }
13
32
  ]
14
33
  },
@@ -51,7 +51,7 @@ const STEPS = [{ text: 'Calendar', state: 'done' }, { text: 'Mail', state: 'done
51
51
  await page.route('**/api/briefing-premium/**', (r) => { const rq = r.request(); if (rq.method() !== 'GET') posts.push({ path: new URL(rq.url()).pathname, body: JSON.parse(rq.postData() || '{}') }); r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, turns: [], working: false, session: 's-asks' }) }); });
52
52
  await page.route('**/api/sessions/conversation**', (r) => r.fulfill({ json: { ok: true, ...st.conv } }));
53
53
  await page.goto(BASE + '/premium-chat.html?about=' + encodeURIComponent(KEY), { waitUntil: 'domcontentloaded' });
54
- await page.waitForFunction(() => !!document.querySelector('#hmIn'), null, { timeout: 15000 });
54
+ await page.waitForFunction(() => { const i = document.querySelector('#hmIn'); return !!i && !!i.offsetParent; }, null, { timeout: 15000 }); // on a desktop the chat is the popup's: wait until it shows
55
55
  return { page, ctx, errors, posts, st };
56
56
  };
57
57
  const card = (page, kind) => until(async () => page.evaluate((k) => { const c = document.querySelector(`#hmLog .hm-askk[data-ask-kind="${k}"]`); if (!c) return null; const w = c.closest('.hm-askw, .hm-askc');
@@ -102,7 +102,7 @@ const OLD = new Map([['initiative:' + ID + '|risks', { drafts: [], issued: { at:
102
102
  await page.route('**/api/briefing-premium/**', (r) => json(r, { ok: true, turns: [], working: false }));
103
103
  await page.route(/\/api\/workflows(\?.*)?$/, (r) => json(r, { ok: true, workflows: WF.list(LIB) }));
104
104
  await page.addInitScript(() => { try { localStorage.setItem('pmos.wf.seen', JSON.stringify({ 'self-serve-v2|tender': 1 })); } catch { /* none */ } });
105
- await page.goto(BASE + '/premium.html?ini=' + ID + '&ws=w1&board=w1&theme=' + theme);
105
+ await page.goto(BASE + '/today.html?ini=' + ID + '&ws=w1&board=w1&theme=' + theme);
106
106
  if (w <= 760) await everyPart(page);
107
107
  let up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]')), 30000);
108
108
  if (up) {
@@ -5,7 +5,7 @@
5
5
  * U1 the place menu: Home, Board, Intelligence, then Search and Settings as icons (feedback batch 16 item 5, FmA1Menu); no More anywhere
6
6
  * S1 Ctrl K opens Search over the page; typing finds a document on main and a draft on the worktree; the kind chips narrow; Escape closes
7
7
  * S2 the worktree chip lists the worktree and leaving it out drops its draft; S3 a result opens in the Viewer
8
- * N1 Good morning opens Your day with the calendar icon; New for you is its fold (FmA2Day); nothing is posted on open
8
+ * N1 the place menu opens no New for you page
9
9
  * R1 Settings › Connectors lists each source with when it was read (was Sources, FmA3Settings); R2 Settings opens on General with its
10
10
  * sections (on Connectors while a source is stale), and Escape closes it
11
11
  * B1 the Board's Settings and Sources open Settings; B2 Ctrl K on Board opens the same Search
@@ -70,7 +70,7 @@ const put = (root, rel, text) => { fs.mkdirSync(path.dirname(path.join(root, rel
70
70
  browser = classicBoard(await chromium.launch({ executablePath: exe, headless: true, args: ['--no-sandbox'] }));
71
71
  const shot = process.env.EV_SHOTS || '';
72
72
  const snap = async (pg, name) => { if (!shot) return; fs.mkdirSync(shot, { recursive: true }); await sleep(400); await pg.screenshot({ path: path.join(shot, name + '.png') }); };
73
- const open = async ({ w = 1440, h = 900, page = 'premium.html', theme = '' } = {}) => {
73
+ const open = async ({ w = 1440, h = 900, page = 'today.html', theme = '' } = {}) => {
74
74
  const ctx = await browser.newContext({ viewport: { width: w, height: h } });
75
75
  const pg = await ctx.newPage(); const errors = [], posts = [];
76
76
  pg.on('pageerror', (e) => errors.push(String(e)));
@@ -111,19 +111,8 @@ const put = (root, rel, text) => { fs.mkdirSync(path.dirname(path.join(root, rel
111
111
  await pg.keyboard.press('Escape');
112
112
  await until(() => pg.evaluate(() => !document.querySelector('#czViewer:not([hidden])')));
113
113
 
114
- /* N: New for you, a fold of Your day (feedback batch 16 item 5b, canvas FmA2Day) */
115
- posts.length = 0;
116
- const nfy = (await json('GET', '/api/news-for-you?ws=' + encodeURIComponent(ws))).body || {};
117
- await pg.click('#hmList [data-hm-day]');
118
- const yd = await until(() => pg.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); if (!v || !v.querySelector('.yd')) return null; const f = v.querySelector('.gm-since');
119
- return { cal: !!v.querySelector('.cz-vw-hd [data-cz-vw-p="cal"]'), more: !!v.querySelector('.cz-vw-hd [data-cz-vw="more"]'), fold: !!f, rows: f ? f.querySelectorAll('[data-yd="news"]').length : 0, all: !!(f && f.querySelector('[data-yd="seen"]')) }; }), 20000);
120
- ok('N1 Good morning opens Your day, with the calendar as an icon in its header and no ⋯', !!yd && yd.cal && !yd.more, JSON.stringify(yd));
121
- ok('N1 New for you is Good morning’s Since yesterday (nyt-ui GM2): the newest 3 at most, with ✓✓; nothing new draws no block', !!yd && (nfy.count > 0 ? yd.fold && yd.rows === Math.min(3, nfy.count) && yd.all : !yd.fold), JSON.stringify({ yd, count: nfy.count }));
114
+ /* N: the place menu no longer opens a New for you page (Your day's own checks went with Home's list: home-desk-layout-delete) */
122
115
  ok('N1 the place menu no longer opens a New for you page', await pg.evaluate(() => !document.querySelector('#czMenu [data-cz-news]')));
123
- const own = posts.filter((u) => u !== '/api/loose-props/rows');
124
- ok('N1 opening Your day posted nothing', own.length === 0, JSON.stringify(posts));
125
- await snap(pg, 'day-1440-light');
126
- await pg.keyboard.press('Escape');
127
116
 
128
117
  /* R: Sources and Settings */
129
118
  await until(() => pg.evaluate(() => !document.querySelector('#czViewer:not([hidden])')));
@@ -162,7 +162,7 @@ Press the name in the Viewer's header. The name becomes a field.
162
162
 
163
163
  PMOS names a session after its first real answer. It does not ask. It changes the name again only when the job changes.
164
164
 
165
- - To rename a session, press its name in the chat header. On a phone, press the name in the top bar. Enter saves and Esc cancels, as above.
165
+ - To rename a session on a desk, press ⋯ in the chat's top bar, then Rename session. The name becomes a field. On a phone, press the name in the top bar. Enter saves and Esc cancels, as above.
166
166
  - Your name always wins. After you rename a session, PMOS does not rename it again.
167
167
  - **Undo** gives back the name that PMOS gave, and PMOS names the session again.
168
168
  - The Home row shows the same name.
@@ -178,7 +178,7 @@ Some features are still not designed. Home keeps each one usable as a plain card
178
178
 
179
179
  ## The other pages
180
180
 
181
- - **Board.** New initiative takes links and files, starts in Triage and asks only the questions that the material does not answer. **Later** keeps the questions as the next step. The Board also has List, By stage and a span picker. Documents are in each initiative's Documents fold and in Search. On a phone, **Metrics** and **Cancelled and archived** are in every view. On a computer, press **Discuss in chat** on an initiative's or a program's panel to open the chat about it in a panel on the Board. It is the same conversation as on Home. At 1600 px and wider the chat opens beside the panel; on a laptop it slides over it.
181
+ - **Board.** New initiative takes links and files, starts in Triage and asks three questions: who has this problem, how do we know, and what would change our mind. The first two answers become the initiative's evidence. The third answer becomes the result that stops the work, its kill condition. If you change an answer, the new answer replaces the old one. **Not sure yet** keeps nothing. **Later** keeps the open questions as the next step. The Board also has List, By stage and a span picker. Documents are in each initiative's Documents fold and in Search. On a phone, **Metrics** and **Cancelled and archived** are in every view. On a computer, press **Discuss in chat** on an initiative's or a program's panel to open the chat about it in a panel on the Board. It is the same conversation as on Home. At 1600 px and wider the chat opens beside the panel; on a laptop it slides over it.
182
182
  - **Dock a panel left or right (Board and Intelligence).** Drag a panel's header to the left or the right half of the window, and drop it when that half turns blue. With the keyboard, press **Arrange** in the panel's header, then **Dock on the left** or **Dock on the right**. Each kind of panel stays on its side after a reload. The divider resizes the panel on either side. The Live pill's list has a grab bar on top: drag it to the left or the right side, or press it to move the list to the other side.
183
183
  - **Meetings.** Replay with screen captures and kept points, Focus, a presenter view, Add material, the After view, a Day, Week and Month calendar, and Notes.
184
184
  - **Reports.** The Brief, the report states, a document reader and a live page reader.
@@ -43,7 +43,7 @@ On a phone, **⋯** at the top right of every screen opens the menu: Today, Work
43
43
 
44
44
  ## Today
45
45
 
46
- On a computer, Today is one page that starts at the left of the panel. At the top are the day and the time, and a greeting. Under them, the Overview and Today's log take the left (at most about 1100 px wide). Today's agenda is in one grey box on the right, about 340 px wide, with the meeting you recorded under it. Today is built from the parts of the PMOS design system: the Overview is a summary card, the log a list card, and the agenda a timeline. Today reads every product. Home's old address on a computer (`/premium.html`, and a link that names one item) opens Today.
46
+ On a computer, Today is one page that starts at the left of the panel. At the top are the day and the time, and a greeting. Under them, the Overview and Today's log take the left (at most about 1100 px wide). Today's agenda is in one grey box on the right, about 340 px wide, with the meeting you recorded under it. Today is built from the parts of the PMOS design system: the Overview is a summary card, the log a list card, and the agenda a timeline. Today reads every product. Home's old address (`/premium.html`, and a link that names one item) opens Today; Home's own page is gone.
47
47
 
48
48
  The **Overview** is one card written by PMOS (✦). It says how many lines are open, the ones to start with and why, how much free time today has and when your first or next meeting is. It names only what the lines themselves say. The names of the lines to start with are links: press one to open it. Under it, PMOS suggests what to clean up with ✓ ✕, only when it is true, for example "Drop the 2 checks carried more than 60 days".
49
49
 
@@ -278,7 +278,7 @@ A chat on a phone uses the full width of the screen:
278
278
 
279
279
  Setup is a conversation in Home. It replaces the chat on the right while it runs, and the list of your work stays on the left. There is no separate setup page.
280
280
 
281
- Today starts setup when PMOS has no project yet; on a desk it opens in the popup's chat. `pmos` also starts it on a first run. To start it again, open `/premium.html?onboard=1`. The old addresses `/welcome` and `/premium-welcome.html` open the same conversation; the three-step Welcome page they once served is gone.
281
+ Today starts setup when PMOS has no project yet; on a desk it opens in the popup's chat. `pmos` also starts it on a first run. To start it again, open `/today.html?onboard=1`. The old addresses `/welcome`, `/premium.html?onboard=1` and `/premium-welcome.html` open the same conversation; the three-step Welcome page they once served is gone.
282
282
 
283
283
  Setup saves its progress on this computer, outside any project folder. A reload continues from the same step.
284
284
 
@@ -241,7 +241,6 @@ Do not set these on your own computer. The suites set them to make a run short o
241
241
  | Variable | What it does | Default | Same in Settings |
242
242
  |---|---|---|---|
243
243
  | `PMOS_TEST` | `1` allows the test seam of the audit sink. | off | — |
244
- | `PMOS_DESK_HOME` | `keep` keeps Home at `/premium.html` (the suites set it). Without it, every `/premium.html` address opens Today with the same query; on a desk the chat, session or setup it names opens in the popup. | Today | — |
245
244
  | `PMOS_OFFLOOP` | `0` runs the board fold in the server thread, not in a worker. | worker | — |
246
245
  | `PMOS_TICK_MS` | The server's tick. | 1 minute | — |
247
246
  | `PMOS_LIVENESS_MS` | How often the session list is sent again. | 2 seconds | — |
@@ -3,11 +3,7 @@
3
3
  /* impact-screens-test.js — Your impact in the real pages (feedback batch 16 item 7, Phases 2 to 4; canvas GmA1Home, GmA3Garden, GmA2Board).
4
4
  * The real Home and Board from the real server; GET /api/impact/week and /weeks are stubbed in the contract's shape (7-impact-api.md), and
5
5
  * every POST is recorded so the test can say nothing left for anywhere but /api/impact/seen.
6
- * H1 Home: the greeting's Adler is its own press, beside "Good morning", which still opens Your day
7
- * H2 the one celebration: a thanks says itself in the toast once and is marked read
8
- * H3 a press opens "Your impact this week" in the Viewer: a row per item, each with its source to open, and the lock line; no digit
9
- * H4 the log icon opens "Your impact": this week open, a quiet week in plain words, past weeks folded
10
- * H5 off (or gated): no face press; the greeting is as it was
6
+ * (H1 to H6, Your impact from Home's greeting, went with Home's list: home-desk-layout-delete)
11
7
  * B1 Board: an initiative with a milestone delivered this month shows who made it happen, unranked, each with a ticket; no send press
12
8
  * N every POST went to /api/impact/seen, and no page error
13
9
  * PMOS_SHOTS=<dir> also saves the screenshots. */
@@ -76,7 +72,7 @@ const WEEKS = { ok: true, on: true, live: true, weeks: [
76
72
  ]);
77
73
  }
78
74
 
79
- const open = async ({ w = 1440, h = 900, week = WEEK(), url = '/premium.html' } = {}) => {
75
+ const open = async ({ w = 1440, h = 900, week = WEEK(), url = '/today.html' } = {}) => {
80
76
  const ctx = await browser.newContext({ viewport: { width: w, height: h }, hasTouch: w < 500 });
81
77
  const page = await ctx.newPage();
82
78
  const errors = [], posts = [];
@@ -94,47 +90,6 @@ const WEEKS = { ok: true, on: true, live: true, weeks: [
94
90
  return { ctx, page, errors, posts };
95
91
  };
96
92
 
97
- /* H1-H4 */
98
- {
99
- const { ctx, page, errors, posts } = await open();
100
- const face = await until(() => page.evaluate(() => { const b = document.querySelector('#hmList [data-hm-impact]'); return b ? { label: b.getAttribute('aria-label'), next: !!(b.nextElementSibling && b.nextElementSibling.matches('[data-hm-day]')), dayFace: !!document.querySelector('#hmList [data-hm-day] .ad-svg') } : null; }), 30000);
101
- ok('H1 the greeting\'s Adler is its own press, "Your impact this week", right before "Good morning"', face && face.label === 'Your impact this week' && face.next && !face.dayFace, JSON.stringify(face));
102
- const toastSaid = await until(() => page.evaluate(() => { const t = document.getElementById('toast'); return t && /thanked you/.test(t.textContent) ? t.textContent : null; }));
103
- ok('H2 the one celebration: Chen\'s thanks says itself in the toast, and it is marked read', /Chen thanked you · Chen: “the drop-off spec saved us a day”/.test(toastSaid || '') && (await until(() => posts.includes('/api/impact/seen'))), toastSaid);
104
- await shot(page, 'home-face');
105
- await page.click('#hmList [data-hm-impact]');
106
- const vw = await until(() => page.evaluate(() => { const v = document.querySelector('#czViewer'); const c = window.czViewer && window.czViewer.current(); if (!v || v.hidden || !c || c.id !== 'impact-week') return null; const rows = [...v.querySelectorAll('.im-row')]; return rows.length ? { title: c.title, rows: rows.map((r) => ({ t: r.querySelector('.im-t').textContent, href: r.querySelector('a.im-ib') && r.querySelector('a.im-ib').getAttribute('href') })), text: v.querySelector('.cz-vw-body').innerText } : null; }));
107
- ok('H3 the Viewer "Your impact this week": a row per item, each opening its own source', vw && vw.title === 'Your impact this week' && vw.rows.length === 3 && vw.rows[0].href === 'https://acme.slack.com/archives/C1/p1' && vw.rows[2].href === '/premium.html?ini=descope', JSON.stringify(vw));
108
- const chrome = vw ? vw.text.replace(/IDPF-\d+/g, '') : '';
109
- ok('H3 the lock line, and no digit anywhere on the page body (no count, no score)', /Only you see this\. Nothing leaves PMOS\./.test(chrome) && !/\d/.test(chrome), chrome);
110
- await shot(page, 'impact-week');
111
- await page.click('#czViewer [data-cz-vw-p="log"]');
112
- const log = await until(() => page.evaluate(() => { const c = window.czViewer && window.czViewer.current(); const b = document.querySelector('#czViewer .cz-vw-body'); if (!c || c.id !== 'impact-log' || !b || !b.querySelector('.im-wk')) return null; return { sections: b.querySelectorAll('section.im-wk').length, folded: [...b.querySelectorAll('details.im-wk')].map((d) => d.open), quiet: [...b.querySelectorAll('.im-wk.quiet')].map((q) => q.innerText.replace(/\s+/g, ' ').trim()), adler: !!b.querySelector('.im-log .ad-svg') }; }));
113
- ok('H4 the log: this week open, last week folded, a quiet week in plain words, Adler at the top', log && log.sections === 1 && log.folded.length === 1 && log.folded[0] === false && log.quiet[0] === 'Week of Oct 12 A quiet week' && log.adler, JSON.stringify(log));
114
- await shot(page, 'impact-log');
115
- ok('N Home: every POST went to /api/impact/seen or the page\'s own reads, and no page error', !posts.some((p) => /slack|mail|jira|outbox|share|send/i.test(p)) && !errors.length, JSON.stringify({ posts, errors }));
116
- await ctx.close();
117
- }
118
- /* H5 */
119
- for (const [name, week] of [['off', { ok: true, on: false }], ['gated', WEEK({ live: false, items: [], grow: 'rest', celebrate: null })]]) {
120
- const { ctx, page } = await open({ week });
121
- await until(() => page.evaluate(() => !!document.querySelector('#hmList [data-hm-day]')), 30000);
122
- await sleep(800);
123
- const st = await page.evaluate(() => ({ face: !!document.querySelector('#hmList [data-hm-impact]'), dayFace: !!document.querySelector('#hmList [data-hm-day] .ad-svg') }));
124
- ok(`H5 ${name}: no impact press; the greeting keeps its own face`, !st.face && st.dayFace, JSON.stringify(st));
125
- await ctx.close();
126
- }
127
- /* H6 a phone */
128
- {
129
- const { ctx, page } = await open({ w: 390, h: 844, week: WEEK({ celebrate: null }) });
130
- await until(() => page.evaluate(() => !!document.querySelector('#hmList [data-hm-impact]')), 30000);
131
- await shot(page, 'home-face-phone');
132
- await page.click('#hmList [data-hm-impact]');
133
- const full = await until(() => page.evaluate(() => { const v = document.querySelector('#czViewer'); return v && !v.hidden && v.querySelectorAll('.im-row').length === 3 ? v.getBoundingClientRect().width : null; }));
134
- ok('H6 a phone: the press opens the week full screen', full >= 380, String(full));
135
- await shot(page, 'impact-week-phone');
136
- await ctx.close();
137
- }
138
93
  /* B1 */
139
94
  {
140
95
  const { ctx, page, errors, posts } = await open({ url: '/premium-board.html' });
@@ -89,7 +89,7 @@ const BRIEF = BRP.build(BRF.facts());
89
89
  await page.route(/\/api\/workflows(\?.*)?$/, (r) => json(r, { ok: true, workflows: LIB }));
90
90
  for (const p of ['ini-wf', 'wontdo', 'archive', 'ini-auto', 'move']) await page.route('**/api/boards/' + p, (r) => json(r, { ok: true, row: {} }));
91
91
  if (!fresh) await page.addInitScript(() => { try { localStorage.setItem('pmos.wf.seen', JSON.stringify({ 'self-serve-v2|tender': 1 })); } catch { /* none */ } });
92
- await page.goto(BASE + '/premium.html?ini=' + ID + '&ws=w1&board=w1&theme=' + theme);
92
+ await page.goto(BASE + '/today.html?ini=' + ID + '&ws=w1&board=w1&theme=' + theme);
93
93
  if (w <= 760) await everyPart(page);
94
94
  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);
95
95
  return { ctx, page, errors, posts, up, S };
@@ -1,62 +1,55 @@
1
1
  'use strict';
2
2
  /* lib/board-grill.js — the first questions of a new initiative (initiative premium-uncovered-features, Board: BdNew, BdGrill).
3
3
  *
4
- * fold(lines, id) → { id, why, material: { links, files }, answers: { [q]: text }, later, at } PURE
4
+ * fold(lines, id) → { id, why, material: { links, files }, answers: { [q]: text }, refs: { [q]: ref }, later, at } PURE
5
5
  * questionsOf(state) → [{ key, n, of, topic, q, why, chips, answer }] PURE
6
6
  * summaryOf(state) → { open, total, later, took: [line] } PURE
7
7
  *
8
8
  * A new initiative starts in Triage with no lane choice. Right after it is made, the Board shows what PMOS took from the PM's words and
9
- * material, then asks only what they leave open, one question at a time. The questions are the BRD's four parts (the Triage output:
10
- * business case, who asked, problem, success measure). A part the Why already answers is not asked. "Later" keeps the open questions as
11
- * the initiative's next step.
9
+ * material, then asks three questions, one at a time: who has this problem, how do we know, and what would change our mind
10
+ * (discovery-three-questions, bet A459; it replaced the BRD's four parts). POST /api/board-grill/answer turns each answer into the
11
+ * Experiment's evidence or kill condition. "Later" keeps the open questions as the initiative's next step.
12
12
  *
13
13
  * FILE MODE ONLY (D64/D66): one append-only file, <state>/triage-answers.jsonl, with lines
14
14
  * { kind: 'start', initiative, why, links: [{ url, label }] } the New initiative panel's Why and links
15
15
  * { kind: 'file', initiative, name, type, size, path } a file the PM added (its bytes are in <state>/material/<initiative>/)
16
- * { kind: 'answer', initiative, q, answer } one answer (the last one per question wins)
16
+ * { kind: 'answer', initiative, q, answer, ref? } one answer (the last one per question wins); ref is the
17
+ * artefact line it wrote, so a changed answer undoes it
17
18
  * { kind: 'later', initiative } the PM closed the questions with Later
18
19
  * Nothing here reads the material for the PM or sends it anywhere: an agent session reads it during Triage. */
20
+ const DQ = require('./discovery-questions.js');
19
21
 
20
- /** The BRD's parts as questions. `answeredBy` says when the Why already answers one, so it is not asked. */
21
- const QUESTIONS = [
22
- { key: 'problem', topic: 'Problem', q: 'What problem does it solve, and who is stuck today?', why: 'The BRD starts from the problem. Your Why did not name it, so PMOS asks.',
23
- chips: [], answeredBy: (why) => words(why) >= 8 },
24
- { key: 'who', topic: 'Who asked', q: 'Who asked for it, or who feels the problem most?', why: 'The BRD names who asked, so the right people review it.',
25
- chips: ['Customers', 'Partners', 'An internal team', 'Not sure yet'] },
26
- { key: 'case', topic: 'Business case', q: 'What does it win or save if it works?', why: 'The business case decides its rank against the other initiatives.',
27
- chips: ['Revenue', 'Retention', 'Cost', 'Risk', 'Not sure yet'] },
28
- { key: 'success', topic: 'Success', q: 'What would show it worked?', why: 'The success measure becomes the target that Monitor reads after the release.',
29
- chips: ['A metric moves', 'Fewer support tickets', 'A customer renews', 'Not sure yet'] },
30
- ];
22
+ /** The three discovery questions (lib/discovery-questions.js, bet A459). Every one is asked: a Why removes none of them. */
23
+ const QUESTIONS = DQ.QUESTIONS;
31
24
  const KEYS = new Set(QUESTIONS.map((x) => x.key));
32
- const words = (s) => String(s || '').trim().split(/\s+/).filter((w) => w.length > 1).length;
33
25
 
34
26
  /** The state of one initiative from the file's lines. Pure. */
35
27
  function fold(lines, id) {
36
- const st = { id, why: '', material: { links: [], files: [] }, answers: {}, later: false, at: null };
28
+ const st = { id, why: '', material: { links: [], files: [] }, answers: {}, refs: {}, later: false, at: null };
37
29
  for (const l of lines || []) {
38
30
  if (!l || l.initiative !== id) continue;
39
31
  if (l.kind === 'start') {
40
32
  st.why = typeof l.why === 'string' ? l.why : st.why; st.at = st.at || l.at || null;
41
33
  for (const k of Array.isArray(l.links) ? l.links : []) if (k && k.url && !st.material.links.some((x) => x.url === k.url)) st.material.links.push({ url: String(k.url), label: String(k.label || k.url) });
42
34
  } else if (l.kind === 'file' && l.name) st.material.files.push({ name: String(l.name), type: String(l.type || ''), size: Number(l.size) || 0, path: l.path || null });
43
- else if (l.kind === 'answer' && KEYS.has(l.q)) { if (String(l.answer || '').trim()) st.answers[l.q] = String(l.answer).trim(); else delete st.answers[l.q]; }
35
+ else if (l.kind === 'answer' && KEYS.has(l.q)) {
36
+ if (String(l.answer || '').trim()) st.answers[l.q] = String(l.answer).trim(); else delete st.answers[l.q];
37
+ if (l.ref) st.refs[l.q] = String(l.ref); else delete st.refs[l.q];
38
+ }
44
39
  else if (l.kind === 'later') st.later = true;
45
40
  }
46
41
  return st;
47
42
  }
48
- /** The questions PMOS asks: the BRD parts the Why does not answer, numbered, each with its answer when there is one. Pure. */
43
+ /** The questions PMOS asks, numbered, each with its answer when there is one. Pure. */
49
44
  function questionsOf(st) {
50
- const ask = QUESTIONS.filter((x) => !(x.answeredBy && x.answeredBy(st.why)));
51
- return ask.map((x, i) => ({ key: x.key, n: i + 1, of: ask.length, topic: x.topic, q: x.q, why: x.why, chips: x.chips.slice(), answer: st.answers[x.key] || '' }));
45
+ return QUESTIONS.map((x, i) => ({ key: x.key, n: i + 1, of: QUESTIONS.length, topic: x.topic, q: x.q, why: x.why, chips: x.chips.slice(), answer: st.answers[x.key] || '' }));
52
46
  }
53
47
  /** How many questions are still open, and what PMOS took from the Why and the material, in plain lines. Pure. */
54
48
  function summaryOf(st) {
55
49
  const qs = questionsOf(st), open = qs.filter((x) => !x.answer).length, L = st.material.links.length, F = st.material.files.length;
56
50
  const took = [];
57
51
  if (st.why.trim()) took.push('Your Why: ' + st.why.trim());
58
- if (QUESTIONS[0].answeredBy(st.why)) took.push('It names the problem, so PMOS does not ask about it.');
59
- if (L || F) took.push('Material: ' + [L ? L + ' ' + (L === 1 ? 'link' : 'links') : '', F ? F + ' ' + (F === 1 ? 'file' : 'files') : ''].filter(Boolean).join(' and ') + '. An agent reads it in Triage and drafts the BRD from it.');
52
+ if (L || F) took.push('Material: ' + [L ? L + ' ' + (L === 1 ? 'link' : 'links') : '', F ? F + ' ' + (F === 1 ? 'file' : 'files') : ''].filter(Boolean).join(' and ') + '. An agent reads it in Triage for more evidence.');
60
53
  return { open, total: qs.length, later: st.later, took };
61
54
  }
62
55
 
@@ -0,0 +1,36 @@
1
+ 'use strict';
2
+ /* lib/discovery-questions.js — discovery in three questions (initiative discovery-three-questions, bet A459).
3
+ *
4
+ * QUESTIONS the three questions a new initiative asks, in order: [{ key, topic, q, why, chips }]
5
+ * lineOf(key, answer) → { artefact: 'experiment', field, text, sources } | null PURE
6
+ *
7
+ * A new initiative on the Board asks only: who has this problem, how do we know, and what would change our mind. There is no
8
+ * template to fill. The first two answers become evidence lines of the initiative's Experiment artefact (lib/artefacts.js), the
9
+ * third becomes its kill condition, and lib/artefact-mirror.js copies the kill condition to the record's `kill:` line, which the
10
+ * gates and the outcome checks read. "Not sure yet" and an empty answer become nothing: the question stays open for discovery.
11
+ * Every line carries the source label TAG, so the health number counts them (the record's health_read). Nothing here writes. */
12
+
13
+ const TAG = '[discovery-questions]';
14
+ const UNSURE = 'Not sure yet';
15
+ const QUESTIONS = Object.freeze([
16
+ Object.freeze({ key: 'who', topic: 'Who has it', q: 'Who has this problem?', field: 'evidence', prefix: 'Who has it: ',
17
+ why: 'Discovery starts with the people who feel it. This becomes the first line of its evidence.',
18
+ chips: Object.freeze(['Customers', 'Partners', 'An internal team', UNSURE]) }),
19
+ Object.freeze({ key: 'know', topic: 'How we know', q: 'How do we know they have it?', field: 'evidence', prefix: 'How we know: ',
20
+ why: 'A guess is fine, if it says so. This becomes its evidence.',
21
+ chips: Object.freeze(['They told us', 'It shows in the data', 'Support tickets', 'A guess for now', UNSURE]) }),
22
+ Object.freeze({ key: 'mind', topic: 'What would change our mind', q: 'What would change our mind?', field: 'kill', prefix: '',
23
+ why: 'This becomes its kill condition: the result that stops the work. A number makes it easy to check.',
24
+ chips: Object.freeze([UNSURE]) }),
25
+ ]);
26
+ const BY_KEY = new Map(QUESTIONS.map((x) => [x.key, x]));
27
+
28
+ /** The artefact set an answer becomes, or null for "Not sure yet", an empty answer or an unknown key. Pure. */
29
+ function lineOf(key, answer) {
30
+ const x = BY_KEY.get(key);
31
+ const a = String(answer == null ? '' : answer).replace(/\s+/g, ' ').trim();
32
+ if (!x || !a || a === UNSURE) return null;
33
+ return { artefact: 'experiment', field: x.field, text: x.prefix + a, sources: [{ label: `${TAG} ${x.key}`, ref: 'triage-answers.jsonl' }] };
34
+ }
35
+
36
+ module.exports = { TAG, UNSURE, QUESTIONS, lineOf };