create-pmos 0.421.0 → 0.422.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 (68) hide show
  1. package/package.json +13 -13
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/scripts/anchor-resolve.js +93 -15
  6. package/payload/state/discoveries.md +1 -1
  7. package/workspace/board-programs-test.js +59 -3
  8. package/workspace/briefing-premium-board-test.js +1 -1
  9. package/workspace/changelog.json +12 -0
  10. package/workspace/fixtures/report-api/draft.json +2 -1
  11. package/workspace/guide/briefing-premium.md +1 -0
  12. package/workspace/guide/home.md +5 -2
  13. package/workspace/guide/programs.md +4 -3
  14. package/workspace/home-other-product-test.js +55 -0
  15. package/workspace/lib/board-premium.js +18 -4
  16. package/workspace/lib/doc-live-root.js +37 -0
  17. package/workspace/lib/engine/anchor-resolve.js +93 -15
  18. package/workspace/lib/engine/boards.js +7 -2
  19. package/workspace/lib/engine/intake.js +1 -1
  20. package/workspace/lib/hold-spans.js +24 -10
  21. package/workspace/lib/kg.js +1 -1
  22. package/workspace/lib/report-draft.js +3 -0
  23. package/workspace/lib/route-modules.js +1 -0
  24. package/workspace/lib/routes-board-premium.js +6 -0
  25. package/workspace/lib/routes-boards.js +48 -9
  26. package/workspace/lib/routes-doc-sheet.js +29 -1
  27. package/workspace/lib/routes-programs.js +44 -5
  28. package/workspace/lib/routes-task-plans.js +333 -0
  29. package/workspace/lib/task-cli.js +16 -9
  30. package/workspace/lib/task-items.js +1 -1
  31. package/workspace/lib/task-plans.js +232 -0
  32. package/workspace/lib/vendor/scripts/anchor-resolve.js +93 -15
  33. package/workspace/lib/vendor/scripts/intake.js +1 -1
  34. package/workspace/package-lock.json +2 -2
  35. package/workspace/package.json +1 -1
  36. package/workspace/premium-vw-doc-test.js +26 -3
  37. package/workspace/program-leave-test.js +203 -0
  38. package/workspace/public/pm/bd-acts.js +5 -2
  39. package/workspace/public/pm/bd-ini-panel.js +20 -7
  40. package/workspace/public/pm/bd-prog-panel.js +22 -7
  41. package/workspace/public/pm/bd-span.js +175 -25
  42. package/workspace/public/pm/cozy-board.css +80 -0
  43. package/workspace/public/pm/cozy-home.css +3 -0
  44. package/workspace/public/pm/doc-follow.js +36 -0
  45. package/workspace/public/pm/home-app.js +38 -7
  46. package/workspace/public/pm/home-ini.js +11 -2
  47. package/workspace/public/pm/home-list.js +2 -2
  48. package/workspace/public/pm/home-today.js +3 -1
  49. package/workspace/public/pm/ini-tasks.js +81 -16
  50. package/workspace/public/pm/ini-versions.js +343 -0
  51. package/workspace/public/pm/ini-view-model.js +27 -41
  52. package/workspace/public/pm/ini-view.css +82 -0
  53. package/workspace/public/pm/ini-view.js +17 -10
  54. package/workspace/public/pm/premium-board.js +109 -18
  55. package/workspace/public/pm/premium-report-read.js +20 -1
  56. package/workspace/public/pm/premium-shell.js +29 -4
  57. package/workspace/public/pm/premium-vw-doc.js +46 -11
  58. package/workspace/public/pm/prog-move.js +69 -0
  59. package/workspace/public/pm/task-card.css +3 -0
  60. package/workspace/public/pm/task-card.js +10 -3
  61. package/workspace/task-milestones-test.js +176 -0
  62. package/workspace/task-plans-test.js +175 -0
  63. package/workspace/task-views-test.js +2 -2
  64. package/workspace/test-lists/program-leave.json +6 -0
  65. package/workspace/test-lists/task-milestones.json +6 -0
  66. package/workspace/test-lists/task-plans.json +6 -0
  67. package/workspace/test-lists/viewer-live-file.json +9 -0
  68. package/workspace/timeline-holds-test.js +61 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.421.0",
3
+ "version": "0.422.0",
4
4
  "description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -32,6 +32,18 @@
32
32
  "audit"
33
33
  ],
34
34
  "pmosChanges": [
35
+ {
36
+ "v": "0.422.0",
37
+ "at": "2026-10-26T13:03:41.940Z",
38
+ "f": 2,
39
+ "prs": [
40
+ {
41
+ "n": 1061,
42
+ "t": "Eleventh testing feedback batch",
43
+ "s": "Eleventh testing feedback batch"
44
+ }
45
+ ]
46
+ },
35
47
  {
36
48
  "v": "0.421.0",
37
49
  "at": "2026-10-26T06:44:56.884Z",
@@ -259,18 +271,6 @@
259
271
  "s": "Viewer shell A, Home rows, meetings, reports and PRD to Jira (second kit)"
260
272
  }
261
273
  ]
262
- },
263
- {
264
- "v": "0.402.0",
265
- "at": "2026-10-24T03:05:59.743Z",
266
- "f": 2,
267
- "prs": [
268
- {
269
- "n": 1031,
270
- "t": "Build the Ready for development page (Home A+C, Programs, 60% panel)",
271
- "s": "Build the Ready for development page (Home A+C, Programs, 60% panel)"
272
- }
273
- ]
274
274
  }
275
275
  ]
276
276
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@7a112c27
1
+ kernel-source: pmos@9e564e36
2
2
  assembled: 2026-10-26
3
3
  mode: vendor
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Eval calibration log"
4
4
  description: "Append-only record of every PM override of an evaluator verdict."
5
- generated: {by: process:create-pmos, at: "2026-10-26T06:44:52Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-26T13:03:39Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Health budgets"
4
4
  description: "Closed registry of health-budget anchors (D59), edited only by the PM."
5
- generated: {by: process:create-pmos, at: "2026-10-26T06:44:52Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-26T13:03:39Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -73,20 +73,45 @@ const ACCEPTED_FORMS = [
73
73
  * called `okrs` that every subsequent KR would then attach to. The shape is therefore pinned:
74
74
  * an objective is `O` + digits, or `O-` + a word; a KR is `KR` + digits, or `KR-` + a word.
75
75
  */
76
- const OBJ_TOKEN = '(O\\d+|O-[A-Za-z][A-Za-z0-9-]*)';
77
- const KR_TOKEN = '(KR\\d+|KR-[A-Za-z][A-Za-z0-9-]*)';
76
+ /*
77
+ * Batch 11 item 6 (2026-10-26): the OKR document as people write it. `## Objective 1 — title` is
78
+ * objective `o1`, the same objective as `## O1 — title`; and `KR1.2` (KR 2 of objective 1) is its own
79
+ * KR `kr1.2`. Before, the heading matched nothing — so no objective was read at all — and `KR1.2`
80
+ * matched as `KR1` with a name starting `.2`: a silent collapse of two KRs into one. The dotted part is
81
+ * digits only, and the token is followed by a lookahead, so `KR1.2` can never be read as `KR1`.
82
+ * `Objective` needs a number after it: `## Objectives` and the H1 `# OKRs — …` stay non-objectives.
83
+ */
84
+ const OBJ_TOKEN = '(O\\d+|O-[A-Za-z][A-Za-z0-9-]*|[Oo]bjective\\s*\\d+)';
85
+ const KR_TOKEN = '(KR\\d+(?:\\.\\d+)*|KR-[A-Za-z][A-Za-z0-9-]*)';
86
+ const TOKEN_END = '(?![A-Za-z0-9]|\\.\\d)';
78
87
  const PERIOD = '((?:q|Q)[1-4]-\\d{4})';
79
88
 
80
- const RE_OBJ_HEADING = new RegExp('^#{1,3}\\s+' + OBJ_TOKEN + '\\s*(?:[—–:-]\\s*(.*))?$');
81
- const RE_KR_BULLET = new RegExp('^\\s*[-*]\\s*\\*\\*\\s*' + KR_TOKEN + '\\s*[—–:-]?\\s*(.+?)\\*\\*');
89
+ const RE_OBJ_HEADING = new RegExp('^#{1,3}\\s+(?:\\*\\*)?' + OBJ_TOKEN + TOKEN_END + '(?:\\*\\*)?\\s*(?:[—–:-]\\s*(.*))?$');
90
+ /* A KR bullet: `- **KR1 — name.** more`, `- **KR1.2** — name`, `- KR1.2: name`, `- KR-C — name`. The
91
+ * name is the bolded text when the bold wraps the id and the name, else the rest of the line. */
92
+ const RE_KR_BULLET = new RegExp('^\\s*[-*]\\s*(\\*\\*)?\\s*' + KR_TOKEN + TOKEN_END + '(.*)$');
93
+
94
+ function krBullet(line) {
95
+ const m = RE_KR_BULLET.exec(line);
96
+ if (!m) return null;
97
+ let rest = m[3];
98
+ const sep = /^\s*[—–:.-]?\s*/;
99
+ let name;
100
+ if (m[1] && /^\s*\*\*/.test(rest)) name = rest.replace(/^\s*\*\*/, '').replace(sep, ''); // **KR1.2** — name
101
+ else if (m[1]) { rest = rest.replace(sep, ''); const end = rest.indexOf('**'); name = end >= 0 ? rest.slice(0, end) : rest; }
102
+ else name = rest.replace(sep, '');
103
+ return { token: m[2], name: name.replace(/\*\*/g, '').trim() };
104
+ }
82
105
 
83
106
  // Anchor forms. Order matters only in that the colon forms are tried before the looser ones.
84
107
  const RE_HEALTH = /^health:([a-z0-9_-]+)/i; // START-anchored — rule 2
85
108
  const RE_DOMAIN = /^domain:([a-z0-9][a-z0-9_-]*)/i; // D67 — the third anchor class
86
- const RE_COLON_KR = new RegExp('^(?:okrs-)?' + PERIOD + ':([a-z0-9][a-z0-9-]*):(kr-?[a-z0-9-]+)$', 'i');
109
+ const RE_COLON_KR = new RegExp('^(?:okrs-)?' + PERIOD + ':([a-z0-9][a-z0-9-]*):(kr-?[a-z0-9-]+(?:\\.\\d+)*)$', 'i');
87
110
  const RE_COLON_OBJ = new RegExp('^(?:okrs-)?' + PERIOD + ':([a-z0-9][a-z0-9-]*)$', 'i');
88
111
  const RE_ARROW = new RegExp('^(?:okrs-)?' + PERIOD + '\\s*(?:→|->)\\s*' + OBJ_TOKEN + '(?:\\.' + KR_TOKEN + ')?$', 'i');
89
112
  const RE_BARE = new RegExp('^' + OBJ_TOKEN + '(?:\\.' + KR_TOKEN + ')?$', 'i');
113
+ // A KR on its own (`KR1.2`, `KR3`): it names its objective only by being declared under exactly one.
114
+ const RE_BARE_KR = new RegExp('^' + KR_TOKEN + '$', 'i');
90
115
 
91
116
  /** Strip markdown emphasis and trailing commentary. `(`, `#` and `/` never appear inside an id. */
92
117
  function stripCommentary(raw) {
@@ -101,6 +126,8 @@ function stripCommentary(raw) {
101
126
  * the heading token minus a leading `O-`, lower-cased. */
102
127
  function objectiveId(token) {
103
128
  const t = String(token || '').trim();
129
+ const n = /^objective\s*(\d+)$/i.exec(t);
130
+ if (n) return 'o' + n[1];
104
131
  const m = /^O-(.+)$/i.exec(t);
105
132
  return (m ? m[1] : t).toLowerCase();
106
133
  }
@@ -110,6 +137,28 @@ function krId(token) {
110
137
  return String(token || '').trim().toLowerCase();
111
138
  }
112
139
 
140
+ /*
141
+ * The OKR period, in the order a reader would look for it: a `period:` line (front matter or body),
142
+ * then the H1 (`# OKRs — Q3 2026`), then the filename (`okrs-q3-2026.md`). Each accepts `2026-Q3`,
143
+ * `Q3 2026` and `q3-2026`. → `q3-2026` or null. Only the canonical form needs it; resolution does not.
144
+ */
145
+ function periodOf(text) {
146
+ const s = String(text || '');
147
+ let m = /(\d{4})[\s_-]*(Q[1-4])(?![0-9])/i.exec(s);
148
+ if (m) return `${m[2].toLowerCase()}-${m[1]}`;
149
+ m = /(?<![A-Za-z])(Q[1-4])[\s_-]*(\d{4})(?![0-9])/i.exec(s);
150
+ return m ? `${m[1].toLowerCase()}-${m[2]}` : null;
151
+ }
152
+
153
+ function filePeriod(text, file) {
154
+ const line = /^\s*[-*]?\s*\**period\**\s*:\s*(.+)$/im.exec(text);
155
+ if (line && periodOf(line[1])) return { period: periodOf(line[1]), from: 'period line' };
156
+ const h1 = /^#\s+(.+)$/m.exec(text);
157
+ if (h1 && periodOf(h1[1])) return { period: periodOf(h1[1]), from: 'title' };
158
+ const name = periodOf(path.basename(file, '.md'));
159
+ return name ? { period: name, from: 'file name' } : null;
160
+ }
161
+
113
162
  function listOkrFiles(root) {
114
163
  const out = [];
115
164
  const seen = new Set();
@@ -150,41 +199,54 @@ function parseOkrIndex(root) {
150
199
  const objectives = [];
151
200
  const byId = new Map();
152
201
  let period = null;
202
+ let periodFrom = null;
203
+ const noPeriod = [];
153
204
  for (const file of files) {
154
205
  let text;
155
206
  try { text = fs.readFileSync(file, 'utf8'); }
156
207
  catch (e) {
157
208
  return { ok: false, objectives: [], files, error: `could not read ${file}: ${String((e && e.message) || e).slice(0, 120)}` };
158
209
  }
210
+ const fp = filePeriod(text, file);
211
+ let declaresObjective = false;
159
212
  let cur = null;
160
213
  for (const line of text.split('\n')) {
161
- if (!period) {
162
- const p = /^\s*[-*]?\s*period\s*:\s*(\d{4})-(Q[1-4])\s*$/i.exec(line);
163
- if (p) period = `${p[2].toLowerCase()}-${p[1]}`;
164
- }
165
214
  const o = RE_OBJ_HEADING.exec(line);
166
215
  if (o) {
216
+ declaresObjective = true;
167
217
  const id = objectiveId(o[1]);
168
218
  cur = byId.get(id);
169
219
  if (!cur) {
170
- cur = { id, token: o[1], name: (o[2] || '').replace(/\*\*/g, '').trim(), krs: [], file: path.relative(root, file) };
220
+ cur = { id, token: o[1].replace(/\s+/g, ' '), name: (o[2] || '').replace(/\*\*/g, '').trim(), krs: [], file: path.relative(root, file), period: fp ? fp.period : null };
171
221
  byId.set(id, cur);
172
222
  objectives.push(cur);
173
223
  }
174
224
  continue;
175
225
  }
176
- const k = RE_KR_BULLET.exec(line);
226
+ const k = krBullet(line);
177
227
  // A KR with no open objective stays UNATTACHED (rule 3) — never inherited from a previous one.
178
- if (k && cur && !cur.krs.some((x) => x.id === krId(k[1]))) {
179
- cur.krs.push({ id: krId(k[1]), token: k[1], name: (k[2] || '').trim() });
228
+ if (k && cur && !cur.krs.some((x) => x.id === krId(k.token))) {
229
+ cur.krs.push({ id: krId(k.token), token: k.token, name: k.name });
180
230
  continue;
181
231
  }
182
232
  // the KR's own measure — its `baseline: … → target: …` sub-bullet (overhaul-r2 B4)
183
233
  const bl = /^\s+[-*]\s*baseline\s*:\s*(.+)$/i.exec(line);
184
234
  if (bl && cur && cur.krs.length && !cur.krs[cur.krs.length - 1].line) cur.krs[cur.krs.length - 1].line = bl[1].trim();
185
235
  }
236
+ if (!declaresObjective) continue; // health-budgets.md, domains.md: not OKR documents, no period expected
237
+ if (fp && !period) { period = fp.period; periodFrom = `${fp.from} of ${path.relative(root, file)}`; }
238
+ if (!fp) noPeriod.push(path.relative(root, file));
239
+ }
240
+ const rels = files.map((f) => path.relative(root, f));
241
+ // What is missing, named with its fix, so a caller never has to guess why a field is empty.
242
+ const missing = [];
243
+ if (!objectives.length) {
244
+ missing.push(`no objective headings were read from ${rels.join(', ')} — write each objective as \`## O1 — title\` or \`## Objective 1 — title\``);
245
+ }
246
+ if (!period && objectives.length) {
247
+ missing.push(`no period found in ${noPeriod.join(', ') || rels.join(', ')} — add a line \`period: 2026-Q3\`, or put the quarter in the title (\`# OKRs — Q3 2026\`) or the file name (\`okrs-q3-2026.md\`)`);
186
248
  }
187
- return { ok: true, objectives, files: files.map((f) => path.relative(root, f)), period: period || null, error: null };
249
+ return { ok: true, objectives, files: rels, period: period || null, period_from: periodFrom, missing, error: null };
188
250
  }
189
251
 
190
252
  function readBudgets(root) {
@@ -298,18 +360,34 @@ function resolveAnchor(raw, index, budgets) {
298
360
  else if ((m = RE_COLON_OBJ.exec(s))) { period = m[1].toLowerCase(); objTok = m[2]; form = 'q3-2026:<objective>'; }
299
361
  else if ((m = RE_ARROW.exec(s))) { period = m[1].toLowerCase(); objTok = m[2]; krTok = m[3] || null; form = 'legacy arrow'; }
300
362
  else if ((m = RE_BARE.exec(s))) { objTok = m[1]; krTok = m[2] || null; form = 'legacy bare'; }
363
+ else if ((m = RE_BARE_KR.exec(s))) { krTok = m[1]; form = 'bare KR'; }
301
364
  else {
302
365
  return Object.assign(base, { kind: 'okr', status: 'unresolvable', form: 'unrecognised', reason: `'${s}' matches no accepted anchor form` });
303
366
  }
304
367
 
305
368
  const out = Object.assign({}, base, {
306
369
  kind: 'okr', form, period,
307
- objective: objectiveId(objTok),
370
+ objective: objTok ? objectiveId(objTok) : null,
308
371
  kr: krTok ? krId(krTok) : null,
309
372
  });
310
373
 
311
374
  if (!index) return Object.assign(out, { status: 'unknown', reason: 'OKR index not supplied to the resolver' });
312
375
  if (!index.ok) return Object.assign(out, { status: 'unknown', reason: index.error || 'OKR documents unreadable' });
376
+ if (!index.objectives.length) {
377
+ return Object.assign(out, { status: 'unresolvable', reason: (index.missing && index.missing[0]) || `no objectives declared in ${index.files.join(', ')}` });
378
+ }
379
+
380
+ if (!out.objective) {
381
+ // A bare KR: its objective is the one objective that declares it. Two objectives with the same KR
382
+ // id is ambiguous, and the reader is told how to write it — never a guess.
383
+ const holders = index.objectives.filter((o) => o.krs.some((k) => k.id === out.kr));
384
+ if (holders.length !== 1) {
385
+ return Object.assign(out, { status: 'unresolvable', reason: holders.length
386
+ ? `KR '${out.kr}' is declared under ${holders.map((o) => o.id).join(' and ')} — write it with its objective, e.g. ${holders[0].token}.${krTok}`
387
+ : `no objective declares KR '${out.kr}' in ${index.files.join(', ')}` });
388
+ }
389
+ out.objective = holders[0].id;
390
+ }
313
391
 
314
392
  const obj = index.objectives.find((o) => o.id === out.objective);
315
393
  if (!obj) {
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Discoveries and friction log"
4
4
  description: "Append-only record of what runs discovered and where the process rubbed."
5
- generated: {by: process:create-pmos, at: "2026-10-26T06:44:52Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-26T13:03:39Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -47,7 +47,13 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
47
47
  const errors = [];
48
48
  page.on('pageerror', (e) => errors.push(String((e && e.stack) || e)));
49
49
  await page.clock.setFixedTime(new Date(F.NOW));
50
- await page.route('**/api/board-premium*', (r) => { const q = new URL(r.request().url()).searchParams; r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: BP.build(F.programFacts(q.get('ws') || 'idpf')), as_of: Date.now() }) }); });
50
+ // o.third: a third product (Replay) in the switcher, its board a copy of Microsites' (batch 11 item 7: tick several)
51
+ const R3 = { ws: 'replay', id: 'replay', name: 'Replay' }, facts = (ws) => {
52
+ if (!o.third) return F.programFacts(ws);
53
+ const boards = [...F.programFacts('idpf').boards, R3];
54
+ return ws === 'replay' ? F.programFacts('microsites', { boards, board: { ...F.programFacts('microsites').board, ...R3, product: 'Replay' } }) : F.programFacts(ws, { boards });
55
+ };
56
+ await page.route('**/api/board-premium*', (r) => { const q = new URL(r.request().url()).searchParams; r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: BP.build(facts(q.get('ws') || 'idpf')), as_of: Date.now() }) }); });
51
57
  await page.route('**/api/programs', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, programs: o.programs || F.programs() }) }));
52
58
  await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'not in this check' }) }));
53
59
  await page.addInitScript(([s]) => { try { if (!sessionStorage.getItem('set')) { sessionStorage.setItem('set', '1'); for (const [k, v] of Object.entries(s)) localStorage.setItem(k, v); } } catch { /* none */ } }, [{ 'pmos.board.view': o.view || 'track', 'pmos.board.pview': o.view === 'time' ? 'track' : o.view || 'track', 'pmos.board.grouping': o.grouping || 'program', ...(o.store || {}) }]);
@@ -159,6 +165,16 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
159
165
  ok('T the program row comes first, with its title and products and a thin span over its initiatives\' dates', /tg-pg/.test(t.first) && /Project Ascent/.test(t.title) && /2 products/.test(t.title) && t.span, JSON.stringify(t));
160
166
  ok('T three milestones within a week merge into one counted diamond labelled "Pilot live +2 · Nov 18–21"', t.clu.length === 1 && /^3\|3 program milestones from Nov 18 to 21: Pilot live, Pilot users invited, Support ready/.test(t.clu[0]) && t.lab.includes('Pilot live +2 · Nov 18–21'), JSON.stringify(t));
161
167
  ok('T the program\'s initiatives sit under it as one-line rows: a status dot and the name', t.kids.join() === 'Descope feature parity,Legacy IdP sunset' && t.oneLine, JSON.stringify(t));
168
+ // batch 11 item 12: By product, a program's initiatives sit under their product on the timeline (the row copies were dropped)
169
+ const bpt = await p.evaluate(async () => {
170
+ const S = await import('/pm/bd-span.js'), now = new Date(2026, 9, 26);
171
+ const a = { key: 'board:a', id: 'a', title: 'In a program', start: '2026-10-01', end: '2026-11-20', track: { key: 'build' } };
172
+ const b = { key: 'board:b', id: 'b', title: 'On its own', start: '2026-10-05', end: '2026-11-10', track: { key: 'build' } };
173
+ const groups = [{ kind: 'product', key: 'p:x', name: 'x', rows: [{ ...a, inProgram: 'pg' }, b] }];
174
+ const d = document.createElement('div'); d.innerHTML = S.timelineHtml([a, b], { jira: null }, 'quarter', { now, groups }).html;
175
+ return [...d.querySelectorAll('.tg-r[data-row]')].map((r) => r.dataset.row);
176
+ });
177
+ ok('T By product: a program\'s initiative shows under its product on the timeline (batch 11 item 12)', bpt.includes('board:a') && bpt.includes('board:b'), JSON.stringify(bpt));
162
178
  const nd = await p.evaluate(async () => {
163
179
  const S = await import('/pm/bd-span.js'), now = new Date(2026, 9, 26);
164
180
  const a = { key: 'board:a', id: 'a', title: 'Dated one', start: '2026-10-01', end: '2026-11-20', track: { key: 'build' } };
@@ -171,7 +187,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
171
187
  return { member: !!row, nd: row ? (row.querySelector('.tg-nd') || {}).textContent : '', loose: [...d.querySelectorAll('.tg-r[data-row]')].some((r) => /Loose undated/.test(r.textContent)), none: T.none.length };
172
188
  });
173
189
  ok('T an undated initiative in a program keeps its row under the program and says "No dates"; an undated one outside a program is named in the foot only (batch 8 item 4)', nd.member && nd.nd === 'No dates' && !nd.loose && nd.none === 2, JSON.stringify(nd));
174
- ok('T a legend in the chip row names done, planned, the program milestone, Deliver or Evaluate and today', /Done in Jira/.test(t.lgd) && /Planned/.test(t.lgd) && /Program milestone/.test(t.lgd) && /Deliver or Evaluate/.test(t.lgd) && /Today/.test(t.lgd), t.lgd);
190
+ ok('T a legend in the chip row names done, planned, the program milestone, Milestone (Deliver, Evaluate and milestone tasks, batch 11 item 3) and today', /Done in Jira/.test(t.lgd) && /To do/.test(t.lgd) && /Program milestone/.test(t.lgd) && /Program milestone.*Milestone/.test(t.lgd) && /Today/.test(t.lgd), t.lgd);
175
191
  await p.click('#ibBody .tg-pg .tg-pgo');
176
192
  // the program opens in the floating Viewer (shell A), which sits over the right of the timeline; close it before the next press
177
193
  await p.keyboard.press('Escape'); await p.waitForFunction(() => { const v = document.querySelector('#czViewer'); return !v || v.hidden; });
@@ -269,7 +285,9 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
269
285
  await p.click('#crSw');
270
286
  const items = await p.evaluate(() => [...document.querySelectorAll('#crMenu [data-sw]')].map((b) => b.textContent));
271
287
  ok('A the product picker offers All products first, then each product', items[0] === 'All products' && items.length === 3, JSON.stringify(items));
272
- await Promise.all([p.waitForNavigation(), p.click('#crMenu [data-sw="*|*"]')]);
288
+ // All products ticks every product; the pick goes when the menu closes (batch 11 item 7)
289
+ await p.click('#crMenu [data-sw="*|*"]');
290
+ await Promise.all([p.waitForNavigation(), p.keyboard.press('Escape')]);
273
291
  await p.waitForSelector('#ibBody [data-key]'); await p.waitForTimeout(700);
274
292
  const a = await p.evaluate(() => ({
275
293
  url: location.search,
@@ -295,6 +313,44 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
295
313
  await ctx.close();
296
314
  }
297
315
 
316
+ /* M several products (batch 11 item 7): the picker ticks several; the Board shows exactly those, merged as All products */
317
+ {
318
+ const { ctx, page: p, errors } = await open({ third: true });
319
+ await p.click('#crSw');
320
+ const st = () => p.evaluate(() => ({ open: !document.querySelector('#crMenu').hidden, ticks: [...document.querySelectorAll('#crMenu [data-sw]')].map((b) => b.textContent + ':' + b.getAttribute('aria-checked')) }));
321
+ const m0 = await st();
322
+ ok('M the menu ticks: All products shows a dash (some), the product on screen is ticked', m0.ticks.join(',') === 'All products:mixed,IDPF:true,Microsites:false,Replay:false', JSON.stringify(m0));
323
+ await p.click('#crMenu [data-sw="microsites|microsites"]');
324
+ const m1 = await st();
325
+ ok('M a press ticks a product and the menu stays open', m1.open && m1.ticks[2] === 'Microsites:true', JSON.stringify(m1));
326
+ await p.click('#crMenu [data-sw="microsites|microsites"]'); await p.click('#crMenu [data-sw="idpf|idpf"]');
327
+ const m2 = await st();
328
+ ok('M a second press unticks; the last ticked product stays ticked', m2.open && m2.ticks.join(',') === 'All products:mixed,IDPF:true,Microsites:false,Replay:false', JSON.stringify(m2));
329
+ await p.click('#crMenu [data-sw="microsites|microsites"]');
330
+ await Promise.all([p.waitForNavigation(), p.mouse.click(1400, 880)]);
331
+ await p.waitForSelector('#ibBody [data-key]'); await p.waitForTimeout(700);
332
+ const look = () => p.evaluate(() => ({ url: decodeURIComponent(location.search), crumb: document.querySelector('#crBoard').textContent, label: document.querySelector('#crBoard').getAttribute('aria-label'), ws: [...new Set([...document.querySelectorAll('#ibBody [data-key]')].map((x) => x.dataset.key.split('/')[0]))].sort() }));
333
+ const a = await look();
334
+ ok('M a click outside closes the menu and the Board shows the ticked products only, merged', a.url === '?pick=idpf|idpf&pick=microsites|microsites' && a.ws.join(',') === 'idpf,microsites', JSON.stringify(a));
335
+ ok('M the button says the first product and +N', a.crumb === 'IDPF +1' && a.label === 'Product: IDPF, Microsites', JSON.stringify(a));
336
+ await p.reload(); await p.waitForSelector('#ibBody [data-key]'); await p.waitForTimeout(700);
337
+ const b = await look();
338
+ ok('M a reload keeps the pick', b.url === a.url && b.crumb === 'IDPF +1' && b.ws.join(',') === 'idpf,microsites', JSON.stringify(b));
339
+ await p.click('#crSw');
340
+ const m3 = await st();
341
+ ok('M the menu ticks the products on screen', m3.ticks.join(',') === 'All products:mixed,IDPF:true,Microsites:true,Replay:false', JSON.stringify(m3));
342
+ await p.click('#crMenu [data-sw="*|*"]');
343
+ const m4 = await st();
344
+ ok('M All products ticks every product', m4.ticks.join(',') === 'All products:true,IDPF:true,Microsites:true,Replay:true', JSON.stringify(m4));
345
+ await p.click('#crMenu [data-sw="idpf|idpf"]'); await p.click('#crMenu [data-sw="microsites|microsites"]');
346
+ await Promise.all([p.waitForNavigation(), p.keyboard.press('Escape')]);
347
+ await p.waitForSelector('#ibBody [data-key]'); await p.waitForTimeout(500);
348
+ const c = await look();
349
+ ok('M unticked down to one product, the Board is that product\'s own board', c.url === '?ws=replay&board=replay' && c.crumb === 'Replay', JSON.stringify(c));
350
+ ok('M the page threw nothing', !errors.length, errors.join('\n'));
351
+ await ctx.close();
352
+ }
353
+
298
354
  /* Z zero is silence; the phone */
299
355
  {
300
356
  const { ctx, page: p } = await open({ programs: [] });
@@ -321,7 +321,7 @@ const IVREAD = () => {
321
321
  await view(p, 'time');
322
322
  const tl = await p.evaluate(() => ({ spans: [...document.querySelectorAll('#bdSpans button')].map((b) => b.textContent + (b.getAttribute('aria-pressed') === 'true' ? '*' : '')).join(), shown: !document.querySelector('#bdSpans').hidden, rows: [...document.querySelectorAll('#ibBody .tg-r .tg-n.ini2 b')].map((b) => b.textContent), bars: document.querySelectorAll('#ibBody .tg-bar').length, none: (document.querySelector('.tg-none') || {}).textContent || '', ask: (document.querySelector('#askDates') || {}).href || '', hid: (document.querySelector('.tg-hid') || {}).textContent || '', lgd: (document.querySelector('.tg-lgd') || {}).textContent || '', today: (document.querySelector('#ibBody .tg-tpill') || {}).textContent === 'Today' }));
323
323
  ok('B6 the timeline has six spans and starts on Quarter, one row per initiative with dates; the others are named, with an ask to propose dates', tl.shown && tl.spans === 'Sprint,Quarter*,Half,Year,2 yr,5 yr' && tl.rows.length === 3 && tl.bars === 3 && /^4 have no dates: Usage-based billing, Audit log export, Refund reason codes, Docs search/.test(tl.none) && /\/premium\.html\?ask=board%3Aw1&q=Propose/.test(tl.ask), JSON.stringify(tl));
324
- ok('B6 Monitor and Evaluate show on the Quarter, with no hidden count in the footer (batch 8 item 2); the legend (PgTimeline: done, planned, the Jira forecast, Deliver or Evaluate, today) and Today are drawn', tl.hid === '' && /Done in Jira/.test(tl.lgd) && /Planned/.test(tl.lgd) && /Jira forecast/.test(tl.lgd) && /Deliver or Evaluate/.test(tl.lgd) && /Today/.test(tl.lgd) && tl.today, JSON.stringify(tl));
324
+ ok('B6 Monitor and Evaluate show on the Quarter, with no hidden count in the footer (batch 8 item 2); the legend (PgTimeline: done, planned, the Jira forecast, Milestone (batch 11 item 3), today) and Today are drawn', tl.hid === '' && /Done in Jira/.test(tl.lgd) && /To do/.test(tl.lgd) && /Jira forecast/.test(tl.lgd) && /Milestone/.test(tl.lgd) && /Today/.test(tl.lgd) && tl.today, JSON.stringify(tl));
325
325
  ok('B6 the spans help popover went with the theme grouping (TsCGrill): the first head is a plain "Initiative"', await p.evaluate(() => !document.querySelector('#popRules') && !document.querySelector('#ibBody [data-rules]') && /^Initiative/.test(document.querySelector('#ibBody .tg-h .tg-n').textContent)));
326
326
  await p.click('#ibBody .tg-n[data-key="board:partner-rate-limits"]');
327
327
  /* re-pointed (the one view, item 3): the timeline opens the same initiative in the Viewer as every other view. The stage card names the step
@@ -1,4 +1,16 @@
1
1
  [
2
+ {
3
+ "v": "0.422.0",
4
+ "at": "2026-10-26T13:03:41.940Z",
5
+ "f": 2,
6
+ "prs": [
7
+ {
8
+ "n": 1061,
9
+ "t": "Eleventh testing feedback batch",
10
+ "s": "Eleventh testing feedback batch"
11
+ }
12
+ ]
13
+ },
2
14
  {
3
15
  "v": "0.421.0",
4
16
  "at": "2026-10-26T06:44:56.884Z",
@@ -29,7 +29,8 @@
29
29
  "milestones": [
30
30
  "2026-10-24"
31
31
  ],
32
- "holds": []
32
+ "holds": [],
33
+ "gaps": []
33
34
  }
34
35
  ]
35
36
  },
@@ -222,6 +222,7 @@ Every markdown document opens as one page in a tab: a PRD, a new document or any
222
222
  - **Page** shows the document as it reads. **Edit** lets you type on the page itself, with a toolbar, a **/** menu for blocks, and Ctrl+S to save. **Markdown** shows the source text. Only the sections you changed are written; the other sections and the front matter keep their exact text. A line that is only an HTML comment, such as `<!-- pmos:note … -->` or `<!-- pmos:slide … -->`, is not shown on the page, and a save writes it back as it was.
223
223
  - When the agent proposes an edit, the page shows it applied and highlighted. Click a highlight to see the old text, and click **Put it back** to restore it. The bar above the page has **Keep as vN**, which keeps the changes that remain, and **Undo all**, which asks first and then rejects the whole edit.
224
224
  - **Health**, **Links** and **Copies** under the toolbar show the document's checks, the documents it links to, and its linked copies. The checks only read the file.
225
+ - **The page follows the file.** When a chat changes the document, the page shows the new text within a few seconds. You do not refresh the page, and the chat does not need to commit. A document of an initiative is read from that initiative's own folder (its git worktree) when its chat works there. If you are editing and have not saved, your edit stays: the page says the file changed, and **Cancel** shows the new text. A report and a document opened from the Board follow the file in the same way.
225
226
 
226
227
  ### Confluence pages and Google Docs
227
228
 
@@ -2,7 +2,7 @@
2
2
  type: Guide
3
3
  title: "Home (/premium.html) and the designed features"
4
4
  description: "Home in the Agreed design: the list grouped by product, the Viewer, the place menu, New for you, Search, and the initiative, meeting, report, Board and Insights features designed after it."
5
- timestamp: 2026-10-25
5
+ timestamp: 2026-10-26
6
6
  ---
7
7
 
8
8
  # Home
@@ -15,7 +15,7 @@ Home is the page at `/premium.html`. It follows the Agreed design and the "Uncov
15
15
  - Press **Good morning** to open **Your day**. Your day shows the date, the meetings of the day, **Your move** (the items that wait on you, with their count) and **This week** (the Weekly review). Your move shows only in Your day, not in the list.
16
16
  - A **program** comes first, above the products. Its header shows the program icon, its name, the next milestone (◆ and the date) and how many of its initiatives are ready for that milestone. Inside it, the program's own tasks come first, then its initiatives under a small heading for each product. Each initiative shows once. Press the program's name to open the program in the Viewer. The chat then talks about the program. Press the chevron to close or open the group.
17
17
  - A program with no open initiative yet still shows, with "No initiatives yet" or "No open initiatives". With one product picked, it shows under its own product. Home reads again when you come back to its tab, so a program made on the Board shows at once.
18
- - Then the list is grouped by **product**. A product header shows a tile with the product's short name, the product name, one dot for each goal (green on track, amber off track) and a chevron. You set the short name in Settings. Press the product's name to open the product in the Viewer, with its goals and this week's update and metrics review. The chat then talks about the product. This is the same for every product in the list: Home stays on the workspace you opened it on. For another product, the weekly update and the metrics review open that product's own Home in a new tab. An initiative of another product opens from that product's own board, and its chat works in that product's workspace.
18
+ - Then the list is grouped by **product**. A product header shows a tile with the product's short name, the product name, one dot for each goal (green on track, amber off track) and a chevron. You set the short name in Settings. Press the product's name to open the product in the Viewer, with its goals and this week's update and metrics review. The chat then talks about the product. This is the same for every product in the list: Home stays on the workspace you opened it on. For another product, the weekly update and the metrics review open that product's own Home in a new tab. An initiative of another product opens from that product's own board, and its chat works in that product's workspace. This is also true for a new initiative that an agent made with `pmos initiative new` and that is not on the board's Now list yet: it opens with its title, stage and tasks.
19
19
  - Each row is one line. A dot is a session: blue when it waits on you, a ring while it runs. A check box is a task: amber when it is late. The stage track on the right shows where the initiative is. A session that runs under an initiative shows indented under it. An initiative shows its 3 most urgent tasks, and **N more** shows the rest.
20
20
  - **Not in an initiative** is one line at the end, with a blue dot, an amber square and a count. Press it to open the items that have no initiative.
21
21
  - **Kept** and **Done** are in the filter icon's menu, on a desktop only.
@@ -55,6 +55,8 @@ Press an initiative's name in the list, or open `?ini=<id>`. The list stays as i
55
55
  - **Moves on by itself** is a switch, on by default. When every exit item is done, the stage moves to the next stage and a message shows **Undo**. A stage never moves by itself into a milestone (Deliver or Evaluate). This rule is a proposal that the PM has not confirmed yet.
56
56
  - **Move to <next>** with open exit items asks first (**Move anyway**, with a note). **Back** always asks for a reason.
57
57
  - **Tasks** in the Viewer can be grouped by stage, by groups that you name, by owner or by status. Drag a task to another group.
58
+ - In the Build stage, the open Jira tickets show with the tasks. A task whose name starts with a Jira key (for example "MSD-4376 Navigation tabs") is that ticket, so the ticket shows once, as the task, and counts once.
59
+ - **Tasks** show one row (one group) for each stage of the workflow, in order. Finished stages and later stages are never merged into one row; they start folded, and the current stage and any stage with a late task start open.
58
60
 
59
61
  ## Rename a program, an initiative or a task
60
62
 
@@ -62,6 +64,7 @@ Press the name in the Viewer's header. The name becomes a field.
62
64
 
63
65
  - Type the new name. Press Enter or the check to save it. Press Esc to stop without a change. An empty name is not saved.
64
66
  - The new name shows at once in the list, the chat header, the Viewer, the Board and the Timeline. The message **Renamed** has **Undo**.
67
+ - An initiative of another product renames in that product's own repository, the same as on the Board.
65
68
  - Only the name changes. The id, the record file, the links and the history stay the same.
66
69
  - An initiative with a Jira epic shows **Rename the Jira epic too**. It is off by default. When you select it, Home opens the initiative's chat with the request typed. Send it to let your agent rename the epic in Jira. PMOS does not change Jira itself.
67
70
  - A program has no Jira box. Its goal stays as it is.
@@ -2,7 +2,7 @@
2
2
  type: Guide
3
3
  title: "Programs on the Board: All products, groupings and the program panel"
4
4
  description: "A program groups initiatives across products. How it shows on the Board (stage track, Kanban, timeline and List), the All products mode, the By product grouping, the program panel and the side panel width."
5
- timestamp: 2026-10-25
5
+ timestamp: 2026-10-26
6
6
  ---
7
7
 
8
8
  # Programs on the Board
@@ -14,13 +14,14 @@ Programs do not change how Insights, the weekly update or sprints count initiati
14
14
  ## The Board
15
15
 
16
16
  - The product picker has **All products** when you have more than one product. All products shows the initiatives of every product on one Board (`/premium-board.html?all=1`).
17
+ - The product picker takes several products. Press a product to tick or untick it; the menu stays open. **All products** ticks every product, and shows a dash when only some are ticked. The last ticked product stays ticked. When the menu closes, the Board shows the ticked products, merged as on All products. The button shows the first product and "+N" (for example "pmos-idpf +1"). The pick is in the address (`?pick=<workspace>|<board>` for each product), so a reload keeps it.
17
18
  - A program comes first. Its band shows the stage spread of its initiatives, the next milestone and how many initiatives are ready for it. Under the band, the initiatives sit under a small heading for each product. Then each product has its own group.
18
- - To group by product only, open **Filter** and choose **By product**. A program member then shows a small layers icon. A chip shows while By product is on.
19
+ - To group by product only, open **Filter** and choose **By product**. A program member then shows a small layers icon and stays under its product in every view, the timeline included. A chip shows while By product is on.
19
20
  - **Kanban** shows programs as swimlanes, then products. Press a column header to fold the column to a strip with its count. An empty column starts folded. The Board remembers each fold.
20
21
  - The **timeline** draws a program row that brackets its initiatives' bars, on every span. Program milestones are diamonds. Milestones that are close together merge into one diamond with a count.
21
22
  - **List** has a Product column and a Program column. Press a column header to sort by it.
22
23
  - **New** opens a menu: **New initiative** or **New program**.
23
- - A new program shows at once, before any initiative joins it. A program with no open initiative shows on its own product's Board and on All products, with "No initiatives yet" or "No open initiatives". Press its name, then **⋯** and **Move an initiative in**. That menu lists open initiatives only.
24
+ - A new program shows at once, before any initiative joins it. A program with no open initiative shows on its own product's Board and on All products, with "No initiatives yet" or "No open initiatives". Press its name, then **⋯** and **Move an initiative in**. That menu lists open initiatives only, grouped by product, with the program's own product first, wherever you open the program (Home, another product's Board or All products). An initiative joins in its own product.
24
25
  - To make an initiative a program, open the initiative, press **⋯**, then **Turn into a program**. The initiative joins the new program, and the program panel opens. **Turn into a program** shows only for an initiative that is in no program.
25
26
  - The chat cannot make or change a program. Every program change is a press on the Board. When you ask the chat about a program, it tells you which press to use.
26
27
 
@@ -7,6 +7,9 @@
7
7
  * O2 the chat is the initiative's own, named by its title (its target carries ws=microsites)
8
8
  * O3 the Microsites heading opens its page in the Viewer and Home stays on IDPF: no navigation, the list keeps the IDPF group
9
9
  * O5 its chat's first message starts a session in Microsites, and "A new session" (In: chip, + New) starts a second one beside it
10
+ * O6 batch 11 item 10: an initiative `pmos initiative new` made in Microsites sits in Later, so the Microsites model does not list it. Its
11
+ * next step (tagged ws=microsites) puts it on Home; pressing it reads it from Microsites, never IDPF's board, under its title
12
+ * O7 the same initiative opened by a link with no next step: the read on IDPF fails, the Microsites one finds it, and its chat is Microsites'
10
13
  * Serves the real page from the real server; the reads are fixtures (fixtures/program-ascent.js through the Board and Home fixtures). */
11
14
  const path = require('path');
12
15
  const { spawn } = require('child_process');
@@ -124,6 +127,58 @@ const model = () => { const m = IP.build(F.facts()); return { ...m, id: ID, key:
124
127
  ok('O4 a phone: the press opens the Microsites chat full screen, the page closed', await until(() => pp.evaluate(() => { const t = document.querySelector('#hmChat textarea, textarea'); return !document.querySelector('#czViewer:not([hidden]) .hi-talk') && !!t && !!t.offsetParent && t.placeholder === 'Message Claude about Microsites'; }), 5000));
125
128
  await pctx.close();
126
129
 
130
+ // O6, O7 (batch 11 item 10): an initiative made by `pmos initiative new` in Microsites, unplaced (Later), so not on the model's list
131
+ const NEW = 'psle-addon-follow-on', NEW_TITLE = 'PSLE Companion add-on follow-on plan';
132
+ const newModel = () => ({ ...model(), id: NEW, key: 'init:' + NEW, title: NEW_TITLE });
133
+ const later = async (withStep) => {
134
+ const c = await browser.newContext({ viewport: { width: 1440, height: 900 } });
135
+ const pg = await c.newPage(), rd = [], asked = [];
136
+ pg.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
137
+ await pg.route('**/api/initiative-premium*', (r) => {
138
+ const q = new URL(r.request().url()).searchParams; rd.push({ id: q.get('id'), ws: q.get('ws'), board: q.get('board') });
139
+ // the real route: a workspace's default board when none is named; an id on another board is a 404
140
+ if (q.get('id') === NEW && q.get('ws') === 'microsites' && (!q.get('board') || q.get('board') === 'microsites')) return json(r, { ok: true, state: 'ready', model: newModel(), as_of: Date.now() });
141
+ return json(r, { ok: false, state: 'error', error: 'no work-lane initiative ' + q.get('id') + ' in this workspace' }, 404);
142
+ });
143
+ await pg.route(/\/api\/board-premium(\?.*)?$/, (r) => { const ws = new URL(r.request().url()).searchParams.get('ws') || 'idpf'; return json(r, { ok: true, state: 'ready', model: BP.build(BF.programFacts(ws)), as_of: Date.now() }); });
144
+ await pg.route(/\/api\/briefing-premium(\?.*)?$/, (r) => {
145
+ const m = BRP.buildMany(BRF.programFacts());
146
+ if (withStep) m.list.rows = [{ key: 'blocked:' + NEW + ':microsites', kind: 'blocked', title: 'Unblock the brief step', subject: NEW_TITLE, prepared: '', product: 'Microsites', ws: 'microsites', from: [NEW] }].concat(m.list.rows || []);
147
+ return json(r, { ok: true, state: 'ready', model: m, as_of: Date.now() });
148
+ });
149
+ await pg.route('**/api/programs', (r) => json(r, { ok: true, programs: [] }));
150
+ // the last route added wins: the ask's own after the catch-all
151
+ await pg.route('**/api/briefing-premium/**', (r) => json(r, { ok: true, turns: [], working: false }));
152
+ await pg.route('**/api/briefing-premium/ask*', (r) => { asked.push({ ws: new URL(r.request().url()).searchParams.get('ws') }); return json(r, { ok: true, session: 'sess-x', started: true }); });
153
+ await pg.goto(BASE + '/premium.html?ws=idpf' + (withStep ? '' : '&ini=' + NEW));
154
+ return { c, pg, rd, asked };
155
+ };
156
+ const pageState = (pg) => until(() => pg.evaluate((v) => { const o = document.querySelector(v); if (!o) return null; if (o.querySelector('[data-hi-v="page"]')) return 'ok'; return /could not be read/.test(o.textContent) ? 'err' : null; }, V), 30000);
157
+ {
158
+ const { c, pg, rd } = await later(true);
159
+ const nrow = `#hmList [data-hm-sel="i:${NEW}"]`;
160
+ const seen = await until(async () => {
161
+ await pg.evaluate(() => document.querySelectorAll('#hmList [data-hm-pg][aria-expanded="false"]').forEach((b) => b.click())).catch(() => {});
162
+ return pg.evaluate((s) => { const b = document.querySelector(s); return !!b && !!b.offsetParent; }, nrow);
163
+ }, 40000);
164
+ ok('O6 the Microsites initiative in Later shows on Home under its next step', seen);
165
+ if (seen) await pg.click(nrow);
166
+ const s6 = await pageState(pg);
167
+ ok('O6 its page opens, not "The initiative could not be read"', s6 === 'ok', s6);
168
+ ok('O6 it is read from Microsites, never from IDPF\'s board', rd.some((x) => x.id === NEW && x.ws === 'microsites') && !rd.some((x) => x.id === NEW && (x.board === 'idpf' || (x.ws || 'idpf') === 'idpf')), JSON.stringify(rd));
169
+ ok('O6 the chat names it by its title, not its id', await until(() => pg.evaluate((t) => (document.querySelector('#hmIn') || {}).placeholder === 'Message Claude about ' + t, NEW_TITLE), 5000), await pg.evaluate(() => (document.querySelector('#hmIn') || {}).placeholder));
170
+ await c.close();
171
+ }
172
+ {
173
+ const { c, pg, rd, asked } = await later(false);
174
+ const s7 = await pageState(pg);
175
+ ok('O7 opened by a link with no next step: its page opens from Microsites', s7 === 'ok', s7 + ' ' + JSON.stringify(rd));
176
+ ok('O7 the chat is its own, in Microsites', await until(() => pg.evaluate((t) => (document.querySelector('#hmIn') || {}).placeholder === 'Message Claude about ' + t, NEW_TITLE), 5000), await pg.evaluate(() => (document.querySelector('#hmIn') || {}).placeholder));
177
+ await pg.fill('#hmIn', 'What is next?'); await pg.keyboard.press('Enter');
178
+ ok('O7 its first message starts the session in Microsites', await until(() => asked.length >= 1, 5000) && asked[0].ws === 'microsites', JSON.stringify(asked));
179
+ await c.close();
180
+ }
181
+
127
182
  ok('no page error', errors.length === 0, errors.join(' | '));
128
183
  await ctx.close();
129
184
  return finish();
@@ -245,8 +245,13 @@ const DAY_RE = /^\d{4}-\d{2}-\d{2}$/;
245
245
  const dayOr = (v) => (typeof v === 'string' && DAY_RE.test(v) ? v : null);
246
246
  const holdsOf = (r) => (Array.isArray(r.holds) ? r.holds : []).filter((h) => h && dayOr(h.from)).slice(-12)
247
247
  .map((h) => ({ from: h.from, to: dayOr(h.to), back: dayOr(h.back), reason: clip(h.reason || '', 200) }));
248
- /** The plain gaps of a row: stretches of 4 weeks or more that no dated work covers. */
249
- const gapsOf = (r) => (Array.isArray(r.gaps) ? r.gaps : []).filter((g) => g && dayOr(g.from) && dayOr(g.to)).slice(0, 12).map((g) => ({ from: g.from, to: g.to }));
248
+ /** The plain gaps of a row: stretches of 2 weeks or more that no dated work covers, with the stage of the work on each side (batch 11 item 13). */
249
+ const stageKey = (v) => (typeof v === 'string' && v ? clip(v, 80) : null);
250
+ const gapsOf = (r) => (Array.isArray(r.gaps) ? r.gaps : []).filter((g) => g && dayOr(g.from) && dayOr(g.to)).slice(0, 12)
251
+ .map((g) => ({ from: g.from, to: g.to, ...(stageKey(g.before) ? { before: stageKey(g.before) } : {}), ...(stageKey(g.after) ? { after: stageKey(g.after) } : {}) }));
252
+ /** Where the dated work of each stage runs (batch 11 item 13): the » of a skipped stage sits between two of them. */
253
+ const stageSpansOf = (r) => (Array.isArray(r.stageSpans) ? r.stageSpans : []).filter((x) => x && stageKey(x.stage) && dayOr(x.start) && dayOr(x.due)).slice(0, 40)
254
+ .map((x) => ({ stage: stageKey(x.stage), start: x.start, due: x.due }));
250
255
  function rowOf(r, wf, today) {
251
256
  const names = (wf || []).map((s) => s.name), cur = names.indexOf(r.stage);
252
257
  const bad = r.status === 'late' || r.status === 'at risk';
@@ -265,7 +270,7 @@ function rowOf(r, wf, today) {
265
270
  finish: r.end ? shortDate(r.end) : 'Not planned', over: !!over, start: r.start || null, end: r.end || null,
266
271
  owner: r.owner || null, lane: r.lane || null, anchor: r.anchor || null, kr: krShort(r.anchor), rank: Number.isInteger(r.rank) ? r.rank : null, warnings: (r.warnings || []).filter((w) => typeof w === 'string').slice(0, 12), epics: Array.isArray(r.epics) ? r.epics.filter((e) => typeof e === 'string').slice(0, 6) : [], updated: r.updated || null, reading: r.reading || null, overDays: over ? days(r.end, today) : 0,
267
272
  acts: actsOf(r, names),
268
- holds: holdsOf(r), gaps: gapsOf(r),
273
+ holds: holdsOf(r), gaps: gapsOf(r), stageSpans: stageSpansOf(r),
269
274
  // D99: the workflow it runs and where it stands in it (lib/routes-boards.js workflowRowOf); Product feature when the server sends none
270
275
  ...wfFields(r),
271
276
  dialog: {
@@ -310,10 +315,19 @@ function build(f) {
310
315
  // the start too: the Tasks Timeline draws a bar from the start to the due day (batch 9 item 5b)
311
316
  taskBy.get(w.ini).push({ uid: w.uid, title: clip(w.title || '', 160), status: w.status || 'To do', owner: w.owner || '', start: w.start || '', end: w.end || '', ...(w.from ? { from: { stage: w.from.stage, finish: w.from.finish } } : {}),
312
317
  // one view (feedback batch 6 item 1): its place in the breakdown, and a breakdown item's own stage and order
313
- ...(typeof w.section === 'string' ? { section: w.section } : {}), ...(w.itemStage ? { itemStage: w.itemStage } : {}), ...(Number.isFinite(w.order) ? { order: w.order } : {}), ...(w.store === 'item' ? { item: true } : {}) });
318
+ ...(typeof w.section === 'string' ? { section: w.section } : {}), ...(w.itemStage ? { itemStage: w.itemStage } : {}), ...(Number.isFinite(w.order) ? { order: w.order } : {}), ...(w.store === 'item' ? { item: true } : {}), ...(w.milestone ? { milestone: true } : {}) });
319
+ }
320
+ // the milestones of each initiative (feedback batch 11 item 3): its tasks flagged ◇, PMOS and Jira alike, at their due dates. Won't do and
321
+ // Archived take one off the timeline; one with no due date is not drawn (the Tasks list asks for the date)
322
+ const msBy = new Map();
323
+ for (const w of f.items || []) {
324
+ if (!w || !w.milestone || w.kind === 'Epic' || !w.ini || !w.uid || w.status === "Won't do" || w.status === 'Archived' || !isoDay(w.end)) continue;
325
+ if (!msBy.has(w.ini)) msBy.set(w.ini, []);
326
+ msBy.get(w.ini).push({ id: w.uid, name: clip(w.title || w.uid, 120), date: String(w.end).slice(0, 10), done: w.status === 'Done', ...(typeof w.section === 'string' && w.section ? { sec: w.section } : w.from && w.from.stage ? { sec: w.from.stage } : {}), ...(w.src === 'jira' ? { jira: true } : {}) });
314
327
  }
315
328
  // every task, not the first 60: the Board's panel and Home count the same tasks (feedback batch 6 item 1: Board said 56 done, Home 61)
316
329
  for (const r of rows.concat(stageRows, gone.cancelled, gone.archived)) if (!r.tasks) r.tasks = (taskBy.get(r.id) || []).slice(0, TASK_MAX);
330
+ for (const r of rows.concat(stageRows, gone.cancelled, gone.archived)) if (!r.milestones) r.milestones = (msBy.get(r.id) || []).sort((a, b) => a.date.localeCompare(b.date)).slice(0, 40);
317
331
  for (const r of rows.concat(stageRows, gone.cancelled, gone.archived)) if (!r.track) {
318
332
  r.track = trackOf(r, tkBy.get(r.id), todayIso, relOfIni.get(r.id)); r.theme = themeOf(r.anchor);
319
333
  if (epicBy.has(r.id) && !r.epics.includes(epicBy.get(r.id))) r.epics.unshift(epicBy.get(r.id));