create-pmos 0.433.0 → 0.434.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 (63) hide show
  1. package/package.json +13 -13
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-insights-test.js +63 -58
  7. package/workspace/changelog.json +12 -0
  8. package/workspace/guide/index.md +1 -0
  9. package/workspace/guide/metric-drafts.md +21 -1
  10. package/workspace/guide/your-impact.md +58 -0
  11. package/workspace/impact-screens-test.js +149 -0
  12. package/workspace/intel-report-ui-test.js +1 -1
  13. package/workspace/intelligence-gaps-ui-test.js +13 -9
  14. package/workspace/lib/engine/outbox.js +1 -1
  15. package/workspace/lib/engine/records/index.js +11 -3
  16. package/workspace/lib/goal-status.js +199 -0
  17. package/workspace/lib/goal-watch.js +71 -0
  18. package/workspace/lib/headless.js +24 -2
  19. package/workspace/lib/impact-cli.js +72 -0
  20. package/workspace/lib/impact-runs.js +114 -0
  21. package/workspace/lib/impact.js +195 -0
  22. package/workspace/lib/insights-premium.js +43 -4
  23. package/workspace/lib/metric-draft-runs.js +33 -10
  24. package/workspace/lib/metric-drafts.js +118 -15
  25. package/workspace/lib/metric-read-runs.js +132 -0
  26. package/workspace/lib/metric-reads.js +129 -0
  27. package/workspace/lib/metrics-cli.js +100 -5
  28. package/workspace/lib/pmos-verbs.js +4 -1
  29. package/workspace/lib/route-modules.js +3 -0
  30. package/workspace/lib/routes-goal-status.js +111 -0
  31. package/workspace/lib/routes-impact-views.js +58 -0
  32. package/workspace/lib/routes-impact.js +91 -0
  33. package/workspace/lib/routes-insights-premium.js +20 -0
  34. package/workspace/lib/routes-metric-drafts.js +55 -4
  35. package/workspace/lib/routes-records.js +2 -0
  36. package/workspace/lib/settings-store.js +3 -0
  37. package/workspace/okr-goals-ui-test.js +175 -0
  38. package/workspace/package-lock.json +2 -2
  39. package/workspace/package.json +1 -1
  40. package/workspace/public/pm/bd-ini-panel.js +10 -2
  41. package/workspace/public/pm/cozy-adler.css +5 -0
  42. package/workspace/public/pm/cozy-adler.js +17 -9
  43. package/workspace/public/pm/cozy-insights.css +84 -0
  44. package/workspace/public/pm/cozy-settings.js +11 -1
  45. package/workspace/public/pm/home-app.js +61 -8
  46. package/workspace/public/pm/home-impact.css +16 -0
  47. package/workspace/public/pm/home-impact.js +72 -0
  48. package/workspace/public/pm/home-today.js +4 -2
  49. package/workspace/public/pm/impact.css +37 -0
  50. package/workspace/public/pm/impact.js +201 -0
  51. package/workspace/public/pm/okr-list.js +249 -0
  52. package/workspace/public/pm/premium-insights.js +222 -238
  53. package/workspace/public/pm/premium-vw-mtg.js +4 -1
  54. package/workspace/public/premium-intelligence.html +3 -2
  55. package/workspace/public/premium.html +1 -0
  56. package/workspace/server.js +56 -2
  57. package/workspace/skills/impact-detect.skill +46 -0
  58. package/workspace/skills/metric-read.skill +32 -0
  59. package/workspace/test-lists/goal-watch.json +9 -0
  60. package/workspace/test-lists/impact-screens.json +5 -0
  61. package/workspace/test-lists/impact-ui.json +9 -0
  62. package/workspace/test-lists/impact.json +9 -0
  63. package/workspace/test-lists/okr-goals-ui.json +5 -0
@@ -0,0 +1,175 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* okr-goals-ui-test.js — "Claude runs the OKRs" on the Intelligence page (feedback batch 16 item 6, build 6-B; frames GsM1–M5, GsViewer, GsMore,
4
+ * GsMetrics, GsMetricsTree, GsNotify). Serves the real page from the real server; GET /api/insights-premium answers the model lib/insights-premium.js
5
+ * builds from its fixture, with the fields lib/goal-status.js adds (reading, recipe, who, notify, was, history, defn, okr) set on some goals, and
6
+ * GET /api/metric-drafts answers drafts that sit under their goal. The write routes are stubbed here so each press can be read back.
7
+ * L the list: the ✦ line, the North Star, Key results, Health budgets, in that order; a row is a dot, the outcome, its reading and age, and the
8
+ * owner, with no sparkline and no initiative status; a goal with no reading has a hollow dot
9
+ * D a draft sits under the row it repairs with ✕ / ✎ / ✓; ✓✓ in the ✦ line keeps them all; ✓ posts the row; the ✦ line never says "no insight"
10
+ * R a broken limit turns the ✦ line red (the one time) and pulses that row's dot
11
+ * V the goal Viewer: the reading against its line, the chart, why, and the folds How I read it, What it counts, History
12
+ * N the Viewer's ⋯: Notify me, Only in Intelligence (✦ my pick, on), Quiet; a press posts /api/goals/notify
13
+ * M ⋯ › Metrics: one list, goals first then "watch"; one switch shows the tree
14
+ * P on a phone: no sideways scroll, the same list. PMOS_SHOTS=<dir> also saves screenshots. */
15
+ const path = require('path');
16
+ const fs = require('fs');
17
+ const { spawn } = require('child_process');
18
+ const { findBrowser } = require('./lib/find-browser');
19
+ const T = require('./test-run').configure({ name: 'okr-goals-ui' });
20
+ const IP = require('./lib/insights-premium.js');
21
+ const F = require('./fixtures/insights-premium-facts.js');
22
+
23
+ const BASE = T.BASE;
24
+ const SHOTS = process.env.PMOS_SHOTS || '';
25
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
26
+ const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { let v; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
27
+ const results = [];
28
+ const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 700) : ''}`); };
29
+ let srv = null; let browser = null;
30
+ const finish = async (code) => {
31
+ if (browser) await browser.close().catch(() => {});
32
+ if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
33
+ T.killTmux();
34
+ const bad = results.filter((x) => !x.cond).length;
35
+ console.log(`\n${results.length - bad}/${results.length} okr-goals-ui assertions passed`);
36
+ process.exit(code !== undefined ? code : (bad ? 1 : 0));
37
+ };
38
+ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
39
+
40
+ /* the model with lib/goal-status.js's fields on it (the agreed JSON, 6-A): a North Star, readings with their dot and age, an owner, a recipe */
41
+ const BUDGETS = [{ id: 'docs', covers: 'documentation upkeep', cap: 0.2 }];
42
+ function model(o = {}) {
43
+ const M = IP.build(F.facts({ pinned: 'all', budgets: BUDGETS }));
44
+ const g = (id) => M.goals.find((x) => x.id === id);
45
+ g('krm-up').role = 'north-star';
46
+ Object.assign(g('krm-up'), { reading: { dot: 'on', at: '2026-10-15', ageDays: 3, stale: false, txt: '99.6% · up 0.4 since 1 Sep', line: '' }, who: null });
47
+ Object.assign(g('krm-act'), { reading: { dot: 'behind', at: '2026-10-15', ageDays: 3, stale: false, txt: '+8 of +30 points', line: 'its line says +18', why: 'SSO for partners ships 23 Oct; activation catches up about 3 weeks after.' },
48
+ recipe: { connector: 'Amplitude', query: 'partners active ÷ partners signed', cadence: 'weekly', last: { at: '2026-10-15', ok: true } }, who: { name: 'Raka Putra', initials: 'RP', from: 'jira' }, notify: 'intel',
49
+ was: 'Partner onboarding revamp', history: [{ at: '2026-10-01', text: 'Rewritten as an outcome' }, { at: '2026-10-02', text: 'You kept it' }], defn: 'Partners with one API call in their first 14 days, of all partners signed that month.' });
50
+ Object.assign(g('krm-ttfc'), { who: { name: 'Dewi', initials: 'D', from: 'jira' } });
51
+ M.metrics = [{ id: 'krm-up', title: 'Partner uptime', role: 'north-star', dot: 'on', meta: 'North Star · Datadog · Mon' },
52
+ { id: 'krm-act', title: 'Partner activation', role: 'input', parent: 'krm-up', dot: 'behind', meta: 'KR · Amplitude · Mon' },
53
+ { id: 'krm-ttfc', title: 'Time to first call', role: 'kr', dot: 'behind', meta: 'KR · typed in' },
54
+ { id: 'w-rating', title: 'App store rating', role: 'watch', meta: 'App Store Connect · Mon' }];
55
+ if (o.crit) { M.okr = { line: { head: 'Partner uptime fell under its floor at 14:02.', sub: 'It started with the gateway release. I drafted a rollback ticket for Sari.', tone: 'crit', keepAll: 0 }, alert: { rid: 'krm-up', title: 'Partner uptime', at: '2026-10-18T14:02:00Z', txt: '98.1%' } }; g('krm-up').reading.dot = 'broken'; }
56
+ return M;
57
+ }
58
+ const DRAFTS = (rows) => ({ ok: true, scope: 'product', id: 'w1', title: 'pmos', run: { state: 'ready', step: 4, reads: [] }, head: '', sub: '', src: '', rows });
59
+ const ROWS = [
60
+ { id: 'd-out', kind: 'outcome', goal: 'krm-ttfc', text: 'New partners make their first call within 3 days', why: 'Time to first call was a project; this is what it is for', old: 'Time to first call', act: 'Keep', state: 'open' },
61
+ { id: 'd-chase', kind: 'chase', goal: 'krm-act', text: 'Ask Raka if SSO for partners still ships 23 Oct', why: 'Thanks for the work on it. The goal catches up about 3 weeks after it ships', act: 'Send', state: 'open' },
62
+ { id: 'd-kr', kind: 'metric', group: 'Key results', name: 'Partners on the new SDK', nowTxt: '41%', targetTxt: '80% by Dec 31', why: 'From the SDK PRD', source: 'Amplitude', state: 'open' },
63
+ ];
64
+
65
+ (async () => {
66
+ const exe = process.env.PMOS_CHROME || findBrowser();
67
+ if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
68
+ let chromium;
69
+ try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
70
+ srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT), PMOS_SELF_ROOT: path.resolve(__dirname, '..') }) });
71
+ await T.waitForServer(BASE);
72
+ browser = await chromium.launch({ executablePath: exe });
73
+ if (SHOTS) fs.mkdirSync(SHOTS, { recursive: true });
74
+ const shot = async (p, name, el) => { if (!SHOTS) return; await sleep(450); if (el) { const h = await p.$(el); if (h) await h.screenshot({ path: path.join(SHOTS, name + '.png') }); } else await p.screenshot({ path: path.join(SHOTS, name + '.png'), fullPage: true }); };
75
+
76
+ const open = async ({ w = 1440, h = 900, m = model(), rows = ROWS, theme = 'light' } = {}) => {
77
+ const ctx = await browser.newContext({ viewport: { width: w, height: h } });
78
+ const page = await ctx.newPage();
79
+ const errors = [], posts = [];
80
+ page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
81
+ await page.route('**/api/insights-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, model: m }) }));
82
+ await page.route('**/api/board-metrics-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: { tiles: [] } }) }));
83
+ await page.route('**/api/briefing-premium/products', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, all: false, chosen: true, products: [{ ws: m.board.ws, name: m.board.name, primary: true, on: true }] }) }));
84
+ await page.route('**/api/metric-drafts?*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify(DRAFTS(rows)) }));
85
+ for (const k of ['keep', 'keep-all', 'drop', 'edit', 'undo', 'start']) await page.route('**/api/metric-drafts/' + k, (r) => { posts.push({ path: '/api/metric-drafts/' + k, body: JSON.parse(r.request().postData() || '{}') }); r.fulfill({ contentType: 'application/json', body: JSON.stringify(k === 'keep' ? { ok: true, rid: 'r1' } : { ok: true, kept: 3 }) }); });
86
+ await page.route('**/api/goals/notify', (r) => { posts.push({ path: '/api/goals/notify', body: JSON.parse(r.request().postData() || '{}') }); r.fulfill({ contentType: 'application/json', body: '{"ok":true}' }); });
87
+ await page.goto(BASE + '/premium-intelligence.html?theme=' + theme);
88
+ await until(() => page.evaluate(() => document.querySelectorAll('#goalTbl .okr-row').length > 0), 20000);
89
+ await until(() => page.evaluate(() => !!document.querySelector('#goalTbl .okr-dr')), 6000);
90
+ return { ctx, page, errors, posts };
91
+ };
92
+ const txt = (p, s) => p.evaluate((x) => { const e = document.querySelector(x); return e ? e.textContent.replace(/\s+/g, ' ').trim() : ''; }, s);
93
+
94
+ /* L · the list */
95
+ const R = await open(), p = R.page;
96
+ const order = await p.evaluate(() => [...document.querySelectorAll('#insHero, #nsRow .okr-h, #goalTbl .okr-h')].filter((e) => e.offsetParent !== null).map((e) => e.id === 'insHero' ? '✦' : e.textContent));
97
+ ok('L1 top to bottom: the ✦ line, North Star, Key results, Health budgets', order.join('|') === '✦|North Star|Key results|Health budgets', order.join('|'));
98
+ const rows = await p.evaluate(() => [...document.querySelectorAll('#goalTbl [data-goal]')].map((r) => ({ id: r.dataset.goal, dot: (r.querySelector('.okr-main .cz-dot') || {}).className || '', meta: r.querySelector('.okr-main .note').textContent, av: !!r.querySelector('.okr-main .okr-av'), svg: !!r.querySelector('.okr-main svg'), pill: !!r.querySelector('.okr-main .cz-pill') })));
99
+ const act = rows.find((r) => r.id === 'krm-act') || {}, churn = rows.find((r) => r.id === 'krm-churn') || {};
100
+ ok('L2 a row is the dot, the outcome, its reading and the owner: no chart and no initiative status', rows.length >= 4 && rows.every((r) => r.av && !r.svg && !r.pill), JSON.stringify(rows));
101
+ ok('L3 the reading the status function sent is the row\'s line, behind is amber', act.meta === '+8 of +30 points · its line says +18' && /risk/.test(act.dot), JSON.stringify(act));
102
+ ok('L4 a goal with no reading has a hollow dot and says so', /hollow/.test(churn.dot) && /No reading yet/.test(churn.meta), JSON.stringify(churn));
103
+ ok('L5 the owner avatar shows the initials; no owner is the dashed circle', await p.evaluate(() => document.querySelector('[data-goal="krm-act"] .okr-av').textContent === 'RP' && !!document.querySelector('[data-goal="krm-churn"] .okr-av.none')));
104
+ ok('L6 the North Star is a row in its own card, read and dated', /99\.6% · up 0\.4 since 1 Sep/.test(await txt(p, '#nsRow [data-goal="krm-up"]')));
105
+ await shot(p, 'okr-desktop-light');
106
+
107
+ /* D · drafts */
108
+ const under = await p.evaluate(() => ({ chase: !!document.querySelector('[data-goal="krm-act"] [data-draft="d-chase"]'), out: !!document.querySelector('[data-goal="krm-ttfc"] [data-draft="d-out"]'), kr: !!document.querySelector('#goalTbl [data-draft-row="d-kr"]'),
109
+ acts: [...document.querySelectorAll('[data-draft="d-chase"] .acts button')].map((b) => b.getAttribute('aria-label').split(':')[0]), old: (document.querySelector('[data-draft="d-out"] .okr-old') || {}).textContent || '' }));
110
+ ok('D1 each draft sits under the row it repairs; a drafted key result is a hollow row of its own', under.chase && under.out && under.kr, JSON.stringify(under));
111
+ ok('D2 a draft has ✕ / ✎ / ✓, and ✓ says its act (Send)', under.acts.join('|') === 'Not now|Edit|Send', under.acts.join('|'));
112
+ ok('D3 an outcome draft says what it was', under.old === 'Was “Time to first call”', under.old);
113
+ const line = await p.evaluate(() => ({ t: document.querySelector('#brief').textContent + ' ' + document.querySelector('#insWhy').textContent, all: !!document.querySelector('#insAct [data-okl="keep-all"]') }));
114
+ ok('D4 the ✦ line says what Claude drafted, with ✓✓ to keep them all, and never "no insight"', /I drafted 3 (changes|fixes)/.test(line.t) && line.all && !/no insight/i.test(line.t), JSON.stringify(line));
115
+ await p.click('[data-draft="d-chase"] [data-okd="keep"]');
116
+ ok('D5 ✓ posts that draft\'s row', await until(() => R.posts.some((x) => x.path === '/api/metric-drafts/keep' && x.body.row === 'd-chase')));
117
+ await p.click('#insAct [data-okl="keep-all"]');
118
+ ok('D6 ✓✓ posts keep-all for the product', await until(() => R.posts.some((x) => x.path === '/api/metric-drafts/keep-all' && x.body.scope === 'product')));
119
+ await p.click('[data-draft="d-out"] [data-okd="edit"]');
120
+ const ed = await until(() => p.evaluate(() => { const i = document.querySelector('[data-dred="d-out"] [data-drf="name"]'); return i ? i.value : null; }), 3000);
121
+ ok('D7 ✎ turns the draft into its words in place', ed === 'New partners make their first call within 3 days', ed);
122
+ await p.fill('[data-dred="d-out"] [data-drf="name"]', 'New partners call us within 3 days');
123
+ await p.click('[data-dred="d-out"] [data-okd="save"]');
124
+ ok('D8 ✓ on the edit posts what was typed (a fix row posts its text, lib/metric-drafts.js editOf)', await until(() => R.posts.some((x) => x.path === '/api/metric-drafts/edit' && x.body.row === 'd-out' && x.body.text === 'New partners call us within 3 days' && x.body.name === undefined)));
125
+
126
+ /* V · the goal Viewer */
127
+ await p.click('#goalTbl [data-goal="krm-act"] .okr-main');
128
+ const v = await until(() => p.evaluate(() => { const V = document.querySelector('#czViewer'); if (!V || V.hidden) return null; return { title: (V.querySelector('.cz-vw-title') || {}).textContent || '', head: (V.querySelector('.okr-vh') || {}).textContent || '', chart: !!V.querySelector('.ins-gbig svg'), why: (V.querySelector('.okr-why') || {}).textContent || '', folds: [...V.querySelectorAll('.czs-row b')].map((b) => b.textContent) }; }), 5000);
129
+ ok('V1 the Viewer opens on the goal with its reading against its line and the owner', v && /Partner activation/.test(v.title) && /\+8 of \+30 points/.test(v.head) && /its line says \+18/.test(v.head) && /RP/.test(v.head), JSON.stringify(v));
130
+ ok('V2 then the chart and why it moved', v && v.chart && /catches up about 3 weeks/.test(v.why), JSON.stringify(v));
131
+ ok('V3 then three folds: How I read it, What it counts, History', v && v.folds.slice(0, 3).join('|') === 'How I read it|What it counts|History', v && v.folds.join('|'));
132
+ await p.click('#czViewer [data-czs-fold="read"]'); await sleep(120);
133
+ ok('V4 How I read it says the source, what is read and how often', /Amplitude/.test(await txt(p, '#czViewer [data-czs-id="read"]')) && /partners active ÷ partners signed/.test(await txt(p, '#czViewer [data-czs-id="read"]')) && /Weekly/.test(await txt(p, '#czViewer [data-czs-id="read"]')));
134
+ await shot(p, 'okr-viewer-desktop');
135
+
136
+ /* N · notify */
137
+ await p.click('#czViewer [data-cz-vw="more"]'); await sleep(120);
138
+ const mi = await p.evaluate(() => [...document.querySelectorAll('.cz-vw-menu [role="menuitem"]')].map((b) => b.textContent.replace(/\s+/g, ' ').trim()).slice(0, 3));
139
+ ok('N1 ⋯ offers Notify me, Only in Intelligence (my pick, on) and Quiet', /^Notify me/.test(mi[0] || '') && /^Only in Intelligence.*my pick · on/.test(mi[1] || '') && /^Quiet/.test(mi[2] || ''), mi.join(' | '));
140
+ await shot(p, 'okr-notify');
141
+ await p.click('.cz-vw-menu [role="menuitem"]:first-child');
142
+ ok('N2 Notify me posts the choice for that goal', await until(() => R.posts.some((x) => x.path === '/api/goals/notify' && x.body.id === 'krm-act' && x.body.notify === 'push')));
143
+ await p.evaluate(() => window.czViewer && window.czViewer.close()); await sleep(200);
144
+
145
+ /* M · ⋯ › Metrics */
146
+ await p.click('#moreB'); await sleep(80);
147
+ ok('M1 ⋯ holds Reports and dashboards, Metrics, Delivery trends, Sources and Export', (await p.evaluate(() => [...document.querySelectorAll('#moreMenu [data-more]')].map((b) => b.dataset.more).join())).startsWith('library,metrics,trends,sources,export'));
148
+ await p.click('#moreMenu [data-more="metrics"]');
149
+ const ml = await until(() => p.evaluate(() => { const V = document.querySelector('#czViewer'); if (!V || V.hidden || !V.querySelector('.okr-met')) return null; return { heads: [...V.querySelectorAll('.okr-sh')].map((e) => e.textContent), watch: [...V.querySelectorAll('.okr-mrow')].filter((r) => r.querySelector('.okr-tag')).map((r) => r.querySelector('b').textContent + ':' + (r.querySelector('.cz-dot').className.includes('hollow') ? 'no status' : 'status')) }; }), 4000);
150
+ ok('M2 Metrics is one list: goals first, then the watched ones with no status', ml && ml.heads.join('|') === 'On a goal|Watched, no goal' && ml.watch.join() === 'App store rating:no status', JSON.stringify(ml));
151
+ await shot(p, 'okr-metrics-list');
152
+ await p.click('#czViewer [data-mv2="tree"]'); await sleep(120);
153
+ const tr = await p.evaluate(() => ({ ns: (document.querySelector('#czViewer .okr-node.ns b') || {}).textContent || '', inputs: [...document.querySelectorAll('#czViewer .okr-tree .okr-tr1 .okr-node b')].map((b) => b.textContent) }));
154
+ ok('M3 one switch shows the same list as a tree: the North Star and its inputs', tr.ns === 'Partner uptime' && tr.inputs.includes('Partner activation'), JSON.stringify(tr));
155
+ await shot(p, 'okr-metrics-tree');
156
+ ok('M4 no script error on the page', !R.errors.length, R.errors.join(' | '));
157
+ await R.ctx.close();
158
+
159
+ /* R · a broken limit */
160
+ const C = await open({ m: model({ crit: true }), rows: [] });
161
+ const cr = await C.page.evaluate(() => ({ crit: document.querySelector('#insHero').classList.contains('crit'), t: document.querySelector('#brief').textContent, pulse: !!document.querySelector('#nsRow [data-goal="krm-up"] .cz-dot.m-crit') }));
162
+ ok('R1 a broken limit is the one time the ✦ line turns red, and its dot pulses', cr.crit && /fell under its floor/.test(cr.t) && cr.pulse, JSON.stringify(cr));
163
+ await shot(C.page, 'okr-crit', '#stage');
164
+ await C.ctx.close();
165
+
166
+ /* P · a phone */
167
+ for (const theme of ['light', 'dark']) {
168
+ const Q = await open({ w: 390, h: 844, theme });
169
+ const ph = await Q.page.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1, rows: document.querySelectorAll('#goalTbl .okr-row').length, shown: getComputedStyle(document.querySelector('#goalTbl')).display !== 'none' }));
170
+ ok('P1 on a phone (' + theme + ') the same list shows with no sideways scroll', !ph.over && ph.rows >= 4 && ph.shown, JSON.stringify(ph));
171
+ await shot(Q.page, 'okr-phone-' + theme);
172
+ await Q.ctx.close();
173
+ }
174
+ finish();
175
+ })();
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.433.0",
3
+ "version": "0.434.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.433.0",
9
+ "version": "0.434.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.433.0",
3
+ "version": "0.434.0",
4
4
  "private": true,
5
5
  "description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
6
6
  "license": "MIT",
@@ -20,6 +20,7 @@
20
20
  * item 5c), the same words and order as Home's initiative page, with Delete last (5d). The rest sits on the thing it changes: the stage chip's
21
21
  * picker moves the stage with the row menu's own presses (moreAct(r, k, btn), bd-acts.js); Change workflow, Won't do and Archive are Home's
22
22
  * (ini-wf.js). Discuss in chat takes the question to Home. */
23
+ import * as IM from './impact.js'; // Your impact (batch 16 item 7): who made a delivered milestone happen
23
24
  import * as VW from './cozy-viewer.js';
24
25
  import { esc } from './premium-shell.js';
25
26
  import { lr, copyText } from './cozy-xv.js';
@@ -170,7 +171,7 @@ function iniBody(r) {
170
171
  const self = !!((O.M() || {}).board || {}).self, M = O.M() || {};
171
172
  // what left the ⋯ for the thing it changes (batch 16 item 5c): the workflow chip, the dashed +, the stage chip, the dates chip, Jira's ↻
172
173
  return viewHtml(viewOf(r), { add: !!(r.id && O.addTask), adding: adding === r.key, addHint: adding === r.key && addDates ? md(addDates.start) + ' to ' + md(addDates.due) : '', openTask: !!O.openTask, quick: !!(O.setTask && O.setDates), hold: !!O.hold, tail: VW.czSections(boardSections(r), { key: 'board' }),
173
- wf: !!r.id && !self && !r.ended, person: !!r.id, stagePick: !!r.id, planDates: !!r.id, jira: !!M.jira });
174
+ wf: !!r.id && !self && !r.ended, person: !!r.id, stagePick: !!r.id, planDates: !!r.id, jira: !!M.jira }) + madeHtml(r);
174
175
  }
175
176
  /** Presses inside the shown item: the view's own (pm/ini-view.js), a ticket's drill-in, the PRD-change question. A [data-doc] goes to the page's handler. */
176
177
  function wire(body, key) {
@@ -272,4 +273,11 @@ export function refresh() {
272
273
  }
273
274
  export function close() { if (cur) { cur = null; VW.close(); } }
274
275
  export const shown = () => (cur ? cur.key : null);
275
- export function mount(o) { O = o; ensurePopCss(); }
276
+ /** Your impact, Phase 3 (batch 16 item 7, GmA2Board): under a milestone delivered in the last 30 days, the people who made it happen, from
277
+ * the row's own tickets, unranked, each with its ticket to open. Private: no thank-you press, no send, and the ◆ on the timeline stays plain. */
278
+ const madeHtml = (r) => IM.madeHtml(IM.madeOf(r, (O.M() && O.M().today) || new Date().toISOString().slice(0, 10)));
279
+ export function mount(o) {
280
+ O = o; ensurePopCss();
281
+ IM.readWeek().then(() => refresh()).catch(() => {});
282
+ window.addEventListener('pmos:impact', () => { setTimeout(() => IM.readWeek().then(() => refresh()).catch(() => {}), 0); }); // the switch: the section follows at once
283
+ }
@@ -80,3 +80,8 @@ html.ad-still .env-leaf { opacity: 0; }
80
80
  .env-leaf { opacity: 0; }
81
81
  }
82
82
  svg.ad-svg.am { stroke: none; }
83
+ /* Your impact (batch 16 item 7, GmA1Home): the newest leaf on the sprout grows once, on a real event; still under reduced motion and Still */
84
+ .ad-svg .ad-gw { animation: adGw 1.4s ease-out 1 both; transform-box: fill-box; transform-origin: right bottom; }
85
+ @keyframes adGw { 0% { transform: scale(0); opacity: 0; } 70% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
86
+ @media (prefers-reduced-motion: reduce) { .ad-svg .ad-gw { animation: none; } }
87
+ html.ad-still .ad-svg .ad-gw { animation: none; }
@@ -39,13 +39,20 @@ function defs(p) {
39
39
  + rg('h', 78, 166, 100, [[0, 'h0'], [0.55, 'h1'], [1, 'h2']]) + rg('l', 96, 4, 44, [[0, 'l0'], [1, 'l1']])
40
40
  + `<filter id="${p}b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="3.5"/></filter></defs>`;
41
41
  }
42
- function sprout(m, p) {
42
+ /* Your impact (batch 16 item 7, GmA1Home, GmA2Board): the leaves on the sprout are the ONLY leaf in PMOS. grow is the word GET /api/impact/week
43
+ * gives (rest, bud, leaf, full): the stem grows taller and carries more leaves. No number is drawn or said. o.growNew plays one grow on the
44
+ * newest leaf (a real event, once). */
45
+ const GROW = { rest: { top: 22, side: [] }, bud: { top: 16, side: [[24, 'l']] }, leaf: { top: 8, side: [[14, 'l']] }, full: { top: -20, side: [[14, 'l'], [0, 'r'], [-14, 'l']] } };
46
+ export const GROWS = Object.freeze(Object.keys(GROW));
47
+ function sprout(m, p, grow, growNew) {
43
48
  const rot = { calm: 0, joy: -8, think: 10, ask: -4, worry: 30, rest: 16 }[m];
44
- let l1 = 'M100 22 C 88 6, 70 8, 66 18 C 74 26, 90 28, 100 22Z', l2 = 'M100 22 C 112 4, 132 6, 136 16 C 128 26, 110 28, 100 22Z';
49
+ const g = m === 'worry' ? GROW.rest : GROW[grow] || GROW.rest, T = g.top;
50
+ let l1 = `M100 ${T} C 88 ${T - 16}, 70 ${T - 14}, 66 ${T - 4} C 74 ${T + 4}, 90 ${T + 6}, 100 ${T}Z`, l2 = `M100 ${T} C 112 ${T - 18}, 132 ${T - 16}, 136 ${T - 6} C 128 ${T + 4}, 110 ${T + 6}, 100 ${T}Z`;
45
51
  if (m === 'worry') { l1 = 'M100 22 C 90 12, 74 14, 70 24 C 80 30, 94 30, 100 22Z'; l2 = 'M100 22 C 106 30, 118 40, 130 38 C 130 28, 116 18, 100 22Z'; }
46
- const leaf = (d) => `<path d="${d}" fill="url(#${p}l)" stroke="${L_LEAF}" stroke-width="2" stroke-linejoin="round"/>`;
47
- return `<g class="ad-sp"><g transform="rotate(${rot} 100 36)"><path d="M100 38 L100 22" fill="none" stroke="${L_LEAF}" stroke-width="4" stroke-linecap="round"/>${leaf(l1)}${leaf(l2)}`
48
- + `<path d="M100 22 C 92 18, 82 17, 74 18" fill="none" stroke="${L_LEAF}" stroke-width="1.2" opacity=".6"/><path d="M100 22 C 110 17, 120 15, 128 16" fill="none" stroke="${L_LEAF}" stroke-width="1.2" opacity=".6"/></g></g>`;
52
+ const leaf = (d, c = '') => `<path d="${d}" fill="url(#${p}l)" stroke="${L_LEAF}" stroke-width="2" stroke-linejoin="round"${c ? ` class="${c}"` : ''}/>`;
53
+ const side = ([y, s], i, all) => leaf(s === 'l' ? `M100 ${y} C 90 ${y - 12}, 76 ${y - 10}, 74 ${y - 4} C 82 ${y + 2}, 92 ${y + 2}, 100 ${y}Z` : `M100 ${y} C 110 ${y - 12}, 124 ${y - 10}, 126 ${y - 4} C 118 ${y + 2}, 108 ${y + 2}, 100 ${y}Z`, growNew && i === all.length - 1 ? 'ad-gw' : '');
54
+ return `<g class="ad-sp"><g transform="rotate(${rot} 100 36)"><path d="M100 38 L100 ${T}" fill="none" stroke="${L_LEAF}" stroke-width="4" stroke-linecap="round"/>${g.side.map(side).join('')}${leaf(l1)}${leaf(l2)}`
55
+ + `<path d="M100 ${T} C 92 ${T - 4}, 82 17, 74 18" fill="none" stroke="${L_LEAF}" stroke-width="1.2" opacity=".6"/><path d="M100 ${T} C 110 ${T - 5}, 120 15, 128 16" fill="none" stroke="${L_LEAF}" stroke-width="1.2" opacity=".6"/></g></g>`;
49
56
  }
50
57
  const mirror = (d) => { let x = true; return d.replace(/[MCZ]|-?\d+\.?\d*/g, (t) => { if (/[MCZ]/.test(t)) { x = true; return t; } const v = Number(t); const o = x ? String(200 - v) : String(v); x = !x; return ' ' + o; }); };
51
58
  function ears(m, p) {
@@ -77,8 +84,8 @@ function face(m, p) {
77
84
  else s += `<path d="M100 113 L100 118 M100 118 Q94 124 88 119 M100 118 Q106 124 112 119" fill="none" class="${S('ink')}" stroke-width="2.8" stroke-linecap="round" stroke-linejoin="round"/>`;
78
85
  return s;
79
86
  }
80
- function head(m, p, prop) {
81
- let h = sprout(m, p) + ears(m, p);
87
+ function head(m, p, prop, grow, growNew) {
88
+ let h = sprout(m, p, grow, growNew) + ears(m, p);
82
89
  h += `<path d="M28 98 C 28 54, 60 32, 100 32 C 140 32, 172 54, 172 98 C 172 138, 140 156, 100 156 C 60 156, 28 138, 28 98Z" fill="url(#${p}f)" stroke="${L_FUR}" stroke-width="3"/>`;
83
90
  h += `<ellipse cx="74" cy="56" rx="30" ry="14" class="${F('white')}" opacity=".35" filter="url(#${p}b)"/><path d="M40 120 C 50 150, 150 150, 160 120 C 150 160, 50 160, 40 120Z" class="${F('shade')}" opacity=".12" filter="url(#${p}b)"/>`;
84
91
  h += `<path d="M36 108 C 44 92, 70 92, 100 102 C 130 92, 156 92, 164 108 C 162 140, 136 154, 100 154 C 64 154, 38 140, 36 108Z" fill="url(#${p}c)"/>`;
@@ -171,7 +178,8 @@ const dot = (mood, px, o) => `<span class="ad-dot m-${mood}" style="--ad-px:${px
171
178
 
172
179
  /**
173
180
  * Adler. mood: one of MOODS (anything else is handled). size: 's' | 'm' | 'l' or a number of px (the face's side; the figure's height).
174
- * o: { label: false (beside words that carry the meaning) | 'text', prop: 'headphones' | 'magnifier', cls, id (a fixed prefix) }. Off → the mood dot;
181
+ * o: { label: false (beside words that carry the meaning) | 'text', prop: 'headphones' | 'magnifier', cls, id (a fixed prefix), grow: one of GROWS (Your
182
+ * impact's leaves on the sprout, the face only), growNew: true plays one grow on the newest leaf }. Off → the mood dot;
175
183
  * Face only → an L figure is drawn as the M face. → HTML string
176
184
  */
177
185
  export function adler(mood, size = 'm', o = {}) {
@@ -186,7 +194,7 @@ export function adler(mood, size = 'm', o = {}) {
186
194
  // redraw that diffs the markup does not replace the node and replay its entrance (premium-viewer-flicker F1)
187
195
  const p = o.id ? 'ad' + o.id : nextId(), cls = `ad-svg am m-${m}${o.cls ? ' ' + o.cls : ''}`;
188
196
  const extra = o.prop === 'headphones' ? 'listening' : o.prop === 'magnifier' ? 'searching' : '';
189
- if (!figure) return `<svg class="${cls} ad-face" width="${px}" height="${px}" viewBox="22 4 156 156" overflow="visible" ${labelAttr(o, mood, extra)}>${defs(p)}${head(m, p, o.prop)}</svg>`;
197
+ if (!figure) return `<svg class="${cls} ad-face" width="${px}" height="${px}" viewBox="22 4 156 156" overflow="visible" ${labelAttr(o, mood, extra)}>${defs(p)}${head(m, p, o.prop, o.grow, o.growNew)}</svg>`;
190
198
  const w = Math.round(px * 200 / 252);
191
199
  return `<svg class="${cls} ad-fig" width="${w}" height="${px}" viewBox="0 0 200 252" overflow="visible" ${labelAttr(o, mood, extra)}>${defs(p)}<ellipse cx="100" cy="246" rx="62" ry="7" class="${F('shadow')}" opacity=".16" filter="url(#${p}b)"/><g class="ad-br">${full(m, p, o.prop)}</g></svg>`;
192
200
  }
@@ -684,3 +684,87 @@ body.ins-trv #goalTbl { border: 0; background: none; border-radius: 0; overflow:
684
684
  .ins-menu#moreMenu [role="menuitem"] { flex-direction: row; align-items: center; gap: 10px; }
685
685
  .ins-menu#moreMenu [role="menuitem"] > span:not(.k) { flex: 1; min-width: 0; }
686
686
  .ins-strip .sp.ad svg { width: 40px; height: 40px; fill: initial; stroke: none; } /* Adler in Claude’s line (batch 16 item 2, AdH3) */
687
+
688
+ /* ── Claude runs the OKRs (batch 16 item 6, 6-B; frames GsM1–M5, GsViewer, GsMetrics, GsMetricsTree, GsProduct): one goal list on every width.
689
+ * A row is a dot, the outcome with its reading and age, and the owner; its drafts sit under it with ✕ / ✎ / ✓. ── */
690
+ #goalTbl.okr-list { display: block !important; background: none; border: 0; box-shadow: none; padding: 0; overflow: visible; }
691
+ #goalCards:empty { display: none; }
692
+ .okr-sec { display: flex; align-items: baseline; gap: 10px; padding: 14px 4px 8px; }
693
+ .okr-h { margin: 0; font-size: var(--fs-1); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--cz-ink3); flex: 1; }
694
+ .okr-sec .note { font-size: var(--fs-2); }
695
+ .okr-card { background: var(--cz-card); border: 1px solid var(--cz-hair); border-radius: 20px; overflow: hidden; }
696
+ .okr-card > * + *, .okr-row + .okr-row, .okr-obj + .okr-row { border-top: 1px solid var(--cz-hair); }
697
+ .okr-obj { margin: 0; padding: 10px 16px 0; font-size: var(--fs-2); font-weight: 700; color: var(--cz-ink3); }
698
+ .okr-row.sel { background: var(--cz-bluebg); }
699
+ .okr-main { display: flex; align-items: flex-start; gap: 12px; padding: 12px 12px 12px 16px; cursor: pointer; min-height: 48px; box-sizing: border-box; border-radius: 16px; }
700
+ .okr-main:hover { background: var(--cz-well); }
701
+ .okr-main:focus-visible { outline: 2px solid var(--cz-blueink); outline-offset: -2px; }
702
+ .okr-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
703
+ .okr-t b { font-size: var(--fs-4); font-weight: 700; line-height: 1.3; color: var(--cz-ink); }
704
+ .okr-t .note { font-size: var(--fs-2); color: var(--cz-ink3); }
705
+ .okr-none { margin: 0; padding: 14px 16px; color: var(--cz-ink3); font-size: var(--fs-3); }
706
+ .okr-dot { width: 10px; height: 10px; margin-top: 6px; }
707
+ .cz-dot.hollow { background: transparent; box-shadow: inset 0 0 0 1.5px var(--cz-ink3); }
708
+ .okr-av { width: 32px; height: 32px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-1); font-weight: 800; background: var(--cz-well); color: var(--cz-ink); }
709
+ .okr-av.none { background: transparent; border: 2px dashed var(--cz-ink3); box-sizing: border-box; }
710
+ .okr-row.drafted .okr-t b { color: var(--cz-ink2); }
711
+ /* a draft under its row (GsM1, GsM3, GsM4, GsM5): its icon, Was …, what it does, why, and the icon presses */
712
+ .okr-dr { display: flex; align-items: flex-start; gap: 10px; margin: 0 12px 12px 38px; padding: 10px 10px 10px 12px; border-radius: 16px; border: 1px dashed rgba(47, 95, 179, .45); background: var(--cz-bluebg); }
713
+ .okr-dr .k { color: var(--cz-blueink); display: inline-flex; margin-top: 2px; }
714
+ .okr-dr .k svg, .okr-why .sp svg, .okr-mbar svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
715
+ .okr-dr .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-3); }
716
+ .okr-dr .tx b { font-weight: 700; color: var(--cz-ink); }
717
+ .okr-dr .tx .note { font-size: var(--fs-2); }
718
+ .okr-old { font-size: var(--fs-2); color: var(--cz-ink3); text-decoration: line-through; }
719
+ .okr-dr .acts { display: flex; gap: 4px; flex: none; align-items: center; }
720
+ .okr-dr.made { border-style: solid; border-color: var(--cz-hair); background: var(--cz-well); }
721
+ .okr-dr.made .tx b { color: var(--cz-ink2); }
722
+ .okr-ed .tx { gap: 6px; }
723
+ .okr-ed .ins-dri { width: 100%; box-sizing: border-box; }
724
+ .okr-row > .okr-dr:first-of-type { margin-top: 0; }
725
+ .okr-row.crit .okr-main b { color: var(--cz-ink); }
726
+ .ins-dr .okr-card { background: none; border: 0; }
727
+ .ins-dr .okr-dr { margin: 6px 0; }
728
+ /* the ✦ line: red only when a limit breaks (GsM4Break) */
729
+ .ins-strip.crit { box-shadow: inset 0 0 0 1.5px var(--cz-dot-red); }
730
+ .ins-strip.crit .sp { color: var(--cz-dot-red); }
731
+ .ins-strip.crit .sp svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
732
+ /* the North Star as the first card */
733
+ .ins-ns.okr-ns { display: block; background: none; border-radius: 0; padding: 0; font-size: inherit; font-weight: inherit; color: inherit; white-space: normal; }
734
+ /* the goal Viewer (GsViewer) */
735
+ .okr-vh { display: flex; align-items: center; gap: 10px; padding: 4px 2px 8px; flex-wrap: wrap; }
736
+ .okr-vh .okr-dot { margin-top: 0; }
737
+ .okr-vh b { font-size: var(--fs-4); font-weight: 800; }
738
+ .okr-vh .okr-sp { flex: 1; }
739
+ .okr-why { display: flex; gap: 12px; align-items: flex-start; background: var(--cz-well); border-radius: 16px; padding: 14px; margin: 8px 0; }
740
+ .okr-why .sp { color: var(--cz-blueink); display: inline-flex; }
741
+ .okr-why .sp svg { width: 20px; height: 20px; }
742
+ .okr-why p { margin: 0; font-size: var(--fs-3); line-height: 1.45; }
743
+ .okr-why .ins-mvl { margin-top: 8px; }
744
+ /* ⋯ › Metrics */
745
+ .okr-mbar { display: flex; gap: 2px; justify-content: flex-end; padding-bottom: 4px; }
746
+ .okr-mbar .cz-ib.on { background: var(--cz-well); }
747
+ .okr-mbar svg { width: 18px; height: 18px; }
748
+ .okr-sh { margin: 14px 4px 8px; font-size: var(--fs-1); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--cz-ink3); }
749
+ .okr-mrow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 12px 10px 14px; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
750
+ .okr-mrow + .okr-mrow { border-top: 1px solid var(--cz-hair); }
751
+ .okr-mrow:hover { background: var(--cz-well); }
752
+ .okr-mrow .okr-dot { margin-top: 0; }
753
+ .okr-tag { font-size: var(--fs-1); font-weight: 700; color: var(--cz-ink3); border: 1px solid var(--cz-hair); border-radius: 10px; padding: 1px 7px; }
754
+ .okr-tree { display: flex; flex-direction: column; align-items: center; }
755
+ .okr-tr0 { display: flex; justify-content: center; width: 100%; }
756
+ .okr-trk { width: 2px; height: 18px; background: var(--cz-hair); }
757
+ .okr-tr1 { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; width: 100%; padding-top: 10px; border-top: 2px solid var(--cz-hair); border-radius: 8px 8px 0 0; }
758
+ .okr-tr1.one { border-top: 0; padding-top: 0; }
759
+ .okr-tr1.loose, .okr-sh + .okr-tr1 { border-top: 0; padding-top: 0; justify-content: flex-start; }
760
+ .okr-node { display: flex; align-items: flex-start; gap: 8px; width: 170px; padding: 10px 12px; border-radius: 16px; border: 1px solid var(--cz-hair); background: var(--cz-card); color: inherit; font: inherit; text-align: left; cursor: pointer; }
761
+ .okr-node.ns { width: min(260px, 100%); }
762
+ .okr-node .okr-t b { font-size: var(--fs-3); }
763
+ .okr-node .okr-dot { margin-top: 5px; }
764
+ /* the product page's Goals line (GsProduct) */
765
+ .okr-pl { display: flex; align-items: center; gap: 10px; min-width: 0; }
766
+ .okr-plt { flex: 1; min-width: 0; }
767
+ .okr-pld { display: inline-flex; gap: 4px; flex: none; }
768
+ .okr-pld .okr-dot { margin-top: 0; width: 8px; height: 8px; }
769
+ @media (prefers-reduced-motion: reduce) { .okr-dot.m-crit::after { animation: none; } }
770
+ textarea.ins-dri { height: auto; padding: 6px 8px; font-weight: 500; resize: vertical; }
@@ -1,7 +1,8 @@
1
1
  /* pm/cozy-settings.js — Settings (initiative premium-uncovered-features, E3; canvas EvSettings). A dialog over the page, its sections on the left:
2
2
  * General Theme (this device; the place menu's Theme row moved here, feedback batch 16 item 5), Viewer opens as a column or a popup
3
3
  * (this device), Product (which products Home reads: the Products card), Your day (when the end-of-day card shows:
4
- * time.workEnd, POST /api/settings), Agents write to Jira (fixed: only after Commit)
4
+ * time.workEnd, POST /api/settings), Your impact (impact.on, POST /api/settings; canvas GmP1Switch, batch 16 item 7: the one switch
5
+ * for Adler's leaf, the impact log and the weekly check; the page hears `pmos:impact`), Agents write to Jira (fixed: only after Commit)
5
6
  * Adler how much of Claude's face shows, Motion, Celebrations, Quiet after (adler.*, POST /api/settings; canvas AdM5, batch 16 item 2)
6
7
  * Connectors each source's last read (GET /api/sources; was the Sources card, feedback batch 16 item 5, canvas FmA3Settings): the amber dot
7
8
  * and ↻ Read again on a stale or failed one (POST /api/sources/refresh), ↻ in the header reads every source
@@ -57,9 +58,12 @@ function general() {
57
58
  + trow('Viewer opens as', 'A column beside the chat, or a popup over it', seg('Viewer opens as', 'viewer', vw, [['column', 'Column'], ['popup', 'Popup']]))
58
59
  + trow('Product', 'Which products Home, Board and Intelligence read', `<button type="button" class="ev-pick" data-ev-products aria-haspopup="menu">${esc(pname)} ${svg(ICON.down, 14)}</button>`)
59
60
  + trow('Your day', 'When the end-of-day card shows', `<label class="ev-vh" for="evDay">Your day ends at</label><select id="evDay" class="ev-inp" data-ev-day>${hours.map((h) => `<option value="${h}"${h === end ? ' selected' : ''}>${pad(h)}:00</option>`).join('')}</select>`)
61
+ + trow('Your impact', 'Adler’s sprout and your impact log. Only you see it. Nothing leaves PMOS.', sw(impactOn(), 'data-ev-impact', 'Your impact'))
60
62
  + trow('Agents write to Jira', 'Only after you press Commit. Never on their own.', '<span class="ev-pill ok">Fixed</span>')
61
63
  + upd;
62
64
  }
65
+ /* Your impact (GmP1Switch): on by default; off hides every impact surface and stops Claude's daily read */
66
+ function impactOn() { const x = T.set && Array.isArray(T.set.settings) ? T.set.settings.find((y) => y.key === 'impact.on') : null; return x ? x.value !== false : true; }
63
67
  /* Settings > Adler (AdM5): four choices, each saved for this computer the moment it is pressed */
64
68
  function adlerSec() {
65
69
  const P = AD.prefs();
@@ -167,6 +171,12 @@ async function press(e) {
167
171
  if (t.dataset.evGo) { T.sec = t.dataset.evGo; draw(); return; }
168
172
  if (t.dataset.evSeg === 'theme') { const M = await import('./cozy-nav.js'); M.setTheme(t.dataset.v); draw(); return; }
169
173
  if (t.dataset.evSeg && t.dataset.evSeg.startsWith('adler.')) { const r = await AD.savePref(pmPost, t.dataset.evSeg, t.dataset.v); T.msg = r && r.ok ? 'Saved.' : (r && r.error) || 'Not saved.'; draw(); return; }
174
+ if ('evImpact' in t.dataset) {
175
+ const on = !impactOn(), r = await pmPost('/api/settings', { key: 'impact.on', value: on });
176
+ if (r && r.ok) { const x = T.set && Array.isArray(T.set.settings) ? T.set.settings.find((y) => y.key === 'impact.on') : null; if (x) x.value = on; window.dispatchEvent(new CustomEvent('pmos:impact', { detail: { on } })); }
177
+ T.msg = r && r.ok ? (on ? 'Your impact is on.' : 'Your impact is off. The leaf, the log and the weekly check are hidden.') : (r && r.error) || 'Not saved.';
178
+ draw(); return;
179
+ }
170
180
  if (t.dataset.evSeg === 'viewer') { store.set(VIEWER_KEY, t.dataset.v); document.body.classList.toggle('ev-vw-popup', t.dataset.v === 'popup'); draw(); return; }
171
181
  // the one product pick (batch 12 item 5): the same list as the chip on Home, Board and Insights, under this row
172
182
  if ('evProducts' in t.dataset) {
@@ -38,6 +38,7 @@ import * as L from './home-list.js';
38
38
  import * as TD from './home-today.js';
39
39
  import * as YD from './home-day.js';
40
40
  import * as AD from './cozy-adler.js'; // Adler, Claude's face (batch 16 item 2)
41
+ import * as OKL from './okr-list.js'; // the product page's Goals line (batch 16 item 6, GsProduct)
41
42
  import { canDictate, dictate } from './home-dictate.js';
42
43
  import { mountIni, iniList, iniOverview, iniPage, iniAddTask } from './home-ini.js'; // the initiative's page, its stage move, Tasks and Core documents (premium-uncovered-features, HbC)
43
44
  import * as MEN from './home-mentions.js'; // @Mentions, the permanent row at the top of Home and its Viewer (Viewer kit, XvANew)
@@ -48,7 +49,9 @@ import * as PM from './prog-move.js'; // move an initiative out of its program
48
49
  import * as CW from './ctx-wedge.js'; // how full a session's context is, and Claude's ✦ Compact (batch 13 item 8, XctxA1Desk)
49
50
  import * as SO from './sort-order.js'; // the sort button and ONE order with the Board (batch 14 item 8, canvas SoAHomePhone)
50
51
  import * as PO from './prog-order.js'; // a program's order on Home: the grip, hold-then-drag on a phone, ✦ Claude's order from the dates (canvas RoAPhone)
52
+ import * as IMP from './home-impact.js'; // Your impact: the weekly check in Home's own chat (batch 16 item 7, GmP1Ledger)
51
53
  import * as LPV from './loose-props.js'; // Claude's clean-up of "Not in an initiative": the ✦ on its header and the Viewer (batch 13 item 3)
54
+ import * as IM from './impact.js'; // Your impact (batch 16 item 7): Adler's sprout on the greeting, the week in the Viewer, the Friday chapter
52
55
  import { initiativeRename, taskRename } from './rename-press.js'; // tap the title to rename (canvas RnATask, RnASaved) // the pinned recording row above it (XvARecHome)
53
56
 
54
57
  const $ = (s, r = document) => r.querySelector(s);
@@ -196,6 +199,8 @@ async function load() {
196
199
  S.ready = true;
197
200
  await loadIni();
198
201
  draw();
202
+ loadImpact();
203
+ readImpact();
199
204
  // the boards of the other products Home reads, each its own closed group: read after the list is drawn, so a slow one never holds it up
200
205
  const others = await Promise.all(otherProducts(D).map((a) => getRetry('/api/board-premium?ws=' + encodeURIComponent(a.ws), 4).then((r) => (r && r.ok && r.model ? { ws: a.ws, name: a.name, model: r.model } : null))));
201
206
  const got = others.filter(Boolean);
@@ -294,7 +299,8 @@ function homeListHtml() {
294
299
  const pOpen = (g) => (g.key in S.pg ? !!S.pg[g.key] : g.kind === 'loose' ? !isPhone() : g.kind === 'program' || g.primary || M.products.length === 1);
295
300
  return TD.listHtml(M, todayModel(), {
296
301
  sel: S.sel || (S.ini && S.ini !== 'product' ? 'i:' + S.ini : null), selHead: S.head, ses: S.ses, pOpen, restOpen: (k) => S.rest.has(k), cap: S.cap, pin: S.pin, avHtml, ready: S.ready, err: S.D.err.length ? S.D.err[0] : '',
297
- pick: S.D.pick, tones: pickTones(), review: R, mic: canDictate(), phone: isPhone(), day: S.day, news: S.news && S.news.ok ? S.news.count : 0, top: S.ready ? RECROW.html() + MEN.rowHtml(S.D, { sel: S.sel }) : '',
302
+ pick: S.D.pick, tones: pickTones(), review: R, mic: canDictate(), phone: isPhone(), day: S.day, news: S.news && S.news.ok ? S.news.count : 0, top: S.ready ? RECROW.html() + MEN.rowHtml(S.D, { sel: S.sel }) + (S.impact ? IMP.rowHtml(S.impact.c, { esc, sel: S.sel === 'impact' }) : '') : '',
303
+ imFace: IM.faceHtml(S.im, { joy: S.imJoy }),
298
304
  });
299
305
  }
300
306
  /** Your day (XvAPhDay): "Good morning" opens it in the Viewer on a phone and a desktop alike (batch 16, Wawan: the same press must lead to
@@ -310,6 +316,26 @@ function dayParts() {
310
316
  function drawDayBody(body, P) {
311
317
  const ph = isPhone() && PHC;
312
318
  YD.drawDay(body, P, VW, ph ? (el) => { el.append(PHC.el); PHC.read(true); } : null);
319
+ // Your impact's chapter (batch 16 item 7, GmP4Chapter): on a Friday when a stage of one of these initiatives really closed this week
320
+ if (S.chap) body.insertAdjacentHTML('afterbegin', IM.chapterHtml(S.chap, { href: '/premium.html?ini=' + encodeURIComponent(S.chap.c.id) + (S.chap.c.ws ? '&ws=' + encodeURIComponent(S.chap.c.ws) : '') }));
321
+ }
322
+ /** Your impact (batch 16 item 7): the week's read gives Adler's sprout its leaves, celebrates once on a real event (a thanks says itself in
323
+ * the toast), and on a Friday finds the chapter for Your day. Nothing shows while the switch is off or the 9-of-10 gate is not passed. */
324
+ async function readImpact() {
325
+ const W = await IM.readWeek().catch(() => null);
326
+ const had = IM.shows(S.im) || !!S.chap;
327
+ S.im = W;
328
+ // nothing to show and nothing shown before: keep the rows as they are, so a click in flight still lands
329
+ if (!IM.shows(W)) { S.chap = null; if (had) drawList(); return; }
330
+ S.imJoy = !!IM.celebrate(W, { toast });
331
+ drawList();
332
+ if (S.imJoy) setTimeout(() => { S.imJoy = false; }, 1600); // the leaf grows once: the next draw is still
333
+ if (new Date(NOW()).getDay() === 5) {
334
+ const ch = await IM.readChapters().catch(() => []);
335
+ const all = H.boardRows(S.D).concat(...(S.D.others || []).map((o) => H.boardRows({ ...S.D, board: o.model })));
336
+ S.chap = IM.chapterToday(ch, (id) => ((all.find((r) => r.id === id) || {}).title || ''), NOW(), W);
337
+ redrawDay();
338
+ }
313
339
  }
314
340
  function day(on) {
315
341
  S.day = !!on;
@@ -780,18 +806,30 @@ const productRename = (ws, name, vid) => (ws ? { value: name, max: 80, save: asy
780
806
  /** The name Home shows for the board's own product: its group's name (the PM's name for the repository wins), else the board's. */
781
807
  const ownProductName = () => { const g = ((S.M && S.M.groups) || []).find((x) => x.kind === 'product' && x.primary); return (g && g.name) || H.productName(S.D); };
782
808
  const productKey = () => { const g = ((S.M && S.M.groups) || []).find((x) => x.kind === 'product' && x.primary); return g ? g.key : null; };
809
+ /** The product page's Goals (GsProduct, batch 16 item 6): one line from the goal status function (GET /api/goal-status, readings only), one dot
810
+ * per goal, that opens the Intelligence goal list. Build status leaves the goal block and stays on the Board. */
811
+ const intelHref = (ws) => '/premium-intelligence.html' + (ws ? '?ws=' + encodeURIComponent(ws) : '');
812
+ const goalsBlock = (ws) => `<section class="hi-pg" aria-label="Goals"><div class="hm-r hi-r"><a class="hm-rm" href="${esc(intelHref(ws))}" aria-label="Open goals in Intelligence"><span class="hm-tile">${SVG(I.chart, 14)}</span><span class="hm-rt"><b>Goals</b><em class="q" data-okr-line>Reading the goals</em></span><span class="okr-pld" data-okr-dots aria-hidden="true"></span></a></div></section>`;
813
+ async function fillGoals(b, ws) {
814
+ let r = null;
815
+ try { r = await pmGet('/api/goal-status' + (ws ? '?ws=' + encodeURIComponent(ws) : '')); } catch { r = null; }
816
+ const L = r && r.ok ? OKL.productLine(r) : null, line = b.querySelector('[data-okr-line]'), dots = b.querySelector('[data-okr-dots]');
817
+ if (!line) return;
818
+ line.textContent = L ? L.text : 'Open them in Intelligence';
819
+ if (dots) dots.innerHTML = L ? L.dots.map((d) => OKL.dotHtml(d)).join('') : '';
820
+ }
783
821
  /** The product's page in the Viewer (HbCProduct): Goals, the KRs and budgets with what is at risk, and This week, the weekly update and the
784
822
  * metrics review. A press opens that one; ← comes back to the page. */
785
823
  function openProductPage() {
786
824
  const name = ownProductName();
787
825
  VW.open({ id: 'product', kind: 'Product', title: name, icon: 'chart', rename: productRename(boardWs(), name, 'product'),
788
826
  render: (b) => {
789
- const C = H.productCard(S.D, S.D.now), U = H.weeklyUpdate(S.D, S.D.now), sent = (U.sent || []).some((x) => x.week === U.week.iso);
790
- const goals = C.items.map((x) => itemHtml({ kind: x.kind === 'ok' ? 'done' : 'risk', label: x.label })).join('') || '<p class="hm-none">No KR or budget is anchored on this board.</p>';
827
+ const U = H.weeklyUpdate(S.D, S.D.now), sent = (U.sent || []).some((x) => x.week === U.week.iso);
791
828
  const row = (k, icon, t, sub) => `<div class="hm-r hi-r"><button type="button" class="hm-rm" data-hp="${k}"><span class="hm-tile">${SVG(icon, 14)}</span><span class="hm-rt"><b>${esc(t)}</b><em class="q">${esc(sub)}</em></span></button></div>`;
792
- b.innerHTML = `<div class="hi-v hi-page"><section class="hi-pg" aria-label="Goals"><div class="hi-pgh"><b>Goals</b><span class="hi-n">${esc(C.of)}</span></div>${goals}</section>`
829
+ b.innerHTML = `<div class="hi-v hi-page">${goalsBlock(boardWs())}`
793
830
  + `<section class="hi-pg" aria-label="This week"><div class="hi-pgh"><b>This week</b></div>${row('update', I.doc, 'Weekly update', sent ? 'Sent this week' : 'Ready to send')}${row('metrics', I.chart, 'Metrics review', 'With Strategist')}</section>`
794
831
  + (isPhone() ? `<button type="button" class="hi-talk" data-hp="talk">Message Claude about ${esc(name)}</button>` : '') + '</div>';
832
+ fillGoals(b, boardWs());
795
833
  b.onclick = (e) => {
796
834
  const t = e.target.closest('[data-hp]'); if (!t) return;
797
835
  if (t.dataset.hp === 'update') { VW.drill(); openTarget(updateTarget()); openUpdateViewer(); }
@@ -852,8 +890,21 @@ function programTarget(id, task) {
852
890
  }
853
891
  function homeTarget() {
854
892
  return { key: 'chat:main', ws: WS || undefined, title: 'Home', scope: { text: 'All work', icon: I.home }, rich: false, placeholder: 'Message Claude', role: CLAUDE,
855
- empty: 'Ask anything about your work. Claude reads your repositories and works in a real Claude Code session.', also: alsoOf(null) };
856
- }
893
+ empty: 'Ask anything about your work. Claude reads your repositories and works in a real Claude Code session.', also: alsoOf(null),
894
+ intro: S.impact ? S.impact.intro : undefined };
895
+ }
896
+ /* Your impact (batch 16 item 7): when a finished week has items not checked yet, Home's own chat opens on Claude's check (GmP1Ledger).
897
+ * Off in Settings, or nothing to check: no card. Read after the list is drawn, so it never holds Home up. */
898
+ async function loadImpact() {
899
+ const c = await IMP.readCheck(pmGet).catch(() => null);
900
+ const was = !!S.impact;
901
+ S.impact = c ? { c, intro: IMP.checkIntro(c, { esc, pmPost, done: () => { S.impact = null; drawList(); } }) } : null;
902
+ const cur = chat.current && chat.current();
903
+ if ((was || S.impact) && cur && cur.key === 'chat:main') { chat.open(homeTarget()); }
904
+ if (was || S.impact) drawList();
905
+ }
906
+ // the switch in Settings › General (pm/cozy-settings.js) turns the check off and on at once
907
+ window.addEventListener('pmos:impact', () => { loadImpact(); readImpact(); }); // the switch: the weekly check row and Adler's sprout follow at once
857
908
  function openTarget(t) {
858
909
  S.cur = { title: t.title, ses: t.ses || null, sub: t.sub != null && t.sub !== '' ? t.sub : t.scope && t.scope.text !== t.title ? t.scope.text : '' };
859
910
  chat.open(t); drawTop();
@@ -929,11 +980,11 @@ function goOtherProduct(g) {
929
980
  const own = '/premium.html?ws=' + encodeURIComponent(ws) + '&ini=product';
930
981
  VW.open({ id: 'product:' + ws, kind: 'Product', title: name, icon: 'chart', rename: productRename(ws, name, 'product:' + ws),
931
982
  render: (b) => {
932
- const goals = C.items.map((x) => itemHtml({ kind: x.kind === 'ok' ? 'done' : 'risk', label: x.label })).join('') || '<p class="hm-none">No KR or budget is anchored on this board.</p>';
933
- b.innerHTML = `<div class="hi-v hi-page"><section class="hi-pg" aria-label="Goals"><div class="hi-pgh"><b>Goals</b><span class="hi-n">${esc(C.of)}</span></div>${goals}</section>`
983
+ b.innerHTML = `<div class="hi-v hi-page">${goalsBlock(ws)}`
934
984
  + `<section class="hi-pg" aria-label="This week"><div class="hi-pgh"><b>This week</b></div><div class="hm-r hi-r"><a class="hm-rm" href="${esc(own)}" target="_blank" rel="noopener"><span class="hm-tile">${SVG(I.doc, 14)}</span><span class="hm-rt"><b>Weekly update and metrics review</b><em class="q">In ${esc(name)}'s own Home, in a new tab</em></span></a></div></section>`
935
985
  + (isPhone() ? `<button type="button" class="hi-talk" data-hp="talk">Message Claude about ${esc(name)}</button>` : '') + '</div>';
936
986
  // a phone has no chat beside the page: its own chat is one press away, as on the board's own product (Wawan, 2026-10-25)
987
+ fillGoals(b, ws);
937
988
  b.onclick = (e) => { const t = e.target.closest('[data-hp="talk"]'); if (t) talk(); };
938
989
  } });
939
990
  }
@@ -1553,7 +1604,9 @@ $('#hmList').onclick = (e) => { // delegated: every press on the list is a <bu
1553
1604
  if (d.hmCompact) { compact(d.hmCompact); return; } // ✓ on Claude's ✦ Compact (batch 13 item 8): the pill's list stays open
1554
1605
  if (S.ses && !b.closest('.hv-spp, .hv-sps')) sesPill(null, false); // a press anywhere else in the list closes it
1555
1606
  if (d.hmSel) { if (S.ses) sesPill(null, false); if (S.day) S.day = false; select(d.hmSel); return; }
1607
+ if ('hrImpact' in d) { if (S.day) S.day = false; S.sel = 'impact'; if (isPhone()) S.phoneChat = true; openTarget(homeTarget()); drawList(); return; } // Your impact: Home's own chat, on the weekly check
1556
1608
  if ('hrMentions' in d) { if (S.day) S.day = false; S.sel = 'mentions'; drawList(); MEN.openMentions(menCtx()); return; }
1609
+ if ('hmImpact' in d) { if (S.day) day(false); IM.openWeek(); return; }
1557
1610
  if ('hmDay' in d) { day(!S.day); return; }
1558
1611
  if ('hmDayx' in d) { day(false); return; }
1559
1612
  if ('hmFlt' in d) { filterMenu(b); return; }