create-pmos 0.659.0 → 0.661.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.659.0",
3
+ "version": "0.661.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,14 +34,39 @@
34
34
  ],
35
35
  "pmosChanges": [
36
36
  {
37
- "v": "0.659.0",
38
- "at": "2026-11-22T03:48:36.791Z",
37
+ "v": "0.661.0",
38
+ "at": "2026-11-22T04:04:22.455Z",
39
39
  "f": 4,
40
40
  "prs": [
41
41
  {
42
- "n": 1444,
43
- "t": "Library is built from the design system's blocks",
44
- "s": "Library is built from the design system's blocks",
42
+ "n": 1445,
43
+ "t": "Pmos design drift, the design drift guard",
44
+ "s": "Pmos design drift, the design drift guard",
45
+ "k": "new"
46
+ },
47
+ {
48
+ "n": 1449,
49
+ "t": "Rebuild the Intelligence page from Komorebi blocks",
50
+ "s": "Rebuild the Intelligence page from Komorebi blocks",
51
+ "k": "new"
52
+ }
53
+ ]
54
+ },
55
+ {
56
+ "v": "0.658.0",
57
+ "at": "2026-11-22T03:38:17.292Z",
58
+ "f": 4,
59
+ "prs": [
60
+ {
61
+ "n": 1441,
62
+ "t": "Goals is built from the design system's blocks",
63
+ "s": "Goals is built from the design system's blocks",
64
+ "k": "new"
65
+ },
66
+ {
67
+ "n": 1443,
68
+ "t": "Events is built from the design system's blocks",
69
+ "s": "Events is built from the design system's blocks",
45
70
  "k": "new"
46
71
  }
47
72
  ]
@@ -303,19 +328,6 @@
303
328
  "k": "new"
304
329
  }
305
330
  ]
306
- },
307
- {
308
- "v": "0.632.0",
309
- "at": "2026-11-19T11:23:46.354Z",
310
- "f": 4,
311
- "prs": [
312
- {
313
- "n": 1414,
314
- "t": "Set up the Meet panel from Settings › Connectors › Google Meet",
315
- "s": "Set up the Meet panel from Settings › Connectors › Google Meet",
316
- "k": "new"
317
- }
318
- ]
319
331
  }
320
332
  ]
321
333
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@d9579e83
1
+ kernel-source: pmos@6ad955bd
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-22T03:48:33Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T04:04:19Z"}
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-22T03:48:33Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T04:04:19Z"}
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-22T03:48:33Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T04:04:19Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -78,7 +78,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
78
78
  if (r.request().method() === 'POST') { pk.on = JSON.parse(r.request().postData() || '{}').on; pk.posts.push(pk.on); }
79
79
  r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, all: false, chosen: true, products: reg.map((x, i) => ({ ...x, home: false, primary: !i, initials: null, on: pk.on.includes(x.ws) })) }) });
80
80
  });
81
- await page.goto(BASE + '/premium-intelligence.html?theme=' + theme + q);
81
+ await page.goto(BASE + '/premium-intelligence.html?theme=' + theme + '&tab=goals' + q); // key results live on Goals: ?tab=goals shows them here (intelligence-ds-page)
82
82
  const up = await until(() => page.evaluate(() => document.querySelectorAll('#goalTbl .ins-row').length > 0 || /could not be read/.test(document.querySelector('#brief').textContent) || !!document.querySelector('#goalTbl .ins-empty')), 20000);
83
83
  return { ctx, page, errors, posts, up, pk, calls: () => calls, setModel: (m) => { current = m; } };
84
84
  };
@@ -123,7 +123,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
123
123
  ok('B1 the filter is chips by status, owner and kind; the owners are the goals\' owners and the work that moves them', fl.heads === 'Status,Owner,Kind' && fl.status === 'Off track,On track,Hit,No readings' && fl.owners === 'Dara,Lee,Mira' && fl.kinds === 'Goals,Health budgets' && /status, owner or kind/.test(fl.label), JSON.stringify(fl));
124
124
  // re-pointed (U3): ⋯ is Reports and dashboards and Export CSV; About moved to the guide, Sources is Settings › Connectors, Metrics and Delivery trends left the menu
125
125
  await p.click('#moreB'); const mo = await p.evaluate(() => [...document.querySelectorAll('#moreMenu [data-more]')].map((b) => b.dataset.more + ':' + (b.disabled ? 'off' : 'on')).join()); await p.keyboard.press('Escape');
126
- ok('B1 ⋯ holds Reports and dashboards and Export CSV only (U3)', mo === 'library:on,export:on', mo);
126
+ ok('B1 ⋯ holds Reports and dashboards, Key results here and Export CSV (U3, intelligence-ds-page)', mo === 'library:on,krs:on,export:on', mo);
127
127
  { const R = await open(), q = R.page; await q.route('**/api/insights-records/export*', (r) => r.fulfill({ status: 200, contentType: 'text/csv', headers: { 'Content-Disposition': 'attachment; filename="insights-goals.csv"' }, body: 'id\n' }));
128
128
  const [rq] = await Promise.all([q.waitForRequest(/\/api\/insights-records\/export/), (async () => { await q.click('#moreB'); await q.click('#moreMenu [data-more="export"]'); })()]);
129
129
  const u = new URL(rq.url());
@@ -281,9 +281,9 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
281
281
 
282
282
  /* L1 the strip */
283
283
  { const hero = await p.evaluate(() => ({ eye: document.querySelector('#insEye').textContent, head: document.querySelector('#brief').textContent, why: document.querySelector('#insWhy').textContent, ask: document.querySelector('#askWhy').getAttribute('href') }));
284
- const pg = await p.evaluate(() => [...document.querySelectorAll('#insPg [data-ins]')].map((b) => b.getAttribute('aria-pressed')).join());
284
+ const pg = await p.evaluate(() => (document.querySelector('#insOf') || {}).textContent || '');
285
285
  /* re-pointed (batch 16 item 6, GsM3): the ✦ line about the goals leads; the strongest finding is the next page */
286
- ok('L1 the ✦ strip leads the page with the goal furthest behind and why (the period chip says the day, so the strip does not); Ask why opens Home with the question; the dots page through the findings', hero.eye === '' && pg.split(',').length >= 3 && pg.split(',')[0] === 'true' && hero.head === 'Partner activation is behind its line: 28% of 50%, its line says 38%. 2 other goals are behind too.' && !!hero.why && /^\/premium\.html\?ws=w1&ask=insights&q=Why/.test(hero.ask), JSON.stringify(hero));
286
+ ok('L1 the ✦ strip leads the page with the goal furthest behind and why (the period chip says the day, so the strip does not); Ask why opens Home with the question; ‹ › page through the findings, 1 of N', hero.eye === '' && /^1 of [3-9]/.test(pg) && hero.head === 'Partner activation is behind its line: 28% of 50%, its line says 38%. 2 other goals are behind too.' && !!hero.why && /^\/premium\.html\?ws=w1&ask=insights&q=Why/.test(hero.ask), JSON.stringify(hero));
287
287
  await p.click('#insPg [data-ins="1"]'); await sleep(80);
288
288
  const f1 = await p.evaluate(() => ({ head: document.querySelector('#brief').textContent, why: document.querySelector('#insWhy').textContent }));
289
289
  ok('L1 the next page is the strongest finding and its reason', f1.head === 'Time to first call will miss its 3 days target on 31 Dec unless it turns.' && /Over its last 4 readings it went from 8 days to 9 days/.test(f1.why), JSON.stringify(f1));
@@ -344,8 +344,8 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
344
344
  /* O: Did it work? (Iq8Overview), the drafted verdict with ✓ Keep and Undo, and the full verdict (AgInsVerdict) */
345
345
  {
346
346
  const R = await open(), q = R.page;
347
- const o = await q.evaluate(() => ({ cols: [...document.querySelectorAll('#outTbl .ins-th [role="columnheader"]')].map((c) => c.textContent).join('|'), rows: [...document.querySelectorAll('#outTbl [data-ini]')].map((r) => r.dataset.ini), sso: document.querySelector('#outTbl [data-ini="sso-partners"]').textContent.replace(/\s+/g, ' '), decide: document.querySelectorAll('#outTbl [data-verdict]').length, keep: document.querySelectorAll('#outTbl [data-keep]').length, shown: !document.querySelector('#pOutcomes').hidden }));
348
- ok('O1 Did it work? sits under the key results with the columns Promised, Check, Got and Verdict (redesign A: the check date is a column), and counts what is to judge and in window', o.shown && o.cols === 'Did it work? 1 to judge · 2 in window|Promised|Check|Got|Verdict', o.cols);
347
+ const o = await q.evaluate(() => ({ cols: [((document.querySelector('#outTbl .head h2') || {}).textContent || '') + ' ' + ((document.querySelector('#outTbl .head .pm-meta') || {}).textContent || ''), ...[...document.querySelectorAll('#outTbl th')].map((c) => c.textContent.trim())].join('|'), rows: [...document.querySelectorAll('#outTbl [data-ini]')].map((r) => r.dataset.ini), sso: document.querySelector('#outTbl [data-ini="sso-partners"]').textContent.replace(/\s+/g, ' '), decide: document.querySelectorAll('#outTbl [data-verdict]').length, keep: document.querySelectorAll('#outTbl [data-keep]').length, shown: !document.querySelector('#pOutcomes').hidden }));
348
+ ok('O1 Did it work? sits under the key results as a Table (board IntelligenceDS): Work, Expected, What happened, PMOS thinks and Keep or change, and counts what is to judge and in window', o.shown && o.cols === 'Did it work? 1 to judge · 2 in window|Work|Expected|What happened|PMOS thinks|Keep or change', o.cols);
349
349
  ok('O1 it lists only the work to judge and in its window; a row says what its goal promised and what it got, and its date', o.rows.join() === 'refund-reason-codes,sso-partners,audit-log-export' && /Partner activation \+30 pts/.test(o.sso) && /\+8 pts/.test(o.sso) && /Judged Dec 31/.test(o.sso) && /shipped Oct 23/.test(o.sso), JSON.stringify(o));
350
350
  ok('O1 a promise with no reading has no drafted verdict: Decide only, no ✓', o.decide === 1 && o.keep === 0, JSON.stringify(o));
351
351
  await R.ctx.close();
@@ -357,7 +357,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
357
357
  const R3 = await open({ model: IP.build(met) }), q3 = R3.page, sent = [];
358
358
  await q3.route(/\/api\/insights-records\/verdict(-undo)?$/, (r) => { sent.push([new URL(r.request().url()).pathname, JSON.parse(r.request().postData() || '{}')]); r.fulfill({ contentType: 'application/json', body: '{"ok":true}' }); });
359
359
  const dv = await q3.evaluate(() => ({ text: document.querySelector('#outTbl [data-ini="refund-reason-codes"]').textContent.replace(/\s+/g, ' '), keep: (document.querySelector('#outTbl [data-keep]') || {}).getAttribute && document.querySelector('#outTbl [data-keep]').getAttribute('aria-label') }));
360
- ok('O2 a met promise gets a drafted verdict said from the readings, with ✓ Record the verdict: Keep', /Keep\. It beat the promise: −2\.2 pts against −2 pts\./.test(dv.text) && dv.keep === 'Record the verdict: Keep', JSON.stringify(dv));
360
+ ok('O2 a met promise gets a drafted verdict said from the readings, with ✓ Record the verdict: Keep', /It beat the promise: −2\.2 pts against −2 pts\./.test(dv.text) && dv.keep === 'Record the verdict: Keep', JSON.stringify(dv));
361
361
  await q3.click('#outTbl [data-keep]'); await until(() => sent.length > 0, 4000);
362
362
  ok('O2 ✓ Keep records Keep with the drafted line, marked drafted, without opening a panel', sent[0][0] === '/api/insights-records/verdict' && sent[0][1].verdict === 'Keep' && sent[0][1].drafted === true && /beat the promise/.test(sent[0][1].learned) && sent[0][1].ini === 'refund-reason-codes' && sent[0][1].board === 'w1' && await q3.evaluate(() => document.querySelector('#side').hidden), JSON.stringify(sent));
363
363
  await q3.click('#toast .cta'); await until(() => sent.length > 1, 4000);
@@ -564,7 +564,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
564
564
  await q.route('**/api/insights-premium?ws=w2*', (r) => { asked.push(r.request().url()); r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: other }) }); });
565
565
  await q.reload(); // the route above answers the second product from the first read on
566
566
  const pf = await until(async () => { const x = await q.evaluate(() => ({ chip: (document.querySelector('#prodPick') || { getAttribute: () => '' }).getAttribute('aria-label'), all: (document.querySelector('#prodPick .ppk-all') || {}).textContent, groups: [...document.querySelectorAll('#goalTbl .ins-grp')].map((g) => g.querySelector('[role="cell"]').textContent), rows: document.querySelectorAll('#goalTbl [data-goal]').length, brief: document.querySelector('#brief').textContent, budgets: document.querySelectorAll('#goalTbl [data-budget]').length })); return x.groups.includes('Billing') ? x : null; }, 8000);
567
- ok('M1 two products ticked (the chip says All; the ✦ line sums All products, redesign A): Portfolio reads the other product once and groups every goal by product; budgets stay with their product', !!pf && pf.chip === 'Products: all 2' && /^All( products)?$/.test(pf.all) && pf.groups.slice(0, 2).join() === 'pmos,Billing' && pf.rows === 6 && /^Across your 2 products/.test(pf.brief) && pf.budgets === 0 && asked.length === 1, JSON.stringify(pf));
567
+ ok('M1 two products ticked (the chip says All; the ✦ line sums All products, redesign A): Portfolio reads the other product once and groups every goal by product; budgets stay with their product', !!pf && pf.chip === 'Products: all 2' && /^All( products)?$/.test(pf.all) && pf.groups.slice(0, 2).join() === 'pmos,Billing' && pf.rows === 6 && /^Across your 2 products/.test(pf.brief) && pf.budgets === 0 && asked.length === 1, JSON.stringify(pf) + ' asked ' + JSON.stringify(asked));
568
568
  await q.click('#prodPick'); const pm = await q.evaluate(() => [...document.querySelectorAll('#ppMenu [data-pp]')].map((b) => b.querySelector('b').textContent + ':' + ((b.querySelector('em') || {}).textContent || '') + ':' + b.getAttribute('aria-checked')).join());
569
569
  ok('M1 the list counts each product\'s goals and ticks both', pm === 'All products::true,pmos:5 goals:true,Billing:1 goal:true', pm);
570
570
  await q.keyboard.press('Escape');
@@ -603,7 +603,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
603
603
  const f = await R.page.evaluate(() => { const cs = (s) => getComputedStyle(document.querySelector(s)); const main = cs('main.ins'), tab = cs('#viewChip'), strip = cs('#insHero'), row = document.querySelector('#goalTbl .ins-row').getBoundingClientRect();
604
604
  return { font: cs('body').fontFamily, radius: main.borderTopLeftRadius, bg: main.backgroundColor, tabBg: tab.backgroundColor, tabR: tab.borderTopLeftRadius, tabW: tab.fontWeight, stripR: strip.borderTopLeftRadius, stripBg: strip.backgroundColor, rowH: Math.round(row.height), over: document.documentElement.scrollWidth > innerWidth, fab: document.querySelector('#czFab').getBoundingClientRect().width, rail: document.querySelector('#czMenu.ev-rail') ? Math.round(document.querySelector('#czMenu.ev-rail').getBoundingClientRect().width) : 0, fabX: Math.round(document.querySelector('#czFab').getBoundingClientRect().left) }; });
605
605
  const phone = w < 720;
606
- ok(`I11 the page wears the Agreed design at ${w} px: Plus Jakarta Sans, the white panel, the pill View chip, the well strip, the 44 px ⋯ at the top right on a phone (phone design, Ph2_menu), the 72 px rail of places on a desktop (slice 1)`, /^"?Plus Jakarta Sans/.test(f.font) && f.radius === (phone ? '0px' : '28px') && (phone || f.bg === 'rgb(255, 255, 255)') && f.tabBg === 'rgb(244, 243, 240)' && f.tabR === '999px' && +f.tabW >= 600 && (phone || (f.stripR === '16px' && f.stripBg === 'rgb(244, 242, 238)' && f.rowH >= 60)) && !f.over && (phone ? f.fab === 44 && f.fabX > 300 : f.rail === 72), JSON.stringify(f));
606
+ ok(`I11 the page wears the Agreed design at ${w} px: Plus Jakarta Sans, the white panel, the pill View chip, the finding as a white Block (board IntelligenceDS), the 44 px ⋯ at the top right on a phone (phone design, Ph2_menu), the 72 px rail of places on a desktop (slice 1)`, /^"?Plus Jakarta Sans/.test(f.font) && f.radius === (phone ? '0px' : '28px') && (phone || f.bg === 'rgb(255, 255, 255)') && f.tabBg === 'rgb(244, 243, 240)' && f.tabR === '999px' && +f.tabW >= 600 && (phone || (f.stripR === '16px' && f.stripBg === 'rgb(255, 255, 255)' && f.rowH >= 60)) && !f.over && (phone ? f.fab === 44 && f.fabX > 300 : f.rail === 72), JSON.stringify(f));
607
607
  if (!phone) {
608
608
  await toTrends(R.page);
609
609
  const t = await R.page.evaluate(() => { const tiles = [...document.querySelectorAll('#bmBody [data-tile]')].map((x) => x.getBoundingClientRect()); return { n: tiles.length, tileH: tiles.length ? Math.round(tiles[0].height) : 0, over: document.documentElement.scrollWidth > innerWidth }; });
@@ -1,13 +1,38 @@
1
1
  [
2
2
  {
3
- "v": "0.659.0",
4
- "at": "2026-11-22T03:48:36.791Z",
3
+ "v": "0.661.0",
4
+ "at": "2026-11-22T04:04:22.455Z",
5
5
  "f": 4,
6
6
  "prs": [
7
7
  {
8
- "n": 1444,
9
- "t": "Library is built from the design system's blocks",
10
- "s": "Library is built from the design system's blocks",
8
+ "n": 1445,
9
+ "t": "Pmos design drift, the design drift guard",
10
+ "s": "Pmos design drift, the design drift guard",
11
+ "k": "new"
12
+ },
13
+ {
14
+ "n": 1449,
15
+ "t": "Rebuild the Intelligence page from Komorebi blocks",
16
+ "s": "Rebuild the Intelligence page from Komorebi blocks",
17
+ "k": "new"
18
+ }
19
+ ]
20
+ },
21
+ {
22
+ "v": "0.658.0",
23
+ "at": "2026-11-22T03:38:17.292Z",
24
+ "f": 4,
25
+ "prs": [
26
+ {
27
+ "n": 1441,
28
+ "t": "Goals is built from the design system's blocks",
29
+ "s": "Goals is built from the design system's blocks",
30
+ "k": "new"
31
+ },
32
+ {
33
+ "n": 1443,
34
+ "t": "Events is built from the design system's blocks",
35
+ "s": "Events is built from the design system's blocks",
11
36
  "k": "new"
12
37
  }
13
38
  ]
@@ -120,7 +120,7 @@ const FIX = { id: 'fx-amp', kind: 'connect', goal: 'krm-act', connector: 'Amplit
120
120
  for (const k of ['metric-drafts/keep', 'metric-drafts/keep-all', 'metric-drafts/drop', 'metric-drafts/edit', 'metric-drafts/undo', 'goal-status/test', 'goal-status/read', 'goal-status/compare', 'goal-status/compare-pick', 'goal-status/file-held']) {
121
121
  await page.route('**/api/' + k, (r) => { const p = '/api/' + k, body = JSON.parse(r.request().postData() || '{}'); posts.push({ path: p, body }); r.fulfill({ contentType: 'application/json', body: JSON.stringify(answer(p, body)) }); });
122
122
  }
123
- await page.goto(BASE + '/premium-intelligence.html?theme=' + theme);
123
+ await page.goto(BASE + '/premium-intelligence.html?tab=goals&theme=' + theme);
124
124
  await until(() => page.evaluate((s) => !!document.querySelector(s), ready), 20000);
125
125
  return { ctx, page, errors, posts, S };
126
126
  };
@@ -129,18 +129,18 @@ const FIX = { id: 'fx-amp', kind: 'connect', goal: 'krm-act', connector: 'Amplit
129
129
 
130
130
  /* T · the drafts table */
131
131
  const A = await open(), p = A.page;
132
- const tb = await p.evaluate(() => ({ heads: [...document.querySelectorAll('#draftBox .gc-th [role="columnheader"]')].map((e) => e.textContent.replace(/\s+/g, ' ').trim()),
133
- groups: [...document.querySelectorAll('#draftBox .gc-grp b')].map((e) => e.textContent), rows: document.querySelectorAll('#draftBox .gc-tr').length,
134
- ns: (() => { const r = document.querySelector('[data-gc-row="d-ns"]'); return r ? [...r.querySelectorAll('[role="cell"]')].map((c) => c.innerText.replace(/\s+/g, ' ').trim()) : []; })(),
135
- g1: (document.querySelector('[data-gc-row="d-g1"] .gc-from') || {}).innerText || '', g2: (document.querySelector('[data-gc-row="d-g2"] .gc-from') || {}).innerText || '',
132
+ const tb = await p.evaluate(() => ({ head: ((document.querySelector('#draftBox .head h2') || {}).textContent || ''), rows: document.querySelectorAll('#draftBox .gc-tr.pm-li').length,
133
+ ns: ((document.querySelector('[data-gc-row="d-ns"] .gc-hw') || {}).innerText || '').replace(/\s+/g, ' ').trim(), nsName: ((document.querySelector('[data-gc-row="d-ns"] .gc-nm .t') || {}).textContent || ''),
134
+ g1: (document.querySelector('[data-gc-row="d-g1"] .gc-hw') || {}).innerText || '', g2: (document.querySelector('[data-gc-row="d-g2"] .gc-hw') || {}).innerText || '',
136
135
  nsRow: !document.querySelector('#nsRow').hidden, list: document.querySelectorAll('#goalTbl .okr-row').length, empty: /No key result is recorded/.test(document.querySelector('#goalTbl').textContent),
137
136
  acts: [...document.querySelectorAll('[data-gc-row="d-ns"] .gc-acts button')].map((b) => b.getAttribute('aria-label') + '|' + b.textContent.trim()) }));
138
- ok('T1 one table: Proposed metric, How it is counted, Now (read 10:58), Target, From, how often', tb.heads.slice(0, 5).join(' | ') === 'Proposed metric | How it is counted | Now read 10:58 | Target | From, how often', tb.heads.join(' | '));
139
- ok('T2 grouped: North Star, Inputs, Guardrails; 6 rows', tb.groups.join('|') === 'North Star|Inputs|Guardrails' && tb.rows === 6, JSON.stringify(tb));
140
- ok('T3 a row says how it is counted, now, its target and where and how often it is read', tb.ns.join(' / ') === 'Weekly signed-in shoppers Count / Shoppers who signed in at least once in the week, each person once / 38.8k / 45k by Dec 31 / Amplitude Every Monday / ', tb.ns.join(' / '));
141
- ok('T4 the rhythm is each goal\'s own: Every hour, Every day, 07:00', /Datadog\s*Every hour/.test(tb.g1) && /Jira\s*Every day, 07:00/.test(tb.g2), tb.g1 + ' | ' + tb.g2);
137
+ // intelligence-ds-page (board IntelligenceDS): the drafted metrics are one List block, "PMOS drafted N measures for <product>", a ListRow each
138
+ ok('T1 one List: PMOS drafted 6 measures, a ListRow each', /^PMOS drafted 6 measures for /.test(tb.head) && tb.rows === 6, JSON.stringify(tb));
139
+ ok('T2 each row says what it is: the North Star, an input, a guardrail', /^The North Star\./.test(tb.ns) && /^(An input|A guardrail)/.test(tb.g1) && /^(An input|A guardrail)/.test(tb.g2), JSON.stringify(tb));
140
+ ok('T3 a row says how it is counted, where and how often it is read, now and its target', tb.nsName === 'Weekly signed-in shoppers' && /Shoppers who signed in at least once in the week, each person once\. Read every Monday 07:00 from Amplitude\. now 38\.8k\. Target 45k by Dec 31\./.test(tb.ns), tb.ns);
141
+ ok('T4 the rhythm is each goal\'s own: every hour, every day 07:00', /every hour/.test(tb.g1) && /from Datadog/.test(tb.g1) && /every day 07:00 from Jira/.test(tb.g2), tb.g1 + ' | ' + tb.g2);
142
142
  ok('T5 no second North Star row, no plain goal list and no empty card under the table', !tb.nsRow && tb.list === 0 && !tb.empty, JSON.stringify(tb));
143
- ok('T6 ✕ and ✓ are icon-only, named in their label', tb.acts.length === 2 && tb.acts.every((a) => /\|$/.test(a)) && /^Not now: /.test(tb.acts[0]) && /^Keep: /.test(tb.acts[1]), tb.acts.join(', '));
143
+ ok('T6 ✓ and ✕ are icon-only, named in their label', tb.acts.length === 2 && tb.acts.every((a) => /\|$/.test(a)) && /^Keep: /.test(tb.acts[0]) && /^Not now: /.test(tb.acts[1]), tb.acts.join(', '));
144
144
  const line = await p.evaluate(() => document.querySelector('#brief').textContent + ' ' + document.querySelector('#insWhy').textContent);
145
145
  ok('T7 a goal behind its line stays the ✦ news; the drafts are kept from the table or with Keep all', /^Partner activation is behind its line/.test(line) && !/I drafted a North Star/.test(line) && !!(await p.$('#insAct [data-okl="keep-all"]')), line);
146
146
  await shot(p, 'GcJ1aTable-built');
@@ -180,7 +180,7 @@ const FIX = { id: 'fx-amp', kind: 'connect', goal: 'krm-act', connector: 'Amplit
180
180
  /* F · the first readings */
181
181
  const B = await open({ m: model('first'), rows: [], ready: '#goalTbl .ins-row' });
182
182
  const f1 = await B.page.evaluate(() => { const r = document.querySelector('#goalTbl [data-goal="krm-act"]'), c = (s) => (r.querySelector(s) || {}).textContent || ''; return { head: [...document.querySelectorAll('#goalTbl .ins-th [role="columnheader"]')].map((h) => h.childNodes[0].textContent.trim()).join('|'), now: c('.val'), dot: !!r.querySelector('.sofar .ins-dot1') && !r.querySelector('.sofar svg'), pace: c('.pace'), bar: !!r.querySelector('.ins-bar1'),
183
- ns: (document.querySelector('#nsRow .ins-nsc') || {}).innerText || '', wait: !!document.querySelector('#nsRow .ins-nsc .gc-wait') && !document.querySelector('#nsRow .ins-nsch'), seg: !!document.querySelector('#nsRow .cz-seg'), inputs: !!document.querySelector('#nsRow .ins-nsi'),
183
+ ns: (document.querySelector('#nsRow .ins-nsc') || {}).innerText || '', wait: !!document.querySelector('#nsRow .ins-nsc .gc-wait') && !document.querySelector('#nsRow .ins-nsch'), seg: !!document.querySelector('#nsRow .pm-tabs'), inputs: !!document.querySelector('#nsRow .ins-nsi'),
184
184
  line: document.querySelector('#brief').textContent + ' ' + document.querySelector('#insWhy').textContent }; });
185
185
  ok('F0 the dashboard: the North Star card, then one table Key results · Now, of target · So far · By its date · Moved by', f1.head === 'Key results|Now, of target|So far|By its date|Moved by', JSON.stringify(f1));
186
186
  ok('F1 one reading: the number of its target, a grey dot for So far, "Known after 3 readings" and the day of the 3rd, Mon 16 Nov, and no bar yet', /^\S+ of \S+$/.test(f1.now.trim()) && f1.dot && /^Known after 3 readings\s*Mon 16 Nov$/.test(f1.pace.trim()) && !f1.bar, JSON.stringify(f1));
@@ -194,7 +194,7 @@ const FIX = { id: 'fx-amp', kind: 'connect', goal: 'krm-act', connector: 'Amplit
194
194
 
195
195
  /* K · a key result's panel */
196
196
  const K = await open({ m: model('kr'), rows: [], ready: '#goalTbl .ins-row' });
197
- const k0 = await K.page.evaluate(() => ({ ns: !!document.querySelector('#nsRow .ins-nsch'), seg: [...document.querySelectorAll('#nsRow .cz-seg button')].map((b) => b.textContent).join('|'), spark: document.querySelectorAll('#goalTbl .ins-row .sofar svg').length }));
197
+ const k0 = await K.page.evaluate(() => ({ ns: !!document.querySelector('#nsRow .ins-nsch'), seg: [...document.querySelectorAll('#nsRow .pm-tabs [data-span]')].map((b) => b.textContent).join('|'), spark: document.querySelectorAll('#goalTbl .ins-row .sofar svg').length }));
198
198
  ok('K0 from the 3rd reading the dashboard is Production Iq8Overview: the North Star line with its spans, a line per key result', k0.ns && k0.seg === '4 weeks|12 weeks|This quarter vs last' && k0.spark > 0, JSON.stringify(k0));
199
199
  await K.page.click('#goalTbl [data-goal="krm-act"] .nm');
200
200
  const k1 = await vw(K.page);
@@ -304,6 +304,13 @@ Only PMOS's impact run uses these. The server pins each run to your ledger. Outs
304
304
  - `pmos drift replay`: the replay of the last four weeks of this repository.
305
305
  - `pmos drift status`: the last weekly result and the replays on record.
306
306
 
307
+ ### pmos design drift: pages that drift from the design system
308
+
309
+ - `pmos design drift`: for each page, the share of its classes that your design system defines, its own CSS rules, the system parts it draws again, and its raw colours. It ends with the pages to rebuild next, lowest share first. It reads git only.
310
+ - `--base <ref>` compares with an earlier commit and marks each page drift, rebuilt, not rebuilt or unchanged. `--base week` uses the last commit a week earlier.
311
+ - `--weeks <n>` adds the mean share at the end of each of the last n weeks. `--write` writes the report to `planning/reports/`. `--gate` exits 1 when a page drifts.
312
+ - A product names its pages and system sheets in `design-drift.json` in its design-system folder, for example `{ "pages": ["web/*.html"], "assetBase": "web", "systemSheets": ["ds.css"] }`.
313
+
307
314
  ## Initiatives and the Board
308
315
 
309
316
  ### pmos initiative
@@ -13,6 +13,17 @@ Intelligence (`/premium-intelligence.html`) uses the OKR file of a product as it
13
13
 
14
14
  Goals and Intelligence use the PMOS design system (see [Layout](layout.md#the-design-system)). On Goals, the North Star is one block. When PMOS drafted it, the draft is a suggestion with ✓ and ✕. The goals are one table: objective, key result, actual and target, days left, levers and initiative. On a phone, the table becomes a list under each objective. On both pages, red means late or at risk, blue means PMOS speaks or waits on you, and a goal on track has no colour.
15
15
 
16
+ Intelligence is built from the design system's blocks, in one column. It is the place for charts, so key results are not repeated here: they are on Goals. From top to bottom:
17
+
18
+ 1. **What PMOS found**: one finding at a time ("1 of 3", with ‹ and ›) and its suggestion: why, what PMOS will do, what changes and what it is based on, with ✓ and ✕.
19
+ 2. **North Star**: a chart with the target line, and a diamond on each day that work moving it shipped. Point at a reading to see its value and source. Its inputs and guardrail are small numbers under it.
20
+ 3. **Measures PMOS drafted**: keep each with ✓, or drop it with ✕.
21
+ 4. **Delivery trends**: the tiles, with **Choose tiles**.
22
+ 5. **Did it work?** (below).
23
+ 6. **Waiting on a source**: a key result with no reading, with Connect or Add a reading.
24
+
25
+ To see the key results on this page too, pick **Key results here** in ⋯, or open a link with `?tab=goals`.
26
+
16
27
  ## The goal list
17
28
 
18
29
  - **The period.** The first period in the period chip is the period of the OKR file, for example H2 2026. It is the default, so a filter for one quarter does not hide a goal of the half.
@@ -51,7 +62,7 @@ The panel shows the drafts that wait for you and the asks that are ready first,
51
62
 
52
63
  ## The ⋯ menu
53
64
 
54
- The ⋯ menu has two items: **Reports and dashboards** and **Export CSV**. Sources are in **Settings › Connectors**. To make a report, use the report icon in the bar (**Make a report from this**).
65
+ The ⋯ menu has three items: **Reports and dashboards**, **Key results here** and **Export CSV**. Sources are in **Settings › Connectors**. To make a report, use the report icon in the bar (**Make a report from this**).
55
66
 
56
67
  ## Forecasts
57
68
 
@@ -82,7 +82,7 @@ const FINDING = { id: 'rf-0123456789', name: 'Partner numbers to Lee', why: 'You
82
82
  });
83
83
  await page.route('**/api/report-setups?*', (r) => json(r, { setups: [], findings: [], asks: [], finder: {} }));
84
84
  await page.route('**/api/report-documents/**', (r) => { posts.push({ path: new URL(r.request().url()).pathname, body: JSON.parse(r.request().postData() || '{}') }); return json(r, { ok: true }); });
85
- await page.goto(BASE + '/premium-intelligence.html');
85
+ await page.goto(BASE + '/premium-intelligence.html?tab=goals'); // key results live on Goals: ?tab=goals shows them here
86
86
  await until(() => page.evaluate(() => document.querySelectorAll('#goalTbl .ins-row').length > 0), 20000);
87
87
  return { page, ctx: c, errors, posts, gets, st };
88
88
  };
@@ -92,7 +92,7 @@ const WEEKLY = { view: 'view', weeks: 3, day: 'Mon', opens: 4 };
92
92
  // the ✦ line about the goals comes first (batch 16 item 6, GsM1–M5); the finding with its drafted move is the next page
93
93
  await until(() => p.evaluate(() => !!document.querySelector('#insPg [data-ins="1"]')), 5000); await p.click('#insPg [data-ins="1"]');
94
94
  const s0 = await until(() => p.evaluate(() => { const m = document.querySelector('#insMv'); const b = document.querySelector('#insAct [data-mv="apply"]'); return m && !m.hidden && b ? { mv: m.textContent, label: b.getAttribute('aria-label'), text: b.textContent.trim(), solid: b.classList.contains('primary'), two: document.querySelector('#insHero').classList.contains('mv') } : null; }), 5000);
95
- ok('S the drafted move is said under the finding, with a primary ✓ that is icon-only', !!s0 && s0.mv === MOVE.text && s0.label === MOVE.label && !s0.text && s0.solid && s0.two, JSON.stringify(s0));
95
+ ok('S the drafted move is the expanded Suggestion under the finding (its label, then PMOS will …), with a primary ✓ that is icon-only', !!s0 && s0.mv.startsWith(MOVE.label) && s0.mv.includes('PMOS will' + MOVE.text) && s0.label === MOVE.label && !s0.text && s0.solid && s0.two, JSON.stringify(s0));
96
96
  await shot(p, 'gap1-strip-move', '#insHero');
97
97
  await p.click('#insAct [data-mv="apply"]');
98
98
  await until(() => A.posts.some((x) => x.path === '/api/insight-moves/apply'), 3000);
@@ -0,0 +1,115 @@
1
+ 'use strict';
2
+ /* design-cli.js — `pmos design drift`: which pages are built from this product's design system, and which drift from it (initiative
3
+ * design-drift-guard; lib/design-drift.js does the measuring).
4
+ *
5
+ * pmos design drift [--ref <ref>] [--base <ref>|week] [--weeks <n>] [--json] [--write] [--gate]
6
+ * --ref the commit to measure (default HEAD). WORKTREE measures the files on disk, saved or not.
7
+ * --base compare with this commit. `week` is the last commit a week before --ref. Without --base, the pages are only listed.
8
+ * --weeks add the mean system share at the end of each of the last n weeks (1 to 12)
9
+ * --json print the rows as JSON
10
+ * --write write the report to planning/reports/design-drift-<date>.md (the only write this command makes)
11
+ * --gate exit 1 when a page drifts against --base (for a CI step later; no CI runs it today)
12
+ *
13
+ * Run it in the product's repository. It reads git only and changes nothing else. Exit codes: 0 done, 1 a page drifts (only with --gate)
14
+ * or the refs cannot be read, 2 usage. */
15
+ const fs = require('fs');
16
+ const path = require('path');
17
+ const D = require('./design-drift.js');
18
+
19
+ const COMMANDS = { design: ['drift'] };
20
+ const USAGE = [
21
+ 'usage: pmos design drift — which pages are built from this product\'s design system, and which drift from it',
22
+ ' pmos design drift [--ref <ref>] [--base <ref>|week] [--weeks <n>] [--json] [--write] [--gate]',
23
+ ' --ref <ref> the commit to measure (default HEAD; WORKTREE reads the files on disk)',
24
+ ' --base <ref> compare with this commit; "week" is the last commit a week earlier',
25
+ ' --weeks <n> the mean system share at the end of each of the last n weeks (1 to 12)',
26
+ ' --write write the report to planning/reports/design-drift-<date>.md',
27
+ ' --gate exit 1 when a page drifts against --base',
28
+ 'It reads git only. A product sets its pages and system sheets in design-drift.json in its design-system folder.',
29
+ ];
30
+ const FLAGS = new Set(['ref', 'base', 'weeks', 'json', 'write', 'gate', 'repo']);
31
+ const BOOL = new Set(['json', 'write', 'gate']);
32
+
33
+ function parse(args) {
34
+ const pos = [], flags = {};
35
+ for (let i = 0; i < args.length; i++) {
36
+ const a = args[i];
37
+ if (!a.startsWith('--')) { pos.push(a); continue; }
38
+ const k = a.slice(2);
39
+ if (BOOL.has(k)) flags[k] = true;
40
+ else flags[k] = args[i + 1] !== undefined && !String(args[i + 1]).startsWith('--') ? args[++i] : '';
41
+ }
42
+ return { pos, flags };
43
+ }
44
+ function repoRoot(cwd) {
45
+ const out = D.gitOut(cwd, ['rev-parse', '--show-toplevel']);
46
+ return out ? out.trim() : null;
47
+ }
48
+ const pct = (x) => Math.round(100 * x) + '%';
49
+ const short = (p) => p.replace(/^.*\//, '').replace(/\.html?$/i, '');
50
+
51
+ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), now = Date.now() } = {}) {
52
+ const args = argv[0] === 'design' ? argv.slice(1) : argv.slice();
53
+ const sub = args[0];
54
+ if (!sub || ['help', '--help', '-h'].includes(sub)) { for (const l of USAGE) say(l); return sub ? 0 : 2; }
55
+ if (!COMMANDS.design.includes(sub)) { say(`unknown design command "${sub}". Use one of: ${COMMANDS.design.join(', ')}`); return 2; }
56
+ const { pos, flags } = parse(args.slice(1));
57
+ if (pos.length) { say(`✗ pmos design ${sub} takes no argument`); return 2; }
58
+ for (const k of Object.keys(flags)) if (!FLAGS.has(k)) { say(`✗ --${k} is not an option of pmos design drift`); return 2; }
59
+ for (const k of ['ref', 'base', 'weeks', 'repo']) if (k in flags && !flags[k]) { say(`✗ --${k} needs a value`); return 2; }
60
+ const weeks = flags.weeks === undefined ? 0 : Number(flags.weeks);
61
+ if (!Number.isInteger(weeks) || weeks < 0 || weeks > 12) { say('✗ --weeks is a whole number from 1 to 12'); return 2; }
62
+ if (flags.gate && !flags.base) { say('✗ --gate needs --base: it fails only a page that drifts against an earlier commit'); return 2; }
63
+
64
+ const repo = repoRoot(flags.repo ? path.resolve(cwd, flags.repo) : cwd);
65
+ if (!repo) { say('✗ this is not a git repository. Run pmos design drift in your product\'s repository.'); return 1; }
66
+ const ref = flags.ref || 'HEAD';
67
+ const worktree = ref === 'WORKTREE';
68
+ if (!worktree && !D.gitOut(repo, ['rev-parse', '--verify', '--quiet', ref + '^{commit}'])) { say(`✗ no commit "${ref}" in this repository`); return 1; }
69
+ let base = flags.base || null;
70
+ if (base === 'week') {
71
+ const when = worktree ? new Date(now) : new Date(D.gitOut(repo, ['show', '-s', '--format=%cI', ref]).trim());
72
+ const sha = (D.gitOut(repo, ['rev-list', '-1', `--before=${new Date(when.getTime() - 7 * 86400000).toISOString()}`, worktree ? 'HEAD' : ref]) || '').trim();
73
+ if (!sha) { say('✗ no commit a week before ' + ref); return 1; }
74
+ base = sha.slice(0, 8);
75
+ }
76
+ if (base && !D.gitOut(repo, ['rev-parse', '--verify', '--quiet', base + '^{commit}'])) { say(`✗ no commit "${base}" in this repository`); return 1; }
77
+
78
+ const head = D.measure(repo, ref);
79
+ if (head.config.error) { say('✗ ' + head.config.error); return 1; }
80
+ const before = base ? D.measure(repo, base) : null;
81
+ const rows = before ? D.compare(before, head) : head.pages;
82
+ const trend = weeks ? D.trend(repo, worktree ? 'HEAD' : ref, weeks, { now: worktree ? now : Date.parse(D.gitOut(repo, ['show', '-s', '--format=%cI', ref]).trim()) }) : null;
83
+ const date = new Date(now).toISOString().slice(0, 10);
84
+ const view = { date, ref, commit: head.commit, base, baseCommit: before && before.commit, rows, compared: !!before, trend, config: head.config, shared: head.shared };
85
+ const drifting = rows.filter((r) => r.status === 'drift');
86
+
87
+ if (flags.json) {
88
+ say(JSON.stringify({ ok: true, ref, commit: head.commit, base, baseCommit: view.baseCommit, config: head.config.from, summary: D.summary(rows, { compared: !!before }),
89
+ pages: rows, shared: { ...head.shared, files: head.shared.files.length }, queue: D.queue(rows).map((r) => r.page), trend }));
90
+ } else {
91
+ say(D.summary(rows, { compared: !!before }) + ` (${head.commit}${before ? ' against ' + before.commit : ''}; config: ${head.config.from})`);
92
+ if (rows.length) {
93
+ say('page share own rules restyled colours ' + (before ? 'status' : ''));
94
+ for (const r of [...rows].sort((a, b) => (a.share || 0) - (b.share || 0))) {
95
+ const b = r.before;
96
+ const two = (x, y, f = String) => (b ? `${f(x)} → ${f(y)}` : f(y));
97
+ if (r.status === 'gone') { say(`${short(r.page).padEnd(26)}(gone)`); continue; }
98
+ say(`${short(r.page).padEnd(26)}${two(b && b.share, r.share, pct).padEnd(14)}${two(b && b.ownRules, r.ownRules).padEnd(15)}${String(r.restyled).padEnd(10)}${String(r.colours).padEnd(9)}${before ? r.status + (r.why && r.why.length ? ' (' + r.why.join('; ') + ')' : '') : ''}`);
99
+ }
100
+ say(`shared code: ${head.shared.files.length} files · ${pct(head.shared.share)} from the system · ${head.shared.ownRules} own CSS rules`);
101
+ const q = D.queue(rows);
102
+ if (q.length) say('Rebuild next, one pull request each: ' + q.map((r) => `${short(r.page)} ${pct(r.share)}`).join(', '));
103
+ }
104
+ if (trend) say('Mean share by week: ' + trend.map((t) => `${t.week} ${t.share == null ? '–' : pct(t.share)}`).join(' · '));
105
+ }
106
+ if (flags.write) {
107
+ const file = path.join(repo, 'planning', 'reports', `design-drift-${date}.md`);
108
+ fs.mkdirSync(path.dirname(file), { recursive: true });
109
+ fs.writeFileSync(file, D.reportMd(view));
110
+ if (!flags.json) say('Report: ' + path.relative(repo, file));
111
+ }
112
+ return flags.gate && drifting.length ? 1 : 0;
113
+ }
114
+
115
+ module.exports = { run, COMMANDS, USAGE };