create-pmos 0.827.0 → 0.829.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 (103) hide show
  1. package/package.json +217 -45
  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/bin/pmos.js +19 -9
  7. package/workspace/board-deliveries-test.js +2 -2
  8. package/workspace/changelog.json +216 -12
  9. package/workspace/guide/cli.md +62 -0
  10. package/workspace/guide/home.md +1 -0
  11. package/workspace/guide/settings-and-switches.md +1 -0
  12. package/workspace/lib/board-cli.js +5 -1
  13. package/workspace/lib/board-premium.js +1 -0
  14. package/workspace/lib/critical-needs.js +162 -0
  15. package/workspace/lib/deps-cli.js +102 -0
  16. package/workspace/lib/engine/boards.js +13 -2
  17. package/workspace/lib/features.json +5 -0
  18. package/workspace/lib/five-action-cap.js +84 -0
  19. package/workspace/lib/needs-providers.js +1 -0
  20. package/workspace/lib/page-one-answer.js +86 -0
  21. package/workspace/lib/pages-cli.js +6 -2
  22. package/workspace/lib/people-cli.js +43 -2
  23. package/workspace/lib/pmos-verbs.js +15 -1
  24. package/workspace/lib/portfolio-cli.js +64 -0
  25. package/workspace/lib/portfolio.js +168 -0
  26. package/workspace/lib/prototype-cli.js +86 -0
  27. package/workspace/lib/report-cli.js +12 -2
  28. package/workspace/lib/report-readers.js +5 -3
  29. package/workspace/lib/review-pack.js +348 -0
  30. package/workspace/lib/review-reasons.js +357 -0
  31. package/workspace/lib/route-modules.js +6 -0
  32. package/workspace/lib/routes-boards.js +25 -2
  33. package/workspace/lib/routes-portfolio.js +50 -0
  34. package/workspace/lib/routes-review-pack.js +42 -0
  35. package/workspace/lib/routes-roadmap-ops.js +53 -1
  36. package/workspace/lib/routes-sim-users.js +66 -0
  37. package/workspace/lib/routes-stakeholders.js +42 -0
  38. package/workspace/lib/routes-strategy-card.js +29 -1
  39. package/workspace/lib/routes-team-waits.js +24 -0
  40. package/workspace/lib/routes-use-log.js +6 -1
  41. package/workspace/lib/sim-users.js +329 -0
  42. package/workspace/lib/stakeholder-map.js +232 -0
  43. package/workspace/lib/task-store.js +1 -1
  44. package/workspace/lib/team-waits.js +167 -0
  45. package/workspace/lib/tradeoff-cards.js +258 -0
  46. package/workspace/lib/tradeoff-cli.js +83 -0
  47. package/workspace/lib/voice-cli.js +7 -0
  48. package/workspace/package-lock.json +2 -2
  49. package/workspace/package.json +1 -1
  50. package/workspace/premium-vw-jira-test.js +6 -2
  51. package/workspace/public/pm/bd-backlog.js +44 -6
  52. package/workspace/public/pm/bd-principles.js +12 -1
  53. package/workspace/public/pm/cozy-library.css +5 -0
  54. package/workspace/public/pm/cozy-pick.css +1 -0
  55. package/workspace/public/pm/cozy-pop-work.js +8 -2
  56. package/workspace/public/pm/cozy-proto.css +5 -0
  57. package/workspace/public/pm/cozy-proto.js +11 -3
  58. package/workspace/public/pm/cozy-today-app.js +53 -3
  59. package/workspace/public/pm/cozy-today-view.js +12 -4
  60. package/workspace/public/pm/day-time.js +8 -0
  61. package/workspace/public/pm/five-action-cap.js +104 -0
  62. package/workspace/public/pm/home-ini.js +3 -2
  63. package/workspace/public/pm/ini-links.js +2 -1
  64. package/workspace/public/pm/ini-tasks.js +5 -2
  65. package/workspace/public/pm/ini-view-model.js +14 -6
  66. package/workspace/public/pm/ini-view.js +12 -2
  67. package/workspace/public/pm/library-model.js +1 -1
  68. package/workspace/public/pm/page-one-answer.css +18 -0
  69. package/workspace/public/pm/page-one-answer.js +134 -0
  70. package/workspace/public/pm/pop-work-model.js +8 -6
  71. package/workspace/public/pm/portfolio.js +67 -0
  72. package/workspace/public/pm/premium-board.js +19 -6
  73. package/workspace/public/pm/premium-library.js +27 -3
  74. package/workspace/public/pm/product-switcher.js +7 -1
  75. package/workspace/public/pm/range-pick.css +12 -0
  76. package/workspace/public/pm/range-pick.js +30 -6
  77. package/workspace/public/pm/review-pack.js +47 -0
  78. package/workspace/public/pm/review-reasons.js +75 -0
  79. package/workspace/public/pm/sim-users.js +34 -0
  80. package/workspace/public/pm/sort-order.js +3 -0
  81. package/workspace/public/pm/stakeholder-map.js +125 -0
  82. package/workspace/public/pm/task-card.js +10 -7
  83. package/workspace/public/pm/team-waits.js +56 -0
  84. package/workspace/public/pm/tradeoff-cards.css +27 -0
  85. package/workspace/public/pm/tradeoff-cards.js +183 -0
  86. package/workspace/public/premium-board.html +1 -0
  87. package/workspace/public/premium-portfolio.html +48 -0
  88. package/workspace/public/today.html +1 -0
  89. package/workspace/run-tests.js +9 -1
  90. package/workspace/server.js +1 -1
  91. package/workspace/stage-card-tasks-test.js +11 -5
  92. package/workspace/test-lists/critical-needs.json +9 -0
  93. package/workspace/test-lists/five-action-cap.json +9 -0
  94. package/workspace/test-lists/page-one-answer.json +9 -0
  95. package/workspace/test-lists/portfolio.json +9 -0
  96. package/workspace/test-lists/review-pack.json +9 -0
  97. package/workspace/test-lists/review-reasons.json +9 -0
  98. package/workspace/test-lists/sim-users.json +9 -0
  99. package/workspace/test-lists/stakeholder-map.json +9 -0
  100. package/workspace/test-lists/task-time-optional.json +9 -0
  101. package/workspace/test-lists/team-waits.json +9 -0
  102. package/workspace/test-lists/tradeoff-cards.json +9 -0
  103. package/workspace/test-timings.json +25 -0
@@ -0,0 +1,258 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* tradeoff-cards.js — two close items on the Roadmap side by side, and the reason the PM kept one above the other (initiative
4
+ * tradeoff-cards, job #1918, idea A325; board TradeoffDS on the main canvas; done test planning/done-tests/tradeoff-cards.md).
5
+ *
6
+ * WHEN A CARD EXISTS. Two neighbours on the one ranked list (D105, lib/placements.js) whose weighted sizes (lib/opportunity-size.js:
7
+ * reach × frequency × worth × confidence) are within MARGIN of the larger one. A side with no complete size is never compared: zero is
8
+ * silence. A drag that puts one directly above another opens the same card for that pair (the page asks `cardFor`).
9
+ *
10
+ * THE SIDES. Read from the initiative's record frontmatter, never guessed; a missing value is NOT_KNOWN:
11
+ * goal parent_kr (or anchor) the goal it moves
12
+ * evidence evidence:, else its size with its source
13
+ * cost cost:, effort: or estimate:
14
+ * risk risk: or riskiest_assumption:
15
+ * waits waits:, else "<the other> starts after it" what waits if it goes first
16
+ *
17
+ * ✦ suggest(a, b): stronger size evidence first (measured > estimated > guess), else the bigger weighted size, else the current order.
18
+ * One line, from the records only. PMOS suggests; the PM chooses (the card's ✓).
19
+ *
20
+ * THE NOTES. One append-only file beside the placements ledger: <runs dir>/tradeoffs.jsonl (planning/runs/ or pmos/state/).
21
+ * { v: 1, eid, ev: 'kept', first, second, reason, at, by, via, moved?: { initiative, back } }
22
+ * { v: 1, eid, ev: 'undone', of: <eid>, at, by, via }
23
+ * keep() writes the note; when `first` was ranked below `second` it also writes ONE `ranked` line to the placements ledger that puts
24
+ * `first` directly above `second` (placements.js stays the one writer of the rank). undo() puts the rank back and marks the note undone.
25
+ * Nothing here changes a record file or a size line: the factor scores stay.
26
+ *
27
+ * CLI: lib/tradeoff-cli.js (pmos tradeoff, the chat's way to read and write the same store the page reads):
28
+ * pmos tradeoff list [--json] the close pairs and the kept reasons
29
+ * pmos tradeoff show <a> <b> [--json] one card
30
+ * pmos tradeoff keep <a> <b> --first <id> --reason "<text>" keep the order and the reason
31
+ * pmos tradeoff undo <note> take a kept reason back (and the rank it moved)
32
+ * pmos tradeoff count [--days 14] reasons kept in the last days; the last line is the number
33
+ * Every log line carries [tradeoff]. No model call, nothing sent. */
34
+ const fs = require('fs');
35
+ const path = require('path');
36
+ const crypto = require('crypto');
37
+ const SIZE = require('./opportunity-size.js');
38
+
39
+ const TAG = '[tradeoff]';
40
+ const MARGIN = 0.25;
41
+ const NOT_KNOWN = 'not known';
42
+ const MAX_REASON = 200;
43
+ const FILE = 'tradeoffs.jsonl';
44
+ const CONF = ['guess', 'estimated', 'measured'];
45
+ const DAY = 86400000;
46
+
47
+ const s = (v) => (v == null ? '' : String(v).trim());
48
+ const fmt = (n) => (n >= 100 ? Math.round(n).toLocaleString('en-US') : String(Math.round(n * 100) / 100));
49
+ const titleOf = (r) => (r && (r.title || r.id)) || '';
50
+
51
+ /* ── the pairs ─────────────────────────────────────────────────────────────────────────────────────────────────── */
52
+
53
+ /** Two weighted sizes are close when the gap is at most `margin` of the larger one. */
54
+ function close(x, y, margin = MARGIN) {
55
+ if (!(x > 0 && y > 0)) return false;
56
+ return Math.abs(x - y) <= margin * Math.max(x, y);
57
+ }
58
+
59
+ /** rows: [{ id, title, size }] in rank order (top first). → [{ a, b, ratio }]: each close pair of neighbours, `a` ranked above `b`. */
60
+ function closePairs(rows, margin = MARGIN) {
61
+ const out = [];
62
+ const L = rows || [];
63
+ for (let i = 0; i + 1 < L.length; i++) {
64
+ const a = L[i], b = L[i + 1];
65
+ if (!(a && b && a.size && b.size && a.size.complete && b.size.complete)) continue;
66
+ if (!close(a.size.weighted, b.size.weighted, margin)) continue;
67
+ out.push({ a: a.id, b: b.id, ratio: Math.round((Math.max(a.size.weighted, b.size.weighted) / Math.min(a.size.weighted, b.size.weighted)) * 100) / 100 });
68
+ }
69
+ return out;
70
+ }
71
+
72
+ /* ── the sides ─────────────────────────────────────────────────────────────────────────────────────────────────── */
73
+
74
+ const firstOf = (fm, keys) => { for (const k of keys) if (s(fm[k])) return s(fm[k]); return ''; };
75
+ function sizeWords(z) {
76
+ if (!z || !z.complete) return '';
77
+ const weak = Object.values(z.lines).find((l) => l.confidence === z.confidence) || {};
78
+ return `about ${fmt(z.size)} a month (${z.confidence}${weak.source ? ', ' + weak.source : ''})`;
79
+ }
80
+
81
+ /** One side of the card. rec: { id, title, fm }; other: the other side's { id, title }. */
82
+ function sideOf(rec, other) {
83
+ const fm = (rec && rec.fm) || {};
84
+ const size = SIZE.sizeOf(fm);
85
+ return {
86
+ id: rec.id, title: titleOf(rec),
87
+ goal: firstOf(fm, ['parent_kr', 'anchor']) || NOT_KNOWN,
88
+ evidence: firstOf(fm, ['evidence']) || sizeWords(size) || NOT_KNOWN,
89
+ cost: firstOf(fm, ['cost', 'effort', 'estimate']) || NOT_KNOWN,
90
+ risk: firstOf(fm, ['risk', 'riskiest_assumption']) || NOT_KNOWN,
91
+ waits: firstOf(fm, ['waits']) || (other ? `${titleOf(other)} starts after it` : NOT_KNOWN),
92
+ size: size && size.complete ? { weighted: size.weighted, confidence: size.confidence } : null,
93
+ };
94
+ }
95
+
96
+ /** ✦ the order the records support, and one line why. a is ranked above b now. */
97
+ function suggest(a, b) {
98
+ const ca = a.size ? CONF.indexOf(a.size.confidence) : -1, cb = b.size ? CONF.indexOf(b.size.confidence) : -1;
99
+ if (ca !== cb && ca >= 0 && cb >= 0) {
100
+ const [w, l] = ca > cb ? [a, b] : [b, a];
101
+ return { first: w.id, reason: `${w.title} first: its size is ${w.size.confidence}, and ${l.title}'s is ${l.size.confidence === 'guess' ? 'a guess' : l.size.confidence}.` };
102
+ }
103
+ if (a.size && b.size && a.size.weighted !== b.size.weighted) {
104
+ const [w, l] = a.size.weighted > b.size.weighted ? [a, b] : [b, a];
105
+ return { first: w.id, reason: `${w.title} first: about ${fmt(w.size.weighted)} a month against ${fmt(l.size.weighted)} for ${l.title}, weighted by how sure each is.` };
106
+ }
107
+ return { first: a.id, reason: 'Keep the current order: the records do not tell these two apart.' };
108
+ }
109
+
110
+ /* ── the notes ─────────────────────────────────────────────────────────────────────────────────────────────────── */
111
+
112
+ function notesPath(root) {
113
+ const ledgers = require('./plan-ledgers.js');
114
+ return path.join(path.dirname(ledgers.ledgerPath(root, 'placements')), FILE);
115
+ }
116
+ function readNotes(root) {
117
+ let text = '';
118
+ try { text = fs.readFileSync(notesPath(root), 'utf8'); } catch { return []; }
119
+ const out = [];
120
+ for (const line of text.split('\n')) { if (!line.trim()) continue; try { const r = JSON.parse(line); if (r && r.eid && r.ev) out.push(r); } catch { /* a torn line is skipped */ } }
121
+ return out;
122
+ }
123
+ /** The notes still in force, newest first. */
124
+ function activeNotes(lines) {
125
+ const undone = new Set(lines.filter((l) => l.ev === 'undone').map((l) => l.of));
126
+ return lines.filter((l) => l.ev === 'kept' && !undone.has(l.eid)).sort((x, y) => String(y.at).localeCompare(String(x.at)));
127
+ }
128
+ /** id → the newest kept note where `id` went first: { eid, other, reason, at }. Shown once, under that row. */
129
+ function keptBy(notes) {
130
+ const out = {};
131
+ for (const n of notes) if (!out[n.first]) out[n.first] = { eid: n.eid, other: n.second, reason: n.reason, at: n.at };
132
+ return out;
133
+ }
134
+ /** The newest kept note about this pair, in either order: shown first when the pair comes up again. */
135
+ function pastFor(notes, a, b) {
136
+ return notes.find((n) => (n.first === a && n.second === b) || (n.first === b && n.second === a)) || null;
137
+ }
138
+ const newEid = () => crypto.randomBytes(9).toString('base64').replace(/[^a-z0-9]/gi, '').toLowerCase().slice(0, 12).padEnd(12, '0');
139
+
140
+ /* ── the read ──────────────────────────────────────────────────────────────────────────────────────────────────── */
141
+
142
+ function ranked(root, now) {
143
+ const placements = require('./placements.js');
144
+ let records;
145
+ try { const d = require('./initiative-rows.js').deriveSync(root); if (d && d.ok) records = d.rows; } catch { records = undefined; }
146
+ let rules;
147
+ try { rules = require('./plan-rules.js').readRules(root); } catch { rules = undefined; }
148
+ const P = placements.readPlacements(root, { now, rules, records });
149
+ return { ids: P.ranked || [], byInit: P.byInit || {} };
150
+ }
151
+
152
+ /** The whole answer for one repository: { pairs: [card], kept: { id: { eid, other, other_title, reason, at } }, margin }. */
153
+ function read(root, { now = Date.now(), margin = MARGIN } = {}) {
154
+ const recs = SIZE.recordsOf(root);
155
+ const byId = new Map(recs.map((r) => [r.id, r]));
156
+ const R = ranked(root, now);
157
+ const rows = R.ids.filter((id) => byId.has(id) && !(R.byInit[id] && R.byInit[id].dormant))
158
+ .map((id) => ({ id, title: byId.get(id).title, size: SIZE.sizeOf(byId.get(id).fm) }));
159
+ const notes = activeNotes(readNotes(root));
160
+ const pairs = closePairs(rows, margin).map((p) => cardOf(byId, notes, p.a, p.b, { ratio: p.ratio }));
161
+ const kept = {};
162
+ for (const [id, k] of Object.entries(keptBy(notes))) if (byId.has(id)) kept[id] = { ...k, other_title: titleOf(byId.get(k.other)) || k.other };
163
+ return { margin, pairs, kept };
164
+ }
165
+
166
+ function cardOf(byId, notes, a, b, extra = {}) {
167
+ const A = byId.get(a), B = byId.get(b);
168
+ const sa = sideOf(A, B), sb = sideOf(B, A);
169
+ const past = pastFor(notes, a, b);
170
+ return { a: sa, b: sb, suggest: suggest(sa, sb), past: past ? { eid: past.eid, first: past.first, reason: past.reason, at: past.at } : null, ...extra };
171
+ }
172
+
173
+ /** One card for any two initiatives on the Roadmap (a drag, or the CLI). `a` is the one ranked higher now. */
174
+ function cardFor(root, x, y, { now = Date.now() } = {}) {
175
+ const recs = SIZE.recordsOf(root);
176
+ const byId = new Map(recs.map((r) => [r.id, r]));
177
+ const R = ranked(root, now);
178
+ for (const id of [x, y]) if (!byId.has(id) || !R.ids.includes(id)) return { ok: false, status: 404, error: `${id} is not an initiative on the Roadmap here` };
179
+ if (x === y) return { ok: false, status: 400, error: 'pick two different initiatives' };
180
+ const [a, b] = R.ids.indexOf(x) < R.ids.indexOf(y) ? [x, y] : [y, x];
181
+ return { ok: true, card: cardOf(byId, activeNotes(readNotes(root)), a, b) };
182
+ }
183
+
184
+ /* ── the writes ────────────────────────────────────────────────────────────────────────────────────────────────── */
185
+
186
+ function reasonError(reason) {
187
+ const r = s(reason);
188
+ if (!r) return 'write why in one line: the reason is kept with the list';
189
+ if (/[\r\n]/.test(String(reason))) return 'the reason is one line';
190
+ if (r.length > MAX_REASON) return `the reason is at most ${MAX_REASON} characters`;
191
+ return null;
192
+ }
193
+ function appendNote(root, rec) {
194
+ const file = notesPath(root);
195
+ fs.mkdirSync(path.dirname(file), { recursive: true });
196
+ fs.appendFileSync(file, JSON.stringify(rec) + '\n');
197
+ }
198
+
199
+ /** Keep `first` above the other of a/b, with the reason. actor: actor.js fromUi() or fromCli(). */
200
+ function keep(root, { a, b, first, reason } = {}, { actor, now = Date.now() } = {}) {
201
+ const placements = require('./placements.js');
202
+ const err = reasonError(reason);
203
+ if (err) return { ok: false, status: 400, error: err };
204
+ if (!a || !b || a === b) return { ok: false, status: 400, error: 'name the two initiatives' };
205
+ if (first !== a && first !== b) return { ok: false, status: 400, error: 'first must be one of the two' };
206
+ const second = first === a ? b : a;
207
+ const R = ranked(root, now);
208
+ for (const id of [a, b]) if (!R.ids.includes(id)) return { ok: false, status: 404, error: `${id} is not an initiative on the Roadmap here` };
209
+ let moved = null;
210
+ const fi = R.ids.indexOf(first), si = R.ids.indexOf(second);
211
+ if (fi > si) {
212
+ const back = R.ids[fi - 1] || null; // first's place now: after the row above it
213
+ const above = si > 0 ? R.ids[si - 1] : null; // directly above `second`
214
+ const w = placements.appendFromCli(root, [{ ev: 'ranked', initiative: first, after: above }], { actor, now });
215
+ if (!w.ok) return { ok: false, status: w.status || 500, error: w.error };
216
+ moved = { initiative: first, back };
217
+ }
218
+ const rec = { v: 1, eid: newEid(), ev: 'kept', first, second, reason: s(reason), at: new Date(now).toISOString(), by: actor.by, via: actor.via, ...(moved ? { moved } : {}) };
219
+ appendNote(root, rec);
220
+ console.info(`${TAG} kept ${first} above ${second}${moved ? ' (moved)' : ''}`);
221
+ return { ok: true, note: rec };
222
+ }
223
+
224
+ /** Take a kept reason back: the rank it moved goes back, and the note is marked undone. */
225
+ function undo(root, eid, { actor, now = Date.now() } = {}) {
226
+ const placements = require('./placements.js');
227
+ const lines = readNotes(root);
228
+ const n = lines.find((l) => l.ev === 'kept' && l.eid === eid);
229
+ if (!n) return { ok: false, status: 404, error: `no kept reason ${eid}` };
230
+ if (lines.some((l) => l.ev === 'undone' && l.of === eid)) return { ok: false, status: 409, error: `${eid} was taken back already` };
231
+ if (n.moved) {
232
+ const w = placements.appendFromCli(root, [{ ev: 'ranked', initiative: n.moved.initiative, after: n.moved.back }], { actor, now });
233
+ if (!w.ok) return { ok: false, status: w.status || 500, error: w.error };
234
+ }
235
+ appendNote(root, { v: 1, eid: newEid(), ev: 'undone', of: eid, at: new Date(now).toISOString(), by: actor.by, via: actor.via });
236
+ console.info(`${TAG} undone ${eid}`);
237
+ return { ok: true, of: eid };
238
+ }
239
+
240
+ /** The workspace whose records hold most of `ids` (the Work page's rows on screen): { id, root } | null. list: ctx.workspaceList(). */
241
+ function wsForIds(list, ids) {
242
+ const want = (ids || []).filter((x) => /^[a-z0-9][a-z0-9._-]*$/i.test(x)).slice(0, 200);
243
+ let best = null, bestN = 0;
244
+ for (const w of list || []) {
245
+ if (!w || !w.root) continue;
246
+ let n = 0;
247
+ for (const id of want) if (['planning/initiatives', 'pmos/state/initiatives'].some((d) => fs.existsSync(path.join(w.root, d, id + '.md')))) n++;
248
+ if (n > bestN) { best = w; bestN = n; }
249
+ }
250
+ return best;
251
+ }
252
+
253
+ function count(root, { days = 14, now = Date.now() } = {}) {
254
+ const from = now - days * DAY;
255
+ return activeNotes(readNotes(root)).filter((n) => Date.parse(n.at) >= from).length;
256
+ }
257
+
258
+ module.exports = { TAG, MARGIN, NOT_KNOWN, MAX_REASON, FILE, close, closePairs, sideOf, suggest, readNotes, activeNotes, keptBy, pastFor, notesPath, read, cardFor, keep, undo, count, wsForIds };
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* tradeoff-cli.js — `pmos tradeoff` (initiative tradeoff-cards, job #1918, idea A325): the chat's and the terminal's way to read and write
4
+ * the same trade-off store the Work page reads (lib/tradeoff-cards.js). Its own module so the verb table names a -cli file. */
5
+ const fs = require('fs');
6
+ const path = require('path');
7
+ const { TAG, MARGIN, read, cardFor, keep, undo, count } = require('./tradeoff-cards.js');
8
+
9
+ /* ── pmos tradeoff ─────────────────────────────────────────────────────────────────────────────────────────────── */
10
+ const COMMANDS = { tradeoff: ['list', 'show', 'keep', 'undo', 'count'] };
11
+ const USAGE = [
12
+ 'usage: pmos tradeoff [list|show|keep|undo|count] — two close items on the Roadmap side by side, and why you kept one first',
13
+ ' pmos tradeoff list the close pairs and the kept reasons (writes nothing)',
14
+ ' pmos tradeoff show <a> <b> one card: goal, evidence, cost, risk and what waits, and ✦',
15
+ ' pmos tradeoff keep <a> <b> --first <id> --reason "<why>" keep that order and the reason with the ranked list',
16
+ ' pmos tradeoff undo <note> take a kept reason back, and the rank it moved',
17
+ ' pmos tradeoff count [--days 14] reasons kept in the last days; the number is the last line',
18
+ ];
19
+ function repoOf(cwd) {
20
+ let d = path.resolve(cwd);
21
+ for (;;) { try { if (fs.existsSync(path.join(d, '.git'))) return d; } catch { /* look further up */ } const up = path.dirname(d); if (up === d) return path.resolve(cwd); d = up; }
22
+ }
23
+ const ROWS = [['Goal it moves', 'goal'], ['Evidence', 'evidence'], ['Cost', 'cost'], ['Risk', 'risk'], ['What waits if it goes first', 'waits']];
24
+ function cardLines(c) {
25
+ const L = [`Which goes first? ${c.a.title} (now above) or ${c.b.title}`];
26
+ if (c.past) L.push(`Last time: ${c.past.reason} (${String(c.past.at).slice(0, 10)})`);
27
+ for (const [label, k] of ROWS) L.push(` ${label}: ${c.a[k]} | ${c.b[k]}`);
28
+ L.push(`✦ ${c.suggest.reason}`);
29
+ return L;
30
+ }
31
+ function run(argv, o = {}) {
32
+ const say = o.say || ((x) => console.log(x)), now = o.now || Date.now();
33
+ const args = argv[0] === 'tradeoff' ? argv.slice(1) : argv.slice();
34
+ const pos = [], flags = {};
35
+ for (let i = 0; i < args.length; i++) { const a = args[i]; if (['--root', '--days', '--first', '--reason', '--margin'].includes(a)) flags[a.slice(2)] = args[++i]; else if (a === '--json') flags.json = true; else pos.push(a); }
36
+ const cmd = pos[0] || 'list';
37
+ if (cmd === 'help' || cmd === '--help') { USAGE.forEach((l) => say(l)); return 0; }
38
+ if (!COMMANDS.tradeoff.includes(cmd)) { say(`✗ ${cmd} is not a command of pmos tradeoff`); USAGE.forEach((l) => say(l)); return 2; }
39
+ const root = path.resolve(flags.root || o.root || repoOf(o.cwd || process.cwd()));
40
+ const actor = o.actor || require('./actor.js').fromCli({ env: o.env || process.env });
41
+ const fail = (r) => { if (flags.json) say(JSON.stringify({ ok: false, error: r.error })); else say(`✗ ${r.error}`); return r.status === 400 ? 2 : 1; };
42
+ if (cmd === 'count') {
43
+ const days = Math.max(1, Math.min(365, parseInt(flags.days, 10) || 14));
44
+ const n = count(root, { days, now });
45
+ say(`${TAG} ${n} trade-off reason${n === 1 ? '' : 's'} kept in the last ${days} days.`);
46
+ say(String(n));
47
+ return 0;
48
+ }
49
+ if (cmd === 'list') {
50
+ const margin = Number(flags.margin) > 0 && Number(flags.margin) < 1 ? Number(flags.margin) : MARGIN;
51
+ const r = read(root, { now, margin });
52
+ if (flags.json) { say(JSON.stringify({ ok: true, ...r })); return 0; }
53
+ if (!r.pairs.length && !Object.keys(r.kept).length) { say('No two neighbours on the Roadmap are close, and no reason is kept yet.'); return 0; }
54
+ for (const c of r.pairs) say(`These two are close: ${c.a.title} (${c.a.id}) and ${c.b.title} (${c.b.id}). pmos tradeoff show ${c.a.id} ${c.b.id}`);
55
+ for (const [id, k] of Object.entries(r.kept)) say(`Kept ${id} above ${k.other_title}: ${k.reason} · ${String(k.at).slice(0, 10)} (note ${k.eid})`);
56
+ return 0;
57
+ }
58
+ if (cmd === 'show') {
59
+ if (pos.length !== 3) { say('usage: pmos tradeoff show <a> <b>'); return 2; }
60
+ const r = cardFor(root, pos[1], pos[2], { now });
61
+ if (!r.ok) return fail(r);
62
+ if (flags.json) { say(JSON.stringify({ ok: true, card: r.card })); return 0; }
63
+ cardLines(r.card).forEach((l) => say(l));
64
+ return 0;
65
+ }
66
+ if (cmd === 'keep') {
67
+ if (pos.length !== 3 || !flags.first) { say('usage: pmos tradeoff keep <a> <b> --first <id> --reason "<why>"'); return 2; }
68
+ const r = keep(root, { a: pos[1], b: pos[2], first: flags.first, reason: flags.reason }, { actor, now });
69
+ if (!r.ok) return fail(r);
70
+ if (flags.json) { say(JSON.stringify({ ok: true, note: r.note })); return 0; }
71
+ say(`✓ Kept ${r.note.first} above ${r.note.second}${r.note.moved ? ' and moved it up' : ''}: ${r.note.reason}. Undo: pmos tradeoff undo ${r.note.eid}`);
72
+ return 0;
73
+ }
74
+ if (pos.length !== 2) { say('usage: pmos tradeoff undo <note>'); return 2; }
75
+ const r = undo(root, pos[1], { actor, now });
76
+ if (!r.ok) return fail(r);
77
+ if (flags.json) say(JSON.stringify({ ok: true, of: r.of })); else say(`✓ Took back ${r.of}.`);
78
+ return 0;
79
+ }
80
+
81
+ module.exports = { run, COMMANDS, USAGE };
82
+
83
+ if (require.main === module) process.exitCode = run(process.argv.slice(2));
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+ /* voice-cli.js — `pmos voice`: survey comments and app-store reviews grouped by reason (initiative review-reasons, idea A427).
3
+ * A thin verb over lib/review-reasons.js run(): the same ledger (customer-voice.jsonl in the product's runs folder) that Work's
4
+ * Customer voice block reads, so what a chat adds shows on Work at the next read. Exit codes: 0 done, 1 refused, 2 usage. */
5
+ const RR = require('./review-reasons.js');
6
+
7
+ module.exports = { run: (argv, o) => RR.run(argv, o), COMMANDS: RR.COMMANDS, USAGE: RR.USAGE };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.827.0",
3
+ "version": "0.829.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.827.0",
9
+ "version": "0.829.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@anthropic-ai/sdk": "^1.3.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.827.0",
3
+ "version": "0.829.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",
@@ -213,15 +213,19 @@ const TICKETS = {
213
213
  for (const theme of ['light', 'dark']) {
214
214
  const S = await open({ w: 390, h: 844, theme });
215
215
  await openSprint(S.page);
216
- await until(() => S.page.$('.jcrd[data-k="PMOS-142"]'));
216
+ // Wait for the card INSIDE the shown Viewer pane: on a busy runner the card can exist before the pane is shown, and the
217
+ // read below then found no pane and threw (#1883, 2026-11-25). A pane that never shows fails F1 with its reason instead.
218
+ await until(() => S.page.$('#czViewer:not([hidden]) .obody.vw .jcrd[data-k="PMOS-142"]'), 30000);
217
219
  await sleep(400);
218
220
  const f = await S.page.evaluate(() => {
219
221
  const pane = document.querySelector('#czViewer:not([hidden]) .obody.vw');
222
+ if (!pane || !pane.querySelector('.jcrd b')) return { missing: pane ? 'no sprint card in the Viewer pane' : 'no shown Viewer pane' };
220
223
  const small = [...pane.querySelectorAll('button.jcrd,.jseg button,.jbtn')].filter((b) => b.getBoundingClientRect().height && b.getBoundingClientRect().height < 44).map((b) => b.textContent.trim().slice(0, 30));
221
224
  const crd = getComputedStyle(pane.querySelector('.jcrd')).backgroundColor, ink = getComputedStyle(pane.querySelector('.jcrd b')).color;
222
225
  return { wide: document.documentElement.scrollWidth > innerWidth + 1, paneWide: pane.scrollWidth > pane.clientWidth + 1, small, crd, ink };
223
226
  });
224
- ok(`F1 ${theme}: 390 px has no sideways scroll and every target is 44 px or more`, !f.wide && !f.paneWide && !f.small.length, JSON.stringify(f));
227
+ ok(`F1 ${theme}: 390 px has no sideways scroll and every target is 44 px or more`, !f.missing && !f.wide && !f.paneWide && !f.small.length, JSON.stringify(f));
228
+ if (f.missing) { ok(`F2 ${theme}: cards follow the theme`, false, f.missing); await S.ctx.close(); continue; }
225
229
  const lum = (c) => { const m = c.match(/\d+(\.\d+)?/g).map(Number); return (m[0] * 299 + m[1] * 587 + m[2] * 114) / 1000; };
226
230
  ok(`F2 ${theme}: cards follow the theme`, theme === 'dark' ? lum(f.ink) > lum(f.crd) : lum(f.ink) < lum(f.crd), JSON.stringify(f));
227
231
  await S.ctx.close();
@@ -21,6 +21,8 @@ import * as WS from './work-select.js'; // the bulk move with one Undo, shared
21
21
  import * as IF from './inline-fields.js'; // a task's sprint and priority, set in the row (initiative inline-sprint-priority)
22
22
  import * as LE from './live-edit.js'; // a task's status or days show at once in the list, before it is read again; a failed save is put back
23
23
  import { noteUse } from './use-log.js'; // the sprint draft's presses, counted on this computer only (sprint-draft-capacity)
24
+ import { pmGet } from './http.js';
25
+ import * as TWV from './team-waits.js'; // team-waits (A364): Work › Dependencies, the waits on other teams (GET /api/team-waits)
24
26
  import * as LV from './line-view.js';
25
27
  import * as LB from './list-balance.js'; // the balance meter under the Backlog header (bet A448, board BalanceDS) // quiet-rows slice B: the Line tab, every initiative by station (GET /api/line)
26
28
  import * as BD from './bd-backlog-ds.js'; // the Backlog from the system's parts (WorkBacklogDS) // the sprint overview while "This sprint" is on (initiative sprint-overview)
@@ -68,14 +70,17 @@ export function tabOf() {
68
70
  if (q === 'backlog') return 'bk';
69
71
  if (q === 'sprint') return 'sp';
70
72
  if (q === 'line') return 'ln';
73
+ if (q === 'deps') return 'dp';
71
74
  if (q === 'initiatives') return 'ini';
72
75
  const v = (get(KEY, {}) || {})[scopeKey()];
73
- return v === 'bk' || v === 'sp' || v === 'ln' ? v : 'ini';
76
+ return v === 'bk' || v === 'sp' || v === 'ln' || v === 'dp' ? v : 'ini';
74
77
  }
75
78
  /** Is a task tab (Backlog or This sprint) the view now? */
76
79
  export const on = () => tabOf() === 'bk' || tabOf() === 'sp';
77
80
  /** Is the Line tab the view now? (quiet-rows slice B) */
78
81
  export const lineOn = () => tabOf() === 'ln';
82
+ /** Is the Dependencies tab the view now? (team-waits) */
83
+ export const depsOn = () => tabOf() === 'dp';
79
84
  function setOn(v) {
80
85
  v = v === true ? 'bk' : v === false ? 'ini' : v;
81
86
  const m = get(KEY, {}) || {}; m[scopeKey()] = v; put(KEY, m);
@@ -125,7 +130,8 @@ export async function load() {
125
130
  /** Work's three tab names: a desk says "This sprint" and no count; a phone says "Backlog 14" and "Sprint" (PhoneWorkDS, job 1540).
126
131
  * Zero is silence: no count when the Backlog is empty or not read yet. */
127
132
  // the Line (quiet-rows-line) is a five-column table for a desk; a phone keeps its three tabs (Today's dashed line is desk-only too)
128
- export const tabNames = (phone, n) => [['ini', 'Initiatives'], ...(phone ? [] : [['ln', 'Line']]), ['bk', 'Backlog' + (phone && n > 0 ? ` <span class="bk-swn">${Number(n)}</span>` : '')], ['sp', phone ? 'Sprint' : 'This sprint']];
133
+ // Dependencies (team-waits) is a desk tab as well: a phone keeps its three
134
+ export const tabNames = (phone, n) => [['ini', 'Initiatives'], ...(phone ? [] : [['ln', 'Line']]), ['bk', 'Backlog' + (phone && n > 0 ? ` <span class="bk-swn">${Number(n)}</span>` : '')], ['sp', phone ? 'Sprint' : 'This sprint'], ...(phone ? [] : [['dp', 'Dependencies']])];
129
135
  const phoneNow = () => typeof matchMedia === 'function' && matchMedia('(max-width: 760px)').matches;
130
136
  function drawSwitch() {
131
137
  if (!sw) return;
@@ -136,13 +142,14 @@ function drawSwitch() {
136
142
  sw.innerHTML = tabNames(ph, ph && DATA ? backlogOf().length : 0).map(([k, n]) => tb(k, n)).join('');
137
143
  }
138
144
  function apply() {
139
- const bk = on(), ln = lineOn();
145
+ const bk = on(), ln = lineOn(), dp = depsOn();
140
146
  if (tabOf() === 'sp') CHIPS.add('sprint');
141
147
  document.body.classList.toggle('sp-on', tabOf() === 'sp');
142
- document.body.classList.toggle('bk-on', bk || ln);
143
- if (host) host.hidden = !(bk || ln);
148
+ document.body.classList.toggle('bk-on', bk || ln || dp);
149
+ if (host) host.hidden = !(bk || ln || dp);
144
150
  drawSwitch();
145
151
  if (ln) { closeAll(); drawLine(); return; }
152
+ if (dp) { closeAll(); drawDeps(); return; }
146
153
  if (bk) { if (!DATA || scopeKey() !== lastScope) { lastScope = scopeKey(); host.innerHTML = '<p class="bk-wait">Reading the tasks…</p>'; load(); } else draw(); }
147
154
  else closeAll();
148
155
  }
@@ -179,6 +186,37 @@ function linePress(e) {
179
186
  return false;
180
187
  }
181
188
 
189
+ /* ── the Dependencies tab (team-waits, board BatchCodeDS panel 14) ── the pick's waits on other teams, from GET /api/team-waits ── */
190
+ const DP = { got: null, key: '', used: false, rows: [] };
191
+ async function readDeps() {
192
+ const ws = [...new Set(A.scope().map((s) => s.ws || ''))];
193
+ const got = await Promise.all(ws.map((w) => pmGet('/api/team-waits' + (w ? '?ws=' + encodeURIComponent(w) : '')).catch(() => null)));
194
+ return got.filter((r) => r && r.ok).map((r) => ({ ws: r.ws, today: r.today, waits: (r.waits || []).map((x) => ({ ...x, ws: r.ws })) }));
195
+ }
196
+ function drawDeps() {
197
+ if (!host) return;
198
+ const k = scopeKey();
199
+ if (!DP.used) { DP.used = true; noteUse('team-waits'); console.info('[team-waits] dependencies tab opened'); } // the health number: one open per page load
200
+ if (!DP.got || DP.key !== k) {
201
+ DP.key = k; host.innerHTML = '<p class="bk-wait">Reading what your work waits on…</p>';
202
+ readDeps().then((g) => { DP.got = g; if (depsOn()) drawDeps(); });
203
+ return;
204
+ }
205
+ const today = (DP.got[0] || {}).today || '';
206
+ const waits = DP.got.flatMap((g) => g.waits).sort((a, b) => String(a.since).localeCompare(String(b.since)));
207
+ DP.rows = TWV.rowsOf(waits, { today });
208
+ host.innerHTML = TWV.waitsHtml(DP.rows) || '<p class="bk-wait">Nothing waits on another team.</p>';
209
+ }
210
+ /** A press in the Dependencies tab: Chase opens a draft in the PM's own mail app. PMOS sends nothing. true when it was one. */
211
+ function depsPress(e) {
212
+ if (!depsOn()) return false;
213
+ const b = e.target.closest('[data-tw-chase]');
214
+ if (!b) return false;
215
+ const r = DP.rows[Number(b.dataset.twChase)];
216
+ if (r) location.href = TWV.chaseDraft(r.chase).mailto;
217
+ return true;
218
+ }
219
+
182
220
  /* ── the list ─────────────────────────────────────────────────────────────────────────────────────────────────── */
183
221
  const partB = () => true;
184
222
  function draw() {
@@ -793,7 +831,7 @@ export function sync(api) {
793
831
  sw.addEventListener('click', (e) => { const b = e.target.closest('[data-bksw]'); if (b) setOn(b.dataset.bksw); });
794
832
  host = document.createElement('div'); host.id = 'bkBody'; host.className = 'bk-host'; host.hidden = true;
795
833
  ib.insertAdjacentElement('afterend', host);
796
- host.addEventListener('click', (e) => { if (linePress(e)) return; press(e); });
834
+ host.addEventListener('click', (e) => { if (linePress(e) || depsPress(e)) return; press(e); });
797
835
  host.addEventListener('change', (e) => { if (e.target.closest('[data-bkck]')) press(e); });
798
836
  host.addEventListener('keydown', (e) => { const c = e.target.closest('[data-bkcap]'); if (c && e.key === 'Enter') { e.preventDefault(); capture(c); } });
799
837
  dragWire();
@@ -9,9 +9,11 @@
9
9
  * · Drafts after them, each with ✦, its why, its sources, and ✓ keep / ✕ drop. A press offers Undo in the Board's toast.
10
10
  * · While PMOS drafts them: one quiet line. No principle and no draft: no block (zero is silence).
11
11
  * The controls are named bdPrinKeep and bdPrinDrop (the button's name, its value the principle's id; one per row, so no id) and each press
12
- * notes that name in the local use log (noteUse), which counts their use (the bet's kill line). */
12
+ * notes that name in the local use log (noteUse), which counts their use (the bet's kill line).
13
+ * It also makes the Customer voice section (#cVoice, pm/review-reasons.js, idea A427) right after itself and mounts it with the same options. */
13
14
  import { pmPost } from './http.js';
14
15
  import { noteUse } from './use-log.js';
16
+ import * as VOICE from './review-reasons.js'; // Customer voice (idea A427) sits under the principles; this block hosts it so Work's page files stay as they are
15
17
 
16
18
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
17
19
  const SV = (d) => `<svg class="pm-ic" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
@@ -43,6 +45,7 @@ export function blockHtml(state) {
43
45
  export async function mount(host, opts = {}) {
44
46
  if (!host) return;
45
47
  const { ws = null, single = true, say = null } = opts;
48
+ voiceHost(host, opts);
46
49
  if (!single) { host.hidden = true; host.innerHTML = ''; return; }
47
50
  let r = null; try { r = await (await fetch('/api/principles' + (ws ? '?ws=' + encodeURIComponent(ws) : ''), { credentials: 'same-origin' })).json(); } catch { r = null; }
48
51
  if (!r || !r.ok) { host.hidden = true; return; } // the block is an extra: a failed read leaves the Board as it was
@@ -60,5 +63,13 @@ export async function mount(host, opts = {}) {
60
63
  };
61
64
  }
62
65
 
66
+ /** Customer voice (pm/review-reasons.js) gets its own section right after this one, made once, and draws itself there. */
67
+ function voiceHost(host, opts) {
68
+ if (!host.parentNode || typeof document === 'undefined') return;
69
+ let v = document.getElementById('cVoice');
70
+ if (!v) { v = document.createElement('section'); v.className = 'bd-sec'; v.id = 'cVoice'; v.setAttribute('aria-label', 'Customer voice'); v.hidden = true; host.after(v); }
71
+ VOICE.mount(v, opts).catch(() => { v.hidden = true; });
72
+ }
73
+
63
74
  /** Draw the block again after a read of the Board. */
64
75
  export const refresh = (host, opts) => mount(host, opts);
@@ -108,3 +108,8 @@
108
108
  .lb-menu, .lb-cwr .lb-menu { position: fixed; left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 80vh; border-radius: var(--radius-panel) var(--radius-panel) 0 0; padding: 18px var(--space-12) 28px; }
109
109
  }
110
110
  .lb .lb-more { margin: var(--space-4) 0 0 var(--space-4); }
111
+ /* the monthly review pack in the preview (initiative review-pack) */
112
+ .rp-pack { gap: var(--space-8); }
113
+ .rp-pack .rp-head { font-size: var(--fs-meta); }
114
+ .rp-pack .rp-lines { margin: 0; padding-left: var(--space-16); font-size: var(--fs-row); line-height: var(--lh-body); }
115
+ .rp-pack + .pm-said { margin: 0; }
@@ -53,6 +53,7 @@
53
53
  .psw-b:hover, .psw-b:focus-visible { background: var(--cz-well); }
54
54
  .psw-b[aria-pressed="true"] { background: var(--cz-bluebg); box-shadow: 0 0 0 2px var(--cz-c-b6c6dc); }
55
55
  .psw-b .ppk-t { box-shadow: none; }
56
+ .psw-pf { color: var(--cz-muted, currentColor); text-decoration: none; } /* the Portfolio link at the end of the row (initiative portfolio) */
56
57
  .psw-dot { position: absolute; top: 1px; right: 1px; width: 8px; height: 8px; border-radius: 50%; background: var(--cz-blue); box-shadow: 0 0 0 2px var(--cz-card); }
57
58
  .hv-psw { padding: 0 0 var(--space-8); }
58
59
  @media (max-width: 760px) { .psw-b { width: 44px; height: 44px; } }
@@ -37,6 +37,7 @@ import * as IF from './inline-fields.js'; // a task's sprint and priority, set
37
37
  import * as SD from './star-draft.js'; // a ✦ draft runs as a PMOS background job and lands on its line (star-buttons-act-directly A7)
38
38
  import * as CAP from './pop-cap.js'; // five actions at most: Ask PMOS and the toolbar's four, the rest under ⋯ (popup-cap, idea A498)
39
39
  import { noteUse } from './use-log.js';
40
+ import * as SMAP from './stakeholder-map.js'; // the People block: who decides, must agree, needs to know (stakeholder-map, A371)
40
41
  import * as PD from './bd-pop-ds.js'; // the popup on a computer, built from the design system's blocks (initiative work-ds-popup) // the Kind of a file and one row per kind (round 3 point 16), shared with the Library // the rename and its Undo, the same write as the old List (batch 18 item 16)
41
42
 
42
43
  const CSS = new URL('./cozy-pop-work.css', import.meta.url).href, DSCSS = new URL('./bd-pop-ds.css', import.meta.url).href;
@@ -490,7 +491,9 @@ function dsHtml(r, v, o, W, S, C, mode) {
490
491
  const crit = S.sel.size || dropped().has('crit:' + id) ? '' : critSugHtml(CRIT.get(id));
491
492
  // Overview (Wawan, 2026-11-23): Where it stands, The case and its facts in one block across the top; folded or open is the person's choice
492
493
  // one column (artefacts-in-more-menu, Wawan 2026-11-23): the Stages and the breakdown take the full width; the artefacts are in ⋯ (moreItems)
493
- return `<div class="pw pwd">${PD.overviewHtml(W, r, { oid: id, dropped: dropped(), open: ovOpen() })}<div class="pwd-main">${PD.stagesHtml(st, W)}${crit}${wbs}</div></div>`;
494
+ // the People block under the Overview (stakeholder-map, BatchPeopleDS panel 9): drawn from memory, read once per initiative; no name, no block
495
+ const ppl = SMAP.blockFor(id, o.ws, () => { if (artRedraw) artRedraw(); });
496
+ return `<div class="pw pwd">${PD.overviewHtml(W, r, { oid: id, dropped: dropped(), open: ovOpen() })}${ppl}<div class="pwd-main">${PD.stagesHtml(st, W)}${crit}${wbs}</div></div>`;
494
497
  }
495
498
 
496
499
  /** The grouping ✦ the PM said no to, for this initiative: 'group:<stage>'. */
@@ -912,6 +915,8 @@ export function wire(body, h0, x0) {
912
915
  goalsRedraw = artRedraw = wsnRedraw = capRedraw = () => { if (body.isConnected && body.querySelector('.pw')) redraw(); };
913
916
  body.__pwcur = cur; body.__pwredraw = redraw; // ⋯ acts on the popup drawn now (capItems)
914
917
  wireGrip(body);
918
+ // the People block's presses (stakeholder-map), before the popup's own handler below
919
+ body.addEventListener('click', (e) => { SMAP.press(e, body, { say: (t) => { const hh = body.__pwh; if (hh && hh.toast) hh.toast(t); } }); });
915
920
  // a phone: a proposal swiped right says yes, left says no (its own hidden Yes and No presses, so the popup's writes and Undo stay theirs)
916
921
  wireSwipe(body, { on: phone, act: (row, way) => { const b = row.querySelector(way === 'right' ? '[data-sw-yes]' : '[data-sw-no]'); if (b) b.click(); } });
917
922
  body.addEventListener('submit', (e) => {
@@ -1222,7 +1227,8 @@ function dateMenu(btn, uid, c, h, x) {
1222
1227
  // "end of sprint" typed in a field (bet A488): the task's own sprint, else the active one, from the board's open sprints (the Sprint menu's read)
1223
1228
  let sprintEnd = '';
1224
1229
  sprintsOf(c, h, x).then((L) => { const C = IF.sprintChoices(L, c.W.today), cur = C.find((q) => row.sprint && q.name === String(row.sprint)) || C.find((q) => q.state === 'active'); sprintEnd = cur ? cur.end : ''; }).catch(() => {});
1225
- mountRange(el.querySelector('.pw-rp'), { ...R, sprintEnd: () => sprintEnd, onPick: (patch, done) => { if (done) closePop(); if (h.dates) h.dates(uid, patch); } }).focus();
1230
+ // the optional time (task-time-optional): offered for a PMOS task, never a Jira ticket's
1231
+ mountRange(el.querySelector('.pw-rp'), { ...R, time: !row.jira, start_time: row.start_time || '', due_time: row.due_time || '', sprintEnd: () => sprintEnd, onPick: (patch, done) => { if (done) closePop(); if (h.dates) h.dates(uid, patch); } }).focus();
1226
1232
  }
1227
1233
  function rowMenu(btn, uid, c, h, body) {
1228
1234
  const row = c.W.rows.find((x) => x.uid === uid) || {};
@@ -75,6 +75,11 @@
75
75
  .pc-bar2 { display: block; height: 4px; border-radius: 2px; background: var(--cz-well); overflow: hidden; }
76
76
  .pc-bar2 i { display: block; height: 100%; background: var(--cz-blue); transition: width .4s ease; }
77
77
  .pc-fixed { margin: 0 0 var(--space-8); font-size: var(--fs-meta); color: var(--cz-ink2); }
78
+ /* Findings (initiative sim-users, pm/sim-users.js): the system's pm-block list; a finding is a press that shows its screen */
79
+ .pc-finds { margin: 0 0 var(--space-8); }
80
+ .pc-finds .pm-li { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
81
+ .pc-finds .pm-li:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
82
+ .pc-finds .pm-li .t { white-space: normal; }
78
83
  .pc-lost { display: block; color: var(--cz-ink2); padding: var(--space-8) 10px; border-radius: 8px; background: var(--cz-well); margin-bottom: var(--space-8); }
79
84
  @keyframes pcPulse { 50% { opacity: 1; } }
80
85
  @media (prefers-reduced-motion: reduce) { .pc-making i { animation: none; opacity: .7; } }