create-pmos 0.492.0 → 0.494.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 (102) hide show
  1. package/package.json +75 -27
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/mods/pmos-cockpit/README.md +1 -1
  4. package/payload/mods/pmos-cockpit/hooks/lib/guard.mjs +2 -2
  5. package/payload/planning/evals/eval-calibration.md +1 -1
  6. package/payload/planning/okrs/health-budgets.md +1 -1
  7. package/payload/state/discoveries.md +1 -1
  8. package/workspace/briefing-premium-initiative-test.js +2 -1
  9. package/workspace/changelog.json +74 -0
  10. package/workspace/fixtures/initiatives-api/list.json +0 -4
  11. package/workspace/fixtures/initiatives-api/roadmap.json +255 -275
  12. package/workspace/fixtures/initiatives-api/sheet.json +2 -3
  13. package/workspace/fixtures/report-api/draft.json +4 -4
  14. package/workspace/fixtures/reports-page/draft-biweekly-2026-10-16.md +4 -4
  15. package/workspace/guide/board.md +2 -2
  16. package/workspace/guide/briefing-premium.md +2 -0
  17. package/workspace/guide/claude-proposes.md +2 -2
  18. package/workspace/guide/data-freshness.md +3 -1
  19. package/workspace/guide/index.md +2 -2
  20. package/workspace/guide/initiative-boards.md +2 -2
  21. package/workspace/guide/initiatives-roadmap.md +38 -39
  22. package/workspace/guide/initiatives-screen.md +22 -20
  23. package/workspace/guide/initiatives-timeline.md +7 -9
  24. package/workspace/guide/integrated-work.md +7 -8
  25. package/workspace/guide/layout.md +2 -2
  26. package/workspace/guide/lifecycle.md +2 -2
  27. package/workspace/guide/notes.md +1 -1
  28. package/workspace/guide/pm-only-acts.md +5 -5
  29. package/workspace/guide/pm-only-lines.md +3 -3
  30. package/workspace/guide/report-slides.md +14 -1
  31. package/workspace/guide/reports.md +4 -2
  32. package/workspace/guide/today.md +2 -2
  33. package/workspace/guide/your-impact.md +6 -7
  34. package/workspace/lib/board-cli.js +1 -1
  35. package/workspace/lib/board-fold.js +6 -6
  36. package/workspace/lib/board-premium.js +3 -3
  37. package/workspace/lib/board-trail.js +30 -3
  38. package/workspace/lib/calendar-tidy.js +1 -1
  39. package/workspace/lib/core-docs.js +2 -2
  40. package/workspace/lib/engine/boards.js +11 -11
  41. package/workspace/lib/engine/signals/detectors.js +13 -13
  42. package/workspace/lib/engine/signals/facts.js +5 -3
  43. package/workspace/lib/git-shape.js +21 -0
  44. package/workspace/lib/grill-runs.js +21 -6
  45. package/workspace/lib/grill.js +1 -1
  46. package/workspace/lib/health-rules-factory.js +13 -14
  47. package/workspace/lib/health-rules-plan.js +8 -7
  48. package/workspace/lib/impact.js +29 -16
  49. package/workspace/lib/initiative-cli.js +59 -63
  50. package/workspace/lib/initiative-needs.js +6 -6
  51. package/workspace/lib/initiative-premium.js +2 -2
  52. package/workspace/lib/initiative-writer.js +2 -2
  53. package/workspace/lib/lifecycle-stage.js +39 -0
  54. package/workspace/lib/page-warm.js +68 -0
  55. package/workspace/lib/placements.js +117 -95
  56. package/workspace/lib/plan-rules.js +7 -5
  57. package/workspace/lib/pm-guard.js +1 -3
  58. package/workspace/lib/pm-lines-needs.js +1 -1
  59. package/workspace/lib/report-design.js +6 -1
  60. package/workspace/lib/report-draft.js +17 -16
  61. package/workspace/lib/report-export.js +148 -9
  62. package/workspace/lib/report-pyramid.js +434 -0
  63. package/workspace/lib/report-slides-data.js +11 -7
  64. package/workspace/lib/report-structure.js +5 -1
  65. package/workspace/lib/report-templates.js +81 -20
  66. package/workspace/lib/routes-boards.js +9 -8
  67. package/workspace/lib/routes-brief-page.js +20 -3
  68. package/workspace/lib/routes-grill.js +10 -4
  69. package/workspace/lib/routes-impact.js +12 -4
  70. package/workspace/lib/routes-initiatives.js +29 -43
  71. package/workspace/lib/routes-notes.js +24 -15
  72. package/workspace/lib/routes-programs.js +6 -4
  73. package/workspace/lib/routes-report-design.js +15 -0
  74. package/workspace/lib/routes-report-flow.js +106 -17
  75. package/workspace/lib/routes-report-setups.js +2 -1
  76. package/workspace/lib/routes-report-structure.js +3 -0
  77. package/workspace/lib/split-merge.js +2 -3
  78. package/workspace/lib/wf-bridge.js +5 -3
  79. package/workspace/package-lock.json +2 -2
  80. package/workspace/package.json +1 -1
  81. package/workspace/premium-chat-report-tab-test.js +5 -1
  82. package/workspace/public/pm/cozy-vw-rp.css +12 -0
  83. package/workspace/public/pm/fetch-share.js +38 -0
  84. package/workspace/public/pm/home-app.js +21 -3
  85. package/workspace/public/pm/home-chat.js +5 -4
  86. package/workspace/public/pm/home-impact.css +23 -13
  87. package/workspace/public/pm/home-impact.js +49 -32
  88. package/workspace/public/pm/home-ini.css +2 -0
  89. package/workspace/public/pm/http.js +1 -1
  90. package/workspace/public/pm/ini-view.css +55 -0
  91. package/workspace/public/pm/ini-view.js +5 -2
  92. package/workspace/public/pm/premium-board.js +1 -0
  93. package/workspace/public/pm/premium-insights.js +1 -0
  94. package/workspace/public/pm/premium-report-read.js +25 -6
  95. package/workspace/public/pm/premium-report-tab.js +69 -14
  96. package/workspace/public/pm/report-flow.js +93 -10
  97. package/workspace/public/pm/view-notes.js +8 -8
  98. package/workspace/replaced-tests.json +14 -0
  99. package/workspace/server.js +24 -3
  100. package/workspace/skills/report-template.skill +8 -0
  101. package/workspace/test-lists/page-open-speed.json +5 -0
  102. package/workspace/test-lists/report-pyramid.json +9 -0
@@ -7,9 +7,14 @@
7
7
  * changedOf(q, base) → ['output' | 'audience' | 'schedule'] what differs from the current template
8
8
  * diffOf(q, base) → ['Format: Slides → Document', …] the same, in words
9
9
  * questionsHtml(q, o) the questions (RfH4, RfH7): Format, Readers, Goes out, Look, Sources, then Draft it.
10
- * o.template draws them as the template (RfH3): "changed" marks, the history, Keep the current template and
10
+ * o.template draws them as the template (RfH3, TplA): Format, Readers, Goes out, Sections (chips, in
11
+ * order, read only) and Look (a small title slide and one line); "changed" marks; ONE ✦ "Make T<n+1>" when
12
+ * the sections or the look change (✕ drops it, ✓ makes it); the history; Keep the current template and
11
13
  * Make a different template
12
- * historyHtml(versions) Template history: T<n>, what it is, when, the cycles issued with it, Go back to T<n>
14
+ * templateChange(T, q) → [words] everything a press of ✓ would change: the settings, the sections, the look
15
+ * changeTargetOf(F) → { path, slot } | { frozen: slot } | {} where a change from the chat goes: the latest draft; an issued
16
+ * latest cycle is frozen; no cycle yet → {} (the first draft takes it)
17
+ * historyHtml(versions) Template history: T<n>, what it is in words, when, the cycles issued with it, what Go back to T<n> restores
13
18
  * waitHtml(F) the report's current state while no cycle is written yet: drafting, ended, or no draft (RfH1)
14
19
  * reviewHtml(rv, o) Claude's review of a draft in the proposal pattern (RfH2): one line, a ✦ row per fix with Not now and Do it,
15
20
  * Do all, and "N other checks found nothing"
@@ -19,7 +24,24 @@
19
24
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
20
25
  const SV = (d, n = 16) => `<svg viewBox="0 0 24 24" width="${n}" height="${n}" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
21
26
  export const ICON = { go: 'M5 12h14M13 6l6 6-6 6', x: 'M6 6l12 12M18 6L6 18', check: 'M5 12.5l4.5 4.5L19 7.5', back: 'M9 14 4 9l5-5M4 9h11a5 5 0 0 1 0 10h-3',
22
- tune: 'M4 7h10M18 7h2M4 17h2M10 17h10M14 5v4M8 15v4' };
27
+ tune: 'M4 7h10M18 7h2M4 17h2M10 17h10M14 5v4M8 15v4', chat: 'M5 6.5A2.5 2.5 0 0 1 7.5 4h9A2.5 2.5 0 0 1 19 6.5v7a2.5 2.5 0 0 1-2.5 2.5H11l-4 3.5V16h.5A2.5 2.5 0 0 1 5 13.5z' };
28
+
29
+ /** The chat a report's header icon opens beside it (Wawan, 2026-11-02: "How do I chat to continue adjusting the template?"): the report's own
30
+ * conversation, pop:report-<id>. A pop: key carries what it is about as its opening context (lib/briefing-premium-agent.js popRow), so Claude knows
31
+ * the report and its draft, and a change comes back as the change block the chip passes to the report's own session. */
32
+ export function chatOf(st = {}, id = '') {
33
+ const sid = String(id).replace(/[^A-Za-z0-9._-]+/g, '-').replace(/^[^A-Za-z0-9]+/, '').slice(0, 90) || 'report';
34
+ const name = String(st.name || 'this report'), draft = st.latest && st.latest.path ? String(st.latest.path) : '';
35
+ const settings = [st.output && (FORMAT_NAMES[st.output] || [st.output])[0], st.audience].filter(Boolean).join(' · ');
36
+ return { key: 'pop:report-' + sid, title: name,
37
+ intro: 'Tell me what to change in ' + name + '. I pass it to the report\'s own session, and the draft beside us changes. Nothing is issued.',
38
+ placeholder: 'Change the report',
39
+ context: { title: name, subject: 'A report set up in PMOS (report id ' + id + ')' + (settings ? ': ' + settings : ''),
40
+ say: 'When the PM asks to change the draft, answer in a few lines and end with ONE fenced code block with the language tag pmos-report holding {"kind":"report","id":"' + id
41
+ + '","change":"the change, in the PM\'s words"}. The PM presses its chip to pass it to the report\'s own session. Do not change the draft yourself. The format, readers, schedule, look and sources change with the template icon in the report\'s header.',
42
+ facts: [['Report id', id]].concat(draft ? [['Latest draft', draft]] : []), files: draft ? [draft] : [] } };
43
+ }
44
+
23
45
  export const FORMAT_NAMES = { 'google-slides': ['Slides', 'Read aloud or presented.'], 'google-doc': ['Document', 'Read alone, with tables and footnotes.'],
24
46
  pdf: ['PDF', 'A fixed page to read or print.'], 'google-sheets': ['Sheets', 'The numbers as a table.'], confluence: ['Confluence page', 'A page in your wiki.'] };
25
47
  export const CADENCES = [['weekly', 'Every week'], ['bi-weekly', 'Every two weeks'], ['monthly', 'Every month'], ['daily', 'Every day']];
@@ -27,6 +49,11 @@ const DAYS = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'];
27
49
  const TIMES = ['07:00', '08:00', '09:00', '10:00', '12:00', '14:00', '16:00', '17:00'];
28
50
 
29
51
  /** The answers a new report starts with: Claude's picks. */
52
+ export function changeTargetOf(F) {
53
+ const L = F && F.latest;
54
+ if (!L || !L.path) return {};
55
+ return L.state === 'issued' ? { frozen: L.slot } : { path: L.path, slot: L.slot };
56
+ }
30
57
  export function picksOf(p = {}) {
31
58
  const s = p.schedule && typeof p.schedule === 'object' && p.schedule.cadence ? p.schedule : null;
32
59
  return { output: p.output || 'google-slides', audience: p.audience || '', repeat: !!s, cadence: s ? s.cadence : 'weekly', day: (s && s.day) || 'Mon', dayOfMonth: (s && s.dayOfMonth) || 1, time: (s && s.time) || '09:00',
@@ -100,6 +127,55 @@ function lookHtml(o) {
100
127
  const words = o.look ? `<p class="vz-note">Your words: “${esc(o.look)}”. Claude makes this look after the first draft; until then it uses the standard look.</p>` : '';
101
128
  return `<fieldset class="rf-q"><legend>Look</legend><p class="rf-fix"><b>Standard PMOS look</b><span>Nunito, navy title slides, 16:9</span></p>${words}</fieldset>`;
102
129
  }
130
+ /* ── the template's sections and look (canvas TplA) ── */
131
+ /** Section chips in order. was: the saved titles; a title new in `now` is marked new, a title gone is struck through. */
132
+ function chipsHtml(now, was) {
133
+ const low = (L) => (L || []).map((x) => String(x).toLowerCase());
134
+ const w = low(was), n = low(now);
135
+ const on = (now || []).map((t, i) => `<span class="rf-cp"${was && !w.includes(n[i]) ? ' data-k="new"' : ''}>${esc(t)}${was && !w.includes(n[i]) ? '<span class="rf-sr"> (new)</span>' : ''}</span>`);
136
+ const gone = was ? (was || []).filter((t, i) => !n.includes(w[i])).map((t) => `<span class="rf-cp" data-k="gone"><s>${esc(t)}</s><span class="rf-sr"> (taken out)</span></span>`) : [];
137
+ return `<div class="rf-cps">${on.concat(gone).join('')}</div>`;
138
+ }
139
+ function tplSectionsHtml(T) {
140
+ const S = T.sections; if (!S) return '';
141
+ const next = S.next && !T.dropped ? S.next : null;
142
+ return `<fieldset class="rf-q"><legend>Sections${next ? ' ' + tag('changed', 'ch') : ''}</legend>${chipsHtml(next || S.titles || [], next ? S.titles || [] : null)}</fieldset>`;
143
+ }
144
+ function tplLookHtml(T, name, o) {
145
+ const L = T.look; if (!L) return '';
146
+ const next = L.next && !T.dropped ? L.next : null;
147
+ const words = next ? next.words : L.words;
148
+ const std = next ? next.n == null : L.saved == null;
149
+ const fol = !std && (L.follows || []).length ? `<small>Follows ${esc(L.follows.join(', '))}</small>` : std ? '<small>Nunito, navy title slides, 16:9</small>' : '';
150
+ const making = o && o.making ? `<p class="vz-note" role="status">Claude is making the look you asked for: “${esc(o.making)}”. It shows here to approve when it is ready.</p>` : '';
151
+ return `<fieldset class="rf-q"><legend>Look${next ? ' ' + tag('changed', 'ch') : ''}</legend><div class="rf-lk"><span class="rf-mini" data-k="${std ? 'std' : 'own'}" aria-hidden="true"><b>${esc(name || '')}</b></span>`
152
+ + `<p class="rf-fix"><b>${esc(words || 'Standard PMOS look')}</b>${fol}</p></div>${making}</fieldset>`;
153
+ }
154
+ /** Everything ✓ would change, in words: the settings (diff), then the sections and the look. */
155
+ export function templateChange(T, q) {
156
+ if (!T) return [];
157
+ const out = (q ? changedOf(q, T.base).length : 0) ? (T.diff || []).slice() : [];
158
+ if (T.dropped) return out;
159
+ if (T.sections && T.sections.next) out.push('Sections: ' + (sectionsDiff(T.sections.titles, T.sections.next) || 'the same'));
160
+ if (T.look && T.look.next) out.push('Look: ' + (T.look.words || 'Standard PMOS look') + ' → ' + (T.look.next.words || 'Standard PMOS look'));
161
+ return out;
162
+ }
163
+ /** "+ Customers, − Risk watch", or "new order" (the same words lib/report-templates.js sectionsDiff says). */
164
+ export function sectionsDiff(was, now) {
165
+ const A = was || [], B = now || [], a = A.map((x) => String(x).toLowerCase()), b = B.map((x) => String(x).toLowerCase());
166
+ const out = B.filter((t, i) => !a.includes(b[i])).map((t) => '+ ' + t).concat(A.filter((t, i) => !b.includes(a[i])).map((t) => '− ' + t));
167
+ return out.length ? out.join(', ') : a.join('\n') !== b.join('\n') ? 'new order' : '';
168
+ }
169
+ /** The ✦ that makes T<n+1> (TplA 2, 3): the change in words, "T<n> keeps its draft and cycles", ✕ drops it, ✓ makes it. Only for a sections
170
+ * or look change: a format, readers or schedule change the PM made here is said in the note under the questions, as before. */
171
+ function proposalHtml(T, words, a, o) {
172
+ if (T.dropped || !((T.sections && T.sections.next) || (T.look && T.look.next))) return '';
173
+ const n = (T.versions || []).reduce((m, v) => Math.max(m, v.n), 0) + 1;
174
+ return `<div class="rf-fx rf-tplx"><span class="rf-star" aria-hidden="true">✦</span><span class="rf-fxt"><b>Make T${n}</b>${words.map((w) => `<span>${esc(w)}</span>`).join('')}`
175
+ + `<span>T${esc(T.current || 1)} keeps its draft and cycles.</span></span>`
176
+ + `<button type="button" class="rf-ib vz-hv" ${a}="tpl-no" aria-label="Not now" title="Not now">${SV(ICON.x)}</button>`
177
+ + `<button type="button" class="rf-ib pri vz-hv" ${a}="maketpl" aria-label="Make T${n}" title="Make T${n}"${o.busy ? ' disabled' : ''}>${SV(ICON.check)}</button></div>`;
178
+ }
103
179
  function sourcesHtml(o) {
104
180
  const L = (o.sources || []).filter(Boolean);
105
181
  if (!L.length) return '';
@@ -110,9 +186,11 @@ export function historyHtml(versions = [], a = 'data-rt', o = {}) {
110
186
  if (!versions.length) return '';
111
187
  const day = (iso) => { const d = new Date(iso || ''); return Number.isFinite(d.getTime()) ? d.toLocaleDateString('en-GB', { day: 'numeric', month: 'short' }) : ''; };
112
188
  const pend = o.pending ? `<li class="rf-hv" data-k="new"><b>T${(versions[0] ? versions[0].n : 0) + 1}</b><span>${esc(o.pending)}<em>Unsaved · waits for Make a different template</em></span></li>` : '';
113
- const rows = versions.map((v) => `<li class="rf-hv"${v.current ? ' aria-current="true"' : ''}><b>T${v.n}</b><span>${esc(v.why || v.words || '')}<em>${esc([day(v.at), v.current ? 'current' : '', v.cycles ? v.cycles + (v.cycles === 1 ? ' cycle issued' : ' cycles issued') : ''].filter(Boolean).join(' · '))}</em></span>`
189
+ // each version says what it is; one that is not current also says what Go back restores (TplA 4): format, readers, schedule, sections, look
190
+ const rows = versions.map((v) => `<li class="rf-hv"${v.current ? ' aria-current="true"' : ''}><b>T${v.n}</b><span>${esc(v.why || v.words || '')}<em>${esc([day(v.at), v.current ? 'current' : '', v.cycles ? v.cycles + (v.cycles === 1 ? ' cycle issued' : ' cycles issued') : ''].filter(Boolean).join(' · '))}</em>`
191
+ + (!v.current && v.words ? `<em class="rf-rest">Going back restores: ${esc(v.words)}</em>` : '') + '</span>'
114
192
  + (v.current ? '' : `<button type="button" class="rf-ib vz-hv" ${a}="restore|${v.n}" aria-label="Go back to T${v.n}" title="Go back to T${v.n}"${o.busy ? ' disabled' : ''}>${SV(ICON.back)}</button>`) + '</li>').join('');
115
- return `<section class="rf-hist"><h3>Template history</h3><ol>${pend}${rows}</ol><p class="vz-note">Going back makes that version the current one. Nothing is deleted.</p></section>`;
193
+ return `<section class="rf-hist"><h3>Template history</h3><ol>${pend}${rows}</ol><p class="vz-note">Going back makes that version the current one. Nothing is deleted. Cycles already made keep the look they were made with; the open draft stays as it is.</p></section>`;
116
194
  }
117
195
  /**
118
196
  * The questions. q = picksOf(…) as the PM changed it. o = { template?: { base, versions, diff }, look, sources, busy, msg }.
@@ -120,16 +198,21 @@ export function historyHtml(versions = [], a = 'data-rt', o = {}) {
120
198
  */
121
199
  export function questionsHtml(q, o = {}, a = 'data-rt') {
122
200
  const T = o.template, ch = T ? changedOf(q, T.base) : [];
123
- const st = T ? (ch.length ? 'Template · changed, not saved yet' : 'Template · T' + (T.current || 1)) : 'Waits on your answers';
201
+ const all = T ? templateChange(T, q) : [];
202
+ const nextN = T ? (T.versions || []).reduce((m, v) => Math.max(m, v.n), 0) + 1 : 0;
203
+ const st = T ? (all.length ? (ch.length ? 'Template · changed, not saved yet' : 'Template · T' + (T.current || 1) + ', T' + nextN + ' waiting') : 'Template · T' + (T.current || 1)) : 'Waits on your answers';
124
204
  const head = `<p class="rf-st"><i class="rf-dot" data-k="you" aria-hidden="true"></i>${esc(st)}</p>`;
125
- const body = formatHtml(q, ch, a) + readersHtml(q, ch, a, o) + goesHtml(q, ch, a) + lookHtml(o) + (T ? '' : sourcesHtml(o));
205
+ const tpl = T && (T.sections || T.look);
206
+ const body = formatHtml(q, ch, a) + readersHtml(q, ch, a, o) + goesHtml(q, ch, a) + (tpl ? tplSectionsHtml(T) + tplLookHtml(T, o.name, o) : lookHtml(o)) + (T ? '' : sourcesHtml(o));
126
207
  const msg = o.msg ? `<p class="vz-msg" role="status">${esc(o.msg)}</p>` : '';
127
208
  if (!T) {
128
209
  return `<div class="rf-qs">${head}${body}${msg}<div class="rf-foot"><span class="vz-note">Nothing goes out</span><button type="button" class="rf-ib pri vz-hv" ${a}="draftit" aria-label="Draft it" title="Draft it"${o.busy || !q.audience.trim() ? ' disabled' : ''}>${SV(ICON.go, 18)}</button></div></div>`;
129
210
  }
130
- const words = ch.length ? T.diff : [];
131
- const note = words.length ? `<p class="rf-chg">${tag('changed', 'ch')} ${esc(words.join('; '))}. This makes a different template. The current one keeps its draft and its cycles.</p>` : '';
132
- return `<div class="rf-qs">${head}${body}${note}${historyHtml(T.versions, a, { pending: words.length ? words.join('; ') : '', busy: o.busy })}${msg}`
211
+ const words = all;
212
+ const fx = proposalHtml(T, words, a, o);
213
+ const note = words.length && !fx ? `<p class="rf-chg">${tag('changed', 'ch')} ${esc(words.join('; '))}. This makes a different template. The current one keeps its draft and its cycles.</p>` : '';
214
+ const ask = tpl && !fx ? `<p class="vz-note">To change the look or the sections, ask in the chat. Claude proposes; you approve.</p>` : '';
215
+ return `<div class="rf-qs">${head}${body}${fx}${note}${ask}${historyHtml(T.versions, a, { pending: words.length ? words.join('; ') : '', busy: o.busy })}${msg}`
133
216
  + `<div class="rf-foot"><button type="button" class="rf-ib vz-hv" ${a}="keep" aria-label="Keep the current template" title="Keep the current template">${SV(ICON.back)}</button>`
134
217
  + `<button type="button" class="rf-ib pri vz-hv" ${a}="maketpl" aria-label="Make a different template" title="Make a different template"${o.busy || !words.length || !q.audience.trim() ? ' disabled' : ''}>${SV(ICON.check, 18)}</button></div></div>`;
135
218
  }
@@ -1429,7 +1429,6 @@ async function meetingSheet(ctx, n) {
1429
1429
  else if (!S.pick && best) S.pick = keyOf(best);
1430
1430
  draw();
1431
1431
  }
1432
- const HORIZON_WORDS = { now: 'Now', next: 'Next', later: 'Later' };
1433
1432
  /** The repositories the notes can be about, one row per repository (its main tree), from the workspace server. */
1434
1433
  async function reposForNotes() {
1435
1434
  const r = await pmGet('/api/workspaces');
@@ -1459,7 +1458,7 @@ async function initiativeSheet(ctx, n) {
1459
1458
  const i = open.find((x) => x.id === pick) || { id: pick, title: pick };
1460
1459
  return link(ctx, n, { initiative: { id: i.id, ws, repo, title: i.title } }, () => 'Now on ' + i.title + '. The note shows on its page.');
1461
1460
  } })] });
1462
- const choose = (v) => { pick = v; for (const b of radios) b.setAttribute('aria-checked', b.dataset.ntIniPick === v ? 'true' : 'false'); if (sel && sel.control.value !== v) sel.control.value = open.some((x) => x.id === v && x.horizon !== 'now') ? v : ''; };
1461
+ const choose = (v) => { pick = v; for (const b of radios) b.setAttribute('aria-checked', b.dataset.ntIniPick === v ? 'true' : 'false'); if (sel && sel.control.value !== v) sel.control.value = open.some((x) => x.id === v && !x.top) ? v : ''; };
1463
1462
  const opt = (v, title, sub) => { const b = button({ label: el('span', { class: 'nt-pick__txt' }, el('b', null, title), el('span', { class: 'nt-hint' }, sub)), variant: 'ghost', attrs: { class: 'nt-pick', role: 'radio', 'aria-checked': pick === v ? 'true' : 'false', 'data-nt-ini-pick': v }, onClick: () => choose(v) }); radios.push(b); return b; };
1464
1463
  async function load(tries = 0) {
1465
1464
  const mine = ++loadId;
@@ -1471,15 +1470,16 @@ async function initiativeSheet(ctx, n) {
1471
1470
  if (!r || !r.ok) { box.replaceChildren(el('p', { class: 'nt-hint', role: 'alert' }, (r && r.error) || 'The initiatives could not be read.')); return; }
1472
1471
  open = r.open || [];
1473
1472
  if (r.pending && !open.length && tries < 8) { setTimeout(() => load(tries + 1), 1500); return; }
1474
- // the active initiatives (Now) are listed as choices; Next and Later are in the list below them
1475
- const active = open.filter((x) => x.horizon === 'now' && !(r.pick && r.pick.id === x.id));
1476
- const later = open.filter((x) => x.horizon !== 'now');
1477
- sel = field({ label: later.length ? 'Or choose a later initiative' : 'Or choose any open initiative', kind: 'select', value: later.some((x) => x.id === pick) ? pick : '',
1478
- options: [{ value: '', label: 'Choose …' }, ...later.map((x) => ({ value: x.id, label: (HORIZON_WORDS[x.horizon] || 'Now') + ' · ' + x.title }))], attrs: { 'data-nt-ini-all': '' } });
1473
+ // the top of the Roadmap is listed as choices, each with its lifecycle stage; the rest are in the list below them (D105)
1474
+ const active = open.filter((x) => x.top && !(r.pick && r.pick.id === x.id));
1475
+ const later = open.filter((x) => !x.top);
1476
+ const sub = (x) => (x.dormant ? 'dormant' : x.stage || 'no stage shown');
1477
+ sel = field({ label: active.length ? 'Or choose another initiative' : 'Or choose any open initiative', kind: 'select', value: later.some((x) => x.id === pick) ? pick : '',
1478
+ options: [{ value: '', label: 'Choose …' }, ...later.map((x) => ({ value: x.id, label: x.title + ' · ' + sub(x) }))], attrs: { 'data-nt-ini-all': '' } });
1479
1479
  sel.control.addEventListener('change', () => choose(sel.control.value));
1480
1480
  const sugg = r.pick ? [el('h3', { class: 'nt-sec__h' }, 'Suggested from what was said'), opt(r.pick.id, r.pick.title, r.pick.shared + ' words in common')] : [];
1481
1481
  const current = n.initiative && (!r.pick || r.pick.id !== n.initiative.id) && !active.some((x) => x.id === n.initiative.id) ? [opt(n.initiative.id, n.initiative.title || n.initiative.id, BY_WORDS[n.initiative.by] || '')] : [];
1482
- const now = active.length ? [el('h3', { class: 'nt-sec__h' }, 'Active now'), ...active.map((x) => opt(x.id, x.title, 'active'))] : [];
1482
+ const now = active.length ? [el('h3', { class: 'nt-sec__h' }, 'Top of the Roadmap'), ...active.map((x) => opt(x.id, x.title, sub(x)))] : [];
1483
1483
  box.replaceChildren(el('div', { role: 'radiogroup', 'aria-label': 'Initiative' }, ...sugg, ...current, ...now, opt('', 'None', 'not about an initiative')),
1484
1484
  later.length ? sel : (open.length ? null : el('p', { class: 'nt-hint' }, 'This repository has no open initiatives. Choose another repository above, or open the Initiatives tab to add one.')));
1485
1485
  }
@@ -619,6 +619,20 @@
619
619
  "index.html's xterm assets are the node_modules-served ones, checked over HTTP below",
620
620
  "the packed workspace runs offline and draws its four panels"
621
621
  ]
622
+ },
623
+ {
624
+ "id": "STD-D105-RETIRE-HORIZONS",
625
+ "file": "workspace/d86-seams.test.js",
626
+ "run": "retire-now-next-later",
627
+ "ref": "okf/products/pmos/adr/d105-retire-now-next-later.md (PM wawan, 2026-11-02: \"We should no longer use Now/Next/Later stage.\")",
628
+ "reason": "D105 retires Now, Next and Later. The placements reader answers one ranked list (`ranked`), the Roadmap golden has rows instead of three horizons, plan-rules has no now_cap, and Move to Now (act 'now') is no longer a PM-only act. The seams suite asserts the new shapes: placements `ranked` and WRITABLE, the golden rows, the three plan rules, and the PM-only acts without 'now'.",
629
+ "names": [
630
+ "1 plan-rules: the four rules have the PRD R24 defaults",
631
+ "5 placements: the reader answers { ok, byInit, order: { now, next, later }, proposals, moves, flags }",
632
+ "5 placements: the horizons are now, next and later",
633
+ "10 the Roadmap golden has the three horizons and a header for each",
634
+ "4 pm-guard: the PM-only acts of R25 and D86 point 2 are listed"
635
+ ]
622
636
  }
623
637
  ],
624
638
  "entries": [
@@ -135,6 +135,7 @@ const memoryLib = require('./lib/memory'); // curated repository mem
135
135
  const audit = require('./lib/audit'); // the workflow audit — the sweep the agents' CLI runs, read-only here (D77)
136
136
  const syncLib = require('./lib/sync'); // press-only fetch / integrate / commit records / push (D70)
137
137
  const kitUpdate = require('./lib/kit-update.js'); // workspace-kit-update: press-only check and update of the kit and the app
138
+ const gitShape = require('./lib/git-shape.js');
138
139
  const gitInfo = require('./lib/git-info'); // read-mostly branch awareness + select/create at session start
139
140
  const startPolicy = require('./lib/start-policy'); // ONE stated rule for where a session starts (repo-first R1/R3)
140
141
  const treeShare = require('./lib/tree-share'); // who shares a working tree, and who is DECLARED to be driving it
@@ -347,6 +348,9 @@ const layoutModel = require('./lib/layout'); // the arrangement model
347
348
  // REFUSED (BIND.refused) so the server exits — there is no code path to a public interface.
348
349
  const BIND = remoteAccess.resolveBinds({ env: process.env });
349
350
  const TOKEN = BIND.token || null; // non-loopback peers must present it; never logged (D08)
351
+ // page-open-speed: a few seconds after a real start, fill the read caches Home and the Board use, so the first page opens like a later one
352
+ const pageWarm = require('./lib/page-warm.js').create({
353
+ binds: BIND.binds, port: () => PORT, stateDir: STATE, start: !REQUIRED_AS_LIBRARY });
350
354
  // workspace-online-mode (D89): the Online switch. Its record lives in the per-user state folder; while it is on, the
351
355
  // workspace runs the tunnel itself and admits the public hostname, and a request to that hostname passes on a verified
352
356
  // Cloudflare Access assertion for the PM's email instead of the token. An environment-set PMOS_PUBLIC_HOST wins and keeps
@@ -923,7 +927,19 @@ function isLinkedRow(w) {
923
927
  }
924
928
  // The rows a PM picks as products (the switcher, Home, the Briefing, the Board's every-product list): every registered row
925
929
  // but a linked worktree. Settings Remove forgets the repository and its worktree rows together (forgetRepository).
926
- function productWorkspaces() { return [...workspaces.values()].filter((w) => !isLinkedRow(w)); }
930
+ function productWorkspaces() {
931
+ // Which tree is the main one changes only when the folder's .git does (gitShape.shapeStamp), so each answer is kept until that stamp
932
+ // moves, not for repoIdentity's 15 s clock (page-open-speed: Home ran git ~20 times for this list after a break).
933
+ const memo = productWorkspaces.memo || (productWorkspaces.memo = new Map()); // root -> { stamp, linked }
934
+ return [...workspaces.values()].filter((w) => {
935
+ const stamp = gitShape.shapeStamp(w.root);
936
+ const hit = memo.get(w.root);
937
+ if (hit && hit.stamp === stamp) return !hit.linked;
938
+ const linked = isLinkedRow(w);
939
+ memo.set(w.root, { stamp, linked });
940
+ return !linked;
941
+ });
942
+ }
927
943
  function wsList() {
928
944
  return [...workspaces.values()].map((w) => {
929
945
  const rid = repoIdentity(w.root);
@@ -2946,13 +2962,13 @@ const proposalRuns = require('./lib/proposal-runs.js').create({
2946
2962
  });
2947
2963
  const proposalTick = () => { try { proposalRuns.tick({}); } catch (e) { warnWriteFail('proposal tick', e); } };
2948
2964
  // Grill and Forecast, part G-A (lib/grill.js, lib/grill-runs.js): Claude grills an initiative by itself before it leaves a stage, when its
2949
- // forecast turns at risk or will miss (lib/forecast.js), when its scope or dates move a lot, and monthly when running work has late tasks.
2965
+ // forecast turns at risk or will miss (lib/forecast.js), when its scope or dates move a lot, and monthly on every running initiative with open work.
2950
2966
  // Each finding is a proposal under its ✦; only the PM's ✓ writes. Settings grill.mode and grill.cap (a monthly credit cap). PMOS_GRILL=off.
2951
2967
  const grillShape = (w) => {
2952
2968
  const RB = require('./lib/routes-boards.js'), TLR = require('./lib/routes-task-links.js'), PR = require('./lib/proposals.js'), ctx = proposalCtx(), out = new Map();
2953
2969
  for (const b of RB.frameFor(ctx, w).boards) {
2954
2970
  const f = TLR.frame(ctx, w, b); if (!f) continue;
2955
- for (const r of f.rows || []) if (r && r.id && !out.has(r.id)) out.set(r.id, { ini: r.id, board: b.id, stage: r.stage || '', stages: (r.wfStages || []).map((s) => ({ key: s.key, name: s.name })), tasks: [] });
2971
+ for (const r of f.rows || []) if (r && r.id && !out.has(r.id)) out.set(r.id, { ini: r.id, board: b.id, resting: !!(r.stopped || r.archived), stage: r.stage || '', stages: (r.wfStages || []).map((s) => ({ key: s.key, name: s.name })), tasks: [] });
2956
2972
  for (const x of f.items) { if (!x || !x.uid || x.kind === 'Epic') continue; const t = PR.taskOf(x); if (t.ini && out.has(t.ini)) out.get(t.ini).tasks.push(t); }
2957
2973
  }
2958
2974
  return [...out.values()];
@@ -2974,6 +2990,11 @@ const grillRuns = require('./lib/grill-runs.js').create({
2974
2990
  return { ini: x.ini, board: x.board, n: x.tasks.filter((t) => !t.closed).length, end: ends.length ? PR.isoN(Math.max(...ends)) : '' };
2975
2991
  }); },
2976
2992
  checks: (w, day) => lateChecks(w, day),
2993
+ // the monthly look covers every running initiative with open work, not only late work (2026-11-02); stopped and archived ones rest
2994
+ looks: (w) => { const PR = require('./lib/proposals.js'); return grillShape(w).filter((x) => !x.resting).map((x) => {
2995
+ const ends = x.tasks.filter((t) => !t.closed).map((t) => t.e).filter((n) => n != null);
2996
+ return { ini: x.ini, board: x.board, n: x.tasks.filter((t) => !t.closed).length, end: ends.length ? PR.isoN(Math.max(...ends)) : '' };
2997
+ }); },
2977
2998
  // the initiatives that move a goal, from the last Intelligence model (lib/insights-premium.js goalsOf: a goal's moves are the initiatives
2978
2999
  // anchored to it); only those of this workspace
2979
3000
  goalInis: (w, id) => { const m = require('./lib/insights-premium.js').peekModel(); const g = m && (m.goals || []).find((x) => x.id === id); if (!g) return [];
@@ -42,3 +42,11 @@ When the lines after this procedure say "This report has a saved structure" (a s
42
42
  - Put the report's words in the note `report.headline`, still between its markers and still one note per marker. Write one short paragraph for each section of the outline that is not the headline, needs or sources section. Start each paragraph with the section's title in bold. Quote the values from the data file with their comparison and say what the flags mean. Start the paragraph with "Warning:" when a chart is flagged. The headline itself comes first: two sentences.
43
43
  - Under the last paragraph, write one paragraph that starts with "Sources:". List the sources reached, with the time you read each, and the sources not reached, each with its reason. The script's own "Sources reached and not reached" section stays as the script wrote it.
44
44
  - The PM changes the structure in the studio. A change applies from the next cycle. Never edit a file under `structure/`.
45
+
46
+ When the lines after this procedure name a draft and a change ("The draft: <path> (slot <slot>)" and "The change the PM asked for"), this run is a change, not a new cycle. Steps 4 to 6 change as follows, and every rule stays:
47
+ - Work on THAT file only. Do not draft a new slot. Never run `pmos report draft <id>` without the slot: it drafts today's slot, which is a second file.
48
+ - If the named file does not exist, stop and say so in one line. Do not write it yourself.
49
+ - A change to the words: rewrite the note or notes that the change is about, even when they already have text. Keep every other note as it is. Rules 3, 6 and 7 still apply.
50
+ - A change to a number, a date, a section, a slide or the order: you cannot make it, because the script writes every number and the template sets the sections (rules 6 and 7). Change nothing. Say in one line which setting it needs: a structured report changes in the studio (it applies from the next cycle); other reports change in the template.
51
+ - Then run `pmos report draft <id> <slot> --redraft`, with the slot from the lines, so the script rewrites the file, keeps every note and writes every number. Read the file once more.
52
+ - A message that starts with `[PMOS report change]` is the same: it names the draft, its slot and the change.
@@ -0,0 +1,5 @@
1
+ {
2
+ "_comment": "Page open speed (2026-11-02): the file-stamp caches that replace git runs on a page open stay as fresh as a git run; the start-up warm-up can be turned off and asks one path at a time.",
3
+ "modules": ["page-open-speed.test.js"],
4
+ "seconds": { "page-open-speed.test.js": 2 }
5
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "The finished report slides, the Pyramid deck (canvas RsA): lib/report-pyramid.js read from a rendered cadence draft. Pure; no server.",
3
+ "modules": [
4
+ "report-pyramid.test.js"
5
+ ],
6
+ "seconds": {
7
+ "report-pyramid.test.js": 1
8
+ }
9
+ }