create-pmos 0.741.0 → 0.744.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 (38) hide show
  1. package/package.json +266 -66
  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 +3 -2
  7. package/workspace/briefing-premium-insights-test.js +1 -1
  8. package/workspace/changelog.json +265 -27
  9. package/workspace/guide/cli.md +28 -0
  10. package/workspace/guide/layout.md +3 -3
  11. package/workspace/lib/briefing-premium-agent.js +8 -2
  12. package/workspace/lib/decision-journal.js +107 -6
  13. package/workspace/lib/decisions-cli.js +24 -8
  14. package/workspace/lib/driver-decide.js +18 -1
  15. package/workspace/lib/parked-reasons.js +4 -1
  16. package/workspace/lib/pmos-verbs.js +6 -0
  17. package/workspace/lib/route-modules.js +1 -0
  18. package/workspace/lib/routes-proposals.js +23 -4
  19. package/workspace/lib/routes-try.js +39 -0
  20. package/workspace/lib/signal-cli.js +41 -0
  21. package/workspace/lib/try-it.js +194 -0
  22. package/workspace/package-lock.json +2 -2
  23. package/workspace/package.json +1 -1
  24. package/workspace/public/pm/cozy-board.css +2 -0
  25. package/workspace/public/pm/cozy-ev.css +8 -0
  26. package/workspace/public/pm/cozy-settings.js +12 -2
  27. package/workspace/public/pm/home-app.js +6 -1
  28. package/workspace/public/pm/library-keys.js +41 -0
  29. package/workspace/public/pm/live-edit.js +1 -1
  30. package/workspace/public/pm/page-chat.js +21 -1
  31. package/workspace/public/pm/premium-board.js +23 -1
  32. package/workspace/public/pm/premium-library.js +5 -12
  33. package/workspace/public/pm/try-view.js +99 -0
  34. package/workspace/public/premium-board.html +2 -0
  35. package/workspace/server.js +2 -0
  36. package/workspace/test-lists/decisions-from-approvals.json +5 -0
  37. package/workspace/test-lists/try-what-shipped.json +9 -0
  38. package/workspace/test-lists/work-ask-chat.json +9 -0
@@ -0,0 +1,194 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* try-it.js — try what shipped (initiative try-what-shipped). After an update, the user tries each change and says if it works.
4
+ * THE ONE WRITER and THE ONE FOLD of <state>/try/answers.jsonl, the list of changes to try, and the `pmos try` command.
5
+ *
6
+ * WHERE THE STEPS COME FROM. Each PR's changelog entry (workspace/changelog.json, written by scripts/kit-changelog.js) may carry
7
+ * try: { steps: [1 to 3], see?, open? }, copied from the PR's Story (Try:, Expect:, Open:). The Builder writes them (factory BUILDER.md).
8
+ * BETA ONLY (Wawan 2026-11-23: "That should only lands on Beta."). A computer on the GA line gets an empty list and no Home row.
9
+ * LOCAL ONLY. The answers stay in the state folder on this computer. Nothing here sends anything. The factory reads the file from the
10
+ * test-bed computer (factory/checker/try-feedback.js; Wawan's card 2026-11-23: "Factory reads it from your computer").
11
+ *
12
+ * THE LEDGER. One line per press, { at, key, v, n, verdict, note?, until? }:
13
+ * key '<version>#<PR number>' (the change) verdict works | broken | note | undo (undo takes the key's answer back)
14
+ * key '*' verdict later, until: 'YYYY-MM-DD' Later hides Today's row until that local day
15
+ *
16
+ * changesOf(appDir) → the installed changelog, raw installedOf(appDir) → the app version
17
+ * listOf({ changes, installed, answers, now, beta }) → { beta, items: [card], total, shown } PURE
18
+ * fold(lines) → { answers: Map key → line, later: 'YYYY-MM-DD' | '' } PURE
19
+ * answer(dir, { key, verdict, note }, list) → { ok, line } | { ok: false, error } refuses a key the list does not hold
20
+ * count(lines, changes, now) → { tried, answered, pct } PURE, the health number
21
+ * rowOf(list, { later, today }) → the Home row or null PURE (public/pm/try-view.js has the same rule for the page)
22
+ * CLI: pmos try [list|works|broken|note|undo|later|count] … (run), and node lib/try-it.js count (the health number on its last line) */
23
+ const fs = require('fs');
24
+ const path = require('path');
25
+
26
+ const TAG = '[try-it]';
27
+ const DAYS = 14;
28
+ const SHOW = 5;
29
+ const VERDICTS = new Set(['works', 'broken', 'note', 'undo']);
30
+ const APP_DIR = path.resolve(__dirname, '..');
31
+
32
+ const ledgerFile = (dir) => path.join(String(dir || ''), 'try', 'answers.jsonl');
33
+ const localDay = (t = Date.now()) => { const d = new Date(t); return new Date(d.getTime() - d.getTimezoneOffset() * 60000).toISOString().slice(0, 10); };
34
+ const vnum = (v) => String(v || '').split('-')[0].split('.').map((x) => Number(x) || 0);
35
+ const vcmp = (a, b) => { const A = vnum(a), B = vnum(b); for (let i = 0; i < 3; i++) if ((A[i] || 0) !== (B[i] || 0)) return (A[i] || 0) - (B[i] || 0); return 0; };
36
+ const str = (x, max) => (typeof x === 'string' ? x.replace(/\s+/g, ' ').trim().slice(0, max) : '');
37
+ const OPEN_RE = /^\/(?!\/)[A-Za-z0-9._~!$&'()*+,;=:@%/?#-]{0,300}$/;
38
+
39
+ function changesOf(appDir = APP_DIR) {
40
+ try { const j = JSON.parse(fs.readFileSync(path.join(appDir, 'changelog.json'), 'utf8')); return Array.isArray(j) ? j : []; } catch { return []; }
41
+ }
42
+ function installedOf(appDir = APP_DIR) {
43
+ try { return JSON.parse(fs.readFileSync(path.join(appDir, 'package.json'), 'utf8')).version || null; } catch { return null; }
44
+ }
45
+ function readLines(dir) {
46
+ try { return fs.readFileSync(ledgerFile(dir), 'utf8').split('\n').filter(Boolean).map((l) => { try { return JSON.parse(l); } catch { return null; } }).filter(Boolean); }
47
+ catch { return []; }
48
+ }
49
+
50
+ /** The answers by key (the last press wins; undo removes it) and the Later day. */
51
+ function fold(lines) {
52
+ const answers = new Map(); let later = '';
53
+ for (const l of lines || []) {
54
+ if (!l || typeof l.key !== 'string') continue;
55
+ if (l.key === '*') { if (l.verdict === 'later' && /^\d{4}-\d{2}-\d{2}$/.test(l.until || '')) later = l.until; continue; }
56
+ if (l.verdict === 'undo') answers.delete(l.key); else if (VERDICTS.has(l.verdict)) answers.set(l.key, l);
57
+ }
58
+ return { answers, later };
59
+ }
60
+
61
+ /** One card per change: from versions up to the installed one, in the last DAYS days, with try steps, not a chore, not answered. */
62
+ function cardsOf(changes, installed, now) {
63
+ const out = [];
64
+ for (const e of changes || []) {
65
+ if (!e || typeof e.v !== 'string' || !Array.isArray(e.prs)) continue;
66
+ if (installed && vcmp(e.v, installed) > 0) continue;
67
+ const at = Date.parse(e.at || '');
68
+ if (!Number.isFinite(at) || now - at > DAYS * 864e5) continue;
69
+ for (const p of e.prs) {
70
+ const y = p && p.try;
71
+ if (!y || !Array.isArray(y.steps) || !y.steps.length || p.k === 'x') continue;
72
+ const steps = y.steps.map((s) => str(s, 140)).filter(Boolean).slice(0, 3);
73
+ if (!steps.length) continue;
74
+ const open = typeof y.open === 'string' && OPEN_RE.test(y.open) ? y.open : null;
75
+ out.push({ key: `${e.v}#${p.n == null ? str(p.h || p.t, 40) : p.n}`, v: e.v, n: p.n == null ? null : p.n, at: e.at,
76
+ title: str(p.h || p.t || p.s, 120), kind: p.k || null, steps, see: str(y.see, 200) || null, open });
77
+ }
78
+ }
79
+ return out.sort((a, b) => vcmp(b.v, a.v) || (b.n || 0) - (a.n || 0));
80
+ }
81
+
82
+ function listOf({ changes, installed, answers = new Map(), now = Date.now(), beta = true } = {}) {
83
+ if (!beta) return { beta: false, items: [], total: 0, shown: 0 };
84
+ const open = cardsOf(changes, installed, now).filter((c) => !answers.has(c.key));
85
+ const items = open.slice(0, SHOW);
86
+ return { beta: true, items, total: open.length, shown: items.length };
87
+ }
88
+
89
+ /** Home's one row, or null (zero is silence; Later hides it until its day). */
90
+ function rowOf(list, { later = '', today = localDay() } = {}) {
91
+ if (!list || !list.beta || !list.total) return null;
92
+ if (later && later > today) return null;
93
+ return { key: 'try', go: 'try', title: list.total + (list.total === 1 ? ' new thing to try' : ' new things to try'), sub: 'From your recent updates. Each takes under a minute.' };
94
+ }
95
+
96
+ function append(dir, line) {
97
+ const f = ledgerFile(dir);
98
+ fs.mkdirSync(path.dirname(f), { recursive: true });
99
+ fs.appendFileSync(f, JSON.stringify(line) + '\n');
100
+ }
101
+
102
+ /** A press: works, broken, note (with text), or undo; the key must be a change the list knows (answered ones count for undo). */
103
+ function answer(dir, { key, verdict, note } = {}, { changes = [], installed = null, now = Date.now() } = {}) {
104
+ if (!VERDICTS.has(verdict)) return { ok: false, error: 'verdict is works, broken, note or undo' };
105
+ const known = cardsOf(changes, installed, now).find((c) => c.key === key);
106
+ if (!known) return { ok: false, error: 'no change to try has that key' };
107
+ const text = str(note, 1000);
108
+ if (verdict === 'note' && !text) return { ok: false, error: 'a note needs its text' };
109
+ const line = { at: new Date(now).toISOString(), key, v: known.v, n: known.n, title: known.title, verdict, ...(text ? { note: text } : {}) };
110
+ append(dir, line);
111
+ console.log(`${TAG} ${verdict} ${key}`);
112
+ return { ok: true, line };
113
+ }
114
+ function later(dir, { now = Date.now() } = {}) {
115
+ const until = localDay(now + 864e5);
116
+ const line = { at: new Date(now).toISOString(), key: '*', verdict: 'later', until };
117
+ append(dir, line);
118
+ return { ok: true, line };
119
+ }
120
+
121
+ /** The health number: of the changes with try steps in the last DAYS days, how many got an answer. */
122
+ function count(lines, changes, now = Date.now()) {
123
+ const cards = cardsOf(changes, null, now), { answers } = fold(lines);
124
+ const answered = cards.filter((c) => answers.has(c.key)).length;
125
+ return { tried: cards.length, answered, pct: cards.length ? Math.round((answered / cards.length) * 100) : 0 };
126
+ }
127
+
128
+ /* ── pmos try ─────────────────────────────────────────────────────────────────────────────────────────────── */
129
+ const USAGE = [
130
+ 'usage: pmos try [list|works|broken|note|undo|later|count] — try what shipped in your recent updates (beta only)',
131
+ ' pmos try the changes to try, newest first, each with its steps, what you should see and where to open',
132
+ ' pmos try works <n> it works (n is the number pmos try shows, or the change key 0.738.0#1639)',
133
+ ' pmos try broken <n> [--note "…"] it did not work; the factory takes it first',
134
+ ' pmos try note <n> --note "…" a note on the change',
135
+ ' pmos try undo <n> take your answer back',
136
+ ' pmos try later hide the Today row until tomorrow',
137
+ ' pmos try count answered percent of the last 14 days; the number is on the last line',
138
+ 'Answers stay on this computer. Nothing is sent.',
139
+ ];
140
+ /** The beta line: PMOS_CHANNEL beta/early, else the setting upd.channel=early (the rule lib/kit-update.js channel() states; read here
141
+ * without requiring kit-update, which no other library module may load). */
142
+ function betaOf(env, stateDir) {
143
+ const e = String((env && env.PMOS_CHANNEL) || '').trim().toLowerCase();
144
+ if (e === 'beta' || e === 'early') return true;
145
+ if (e === 'latest' || e === 'ga' || e === 'stable' || !stateDir) return false;
146
+ try { return require('./settings-store.js').get(stateDir, 'upd.channel') === 'early'; } catch { return false; }
147
+ }
148
+
149
+ function ctxOf(o) {
150
+ const stateDir = o.stateDir || require('./state-root.js').defaultRoot({ env: o.env || process.env });
151
+ const appDir = o.appDir || APP_DIR;
152
+ const beta = o.beta != null ? o.beta : betaOf(o.env || process.env, stateDir);
153
+ return { stateDir, changes: changesOf(appDir), installed: installedOf(appDir), beta, now: o.now || Date.now() };
154
+ }
155
+ function run(argv, o = {}) {
156
+ const say = o.say || console.log;
157
+ const args = argv[0] === 'try' ? argv.slice(1) : argv.slice();
158
+ const flag = (k) => { const i = args.indexOf('--' + k); if (i < 0) return null; const v = args[i + 1]; args.splice(i, 2); return v; };
159
+ const note = flag('note');
160
+ const [cmd = 'list', ref] = args;
161
+ if (cmd === 'help' || cmd === '--help') { USAGE.forEach((l) => say(l)); return 0; }
162
+ const C = ctxOf(o), lines = readLines(C.stateDir), F = fold(lines);
163
+ if (cmd === 'count') { const c = count(lines, C.changes, C.now); say(`${TAG} ${c.answered} of ${c.tried} changes answered`); say(String(c.pct)); return 0; }
164
+ if (!C.beta) { say('This computer follows the GA line, so PMOS does not ask you to try changes. Beta computers do.'); return cmd === 'list' ? 0 : 1; }
165
+ const L = listOf({ changes: C.changes, installed: C.installed, answers: F.answers, now: C.now, beta: true });
166
+ if (cmd === 'list') {
167
+ if (!L.total) { say('Nothing new to try.'); return 0; }
168
+ L.items.forEach((c, i) => {
169
+ say(`${i + 1}. ${c.title} (${c.v}) · ${c.key}`);
170
+ c.steps.forEach((s, j) => say(` ${j + 1}) ${s}`));
171
+ if (c.see) say(` You should see: ${c.see}`);
172
+ if (c.open) say(` Open: ${c.open}`);
173
+ });
174
+ if (L.total > L.shown) say(`${L.total - L.shown} more after these.`);
175
+ return 0;
176
+ }
177
+ if (cmd === 'later') { later(C.stateDir, { now: C.now }); say('Hidden from Today until tomorrow.'); return 0; }
178
+ if (!VERDICTS.has(cmd)) { say(`✗ ${cmd} is not a command of pmos try`); USAGE.forEach((l) => say(l)); return 2; }
179
+ if (!ref) { say(`✗ pmos try ${cmd} needs the change: its number in pmos try, or its key`); return 2; }
180
+ const all = cardsOf(C.changes, C.installed, C.now);
181
+ const key = /^\d+$/.test(ref) && Number(ref) <= L.items.length ? L.items[Number(ref) - 1].key : ref;
182
+ const r = answer(C.stateDir, { key: all.some((c) => c.key === key) ? key : ref, verdict: cmd, note }, C);
183
+ if (!r.ok) { say('✗ ' + r.error); return 1; }
184
+ say(cmd === 'works' ? 'Marked as working.' : cmd === 'broken' ? 'Marked as not working. The factory takes it first.' : cmd === 'undo' ? 'Your answer is taken back.' : 'Note kept.');
185
+ return 0;
186
+ }
187
+
188
+ if (require.main === module) {
189
+ const a = process.argv.slice(2);
190
+ if (a[0] === 'count') { const sd = require('./state-root.js').defaultRoot({ env: process.env }); const c = count(readLines(sd), changesOf()); console.log(`${TAG} ${c.answered} of ${c.tried} changes answered`); console.log(String(c.pct)); }
191
+ else process.exitCode = run(a);
192
+ }
193
+
194
+ module.exports = { TAG, DAYS, SHOW, ledgerFile, localDay, vcmp, changesOf, installedOf, readLines, fold, cardsOf, listOf, rowOf, answer, later, count, run, ctxOf, USAGE, COMMANDS: { try: ['list', 'works', 'broken', 'note', 'undo', 'later', 'count'] } };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.741.0",
3
+ "version": "0.744.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.741.0",
9
+ "version": "0.744.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.741.0",
3
+ "version": "0.744.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",
@@ -1615,3 +1615,5 @@ html.ro body.wk-on .bd-hd { display: none; } /* find and tune moved to the top
1615
1615
  .bd-sigs li { padding: 6px 0; border-top: 1px solid var(--cz-hair); font-size: var(--fs-label); line-height: var(--lh-label); }
1616
1616
  .bd-sigs li:first-child { border-top: 0; }
1617
1617
  .bd-sigs .bd-sign { display: block; color: var(--cz-ink2); }
1618
+ /* Work's Ask PMOS icon (bug 2026-11-23, initiative work-ask-chat) is a computer's: a phone's top bar is one row, and its Ask PMOS is in the menu */
1619
+ @media (max-width: 760px) { .bd-hd .bd-ask { display: none; } }
@@ -542,6 +542,14 @@
542
542
  .ev-st.pm-ds svg.ev-gbar .bg { fill: var(--well); }
543
543
  .ev-st.pm-ds svg.ev-gbar .fg { fill: var(--leaf); }
544
544
 
545
+ /* try-what-shipped (pm/try-view.js): the changes to try, one card each, in Settings › Updates and in the Viewer from Home. Tokens only. */
546
+ .try-list { display: flex; flex-direction: column; gap: var(--space-12); }
547
+ .try-list .try-card { display: flex; flex-direction: column; gap: var(--space-8); }
548
+ .try-list .try-steps { margin: 0; padding-left: var(--space-24); }
549
+ .try-list .try-acts { display: flex; flex-wrap: wrap; gap: var(--space-8); align-items: center; }
550
+ .try-list .try-note { display: block; width: 100%; box-sizing: border-box; margin-top: var(--space-4); font: inherit; }
551
+ @media (max-width: 640px) { .try-list .try-acts .ev-btn { min-height: 44px; flex: 1 1 40%; } }
552
+
545
553
  /* ── the ? list of action keys (pm/action-keys.js, bet A477): a Komorebi sheet over the page; its parts are pm-h-sm, pm-row, pm-kbd, pm-meta, pm-btn.
546
554
  * It takes the width of its rows, never wider than the window less space-16 a side, and its head and list are reached through those parts. ── */
547
555
  .ev-keys.pm-ds { border: 0; border-radius: var(--radius-card); background: var(--card); color: var(--ink); box-shadow: var(--lift); padding: var(--space-24); width: fit-content; max-width: calc(100% - var(--space-32)); }
@@ -397,7 +397,7 @@ function updates() {
397
397
  const acts = T.phase === 'busy' ? '' : `<button type="button" class="ev-btn sm" data-ev-upd="check"${T.busy ? ' disabled' : ''}>Check now</button>${ready() ? `<button type="button" class="ev-btn sm dark" data-ev-upd="update">${appBehind() ? 'Restart to update' : 'Update'}</button>` : ''}`;
398
398
  const kits = (T.ws || []).filter((w) => !w.linked).map((w) => { const k = T.st[w.id], kit = k && k.kit; return trow(w.label || w.name || w.id, kit && kit.present ? 'kit ' + (kit.version || 'vendored by hand') : 'no kit in this workspace', k && k.kitBehind && L ? `<span class="pm-badge blue">${esc(L)} ready</span>` : kit && kit.present && (k.lastCheck || k.latest) ? '<span class="pm-badge">Up to date</span>' : ''); }).join('');
399
399
  const last = s.lastCheck ? 'Last checked ' + new Date(s.lastCheck.at).toLocaleString() + '. ' : '';
400
- return `<div class="ev-card ev-upd first">${mood ? adFace(mood) : ''}<div class="ev-tx ev-grow">${head}</div>${acts}</div>${kits}<p class="pm-meta">${esc(last)}${s.checkDaily ? 'PMOS checks when you open Updates and once a day while a page is open; Check now asks again.' : 'PMOS checks only when you press Check now.'}</p>${weeks()}`;
400
+ return `<div class="ev-card ev-upd first">${mood ? adFace(mood) : ''}<div class="ev-tx ev-grow">${head}</div>${acts}</div>${kits}<p class="pm-meta">${esc(last)}${s.checkDaily ? 'PMOS checks when you open Updates and once a day while a page is open; Check now asks again.' : 'PMOS checks only when you press Check now.'}</p><div data-try-host></div>${weeks()}`;
401
401
  }
402
402
  /** Design E (UpE). A story line: a blue dot for New, an amber dot for Fixed, no dot for Improved; Claude's plain title, then the sentence. */
403
403
  const SPARK = 'M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z';
@@ -582,6 +582,7 @@ function draw() {
582
582
  cardRows(el.querySelector('.ev-st-main')); el.querySelectorAll('.ev-st-main .sc-w').forEach(cardRows);
583
583
  if (disposeClaudeSetup) { disposeClaudeSetup(); disposeClaudeSetup = null; }
584
584
  wfPanel(el);
585
+ tryPanel(el);
585
586
  const setup = el.querySelector('[data-claude-setup]');
586
587
  if (setup) disposeClaudeSetup = mountClaudeSetup(setup, { ws: wsParam() || (T.ws && T.ws[0] && T.ws[0].id) || '', onReady: () => {} });
587
588
  const cur = el.querySelector('.ev-st-nav [aria-current="page"]'); if (cur && cur.scrollIntoView) cur.scrollIntoView({ block: 'nearest', inline: 'nearest' }); // on a phone the section row scrolls: keep the open one in view
@@ -595,6 +596,15 @@ function cardRows(root) {
595
596
  [...root.children].forEach((k) => { if (k.classList.contains('ev-trow')) run.push(k); else flush(); });
596
597
  flush();
597
598
  }
599
+ /** Updates › To try (try-what-shipped): pm/try-view.js draws the changes to try into one node kept across redraws, so an answer in
600
+ * progress is not lost when the status line redraws. Beta only; nothing to try draws nothing. */
601
+ let TRY = null;
602
+ function tryPanel(el) {
603
+ const spot = el.querySelector('[data-try-host]');
604
+ if (!spot) return;
605
+ if (!TRY) { TRY = document.createElement('div'); TRY.className = 'try-host'; import('./try-view.js').then((TV) => TV.mountTry(TRY, { toast, head: true })).catch(() => {}); }
606
+ spot.replaceWith(TRY);
607
+ }
598
608
  /** Workspaces › Workflows (UI grill U1): pm/wf-page.js draws into its host, the same node across redraws; leaving it lets it go. */
599
609
  let WF = null, wfOpts = {};
600
610
  function wfPanel(el) {
@@ -841,7 +851,7 @@ async function load() {
841
851
  T.prods = pk ? pk.products : b && b.ok && b.model && b.model.products ? b.model.products.available || [] : [];
842
852
  if (!w || !Array.isArray(w.workspaces)) T.msg = 'The repositories could not be read.'; else if (!p || !p.ok) T.msg = 'The connectors could not be read.';
843
853
  draw();
844
- await Promise.all(T.ws.map(async (x) => { const r = await pmGet('/api/kit/status?ws=' + encodeURIComponent(x.id)); if (r && r.ok) T.st[x.id] = r; }));
854
+ await Promise.all((T.ws || []).map(async (x) => { const r = await pmGet('/api/kit/status?ws=' + encodeURIComponent(x.id)); if (r && r.ok) T.st[x.id] = r; }));
845
855
  draw();
846
856
  openCheck();
847
857
  }
@@ -447,6 +447,8 @@ function rankIn() {
447
447
  for (const l of S.lab || []) extra.push({ key: 'lab:' + l.ws, go: 'lab', ws: l.ws, board: l.board, title: l.n + (l.n === 1 ? ' Lab finding' : ' Lab findings') + ' to keep or drop', sub: l.say || 'Keep one to start an initiative, or let it go.' });
448
448
  // weekly-what-moved (A441): last week's date and scope moves of every product, one row until the PM opens the list (pm/moves-view.js)
449
449
  if (S.movesRow) extra.push(S.movesRow);
450
+ // try-what-shipped: one row while the updates brought changes to try (beta only; GET /api/try says the row, pm/try-view.js opens the list)
451
+ if (S.tryRow) extra.push(S.tryRow);
450
452
  return { products, programs: S.D.programs || [], move: S.move || {}, mentions: MEN.mentionsOf(S.D).waiting, outbox: S.outbox || [], gaps: (S.wait && S.wait.gaps) || [], extra };
451
453
  }
452
454
  /** Each product's GET /api/your-move, read when Your day opens (never on Home's first draw: page speed). */
@@ -473,10 +475,12 @@ async function readMove() {
473
475
  S.moves = mv.filter((r) => r && r.ok);
474
476
  const prevMoves = JSON.stringify(S.movesRow || null);
475
477
  try { const MV = await import('./moves-view.js'); S.movesRow = MV.rowOf(S.moves, { looked: MV.lookedWeek() }); } catch { S.movesRow = null; }
478
+ const prevTry = JSON.stringify(S.tryRow || null);
479
+ try { const TV = await import('./try-view.js'); S.tryRow = TV.rowOf(await pmGet('/api/try').catch(() => null)); } catch { S.tryRow = null; }
476
480
  const ob = await pmGet('/api/outbox').catch(() => null);
477
481
  const outbox = ob && ob.ok && Array.isArray(ob.entries) ? ob.entries.filter((e) => e && (e.state === 'queued' || e.state === 'blocked')) : [];
478
482
  const lab = labs.filter(Boolean);
479
- const same = JSON.stringify(next) === JSON.stringify(S.move || null) && JSON.stringify(outbox) === JSON.stringify(S.outbox || []) && JSON.stringify(lab) === JSON.stringify(S.lab || []) && prevMoves === JSON.stringify(S.movesRow || null);
483
+ const same = JSON.stringify(next) === JSON.stringify(S.move || null) && JSON.stringify(outbox) === JSON.stringify(S.outbox || []) && JSON.stringify(lab) === JSON.stringify(S.lab || []) && prevMoves === JSON.stringify(S.movesRow || null) && prevTry === JSON.stringify(S.tryRow || null);
480
484
  S.move = next; S.outbox = outbox; S.lab = lab;
481
485
  if (!same) { redrawLater(); drawList(); }
482
486
  // a demotion notice is said once: drawn now, then marked seen so the next read leaves it out
@@ -514,6 +518,7 @@ async function movePress(b) {
514
518
  if (r.go === 'impact') { S.day = false; S.sel = 'impact'; if (isPhone()) S.phoneChat = true; openTarget(homeTarget()); drawList(); return; }
515
519
  if (r.go === 'loose') { VW.drill(); LPV.open(lpHost); return; }
516
520
  if (r.go === 'moves') { VW.drill(); import('./moves-view.js').then((MV) => { MV.openMoves(S.moves || [], { toast }); S.movesRow = null; drawList(); }); return; }
521
+ if (r.go === 'try') { VW.drill(); import('./try-view.js').then((TV) => TV.openTry({ toast, toastUndo, onChange: (l) => { S.tryRow = TV.rowOf({ ...l, ok: true, row: l.total ? { ...S.tryRow, title: l.total + (l.total === 1 ? ' new thing to try' : ' new things to try') } : null }); drawList(); } })); return; }
517
522
  if (r.go === 'lab') { VW.drill(); import('./cozy-lab-ins.js').then((LB) => LB.openLab({ where: () => ({ ws: r.ws, board: r.board }), iniHref: (id) => '/premium-initiative.html?' + (r.ws ? 'ws=' + encodeURIComponent(r.ws) + '&' : '') + 'id=' + encodeURIComponent(id), toast: (m, undo) => (undo ? toastUndo(m, undo) : toast(m)) })); return; }
518
523
  return;
519
524
  }
@@ -0,0 +1,41 @@
1
+ /* pm/library-keys.js — what a key and a press do on the Library page (initiative library-place, D1 and D6; A437).
2
+ * The page (premium-library.js) binds these to the real window and list; library-place.test.js presses the same keys on a stand-in
3
+ * EventTarget in node, so the tests run the handlers themselves and not a search over the source.
4
+ *
5
+ * bindSlash(target, { focus, popupOpen }) "/" anywhere but a text field, with no modifier and no popup open, puts the cursor in the search (D1)
6
+ * pressStep(x, { wide, pick }) a press on a row: on a desk (≥ 1200 px) the first press shows its Detail block → 'show',
7
+ * the second press opens it as the full popup → 'open'; a link, or a narrow screen, opens at once (D6)
8
+ * bindEnterOpen(target, { open }) Enter on a row's name opens the item, on any screen (D6)
9
+ */
10
+ const TEXT = /^(INPUT|TEXTAREA|SELECT)$/;
11
+
12
+ export function slashFocuses(e, { popupOpen = false } = {}) {
13
+ if (!e || e.key !== '/' || e.metaKey || e.ctrlKey || e.altKey) return false;
14
+ const t = e.target;
15
+ if (t && (t.isContentEditable || TEXT.test(t.tagName || ''))) return false;
16
+ return !popupOpen;
17
+ }
18
+
19
+ export function bindSlash(target, { focus, popupOpen = () => false }) {
20
+ const on = (e) => { if (!slashFocuses(e, { popupOpen: popupOpen() })) return; e.preventDefault(); focus(); };
21
+ target.addEventListener('keydown', on);
22
+ return on;
23
+ }
24
+
25
+ export function pressStep(x, { wide = false, pick = null } = {}) {
26
+ if (!x) return null;
27
+ return wide && pick !== x.id && !(x.open && x.open.url) ? 'show' : 'open';
28
+ }
29
+
30
+ // the row element of an event target that is a row's name (data-lb-open), or null
31
+ export function nameRow(e) {
32
+ const t = e && e.target;
33
+ if (!e || e.key !== 'Enter' || !t || typeof t.matches !== 'function' || !t.matches('[data-lb-open]')) return null;
34
+ return (typeof t.closest === 'function' && t.closest('[data-lb-i]')) || null;
35
+ }
36
+
37
+ export function bindEnterOpen(target, { open }) {
38
+ const on = (e) => { const row = nameRow(e); if (!row) return false; e.preventDefault(); open(row); return true; };
39
+ target.addEventListener('keydown', on);
40
+ return on;
41
+ }
@@ -259,7 +259,7 @@ export function install(g = globalThis) {
259
259
  const url = typeof input === 'string' ? input : input && input.url;
260
260
  const method = String((init && init.method) || (input && typeof input === 'object' && input.method) || 'GET').toUpperCase();
261
261
  if (method === 'POST' && url && init && typeof init.body === 'string') {
262
- const p = new URL(url, 'http://x').pathname;
262
+ const p = new URL(url, 'http://127.0.0.1/').pathname;
263
263
  if (TASK_WRITE.test(p) || JIRA_MOVE.test(p)) le = begin(p, JSON.parse(init.body));
264
264
  }
265
265
  } catch { le = null; }
@@ -43,9 +43,29 @@ export function keyOf(it) {
43
43
  /** The chat's target (home-chat.js mountChat open): the item's name is its scope; Claude answers. */
44
44
  export function targetOf(it, ws) {
45
45
  const title = String((it && it.title) || 'this').slice(0, 80);
46
- return { key: keyOf(it), ws: ws || undefined, title, about: title, scope: { text: title, icon: FLAG }, role: CLAUDE, rich: false,
46
+ return { key: keyOf(it), ws: ws || undefined, title, about: title, scope: { text: title, icon: FLAG }, role: CLAUDE, rich: false, context: contextOf(it, ws),
47
47
  placeholder: 'Message PMOS about ' + title, empty: 'Ask about ' + title + '. PMOS reads its records and works on it in a real session.' };
48
48
  }
49
+ /** What the chat is about, in the page's words, for a chat whose key the server's model has no row for (a program, a whole product):
50
+ * lib/briefing-premium-agent.js starts it from these words (bug 2026-11-23). An initiative's chat reads its own record and needs none. */
51
+ export function contextOf(it, ws) {
52
+ const kind = String((it && (it.scopeKind || it.kind)) || '').toLowerCase(), title = String((it && it.title) || '').replace(/\s+/g, ' ').trim().slice(0, 80);
53
+ if (!title || !/^(program|product)$/.test(kind)) return undefined;
54
+ const where = ws ? ' (workspace ' + String(ws).slice(0, 60) + ')' : '';
55
+ return kind === 'product'
56
+ ? 'The product ' + title + where + ': its programs and initiatives on the Work page. Read them with pmos before you answer.'
57
+ : 'The program ' + title + where + ': its initiatives and milestones. Read it with pmos before you answer.';
58
+ }
59
+ /** The chat about one whole product (Work's Ask PMOS icon, bug 2026-11-23): its own conversation (board:product-<ws>), "In: <name>". */
60
+ export function productTarget(ws, name) {
61
+ return popTarget({ id: 'product-' + String(ws || ''), kind: 'board', scopeKind: 'product', title: name || ws }, ws);
62
+ }
63
+ /** Open a chat target as the page's chat: the one popup on a desk (its chat changes when it shows already), the sheet on a phone. */
64
+ export async function openAbout(t) {
65
+ if (!t) return false;
66
+ if (!isPhone()) { const P = await import('./cozy-popup.js'); return P.openCos(t); }
67
+ return openTarget(t, { title: t.title });
68
+ }
49
69
  /** Home's own address for the same conversation (⋯ › Open in a new tab). */
50
70
  const homeHref = (it, key) => '/premium.html?' + new URLSearchParams({ about: key, label: String(it.title || '').slice(0, 80) }).toString();
51
71
 
@@ -319,6 +319,27 @@ function pinSettled() {
319
319
  }
320
320
  $('#ibBody').addEventListener('click', (e) => { if (e.target.closest('[data-pvwpin],[data-pvwsug]')) pinPress(e); }, true);
321
321
 
322
+ /* ── Ask PMOS about the product shown (bug 2026-11-23): a product, or the products picked, get their own chat in the one popup. Not on a
323
+ * published read-only copy, which has no chat. ── */
324
+ function askAbout() {
325
+ if (!M || !M.board) return null;
326
+ if (ALL) {
327
+ const names = (M.board.products || []).map((p) => productName(p.ws, p.name)).filter(Boolean), some = PICK.length > 1 && names.length;
328
+ const here = some ? names.join(', ') : 'all products';
329
+ return { label: 'Ask PMOS about ' + here, open: (C) => C.openCos({ here: 'Work · ' + here }) };
330
+ }
331
+ const name = productName(M.board.ws, M.board.product || M.board.name || M.board.ws || '');
332
+ if (!M.board.ws || !name) return null;
333
+ return { label: 'Ask PMOS about ' + name, open: (C) => C.openAbout(C.productTarget(M.board.ws, name)) };
334
+ }
335
+ function drawAsk() {
336
+ const b = $('#bdAsk'); if (!b) return;
337
+ const a = window.PMOS_READONLY ? null : askAbout();
338
+ b.hidden = !a;
339
+ if (a) { b.setAttribute('aria-label', a.label); b.title = a.label; }
340
+ }
341
+ { const b = $('#bdAsk'); if (b) b.addEventListener('click', () => { const a = askAbout(); if (a) import('./page-chat.js').then((C) => a.open(C)); }); }
342
+
322
343
  /* ── the toolbar: picker, chips ───────────────────────────────────────────────────────────────────────────────────── */
323
344
  let crumbed = false;
324
345
  function drawHead() {
@@ -326,10 +347,11 @@ function drawHead() {
326
347
  crumbed = true;
327
348
  drawPick();
328
349
  // the display names come in once (GET /api/workspaces): then the chip and Work's Product cells draw again with them
329
- whenNames().then(() => { if (!M) return; drawPick(); if (workOn()) drawInit(); });
350
+ whenNames().then(() => { if (!M) return; drawPick(); drawAsk(); if (workOn()) drawInit(); });
330
351
  const names = (M.board.products || []).map((p) => p.name), some = ALL && PICK.length > 1;
331
352
  chatAbout('board:this-board', some ? 'the ' + names.join(', ') + ' boards' : ALL ? 'all products' : M.board.name ? 'the ' + M.board.name + ' board' : 'this board');
332
353
  }
354
+ drawAsk();
333
355
  $('#snap').textContent = M.header.text;
334
356
  // PMOS-self: new work starts at the pmos-router skill. All products: New asks which product the initiative is for
335
357
  $('#newIni').hidden = ALL ? (M.board.products || []).every((p) => p.self) : !!M.board.self;
@@ -27,6 +27,7 @@ import * as SC from './scope-chip.js';
27
27
  const { scopeChipHtml, openScope, matches: scopeMatches, narrowed, scopeWords, whenNames } = SC;
28
28
  import { FAMILIES, GROUPS, STATES, view, counts, passes, matches, aboutText, stateText, dayText, when, noteOf, hiddenText } from './library-model.js';
29
29
  import { openItem } from './library-open.js';
30
+ import { bindSlash, bindEnterOpen, pressStep } from './library-keys.js'; // D1 and D6: the keys and presses, tested by pressing them (A437)
30
31
  import { STEP, nextShown, moreHtml, totalOf, logMore } from './list-cap.js'; // lists stay short (A455): one step for every long list
31
32
 
32
33
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
@@ -405,7 +406,7 @@ $('lbMore').onclick = () => openMenu('lbMore', moreMenu, morePress, 'pm-menu lb-
405
406
  addEventListener('pp:changed', (e) => { if (e.detail && e.detail.products) { S.P = e.detail; draw(); } });
406
407
  function press(x) {
407
408
  if (!x) return;
408
- if (wide() && S.pick !== x.id && !(x.open && x.open.url)) { S.pick = x.id; draw(); return; }
409
+ if (pressStep(x, { wide: wide(), pick: S.pick }) === 'show') { S.pick = x.id; draw(); return; }
409
410
  openItem(x, { from: 'Library' });
410
411
  }
411
412
  async function saveName(id, name) {
@@ -448,12 +449,9 @@ body.onkeydown = (e) => {
448
449
  if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); S.naming = null; draw(); }
449
450
  return;
450
451
  }
451
- // Enter on a name opens the item, on any screen
452
- if (e.key === 'Enter' && e.target.matches('[data-lb-open]')) {
453
- e.preventDefault();
454
- const row = e.target.closest('[data-lb-i]'); const x = row && S.shown[Number(row.dataset.lbI)]; if (x) openItem(x, { from: 'Library' });
455
- }
456
452
  };
453
+ // Enter on a name opens the item, on any screen
454
+ bindEnterOpen(body, { open: (row) => { const x = S.shown[Number(row.dataset.lbI)]; if (x) openItem(x, { from: 'Library' }); } });
457
455
  pv.onclick = (e) => {
458
456
  const x = S.pick && (S.items || []).find((i) => i.id === S.pick);
459
457
  let b;
@@ -463,12 +461,7 @@ pv.onclick = (e) => {
463
461
  };
464
462
  qBox.addEventListener('input', () => { S.q = qBox.value.trim(); draw(); findByMeaning(); });
465
463
  qBox.addEventListener('keydown', (e) => { if (e.key === 'Escape' && qBox.value) { e.stopPropagation(); qBox.value = ''; S.q = ''; S.meaning = null; draw(); } });
466
- addEventListener('keydown', (e) => {
467
- if (e.key !== '/' || e.metaKey || e.ctrlKey || e.altKey) return;
468
- const t = e.target; if (t && (t.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName))) return;
469
- if (document.body.classList.contains('cz-pop-on')) return;
470
- e.preventDefault(); qBox.focus();
471
- });
464
+ bindSlash(window, { focus: () => qBox.focus(), popupOpen: () => document.body.classList.contains('cz-pop-on') });
472
465
  addEventListener('resize', () => { if (S.pick) drawPreview(); });
473
466
  // the +: Ask PMOS, with the words ready to finish; PMOS adds the file, the link or the new document, fills its record and shows it to confirm
474
467
  $('lbAdd').onclick = async () => {
@@ -0,0 +1,99 @@
1
+ /* pm/try-view.js — try what shipped (initiative try-what-shipped; lib/try-it.js is the store and the list, lib/routes-try.js the HTTP).
2
+ * Pure apart from mountTry and openTry: Node imports it (try-it.test.js Y5).
3
+ *
4
+ * rowOf(list) → Home's Your move row ({ key, go, title, sub }) or null; the server's GET /api/try already says row
5
+ * listHtml(list, { esc }) → one card per change: its title, 1 to 3 steps, what you should see, Show me, Works, Didn't work, a note
6
+ * mountTry(host, H) reads GET /api/try and draws the list in host, with its presses. H: { toast, onChange, phone }
7
+ * openTry(H) the list in the Viewer (Home's row opens it)
8
+ * Beta only: a computer on the GA line gets an empty list, and the list draws nothing (zero is silence).
9
+ * Every answer is the PM's press (pmPost carries the launch nonce) and has Undo. Nothing is sent: the answers stay on this computer. */
10
+ import { pmGet, pmPost } from './http.js';
11
+
12
+ const escDefault = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
13
+ const ICON = 'M9 11l3 3L22 4M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11';
14
+ const svg = (d) => `<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="${d}"/></svg>`;
15
+ const YES = svg('M20 6 9 17l-5-5'), NO = svg('M18 6 6 18M6 6l12 12');
16
+ const OPEN_RE = /^\/(?!\/)[A-Za-z0-9._~!$&'()*+,;=:@%/?#-]{0,300}$/;
17
+
18
+ export function rowOf(list) {
19
+ if (!list || !list.ok || !list.beta) return null;
20
+ return list.row || null;
21
+ }
22
+
23
+ function cardHtml(c, esc, i) {
24
+ const steps = c.steps.map((s) => `<li>${esc(s)}</li>`).join('');
25
+ const open = c.open && OPEN_RE.test(c.open) ? `<a class="ev-btn sm" href="${esc(c.open)}" data-try-open="${esc(c.key)}">Show me</a>` : '';
26
+ return `<section class="pm-block try-card" data-try-key="${esc(c.key)}" aria-label="${esc(c.title)}">`
27
+ + `<div class="head"><h3 class="pm-h-sm">${esc(c.title)}</h3><span class="pm-meta">${esc(c.v)}</span></div>`
28
+ + `<ol class="try-steps">${steps}</ol>`
29
+ + (c.see ? `<p class="pm-meta">You should see: ${esc(c.see)}</p>` : '')
30
+ + `<div class="try-acts">${open}`
31
+ + `<button type="button" class="ev-btn sm" data-try-act="works" data-try-i="${i}" aria-label="It works" title="It works">${YES} Works</button>`
32
+ + `<button type="button" class="ev-btn sm" data-try-act="broken" data-try-i="${i}" aria-label="It did not work" title="It did not work">${NO} Didn't work</button>`
33
+ + `<button type="button" class="ev-btn sm" data-try-act="note" data-try-i="${i}" aria-label="Add a note" title="Add a note">Note</button>`
34
+ + `</div></section>`;
35
+ }
36
+
37
+ /** The list, or '' when there is nothing to try (zero is silence). */
38
+ export function listHtml(list, { esc = escDefault, head = false } = {}) {
39
+ if (!list || !list.beta || !list.items || !list.items.length) return '';
40
+ const more = list.total > list.shown ? `<p class="pm-meta">${list.total - list.shown} more after these.</p>` : '';
41
+ return `<div class="try-list">${head ? `<div class="head"><h3 class="pm-h">To try</h3><span class="pm-meta">${list.total}</span></div>` : ''}<p class="pm-meta">Your recent updates brought these. Each takes under a minute. Didn't work goes to the front of the fix queue.</p>`
42
+ + list.items.map((c, i) => cardHtml(c, esc, i)).join('') + more + '</div>';
43
+ }
44
+
45
+ const SAID = { works: 'Thanks. Marked as working.', broken: 'Marked as not working. It goes to the front of the fix queue.', note: 'Note kept.' };
46
+
47
+ /** Draw the list in host and handle its presses. Returns { list } once read. */
48
+ export async function mountTry(host, H = {}) {
49
+ const toast = H.toast || (() => {});
50
+ const r = await pmGet('/api/try').catch(() => null);
51
+ let list = r && r.ok ? r : { ok: false, beta: false, items: [] };
52
+ const draw = () => { host.innerHTML = listHtml(list, { head: !!H.head }) || (H.empty || ''); };
53
+ draw();
54
+ const send = async (c, verdict, note) => {
55
+ const a = await pmPost('/api/try/answer', { key: c.key, verdict, ...(note ? { note } : {}) }).catch((e) => ({ ok: false, error: String(e && e.message || e) }));
56
+ if (!a || !a.ok) { toast('Not saved: ' + ((a && a.error) || 'the workspace did not answer') + '.'); return false; }
57
+ return true;
58
+ };
59
+ // the presses are real <button>s in host; one listener on the document reads them (a remounted host drops its old one)
60
+ if (host._tryOff) host._tryOff();
61
+ const onPress = async (ev) => {
62
+ const b = ev.target && ev.target.closest && ev.target.closest('[data-try-act]'); if (!b || !host.contains(b)) return;
63
+ const c = list.items[Number(b.dataset.tryI)]; if (!c) return;
64
+ const verdict = b.dataset.tryAct;
65
+ let note = '';
66
+ if (verdict === 'note' || verdict === 'broken') {
67
+ const card = b.closest('.try-card');
68
+ const box = card && card.querySelector('textarea.try-note');
69
+ if (!box) { // the first press opens a note box under the card; broken may be sent without text
70
+ card.insertAdjacentHTML('beforeend', `<label class="pm-meta">${verdict === 'broken' ? 'What happened? (optional)' : 'Your note'}<textarea class="try-note" rows="2"></textarea></label>`
71
+ + `<div class="try-acts"><button type="button" class="ev-btn sm pri" data-try-act="${verdict}" data-try-i="${b.dataset.tryI}" data-try-send="1">Send</button></div>`);
72
+ card.querySelector('textarea.try-note').focus();
73
+ return;
74
+ }
75
+ note = box.value.trim();
76
+ if (verdict === 'note' && !note) { box.focus(); return; }
77
+ }
78
+ b.disabled = true;
79
+ if (!(await send(c, verdict, note))) { b.disabled = false; return; }
80
+ list = { ...list, items: list.items.filter((x) => x.key !== c.key), total: Math.max(0, list.total - 1), shown: Math.max(0, list.shown - 1) };
81
+ draw();
82
+ if (H.onChange) H.onChange(list);
83
+ if (H.toastUndo) H.toastUndo(SAID[verdict], async () => { if (await send(c, 'undo')) { list = await pmGet('/api/try').catch(() => list) || list; draw(); if (H.onChange) H.onChange(list); } });
84
+ else toast(SAID[verdict]);
85
+ };
86
+ host.ownerDocument.addEventListener('click', onPress);
87
+ host._tryOff = () => host.ownerDocument.removeEventListener('click', onPress);
88
+ return { list };
89
+ }
90
+
91
+ /** The list in the Viewer: Home's row opens it. */
92
+ export function openTry(H = {}) {
93
+ const VW = window.czViewer;
94
+ if (!VW) { if (H.toast) H.toast('The list could not open here.'); return; }
95
+ VW.open({ id: 'try', kind: 'To try', title: 'New things to try', icon: ICON, presses: [],
96
+ render: (b) => { mountTry(b, { ...H, empty: '<p class="pm-meta">Nothing new to try. Each update you install brings its own list.</p>' }); } });
97
+ }
98
+
99
+ export function later() { return pmPost('/api/try/later', {}).catch(() => null); }
@@ -50,6 +50,8 @@
50
50
  <!-- what needs a look: one pill of dots and numbers, and its (i): the timeline's legend, the sprints and releases, the Jira read -->
51
51
  <div class="bd-chipset" id="bdChipset"></div>
52
52
  <div class="bd-tools">
53
+ <!-- Ask PMOS about the product shown (bug 2026-11-23): its own chat, in the one popup; pm/premium-board.js names it -->
54
+ <button type="button" class="bd-ib pm-btn bd-ask" id="bdAsk" aria-label="Ask PMOS about this product" title="Ask PMOS about this product" aria-haspopup="dialog" hidden><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 5h16v11H9l-5 4z"/></svg></button>
53
55
  <button type="button" class="bd-ib pm-btn" id="bdFind" aria-label="Find an initiative or work-item" title="Find an initiative or work-item" aria-haspopup="dialog"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M11 4a7 7 0 1 0 0 14a7 7 0 1 0 0-14M20 20l-4-4"/></svg></button>
54
56
  <!-- the tune button: Group, Sort and the filters (owner, category, sprint), with a dot while one is on -->
55
57
  <button type="button" class="bd-ib pm-btn" id="bdFilter" aria-label="Group, sort and filter" title="Group, sort and filter" aria-haspopup="dialog"><svg class="bd-icf" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 5h16l-6 8v6l-4-2v-4z"/></svg><svg class="bd-ict" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 7h9M17 7h3M4 17h3M11 17h9M15 5v4M9 15v4"/></svg><i class="bd-pip bd-tune-pip" hidden></i></button>
@@ -10731,6 +10731,8 @@ async function handleRequest(req, res) {
10731
10731
  : 'could not record the change — nothing was saved', sink, ...(wrote ? { grant, unsaved: rest } : {}) }, 500);
10732
10732
  }
10733
10733
  boardCache.invalidate(w.root);
10734
+ // decisions-from-approvals: a hold with a reason is one line in the product's decision journal; the hold's Undo takes it out
10735
+ try { for (const r of recs) require('./lib/decision-journal.js').onLifecycle(w.root, r); } catch { /* the lifecycle line holds the hold */ }
10734
10736
  return json(res, bulk ? { ok: true, recorded: recs, grant, sink } : { ok: true, recorded: rec, sink });
10735
10737
  }
10736
10738
  if (p === '/api/doc/save' && req.method === 'POST') {
@@ -0,0 +1,5 @@
1
+ {
2
+ "_comment": "decisions-from-approvals (bet A475): the PM approvals, card picks, drops and parks write the decision journal by themselves, with Undo (lib/decision-journal.js logFrom, undo, onLifecycle).",
3
+ "modules": ["decisions-from-approvals.test.js"],
4
+ "seconds": { "decisions-from-approvals.test.js": 2 }
5
+ }