create-pmos 0.479.0 → 0.481.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 (50) hide show
  1. package/package.json +26 -27
  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-board-test.js +1 -3
  7. package/workspace/briefing-premium-insights-test.js +6 -6
  8. package/workspace/briefing-premium-metrics-test.js +5 -84
  9. package/workspace/briefing-premium-sources-test.js +6 -1
  10. package/workspace/changelog.json +25 -0
  11. package/workspace/guide/briefing-premium.md +11 -4
  12. package/workspace/guide/programs.md +4 -2
  13. package/workspace/lib/board-pack.js +1 -1
  14. package/workspace/lib/goal-chat.js +3 -0
  15. package/workspace/lib/metric-drafts.js +37 -6
  16. package/workspace/lib/ready-reports.js +6 -4
  17. package/workspace/lib/report-chat.js +8 -4
  18. package/workspace/lib/report-draft.js +14 -5
  19. package/workspace/lib/report-structure.js +35 -1
  20. package/workspace/lib/routes-metric-drafts.js +2 -1
  21. package/workspace/lib/routes-ready-reports.js +6 -2
  22. package/workspace/lib/routes-report-setups.js +24 -4
  23. package/workspace/package-lock.json +2 -2
  24. package/workspace/package.json +1 -1
  25. package/workspace/premium-html-viewer-test.js +2 -0
  26. package/workspace/public/pm/bd-acts.js +2 -20
  27. package/workspace/public/pm/bd-prog-panel.js +1 -2
  28. package/workspace/public/pm/cozy-board.css +0 -11
  29. package/workspace/public/pm/cozy-home.css +5 -0
  30. package/workspace/public/pm/cozy-insights.css +31 -0
  31. package/workspace/public/pm/cozy-vw-rp.css +5 -0
  32. package/workspace/public/pm/dash-view.css +19 -0
  33. package/workspace/public/pm/dash-view.js +49 -11
  34. package/workspace/public/pm/goal-chat.js +10 -3
  35. package/workspace/public/pm/home-app.js +31 -89
  36. package/workspace/public/pm/home-chat.js +19 -4
  37. package/workspace/public/pm/home-goal.js +1 -1
  38. package/workspace/public/pm/home-line.js +16 -1
  39. package/workspace/public/pm/home-list.js +1 -1
  40. package/workspace/public/pm/premium-board.js +2 -2
  41. package/workspace/public/pm/premium-insights.js +64 -11
  42. package/workspace/public/pm/premium-report-read.js +42 -5
  43. package/workspace/public/pm/premium-report-tab.js +89 -24
  44. package/workspace/public/pm/premium-vw-file.js +4 -0
  45. package/workspace/public/pm/prog-page.css +1 -1
  46. package/workspace/public/pm/prog-page.js +6 -3
  47. package/workspace/public/pm/report-chat.js +20 -3
  48. package/workspace/public/pm/trends-review.js +55 -0
  49. package/workspace/ready-dash-ui-test.js +1 -3
  50. package/workspace/test-files.json +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.479.0",
3
+ "version": "0.481.0",
4
4
  "description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -32,6 +32,31 @@
32
32
  "audit"
33
33
  ],
34
34
  "pmosChanges": [
35
+ {
36
+ "v": "0.481.0",
37
+ "at": "2026-11-01T15:21:25.176Z",
38
+ "f": 3,
39
+ "prs": [
40
+ {
41
+ "n": 1141,
42
+ "t": "Batch 22: feedback fixes (held for one merge)",
43
+ "s": "Batch 22: feedback fixes (held for one merge)"
44
+ }
45
+ ]
46
+ },
47
+ {
48
+ "v": "0.480.0",
49
+ "at": "2026-11-01T11:08:09.778Z",
50
+ "f": 3,
51
+ "prs": [
52
+ {
53
+ "n": 1139,
54
+ "t": "Set up a custom report from chat in one press (held)",
55
+ "s": "Set up a custom report from chat in one press (held)",
56
+ "k": "fix"
57
+ }
58
+ ]
59
+ },
35
60
  {
36
61
  "v": "0.479.0",
37
62
  "at": "2026-11-01T10:19:06.142Z",
@@ -270,32 +295,6 @@
270
295
  "k": "fix"
271
296
  }
272
297
  ]
273
- },
274
- {
275
- "v": "0.461.0",
276
- "at": "2026-10-31T01:34:13.377Z",
277
- "f": 3,
278
- "prs": [
279
- {
280
- "n": 1111,
281
- "t": "Remove a repository with its worktrees; keep linked worktrees out of product lists",
282
- "s": "Remove a repository with its worktrees; keep linked worktrees out of product lists",
283
- "k": "fix"
284
- }
285
- ]
286
- },
287
- {
288
- "v": "0.460.0",
289
- "at": "2026-10-31T01:09:44.980Z",
290
- "f": 3,
291
- "prs": [
292
- {
293
- "n": 1112,
294
- "t": "Read a linked worktree's programs as its main tree's",
295
- "s": "Read a linked worktree's programs as its main tree's",
296
- "k": "fix"
297
- }
298
- ]
299
298
  }
300
299
  ]
301
300
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@06948cf0
1
+ kernel-source: pmos@aeb4affe
2
2
  assembled: 2026-11-01
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-01T10:19:03Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-01T15:21:21Z"}
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-01T10:19:03Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-01T15:21:21Z"}
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-01T10:19:03Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-01T15:21:21Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -536,9 +536,7 @@ const IVREAD = () => {
536
536
  ok('T Filter narrows the rows by owner, and the Showing bar says so', await until(() => q.evaluate(() => [...document.querySelectorAll('#ibBody .bt-l')].map((r) => r.dataset.row).sort().join() === 'board:partner-rate-limits,board:sso-partners' && /ShowingOwner: Lee.*Clear all/.test(document.querySelector('#bdShowing').textContent))));
537
537
  await q.click('#bdPop [data-fclear]'); await q.keyboard.press('Escape');
538
538
  ok('T Clear takes the filter off and hides the Showing bar', await q.evaluate(() => document.querySelector('#bdShowing').hidden));
539
- await q.click('#moreBtn'); await q.click('#bdMetrics'); // re-pointed: Metrics moved from the track's footer to the ⋯ menu
540
- ok('T Metrics shows the board\'s tiles, and says which are not on record', await until(() => q.evaluate(() => /Cycle time9 daysmedian, last 90 days/.test(document.querySelector('#czViewer').textContent) && /ThroughputNot on recordNo run log/.test(document.querySelector('#czViewer').textContent))));
541
- await q.keyboard.press('Escape');
539
+ ok('T the ⋯ menu has no Metrics: it moved to Intelligence › Delivery trends', await q.evaluate(() => { document.querySelector('#moreBtn').click(); const gone = !document.querySelector('#bdMetrics'); document.querySelector('#moreBtn').click(); return gone; }));
542
540
  await q.click('#moreBtn'); await q.click('#bdGone');
543
541
  ok('T the cancelled and archived open from the ⋯ menu, with Reopen', await until(() => q.evaluate(() => /Old idea/.test(document.querySelector('#czViewer').textContent) && !!document.querySelector('#czViewer [data-rowact="reopen"]'))));
544
542
  await q.click('#czViewer [data-rowact="reopen"]');
@@ -252,21 +252,21 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
252
252
  const R = await open(), q = R.page, sent = [];
253
253
  await toTrends(q);
254
254
  await q.route(/\/api\/(board-metric-targets\/save|insights-records\/target|insights-records\/tile)/, (r) => { sent.push([new URL(r.request().url()).pathname, JSON.parse(r.request().postData() || '{}')]); r.fulfill({ contentType: 'application/json', body: '{"ok":true,"targets":{}}' }); });
255
- await q.click('#bmBody [data-tile="merges"]'); await until(() => q.evaluate(() => !!document.querySelector('#tgPop')));
255
+ await q.click('#bmBody [data-tile="merges"]'); await q.click('#czViewer [data-tgset]'); await until(() => q.evaluate(() => !!document.querySelector('#tgPop')));
256
256
  const pop = await q.evaluate(() => ({ h: document.querySelector('#tgPop .ins-h3').textContent, dirs: [...document.querySelectorAll('#tgPop [data-v]')].map((b) => b.textContent + ':' + b.getAttribute('aria-pressed')).join(), range: document.querySelector('#tgPop p.note').textContent, chip: document.querySelector('#tgChip').getAttribute('aria-checked'), tile: document.querySelector('#bmBody [data-tile="merges"]').getAttribute('aria-expanded'), say: document.querySelector('#bmBody [data-tile="merges"] .tg').textContent, viewer: !!document.querySelector('#czViewer:not([hidden])') }));
257
257
  ok('G1 a tile press opens its target over the tiles: At least (more merges is better), At most or No target, the tile\'s range, the Board chip (IsTarget)', pop.h === 'Target for merged a week' && pop.dirs === 'At least:true,At most:false,No target:false' && /^Last 3 weeks: 150 to 174, median 160\./.test(pop.range) && /amber only after 2 weeks/.test(pop.range) && pop.chip === 'true' && pop.tile === 'true' && pop.say === 'Setting target…' && !pop.viewer, JSON.stringify(pop));
258
258
  await q.fill('#tgV', '150'); await q.fill('#tgFrom', '2026-10-19'); await q.click('#tgSet'); await until(() => sent.length > 1, 4000);
259
259
  ok('G1 Set target sends the number to the Board\'s target route and how it is read to the page\'s own records', sent[0][0] === '/api/board-metric-targets/save' && sent[0][1].key === 'merges' && sent[0][1].target === 150 && sent[1][0] === '/api/insights-records/tile' && sent[1][1].dir === 'at least' && sent[1][1].from === '2026-10-19' && sent[1][1].chip === true && await until(() => q.evaluate(() => !document.querySelector('#tgPop')), 5000), JSON.stringify(sent)); // the popover closes once both saves answer
260
- await q.click('#bmBody [data-tile="late"]'); await until(() => q.evaluate(() => !!document.querySelector('#tgPop')));
260
+ await q.click('#bmBody [data-tile="late"]'); await q.click('#czViewer [data-tgset]'); await until(() => q.evaluate(() => !!document.querySelector('#tgPop')));
261
261
  await q.fill('#tgV', '0'); await q.click('#tgChip'); await q.click('#tgSet'); await until(() => sent.length > 3, 4000);
262
262
  ok('G1 the Late initiatives target is kept in the page\'s own records, at most by default, and the chip can be left off', sent[2] && sent[2][0] === '/api/insights-records/target' && sent[2][1].key === 'late' && sent[2][1].target === 0 && sent[3][1].dir === 'at most' && sent[3][1].chip === false, JSON.stringify(sent));
263
- await q.click('#bmBody [data-tile="idle"]'); await until(() => q.evaluate(() => !!document.querySelector('#tgPop'))); await q.click('#tgPop [data-v="none"]'); await q.click('#tgSet'); await until(() => sent.length > 5, 4000);
263
+ await q.click('#bmBody [data-tile="idle"]'); await q.click('#czViewer [data-tgset]'); await until(() => q.evaluate(() => !!document.querySelector('#tgPop'))); await q.click('#tgPop [data-v="none"]'); await q.click('#tgSet'); await until(() => sent.length > 5, 4000);
264
264
  ok('G1 No target clears the number', sent[4][1].key === 'idle' && sent[4][1].target === null && sent[5][1].dir === 'none', JSON.stringify(sent.slice(4)));
265
- await q.click('#bmBody [data-tile="scope"]'); await until(() => q.evaluate(() => !!document.querySelector('#tgPop'))); await q.keyboard.press('Escape');
265
+ await q.click('#bmBody [data-tile="scope"]'); await q.click('#czViewer [data-tgset]'); await until(() => q.evaluate(() => !!document.querySelector('#tgPop'))); await q.keyboard.press('Escape');
266
266
  ok('G1 Escape closes the target and gives the tile its focus back', await q.evaluate(() => !document.querySelector('#tgPop') && document.activeElement && document.activeElement.dataset.tile === 'scope'));
267
267
  await q.click('#viewChip'); await q.click('#viewMenu [data-view="trends"]'); await sleep(150);
268
- const tv = await q.evaluate(() => { const T = [...document.querySelectorAll('#bmBody [data-tile]')].map((t) => t.getBoundingClientRect()); return { name: document.querySelector('#viewName').textContent, h: document.querySelector('.ins-trends.big h2').textContent, rows: document.querySelectorAll('#goalTbl [data-goal]').length, cols: T.filter((t) => Math.abs(t.top - T[0].top) < 2).length, tg: [...document.querySelectorAll('#bmBody .tg')].map((x) => x.textContent).join('|') }; });
269
- ok('G1 Delivery trends is a view of its own: the six tiles three to a row, each with its target line', tv.name === 'Delivery trends' && tv.h === 'Delivery trends' && tv.rows === 0 && tv.cols === 3 && tv.tg.split('|').length === 6, JSON.stringify(tv));
268
+ const tv = await q.evaluate(() => { const T = [...document.querySelectorAll('#bmBody [data-tile]')].map((t) => t.getBoundingClientRect()); return { name: document.querySelector('#viewName').textContent, h: document.querySelector('.ins-trends.big h2').textContent, rows: [...document.querySelectorAll('#goalTbl [data-goal]')].filter((r) => !r.closest('.ins-mvd')).length, cols: T.filter((t) => Math.abs(t.top - T[0].top) < 2).length, tg: [...document.querySelectorAll('#bmBody .tg')].map((x) => x.textContent).join('|') }; });
269
+ ok('G1 Delivery trends is a view of its own (only Goals that moved lists goals, batch 22 item 4): the six tiles three to a row, each with its target line', tv.name === 'Delivery trends' && tv.h === 'Delivery trends' && tv.rows === 0 && tv.cols === 3 && tv.tg.split('|').length === 6, JSON.stringify(tv));
270
270
  await R.ctx.close();
271
271
  }
272
272
  {
@@ -3,7 +3,8 @@
3
3
  /* briefing-premium-metrics-test.js — the Metrics card of the premium Board (initiative briefing-premium-metrics; planning/prd/briefing-premium-metrics-prd.md M1 to M10).
4
4
  * Serves the real page from the real server. The Board's answer and the card's answer are served from fixtures (the card's model is built by
5
5
  * lib/board-metrics-premium.js from made-up runs, commits and initiatives); the last blocks ask the real route and compare the card with the mockup.
6
- * C1 place · C2 tiles · C4 definition and values by week · C5 pending and failure · C6 floors · C7 the real route · C9 targets on the Board · C10 the Insights twin
6
+ * C7 the real route · C10 the Insights twin. Batch 22 item 4 moved the Board's Metrics panel (C1–C6, C9) to Intelligence › Delivery trends, so those
7
+ * checks went with it; the Delivery trends view is checked by trends-review.test.js and briefing-premium-insights-test.js.
7
8
  * Re-pointed for the Agreed Board (premium-agreed-design): the Agreed design has no Metrics frame, so the Board keeps the card's function as a plain
8
9
  * panel (pm/bd-acts.js), tagged "Waiting for design", opened from the quiet Metrics link under the stage track. The charts, the week reader (C3), the
9
10
  * dialog with its agent (C4) and the card's geometry (C8) were parts of the retired card: the definition and the values by week stay, in a fold;
@@ -48,94 +49,12 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
48
49
  await T.waitForServer(BASE);
49
50
  browser = await chromium.launch({ executablePath: exe });
50
51
 
51
- const open = async ({ w = 1280, h = 900, theme = 'light', answers = null, url = '/premium-board.html' } = {}) => {
52
- const ctx = await browser.newContext({ viewport: { width: w, height: h } });
53
- const page = await ctx.newPage();
54
- const errors = []; let calls = 0;
55
- page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
56
- await page.route('**/api/board-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: BP.build(F.facts()), as_of: Date.now() }) }));
57
- await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: '{"ok":false}' }));
58
- await page.route('**/api/board-metrics-premium*', (r) => { calls++; const a = answers ? answers(calls) : ready(metrics()); return r.fulfill({ status: a.status, contentType: 'application/json', body: JSON.stringify(a.body) }); });
59
- await page.goto(BASE + url + (url.includes('?') ? '&' : '?') + 'theme=' + theme);
60
- await until(() => page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 20000);
61
- if (await page.isVisible('#moreBtn')) { await page.click('#moreBtn'); await page.click('#bdMetrics'); } else await page.click('#ibBody [data-open="metrics"]'); // re-pointed: Metrics is in the ⋯ menu (desktop) or the phone's plain row
62
- return { ctx, page, errors, calls: () => calls };
63
- };
64
- const tilesOf = (pg) => pg.evaluate(() => [...document.querySelectorAll('#czViewer .bd-met')].map((t) => ({ k: t.dataset.met, s: [...t.querySelector('summary').children].map((c) => c.textContent), look: t.classList.contains('look') })));
65
-
66
- /* C1 */
67
- const A = await open(), p = A.page;
68
- const shown = await until(async () => { const t = await tilesOf(p); return t.length === 4 ? t : null; });
69
- ok('C1 the Metrics link under the track opens the board\'s four measures in the side panel', !!shown);
70
- if (!shown) return finish(1);
71
- const place = await p.evaluate(() => ({ t: document.querySelector('#czViewer .cz-vw-title').textContent, cap: document.querySelector('#metW .bd-amut').textContent, ins: (document.querySelector('#metW a[href^="/premium-intelligence.html"]') || {}).textContent, dlg: !!document.querySelector('#dlg.on') }));
72
- ok('C1 it is a side panel that says which repository it counts and links to Insights; no old dialog', place.t === 'Metrics' && /^counted from idpf/.test(place.cap) && /Targets and longer ranges are on Intelligence/.test(place.ins || '') && !place.dlg, JSON.stringify(place));
73
-
74
- /* C2 */
75
- const t0 = shown;
76
- ok('C2 the first tile is the latest week with its run count, and how it changed', t0[0].k === 'corrections' && t0[0].s[0] === 'Corrections per 100 runs' && t0[0].s[1] === '10.0' && /^week to .+, 10 runs$/.test(t0[0].s[2]) && t0[0].s[3] === 'Down 15.0 vs last week', JSON.stringify(t0[0]));
77
- ok('C2 merges, blocked and idle are counted; blocked and idle say plainly that their history starts today', t0[1].s[1] === '3' && t0[2].s[1] === '1' && t0[2].s[2] === 'of 3 open · history starts today' && t0[3].s[1] === '1' && t0[3].s[2] === 'of 3 open · history starts today', JSON.stringify(t0));
78
- ok('C2 no target and no on-target chip is drawn when none is set; a measure that needs a look says so', !t0.some((x) => x.s.some((y) => /target/i.test(y))) && t0.filter((x) => x.look).every((x) => x.s.includes('Needs a look')), JSON.stringify(t0));
79
- {
80
- const R = await open({ answers: () => ready(metrics({ runs: null, commits: null, inits: null })) });
81
- const t = await until(async () => { const a = await tilesOf(R.page); return a.length === 4 ? a : null; }) || [];
82
- ok('C2 a source that cannot be read says Not read and why, with no number', t.length === 4 && t.every((x) => x.s[1] === 'Not read') && /agent-runs\.jsonl could not be read in idpf/.test(t[0].s[2]), JSON.stringify(t));
83
- await R.ctx.close();
84
- }
85
-
86
- /* C4 the definition and the values by week */
87
- await p.click('#czViewer .bd-met[data-met="corrections"] summary');
88
- const d = await p.evaluate(() => { const t = document.querySelector('#czViewer .bd-met[data-met="corrections"]'); return { open: t.open, def: t.querySelector(':scope > .bd-amut').textContent, wk: t.querySelectorAll('.bd-kv b').length, vals: [...t.querySelectorAll('.bd-kv b')].map((b) => b.textContent) }; });
89
- ok('C4 a measure opens its definition and its values by week; a week with too few runs is not kept', d.open && /per 100 agent runs/.test(d.def) && d.wk === 8 && d.vals[7] === '10' && d.vals[0] === 'Not kept yet', JSON.stringify(d));
90
- ok('C4 the panel holds no press that records anything', await p.evaluate(() => !document.querySelector('#czViewer form, #czViewer [data-act]')));
91
- ok('0 no page error', A.errors.length === 0, A.errors.join(' | '));
92
- await A.ctx.close();
93
-
94
- /* C5 */
95
- {
96
- const R = await open({ answers: (c) => (c < 2 ? ready(metrics({ inits: null, initsPending: true })) : ready(metrics())) });
97
- const idle = async () => { const t = await tilesOf(R.page); return t[2] ? t[2].s[1] : ''; };
98
- ok('C5 while the workflow is derived Blocked says Reading, and the panel asks again until it is filled', await until(async () => /^Reading/.test(await idle())) && await until(async () => (await idle()) === '1', 9000) && R.calls() >= 2, String(R.calls()));
99
- await R.ctx.close();
100
- const F2 = await open({ answers: () => ({ status: 500, body: { ok: false, state: 'error', error: 'the repository could not be read' } }) });
101
- ok('C5 a failed read says why and draws no tile', await until(() => F2.page.evaluate(() => /The reason: the repository could not be read/.test((document.querySelector('#metW') || {}).textContent || '') && !document.querySelector('#czViewer .bd-met'))));
102
- await F2.ctx.close();
103
- }
104
-
105
- /* C6 */
106
- for (const theme of ['light', 'dark']) {
107
- const R = await open({ w: 390, h: 844, theme }), q = R.page;
108
- await until(async () => (await tilesOf(q)).length === 4);
109
- const m = await q.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1, small: [...document.querySelectorAll('#czViewer .bd-met summary')].filter((b) => b.getBoundingClientRect().height < 44).length }));
110
- ok(`C6 at 390 px (${theme}) the panel does not scroll sideways and every measure is 44 px or more`, !m.over && m.small === 0, JSON.stringify(m));
111
- ok(`C6 no page error at 390 px (${theme})`, R.errors.length === 0, R.errors.join(' | '));
112
- await R.ctx.close();
113
- }
114
-
115
52
  /* C7 the real route */
116
53
  {
117
54
  const home = await fetch(BASE + '/api/board-metrics-premium').then((r) => r.json());
118
55
  ok('C7 the real route gives the home workspace its measures', home.ok === true && home.state === 'ready', JSON.stringify(home).slice(0, 300));
119
56
  const post = await fetch(BASE + '/api/board-metrics-premium', { method: 'POST', headers: await T.pressHeaders(BASE), body: '{}' }).then((r) => r.status);
120
57
  ok('C7 the route is read-only', post === 405, String(post));
121
- const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), pg = await ctx.newPage(), errs = [];
122
- pg.on('pageerror', (e) => errs.push(String(e)));
123
- await pg.goto(BASE + '/premium-board.html');
124
- await until(() => pg.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 40000); await sleep(800);
125
- await pg.click('#moreBtn'); await pg.click('#bdMetrics');
126
- ok('C7 the real PMOS board opens its Metrics panel with four measures and no script error', await until(() => pg.evaluate(() => document.querySelectorAll('#czViewer .bd-met').length === 4), 30000) && errs.length === 0, errs.join(' | '));
127
- await ctx.close();
128
- }
129
-
130
- /* C9 a target set on Insights shows on the Board */
131
- {
132
- const R = await open({ answers: () => ready(metrics({ targets: { corrections: { target: 12 }, merges: { target: 5 } } })) }), q = R.page;
133
- const t = await until(async () => { const a = await tilesOf(q); return a.length === 4 ? a : null; }) || [];
134
- ok('C9 a measure on target says On target with its target', t[0] && t[0].s.includes('On target · target 12.0') && !t[0].look, JSON.stringify(t[0]));
135
- ok('C9 a measure off target says its gap and is outlined', t[1] && t[1].s.includes('2 short · target 5') && t[1].look, JSON.stringify(t[1]));
136
- ok('C9 a measure with no target shows none', t[2] && !t[2].s.some((y) => /target/.test(y)) && !t[3].s.some((y) => /target/.test(y)), JSON.stringify(t.slice(2)));
137
- ok('C9 no page error', R.errors.length === 0, R.errors.join(' | '));
138
- await R.ctx.close();
139
58
  }
140
59
 
141
60
  /* C10 the Insights page shows the same measures (Delivery trends), and a target saved there is sent for the Board */
@@ -154,7 +73,9 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
154
73
  ok('C10 Insights\' Delivery trends show the Board\'s measures with the same values', !!v && v.corrections === '10.0' && v.merges === '3' && v.idle === '1', JSON.stringify(v));
155
74
  // premium-uncovered-features (IsTarget): a tile opens the target popover under it, and the number goes to the Board's target route.
156
75
  await q.route('**/api/insights-records/tile', (r) => r.fulfill({ contentType: 'application/json', body: '{"ok":true,"tiles":{}}' }));
157
- await q.click('#bmBody [data-tile="merges"]'); await until(() => q.evaluate(() => !!document.querySelector('#tgPop #tgV')));
76
+ // batch 22 item 4: a tile opens its weeks in the Viewer; the target icon there opens the popover
77
+ await q.click('#bmBody [data-tile="merges"]'); await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-tgset]')));
78
+ await q.click('#czViewer [data-tgset]'); await until(() => q.evaluate(() => !!document.querySelector('#tgPop #tgV')));
158
79
  await q.fill('#tgV', '5'); await q.click('#tgSet');
159
80
  ok('C10 a target saved on Insights goes to the Board\'s target route, for this board', await until(() => saves.length === 1) && saves[0].key === 'merges' && saves[0].target === 5, JSON.stringify(saves));
160
81
  ok('C10 no page error', errs.length === 0, errs.join(' | '));
@@ -157,7 +157,12 @@ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
157
157
  }
158
158
  // the panel rises into place: measure the line once it has a width, not while it is still animating in (H4 read 0 px)
159
159
  await page.waitForFunction(() => { const e = document.querySelector('#evSettings #srcHealth'); return !!e && e.getBoundingClientRect().width > 0; }, null, { timeout: 15000 });
160
- const line = await page.$eval('#evSettings #srcHealth', (e) => ({ text: e.textContent.trim(), dot: (e.querySelector('.ev-dot') || {}).className || '', w: Math.round(e.getBoundingClientRect().width), sw: document.documentElement.scrollWidth }));
160
+ // Home may draw the panel again after it opens (batch 22: the line read 0 px between two draws), so read it until it has its width
161
+ let line = null;
162
+ for (let k = 0; k < 25 && !(line && line.w > 0); k++) {
163
+ if (k) await page.waitForTimeout(200);
164
+ line = await page.$eval('#evSettings #srcHealth', (e) => ({ text: e.textContent.trim(), dot: (e.querySelector('.ev-dot') || {}).className || '', w: Math.round(e.getBoundingClientRect().width), sw: document.documentElement.scrollWidth })).catch(() => null);
165
+ }
161
166
  if (theme === 'light') {
162
167
  ok('H2 Settings › Connectors opens with the background line on top, in the level\'s colour', line.text.startsWith(h.line.slice(0, 20)) && line.dot === 'ev-dot ' + (h.level === 'ok' ? 'ok' : 'risk'), JSON.stringify(line));
163
168
  ok('H3 no Sources chip and no dot are drawn on the page; the line above carries the level (premium-agreed-design)', dot === 'none', dot);
@@ -1,4 +1,29 @@
1
1
  [
2
+ {
3
+ "v": "0.481.0",
4
+ "at": "2026-11-01T15:21:25.176Z",
5
+ "f": 3,
6
+ "prs": [
7
+ {
8
+ "n": 1141,
9
+ "t": "Batch 22: feedback fixes (held for one merge)",
10
+ "s": "Batch 22: feedback fixes (held for one merge)"
11
+ }
12
+ ]
13
+ },
14
+ {
15
+ "v": "0.480.0",
16
+ "at": "2026-11-01T11:08:09.778Z",
17
+ "f": 3,
18
+ "prs": [
19
+ {
20
+ "n": 1139,
21
+ "t": "Set up a custom report from chat in one press (held)",
22
+ "s": "Set up a custom report from chat in one press (held)",
23
+ "k": "fix"
24
+ }
25
+ ]
26
+ },
2
27
  {
3
28
  "v": "0.479.0",
4
29
  "at": "2026-11-01T10:19:06.142Z",
@@ -457,10 +457,13 @@ Sending and the option presses need the page's launch nonce, so an agent session
457
457
 
458
458
  Any chat can become a report. There is no button for it: say it in the chat, for example "make this a report for the growth leads" or "make it weekly on Wednesdays". Claude answers in a few lines, and the **Report** tab opens beside the conversation (on a phone, a bar over the message box offers it). The chip under Claude's answer opens the tab again.
459
459
 
460
- - **A new report** shows its name, what it answers, who reads it, its format and the seven sections every new report has. **Set it up** records it and writes its first draft. If you did not say a schedule, its **Schedule** is **Off**: it runs once, and you can give it a schedule later. If you asked for other contents, or Claude proposed them, **Structure and look** shows that change. The first draft uses the seven sections. Right after **Set it up**, Claude starts the change, and **Use this** keeps the new sections.
460
+ - **A new report** shows its name, what it answers, who reads it, its format and its sections. The chip under Claude's answer says **Set it up in the Report tab**. Press ✓ (**Set it up**) at the top of the tab: that one press records the report and writes its first draft. If you did not say a schedule, its **Schedule** is **Off**: it runs once, and you can give it a schedule later.
461
+ - **Your own sections.** Name them in the chat, for example "use these sections: Decision question; Current position; Options and recommendation; Open items; Sources". The tab shows them as the slides. ✓ saves them as the report's structure (S1), and the first draft follows them. Your first section is the report's lead, the one before Sources holds the asks to the readers, and Sources is always last. If you describe a change without a list, **Structure and look** shows the change: the first draft uses the seven standard sections, Claude starts the change right after ✓, and **Use this** keeps it. When you press **Use this**, Claude writes the draft again with the new sections.
462
+ - **A look to follow.** Say how the report should look, or name a file for it to follow, such as your draft deck (a PDF, PowerPoint, Word file or picture). **Structure and look** shows **Look** with the file's name. After ✓, Claude adds the file as the look's sample and makes the look from it.
463
+ - **While Claude works.** When Claude reshapes the sections, makes the look or writes the draft again, a line with a pulsing dot says so on the report and in the tab, and says how long it takes. The line goes when the work is done, and the new draft opens in its place.
461
464
  - **Schedule** is a chip on the tab. Press it to pick **Off**, **Daily**, **Weekly**, **Every two weeks** or **Monthly**, and a day for a weekly one. Or say it in the chat; Claude's proposal shows with **Change the schedule**. Off pauses the template and keeps its schedule for later.
462
465
  - **Structure** and **Design** show the report's versions (S1, S2, … and D1, D2, …). Say a change in the chat ("leave out the timeline", "use the theme of my sample"); the tab shows it with **Make the next version**. **Use this** or **This is it** saves the version shown, and **Undo** goes back one.
463
- - **Reports** lists the template's cycles. A **draft** can be discarded until it is issued. An **issued** report is kept for good: it can be archived (hidden) and brought back, never deleted.
466
+ - **Reports** lists the template's cycles. A **draft** can be discarded until it is issued, also while Claude makes a new version. An **issued** report is kept for good: it can be archived (hidden) and brought back, never deleted.
464
467
  - **Delete template** stops its schedule now. Its issued reports and its open draft stay, with its name.
465
468
 
466
469
  Charts and dashboards work the same way. Say "chart partner activation as bars" or "make a dashboard for the Monday partner review", and the **Chart** or **Dashboard** tab opens beside the conversation.
@@ -499,17 +502,21 @@ Press **+** at the left of the message box. The menu has three items: **Add file
499
502
  - In the conversation, your message shows its files as chips above your words. Press a chip to open the file in the viewer. A photo shows as the picture and a PDF shows as the document. For other files, the viewer gives **Download**.
500
503
  - A dialog with no conversation has no **+**.
501
504
 
505
+ ### Open a file Claude names
506
+
507
+ A PDF that Claude names opens in the Viewer, in the browser's own PDF viewer. Other files show as text.
508
+
502
509
  ### Give Claude a goal with `/goal`
503
510
 
504
511
  Type `/` in the box to see the commands: `/goal`, `/compact` and `/clear`. Use the arrow keys and Enter, or press one.
505
512
 
506
513
  - **`/goal <what you want>`** asks Claude to make the goal SMART before any work. Claude reads the records first, then asks only what it could not find out: at most 5 questions, one at a time, about how you will know it is done, by when, whether it can be done here, and what it serves.
507
- - **Each question** shows its answers as buttons, with the recommended one marked. Press one, or answer in your own words. **Start with defaults** stops the questions; a value you did not give is marked "assumed".
514
+ - **Each question** shows its answers as buttons, with the recommended one marked. Press one, or answer in your own words. A pressed answer turns blue and says **Sent**, and the others wait until Claude answers. While the goal is agreed, the Viewer shows the goal so far. Your bubble shows only what you typed, never the rule PMOS adds. **Start with defaults** stops the questions; a value you did not give is marked "assumed".
508
515
  - **The goal card** is in the viewer, in a **Goal** tab, like Notes. The conversation shows only a small Goal chip with the goal's state; press it to open the tab. On a phone the tab covers the page, and **Back** returns to the conversation.
509
516
  - **The card** shows the goal, its done points, what Claude may do, what it serves, the deadline and the round limit. Nothing runs until you press **Start** (under Claude's message or in the Goal tab). **Change something** lets you say what to change; **Cancel** drops the goal.
510
517
  - **Start** tells Claude to work on the goal until every done point is met. Merging follows your standing rule (merge once required CI is green). Claude asks before anything that is sent to other people.
511
518
 
512
- - **While it works**, the Goal tab shows the round, each done point met or open, and the deadline. The points are Claude's own report, so the card says "unverified". Each time Claude would stop with a point still open, it is told to keep going.
519
+ - **While it works**, the Goal tab shows the round, each done point met or open, and the deadline. Claude keeps its to-do list as the done points, so each point ticks the moment Claude marks it done, inside the round; the round's own report still decides at its end. The points are Claude's own report, so the card says "unverified". Each time Claude would stop with a point still open, it is told to keep going.
513
520
  - **It stops by itself** when Claude reports every point met (Done), when it needs you (Needs you: answer it in the box and it goes on), at the deadline, after the round limit (12 unless the goal says fewer), or after 3 rounds that met no new point. The card says which.
514
521
  - **When the goal changes** (it starts, a point is met, it stops, it needs you, it is done), the Goal tab opens by itself on a desktop. On a phone a bar over the box offers it, so the conversation stays in view.
515
522
  - **Stop the goal** is in the Goal tab. It presses Esc in the session and ends the goal.
@@ -47,9 +47,11 @@ Press a program's name on the Board to open its panel. Home links to it with `?p
47
47
  The Viewer of a program, and the product page, are one page. There is no Work and Dashboard switch.
48
48
 
49
49
  - The top shows Claude's ✦ line, then the goal card with its milestones and the forecast bar. Goals show a short title, not the KR's full text.
50
- - When Claude proposes changes, a folded row under the goal card counts them. Only the owner sees this row.
50
+ - Each goal row shows the KR as a chip, then a short title, then one grey line on how it reads. The KR id alone is never the title.
51
+ - When Claude proposes changes, a folded row under the goal card counts them. Only the owner sees this row. Press it to open every proposal, each with Claude's pick: ✕ drops it, ✎ opens it to change, ✓ keeps the pick.
52
+ - On the product page, the same row also holds **Goals I would change**: a KR whose wording reads badly, with the old words struck through, the new words, one reason and a test read (its source and number). Claude lists a goal only when its test read returned a number.
51
53
  - The tabs are **Tasks**, **Initiatives** (the default), **Reports** and **Documents**.
52
- - The product page also shows a **Programs** card and a **Health budgets** card.
54
+ - The product page also shows a **Programs** card and a **Health budgets** card. Its **Initiatives** tab lists the product's own initiatives, then one card for each program that holds some of them.
53
55
  - A teammate on a shared board sees the same page, with no proposals.
54
56
 
55
57
  ## Claude suggests milestones
@@ -114,7 +114,7 @@ function pruneRecords(v, outside) {
114
114
  * It keeps the ✦ line's words, the goals with their short titles, the milestones or launches, and the reports by name and state. It drops the
115
115
  * proposals and their count, the goal Claude drafted, the promise date it guessed, Send by itself, a heads-up draft, a held source, and every
116
116
  * report's press (its path, its issue slot): a copy sends nothing and opens no file of the publisher's. */
117
- const DASH_DROP = new Set(['needs', 'needsN', 'drafts', 'trust', 'heldBy', 'opens']);
117
+ const DASH_DROP = new Set(['needs', 'needsN', 'needsList', 'drafts', 'trust', 'heldBy', 'opens']);
118
118
  const REP_KEEP = ['id', 'kind', 'name', 'sub', 'state'];
119
119
  function teammateDash(d) {
120
120
  if (!d || typeof d !== 'object') return null;
@@ -72,7 +72,10 @@ function startMessage(draft) {
72
72
  JSON.stringify(draft),
73
73
  'Do whatever the goal needs, as the PM would. Do not stop to ask for approval, feedback or a choice: pick the sensible option yourself, say in one line what you chose, and go on. Merging follows the PM\'s standing rule (merge once required CI is green).',
74
74
  'Stop for the PM only when the work cannot go on without them: a sign-in or secret only they have, or a message that goes to other people. Then do every other open point first, and end with needs-you and exactly what you need.',
75
+ 'Keep your to-do list (TodoWrite) as the done points, word for word, one item each. Mark the one you work on in_progress, and mark it completed the moment it is met, so the PM sees each point tick as you go.',
75
76
  'At the end of each message about this goal, add a fenced pmos-goal block: {"step":"progress","state":"working|done|needs-you","met":["done points met"],"open":["done points still open"]}. Copy each done point word for word. Report done only after you checked every point.',
77
+ // batch 22 item 13 (Wawan, 2026-11-01): "6 of 6 met" while the report the goal asked for was only proposed
78
+ 'A done point that names a thing to make (a report, slides, a deck, a document) is met only when that thing exists where the PM reads it, opened and checked by you. A proposal, a plan or a draft waiting for a PM press does not meet it: that point stays open, and you end with needs-you and the one press.',
76
79
  ].join('\n');
77
80
  }
78
81
  const cancelMessage = () => MARK.cancel + ' The PM cancelled this goal. Do no more work for it and say in one line what you stopped.';
@@ -117,7 +117,7 @@ function append(dir, actor, ev, at) {
117
117
  const LIM = { name: 80, txt: 40, why: 160, source: 40, key: 24, text: 400, unit: 12, pillar: 80, label: 40 };
118
118
  const numOrNull = (v) => (v === null || v === undefined || v === '' ? { v: null } : fin(v) ? { v } : { error: true });
119
119
  /** → { row } | { error }. input: { group, name, type, now, nowTxt, target, targetTxt, by, why, source, ticket, checkpoints, direction, unit, pillar } */
120
- function clean(scope, input) {
120
+ function clean(scope, input, o = {}) {
121
121
  if (!SCOPES.includes(scope)) return { error: 'scope is one of ' + SCOPES.join(', ') };
122
122
  if (!isObj(input)) return { error: 'a row is a JSON object' };
123
123
  const group = str(input.group);
@@ -144,7 +144,7 @@ function clean(scope, input) {
144
144
  const by = input.by == null || input.by === '' ? null : String(input.by);
145
145
  if (by != null && !DAY_RE.test(by)) return { error: 'by is YYYY-MM-DD' };
146
146
  if (by == null && type !== 'Stay within') return { error: 'by is the date the target is due (YYYY-MM-DD); only a Stay within guardrail may have none' };
147
- if (now.v != null && target.v != null && now.v === target.v) return { error: type === 'Stay within' ? 'the limit equals the reading now: give the limit the evidence says (the worst week of the last 8, a service level)' : 'the target equals now: a target moves the metric' };
147
+ if (now.v != null && target.v != null && now.v === target.v && !(o.hold && type === 'Stay within')) return { error: type === 'Stay within' ? 'the limit equals the reading now: give the limit the evidence says (the worst week of the last 8, a service level)' : 'the target equals now: a target moves the metric' };
148
148
  const direction = ['up', 'down'].includes(input.direction) ? input.direction : null;
149
149
  const checkpoints = [];
150
150
  if (input.checkpoints != null) {
@@ -180,7 +180,11 @@ function cleanFix(scope, id, input) {
180
180
  let key = '';
181
181
  if (kind === 'outcome' || kind === 'next-quarter') {
182
182
  if (kind === 'outcome' && (!goal || !old)) return { error: 'an outcome names its goal (the KR) and its old, project-shaped title (old)' };
183
- const m = clean(scope, { ...(isObj(input.metric) ? input.metric : {}), group: 'Key results' });
183
+ // a limit with no number of its own is today's count: "no worse than now" (batch 22 item 5). Never invented: it needs a measured now.
184
+ const mi = { ...(isObj(input.metric) ? input.metric : {}), group: 'Key results' };
185
+ const hold = kind === 'outcome' && mi.type === 'Stay within' && (mi.target == null || mi.target === '') && fin(mi.now);
186
+ if (hold) { mi.target = mi.now; if (!mi.targetTxt) mi.targetTxt = mi.nowTxt || String(mi.now); if (!mi.direction) mi.direction = 'down'; }
187
+ const m = clean(scope, mi, { hold });
184
188
  if (m.error) return { error: 'metric: ' + m.error };
185
189
  row.metric = m.row; key = m.row.name.toLowerCase();
186
190
  if (input.recipe != null) { const r = recipeOf(input.recipe); if (r.error) return r; row.recipe = r.recipe; }
@@ -249,11 +253,21 @@ function recipeOf(r) {
249
253
  /* ── the PM's inline edit of an open draft (batch 16 item 1): its name, its target and where it is measured. The rest (why, now, the group) stays
250
254
  * Claude's: a change to those is asked of Claude in Home's chat. The target keeps the draft's own way of writing it ("≤ 3%", "$1,200"): the first
251
255
  * number in it is replaced. ── */
252
- const EDIT_KEYS = ['name', 'target', 'targetTxt', 'source', 'text', 'body', 'recipe']; // recipe: only the compare pick (lib/routes-goal-status.js)
256
+ const EDIT_KEYS = ['name', 'target', 'targetTxt', 'source', 'text', 'body', 'recipe', 'metric']; // recipe: only the compare pick (lib/routes-goal-status.js)
253
257
  function editOf(row, input) {
254
258
  if (!isObj(row)) return { error: 'There is no such draft.' };
255
259
  if (!isObj(input)) return { error: 'An edit is { name?, target?, source? }.' };
256
260
  const set = {};
261
+ if (row.kind === 'outcome' && isObj(row.metric)) { // a goal Claude would reword (batch 22 item 5): the new wording and its number, nothing else
262
+ const m = { ...row.metric };
263
+ if (input.name !== undefined) { const n = one(input.name, LIM.name); if (!n) return { error: 'The wording is the goal, in a few words.' }; m.name = n; }
264
+ if (input.target !== undefined && m.type !== 'Done or not') {
265
+ const t = typeof input.target === 'string' && input.target.trim() !== '' ? Number(input.target.replace(/[,\s]/g, '')) : input.target;
266
+ if (!fin(t)) return { error: 'The target is a number.' };
267
+ if (t !== m.target) { const was = String(m.targetTxt || ''), x = /-?\d[\d,]*(\.\d+)?/.exec(was); m.target = t; m.targetTxt = one(x ? was.slice(0, x.index) + String(t) + was.slice(x.index + x[0].length) : String(t), LIM.txt); }
268
+ }
269
+ return { set: m.name !== row.metric.name || m.target !== row.metric.target ? { metric: m } : {} };
270
+ }
257
271
  if (row.kind && row.kind !== 'metric') { // a fix row: its line, and a chase's note (the rest is Claude's evidence)
258
272
  if (input.text !== undefined) { const t = one(input.text, FLIM.text); if (!t) return { error: 'The line says the fix.' }; if (t !== row.text) set.text = t; }
259
273
  if (input.body !== undefined && row.kind === 'chase') { const b = one(input.body, FLIM.body); if (!b) return { error: 'The note has words in it.' }; if (b !== row.body) set.body = b; }
@@ -372,7 +386,7 @@ function keepFields(scope, id, row, o = {}) {
372
386
  f.unit = row.unit || UNIT_OF[type] || '';
373
387
  }
374
388
  if (!DAY_RE.test(String(by || '')) && !f.always_on) return { error: 'This draft has no date, so it cannot be kept.' };
375
- if (baseline === target) return { error: 'The target equals the baseline, so there is nothing to move. Drop it or draft again.' };
389
+ if (baseline === target && type !== 'Stay within') return { error: 'The target equals the baseline, so there is nothing to move. Drop it or draft again.' };
376
390
  Object.assign(f, { baseline, target, ...(by ? { by } : {}), direction, source: row.source || '', why: row.why || '' });
377
391
  if (now == null && type !== 'Done or not') f.measured = false;
378
392
  if (row.ticket) f.ticket = { key: row.ticket.key, text: row.ticket.text };
@@ -385,7 +399,24 @@ function keepFields(scope, id, row, o = {}) {
385
399
  return { fields: f, reading: now != null && DAY_RE.test(String(o.today || '')) ? { at: o.today, value: now } : null };
386
400
  }
387
401
 
402
+ /** The goals Claude would reword (batch 22 item 5, canvas RdKrKeep): the open outcome rows of a product, from viewOf. A goal is listed only when its
403
+ * test read returned a number (proven only): the live read of lib/metric-reads.js (row.live), else the reading the run drafted it from, which
404
+ * names its source. One without a number is not listed; it becomes one quiet line. → { items, quiet } */
405
+ function krProposalsOf(view) {
406
+ const items = [], quiet = [];
407
+ for (const r of (view && view.rows) || []) {
408
+ if (r.kind !== 'outcome' || r.state !== 'open' || !isObj(r.metric)) continue;
409
+ const m = r.metric, live = r.live && r.live.ok && !r.live.held && fin(r.live.value) ? r.live : null;
410
+ const now = live ? live.value : fin(m.now) && m.source ? m.now : null;
411
+ if (now == null) { quiet.push({ id: r.id, goal: r.goal || '', line: (r.goal ? r.goal + ' stays as it is. ' : '') + (r.why || 'Nothing can read it yet.') }); continue; }
412
+ items.push({ id: r.id, goal: r.goal || '', old: r.old || '', name: m.name, why: r.why || '', now, nowTxt: live && live.txt ? live.txt : m.nowTxt || String(now),
413
+ target: fin(m.target) ? m.target : null, targetTxt: m.targetTxt || '', source: (live && live.source) || m.source || '', how: (r.rhythm && r.rhythm.txt) || '', at: live ? live.at : null,
414
+ act: r.act || 'Keep' });
415
+ }
416
+ return { items, quiet };
417
+ }
418
+
388
419
  /** How many fix rows one run filed. */
389
420
  function fixesIn(s, run) { let n = 0; if (s) for (const r of s.rows.values()) if (r.run === run && r.kind && r.kind !== 'metric') n++; return n; }
390
421
 
391
- module.exports = { LEDGER, SCOPES, GROUPS, LIMITS, ROLES, TYPES, STEPS, WHEN, WHYS, WINDOW, FIXES, CADENCES, WEEKDAYS, FIX_LIMIT, countsOf, ledgerFile, readLines, read, append, fold, viewOf, clean, cleanFix, recipeOf, keepFields, editOf, rowId, keyOf, countIn, fixesIn };
422
+ module.exports = { LEDGER, SCOPES, GROUPS, LIMITS, ROLES, TYPES, STEPS, WHEN, WHYS, WINDOW, FIXES, CADENCES, WEEKDAYS, FIX_LIMIT, countsOf, ledgerFile, readLines, read, append, fold, viewOf, clean, cleanFix, recipeOf, keepFields, editOf, krProposalsOf, rowId, keyOf, countIn, fixesIn };
@@ -371,7 +371,7 @@ function whenTxt(iso, now) { const t = Date.parse(iso); if (!fin(t)) return 'a w
371
371
  * program the program record (lib/programs.js), on a program scope
372
372
  * jiraOf { [initiative id]: { at, tickets: [{ category, resolved }] } }
373
373
  * checklist the initiative's exit checklist [{ text, done, who, when }] (its stepper), before Build
374
- * needs [{ id, q, sub, pick, from, ini, keep, drop }] the open proposals, the slips first
374
+ * needs [{ id, q, sub, pick, from, ini, keep, drop }] the open proposals, the slips first (the model keeps the first as needs and all as needsList)
375
375
  * products [{ ws, name, read, why, asked }] on a program
376
376
  * reports the Reports block's rows (rowsFor)
377
377
  * trust { reportId } | null goalDraft { title, sub, anchor } | null kept the PM's promise line for the scope
@@ -406,7 +406,7 @@ function dashboardOf(f) {
406
406
  scope: f.scope, level: P.level, name: f.name || '', sub: f.sub || '',
407
407
  opens: f.from === 'act' ? 'work' : 'dashboard',
408
408
  handled, goals, drafts: Object.keys(drafts).length ? drafts : null, stage, guardrails: stage && (stage.kind === 'did-it-work' || P.level === 'product') ? guardrails : [],
409
- needs, needsN: allNeeds.length, reports, heldBy: f.stale || null, trust: f.trust || null,
409
+ needs, needsN: allNeeds.length, needsList: allNeeds, reports, heldBy: f.stale || null, trust: f.trust || null,
410
410
  done: closedWeek ? { text: plural(closedWeek, 'ticket', 'tickets') + ' closed this week' } : null,
411
411
  products: P.level === 'program' && multi ? (f.products || []) : [],
412
412
  asOf: today,
@@ -503,8 +503,10 @@ function anchorGoalsOf(rows, covered) {
503
503
  const bad = L.filter((r) => r.late || /risk|late|stalled|blocked/.test(String(r.status || '').toLowerCase()));
504
504
  const health = a === 'Health budget' || /^health:/.test(a);
505
505
  const title = /^health:/.test(a) ? a.slice(7) + ' health budget' : a;
506
- return { id: a, title, short: shortTitle(title).short, ...(/^KR \d/.test(a) ? { kr: a } : {}), ...(health ? { budget: true } : {}), owner: '', dot: bad.length ? 'behind' : 'on', from: 'anchor',
507
- sub: bad.length ? clip(bad[0].title || bad[0].id, 50) + ' is ' + (bad[0].late ? 'running late' : String(bad[0].status || 'at risk').toLowerCase()) : 'No reading yet · ' + plural(L.length, 'initiative is', 'initiatives are') + ' on their dates' };
506
+ // no goal record names this KR: the chip carries the id, the title says the one fact known (never an invented goal), the grey line says what is missing
507
+ const fact = bad.length ? clip(bad[0].title || bad[0].id, 50) + ' is ' + (bad[0].late ? 'running late' : String(bad[0].status || 'at risk').toLowerCase()) : plural(L.length, 'initiative is', 'initiatives are') + ' on their dates';
508
+ return { id: a, title, short: fact, noText: true, ...(health || /^KR[\s-]?[\w.]+$/i.test(a) ? { kr: a } : {}), ...(health ? { budget: true } : {}), owner: '', dot: bad.length ? 'behind' : 'on', from: 'anchor',
509
+ sub: 'No goal text yet · ' + (bad.length ? plural(bad.length, 'initiative', 'initiatives') + ' behind' : 'no reading yet') };
508
510
  });
509
511
  }
510
512
 
@@ -10,7 +10,7 @@
10
10
  const MARK = '[PMOS report]';
11
11
  const SAYS = 'The PM says: ';
12
12
  // A message about a report, a chart or a dashboard. Other messages go to the session as typed.
13
- const ASK_RE = /\b(reports?|charts?|graphs?|dashboards?)\b/i;
13
+ const ASK_RE = /\b(reports?|charts?|graphs?|dashboards?|sections)\b/i;
14
14
 
15
15
  const isAsk = (text) => ASK_RE.test(String(text == null ? '' : text)) && !String(text).trim().startsWith('/');
16
16
 
@@ -20,9 +20,13 @@ const RULE = [
20
20
  'You never set up, schedule, change or delete a report yourself, and you never write report-setups.jsonl: the PM presses in the tab.',
21
21
  '- A new report: {"kind":"report","proposal":{"name":"short name","purpose":"what it answers, one line","audience":"who reads it","output":"google-doc|google-slides|google-sheets|confluence|pdf","schedule":null,"sources":["what it draws from"]}}',
22
22
  ' schedule stays null unless the PM named one; then it is {"cadence":"daily|weekly|bi-weekly|monthly","day":"Mon","dayOfMonth":1,"time":"09:00"}. A report with no schedule runs once.',
23
- ' A new report always starts with the standard sections: Headline, Timeline, Initiatives, New since last report, Decided this cycle, Needs your call, Sources. When the PM wants other contents (or you propose them), add "structure": "the sections it should have instead, in plain words" next to "proposal". Once the PM sets it up, the tab starts that change at once and the PM keeps it with one press.',
24
- ' In your words, say what the tab will show: the standard sections, and the change in "structure" if there is one. Never describe contents the block does not carry.',
25
- '- A report that is set up already: {"kind":"report","id":"<its id>"} and, only when the PM asked for it, "schedule": {…} or "off", "structure": "the change to its sections, in the PM\'s words", "design": "the change to its look, in the PM\'s words".',
23
+ ' A new report starts with the standard sections: Headline, Timeline, Initiatives, New since last report, Decided this cycle, Needs your call, Sources.',
24
+ ' When the PM names the sections (or you propose a list and the PM agrees), add "sections": ["Section title", …] next to "proposal": the titles in order, up to 10, in the PM\'s words. The tab shows them, and setting it up saves them and drafts the first report with them.',
25
+ ' When the PM wants other contents but names no list, add "structure": "the change, in plain words" instead. Once the PM sets it up, the tab starts that change and the PM keeps it with one press.',
26
+ ' When the PM says how it should look, or asks it to follow a file (a draft deck, a sample), add "design": "the look, in the PM\'s words" and, for a file, "sample": "<its path in the workspace>" (a .pdf, .pptx, .docx, .png or .jpg). Once the PM sets it up, the tab adds the sample and starts that look.',
27
+ ' The PM sets a new report up with ONE press: the check button (Set it up) at the top of the Report tab. Name it like that. Never say Create, Save or any other button.',
28
+ ' In your words, say what the tab will show: the sections it will have, then the one press. Never describe contents the block does not carry.',
29
+ '- A report that is set up already: {"kind":"report","id":"<its id>"} and, only when the PM asked for it, "schedule": {…} or "off", "sections": ["the new section titles, in order"] or "structure": "the change to its sections, in the PM\'s words", "design": "the change to its look, in the PM\'s words".',
26
30
  ' The set-up reports are the setup lines of report-setups.jsonl (planning/ or pmos/state/); a later change line wins, a remove line deletes one.',
27
31
  '- A chart of one measure: {"kind":"chart","proposal":{"measure":"<KR metric id>","title":"short title","question":"what it answers","form":"line|bars|number|meter","range":null,"target":null,"better":"higher|lower","note":""}}',
28
32
  ' measure is the id of a KR metric record (planning/records/kr-metrics.jsonl). range is how many of the latest readings to draw, or null for all. A meter needs a target.',