create-pmos 0.265.0 → 0.267.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.265.0",
3
+ "version": "0.267.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": {
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@847d5bc
1
+ kernel-source: pmos@277fdcb
2
2
  assembled: 2026-10-18
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-18T09:12:55Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-18T11:30:29Z"}
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-18T09:12:55Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-18T11:30:29Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Discoveries and friction log"
4
4
  description: "Append-only record of what runs discovered and where the process rubbed."
5
- generated: {by: process:create-pmos, at: "2026-10-18T09:12:55Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-18T11:30:29Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -139,7 +139,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
139
139
  /* B10 dialog */
140
140
  await p.locator('#ibBody .ini2').first().click(); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(700);
141
141
  const dlg = await p.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, sub: document.querySelector('#dSub').textContent, grid: [...document.querySelectorAll('#oMain .kv2 span')].map((s) => s.textContent).join('|'), path: document.querySelector('#oMain .dpath').textContent, buttons: [...document.querySelectorAll('#card button')].length, hold: document.querySelector('#holdWhy').textContent, ask: !!document.querySelector('#askGo'), label: document.querySelector('#oLab').textContent }));
142
- ok('B10 an initiative opens its record as a grid with the path of its file, the read-only agent beside it and no press', dlg.title === 'Self-serve onboarding v2' && /Stage\|Build \(derived\)/.test(dlg.grid) && /Progress\|62%/.test(dlg.grid) && dlg.path === 'planning/initiatives/self-serve-v2.md' && dlg.buttons === 0 && dlg.ask && /not built on this page/.test(dlg.hold) && dlg.label === 'Initiative record', JSON.stringify(dlg));
142
+ ok('B10 an initiative opens its record as a grid with the path of its file, the read-only agent beside it and no press', dlg.title === 'Self-serve onboarding v2' && /Stage\|Build \(derived\)/.test(dlg.grid) && /Progress\|62%/.test(dlg.grid) && dlg.path === 'planning/initiatives/self-serve-v2.md' && dlg.buttons === 0 && dlg.ask && /This dialog changes nothing/.test(dlg.hold) && dlg.label === 'Initiative record', JSON.stringify(dlg));
143
143
  A.setThread({ ok: true, working: false, turns: [] });
144
144
  await p.fill('#askIn', 'Why is this late?'); const nA = A.posts.length; await p.press('#askIn', 'Enter');
145
145
  ok('B10 a question posts the initiative key and the text', await until(() => A.posts.length > nA && A.posts[A.posts.length - 1].path === '/api/briefing-premium/ask' && A.posts[A.posts.length - 1].body.key === 'board:self-serve-v2' && A.posts[A.posts.length - 1].body.text === 'Why is this late?'));
@@ -0,0 +1,231 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* briefing-premium-calendar-2-test.js — Add and Remove material and Make task in the premium meeting dialog (initiative briefing-premium-calendar, slice 2;
4
+ * planning/prd/briefing-premium-calendar-2-prd.md M1 to M7). Serves the real page from the real server. The Briefing model, the calendar answer, the replay and the material
5
+ * are answered by stand-ins, so each press can be read off the request the page sent; the routes' own behaviour is in their own suites.
6
+ * M1 add material · M2 remove · M3 what each press records · M4 make task · M5 honest states · M6 only the named writes · M7 floors and fidelity
7
+ * Every wait polls the page; no fixed sleep stands in for a state. */
8
+ const fs = require('fs');
9
+ const path = require('path');
10
+ const { spawn } = require('child_process');
11
+ const { findBrowser } = require('./lib/find-browser');
12
+ const T = require('./test-run').configure({ name: 'briefing-premium-calendar-2' });
13
+ const B = require('./lib/briefing-premium.js');
14
+ const F = require('./fixtures/briefing-premium-facts.js');
15
+
16
+ const BASE = T.BASE;
17
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
18
+ const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
19
+ const results = [];
20
+ const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
21
+ let srv = null; let browser = null;
22
+ const finish = async (code) => {
23
+ if (browser) await browser.close().catch(() => {});
24
+ if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
25
+ T.killTmux();
26
+ const bad = results.filter((x) => !x.cond).length;
27
+ console.log(`\n${results.length - bad}/${results.length} briefing-premium-calendar-2 assertions passed`);
28
+ process.exit(code !== undefined ? code : (bad ? 1 : 0));
29
+ };
30
+ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
31
+
32
+ const pad = (n) => String(n).padStart(2, '0');
33
+ const dayKey = (d) => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
34
+ const iso = (d) => { const off = -d.getTimezoneOffset(), a = Math.abs(off); return `${dayKey(d)}T${pad(d.getHours())}:${pad(d.getMinutes())}:00${off >= 0 ? '+' : '-'}${pad(Math.floor(a / 60))}:${pad(a % 60)}`; };
35
+ const NOW = new Date();
36
+ const at = (h, m, plus = 0) => { const d = new Date(NOW.getFullYear(), NOW.getMonth(), NOW.getDate() + plus, h, m, 0, 0); return d; };
37
+ const monday = () => { const d = new Date(NOW.getFullYear(), NOW.getMonth(), NOW.getDate()); d.setDate(d.getDate() - ((d.getDay() + 6) % 7)); return d; };
38
+ const weekAnswer = () => {
39
+ const m = monday(), cells = [];
40
+ for (let i = 0; i < 7; i++) { const d = new Date(m.getFullYear(), m.getMonth(), m.getDate() + i); cells.push({ key: dayKey(d), start: dayKey(d), end: dayKey(d), events: [] }); }
41
+ const put = (d, e) => cells.find((c) => c.key === dayKey(d)).events.push(e);
42
+ put(at(9, 30), { id: 'ev-checkout', at: iso(at(9, 30)), end: iso(at(10, 15)), title: 'Checkout sync', attendees: ['Priya', 'Dara'] });
43
+ put(at(14, 0), { id: 'ev-sprint', at: iso(at(14, 0)), end: iso(at(15, 0)), title: 'Sprint planning', attendees: ['Dara', 'Priya', 'Sam'], series: 'sprint-planning' });
44
+ const other = at(9, 30, NOW.getDay() === 0 ? -1 : 1); // a day other than today, still in the week unless it runs off the end
45
+ if (cells.some((c) => c.key === dayKey(other))) put(other, { id: 'ev-standup', at: iso(other), end: iso(new Date(other.getTime() + 30 * 60000)), title: 'Standup', attendees: [] });
46
+ return { ok: true, view: 'week', range: { start: cells[0].key, end: cells[6].key }, cells, events_source: 'calendar-memory', today: dayKey(NOW),
47
+ context: { 'ev-sprint': { phase: 'upcoming', level: { kind: 'board', ws: 'w1', id: 'idpf', name: 'IDPF', why: 'you linked it to the board', by: 'pm' } } },
48
+ link_boards: [{ ws: 'w1', id: 'idpf', name: 'IDPF' }, { ws: 'w1', id: 'pay', name: 'Payments' }], gantt: [{ id: 'premium-ux', title: 'Premium UX' }] };
49
+ };
50
+ const REPLAY0 = { ok: true, note: { id: 'n1', title: 'Sprint planning notes' }, meeting: { title: 'Sprint planning', attendees: ['Dara', 'Priya', 'Sam'] }, audio: { url: '/x', ms: 1500000 }, length_ms: 1500000, lines: [{}],
51
+ keys: [{ k: 'decision', text: 'Plan the sprint with eight people', state: 'draft' }, { k: 'action', text: 'Sam confirms the data fix owner', owner: 'Sam', due: 'Tue', state: 'owner' }, { k: 'question', text: 'Does a release eat the capacity?', state: 'open' }] };
52
+ const MATERIAL = { ok: true, key: 'k', items: [{ id: 'm1', kind: 'doc', ref: 'r', title: 'Capacity sheet', scope: 'series' }, { id: 'm2', kind: 'link', url: 'https://x.example', title: 'Roadmap', scope: 'meeting' }] };
53
+ const MOCKUP = fs.readFileSync(path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'briefing-artifact.html'), 'utf8');
54
+
55
+
56
+ const REPLAY = Object.assign({}, REPLAY0, { note: { id: 'n1', title: 'Sprint planning notes', ws: 'w1', initiative: { id: 'premium-ux', title: 'Premium UX', ws: 'w1' } } });
57
+ const REPLAY_NOINI = Object.assign({}, REPLAY0, { note: { id: 'n1', title: 'Sprint planning notes' } });
58
+ const SUGGEST = { ok: true, suggested: [{ kind: 'pmos-doc', ref: 'planning/prd/premium-ux-prd.md', title: 'Premium UX PRD', meta: 'document', ws: 'w1' }], found: [{ kind: 'report', ref: 'planning/reports/q3.md', title: 'Q3 report', meta: 'report', ws: 'w1' }] };
59
+
60
+ (async () => {
61
+ const exe = findBrowser();
62
+ if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
63
+ let chromium;
64
+ try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
65
+ srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
66
+ await T.waitForServer(BASE);
67
+ browser = await chromium.launch({ executablePath: exe });
68
+
69
+ const facts = () => { const f = F.facts(); f.meetings = [{ start: at(14, 0).getTime(), end: at(15, 0).getTime(), title: 'Sprint planning', with: 'Dara, Priya, Sam', initiative: null }]; return f; };
70
+ const open = async ({ w = 1280, h = 900, theme = 'light', replay = REPLAY, items = [{ id: 'm1', kind: 'link', url: 'https://x.example/road', title: 'Roadmap', scope: 'meeting', from: 'you' }], writeStatus = 200, planStatus = 200, stages = [{ id: 'st1', label: 'Intake' }] } = {}) => {
71
+ const ctx = await browser.newContext({ viewport: { width: w, height: h } });
72
+ const page = await ctx.newPage();
73
+ const S = { errors: [], reqs: [], matPosts: [], planPosts: [], suggestGets: [], items: items.slice() };
74
+ page.on('pageerror', (e) => S.errors.push(String((e && e.message) || e)));
75
+ page.on('request', (r) => { if (r.url().startsWith(BASE)) S.reqs.push(r.method() + ' ' + new URL(r.url()).pathname); });
76
+ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'application/json', body: JSON.stringify(b) });
77
+ await page.route('**/api/briefing-premium*', (r) => json(r, { ok: true, state: 'ready', model: B.build(facts()), as_of: Date.now() }));
78
+ await page.route('**/api/calendar-views*', (r) => json(r, weekAnswer()));
79
+ await page.route('**/api/meeting-replay*', (r) => json(r, replay));
80
+ await page.route('**/api/meeting-material/suggest*', (r) => { S.suggestGets.push(new URL(r.request().url()).search); json(r, SUGGEST); });
81
+ await page.route('**/api/meeting-material?*', (r) => {
82
+ const req = r.request();
83
+ if (req.method() === 'POST') {
84
+ const b = JSON.parse(req.postData() || '{}'); S.matPosts.push(b);
85
+ if (writeStatus !== 200) return json(r, { ok: false, error: 'a page press is required' }, writeStatus);
86
+ if (b.op === 'add') S.items.push(Object.assign({ id: 'n' + S.items.length, from: 'you', scope: b.scope }, b.item));
87
+ else S.items = S.items.filter((i) => (i.ref || i.url) !== (b.item.ref || b.item.url));
88
+ return json(r, { ok: true, items: S.items });
89
+ }
90
+ return json(r, { ok: true, key: 'k', items: S.items });
91
+ });
92
+ await page.route('**/api/meeting-material', (r) => {
93
+ const req = r.request(); const b = JSON.parse(req.postData() || '{}'); S.matPosts.push(b);
94
+ if (writeStatus !== 200) return json(r, { ok: false, error: 'a page press is required' }, writeStatus);
95
+ if (b.op === 'add') S.items.push(Object.assign({ id: 'n' + S.items.length, from: 'you', scope: b.scope }, b.item));
96
+ else S.items = S.items.filter((i) => (i.ref || i.url) !== (b.item.ref || b.item.url));
97
+ return json(r, { ok: true, items: S.items });
98
+ });
99
+ await page.route('**/api/plan-items*', (r) => {
100
+ const req = r.request();
101
+ if (req.method() === 'POST') { const b = JSON.parse(req.postData() || '{}'); S.planPosts.push(b); return planStatus === 200 ? json(r, { ok: true, written: [{ item: 'item-9' }] }) : json(r, { ok: false, error: 'a page press is required' }, planStatus); }
102
+ return json(r, { ok: true, stages });
103
+ });
104
+ await page.route('**/api/calendar-links', (r) => json(r, { ok: true }));
105
+ await page.goto(BASE + '/premium.html?theme=' + theme);
106
+ S.up = await until(() => page.evaluate(() => document.querySelectorAll('#rank .rr').length > 0 && document.querySelectorAll('#tl .ev').length > 0), 20000);
107
+ await page.click('#rng [data-r=week]');
108
+ await until(() => page.evaluate(() => !document.querySelector('#tl').hasAttribute('aria-busy') && !!document.querySelector('#tl .wkd')));
109
+ await page.evaluate(() => { const r = [...document.querySelectorAll('#tl .ev')].find((e) => e.querySelector('b').textContent === 'Sprint planning'); r.id = 'rowSprint'; r.click(); });
110
+ S.dlg = await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#mmAdd') && /Roadmap|No material/.test(document.querySelector('#oMain').textContent)));
111
+ return Object.assign(S, { ctx, page });
112
+ };
113
+ const text = (p) => p.evaluate(() => document.querySelector('#oMain').textContent);
114
+
115
+ const A = await open();
116
+ ok('0 the dialog opens on a week row with Add material', A.up && A.dlg);
117
+ if (!A.up || !A.dlg) return finish(1);
118
+ const p = A.page;
119
+
120
+ /* M1 the sheet */
121
+ ok('M2 each removable row has Remove, and the row says its scope', await p.evaluate(() => { const b = document.querySelector('.mtg-rm'); return !!b && /Roadmap/.test(b.getAttribute('aria-label')) && /document itself is not changed/.test(b.title) && /for this meeting/.test(b.closest('li').textContent); }));
122
+ await p.click('#mmAdd');
123
+ const sheet = await until(() => p.evaluate(() => { const s = document.querySelector('.mtg-sheet'); return s && /Premium UX PRD/.test(s.textContent) ? s.textContent : null; }));
124
+ ok('M1 the sheet opens in the dialog with Suggested, Find in PMOS and Or paste a link', sheet && /Suggested for this meeting/.test(sheet) && /Find in PMOS/.test(sheet) && /Or paste a link/.test(sheet), String(sheet).slice(0, 200));
125
+ ok('M1 the sheet says the invite is not changed, and focus is on Back', sheet && /invite in your calendar is not changed/.test(sheet) && await p.evaluate(() => document.activeElement && document.activeElement.id === 'mmBack'));
126
+ ok('M1 Suggested asked for the workspace-free level query of this meeting', A.suggestGets.length >= 1 && !/q=/.test(A.suggestGets[0]), JSON.stringify(A.suggestGets));
127
+ await p.fill('#mmFind', 'q3');
128
+ const found = await until(() => p.evaluate(() => /Q3 report/.test(document.querySelector('#mmFound').textContent)));
129
+ ok('M1 Find in PMOS shows what the search returned, and nothing for one letter', found && A.suggestGets.some((q) => /q=q3/.test(q)));
130
+ await p.fill('#mmFind', 'q');
131
+ ok('M1 a one-letter search shows nothing', await until(() => p.evaluate(() => document.querySelector('#mmFound').textContent === '')));
132
+ await p.fill('#mmLinkIn', 'not a link');
133
+ ok('M1 an address that is not https says so and cannot be picked', await p.evaluate(() => /Paste an https address/.test(document.querySelector('#mmPaste').textContent) && !document.querySelector('#mmPaste [data-pick]')));
134
+ ok('M1 no Add button shows before something is picked', await p.evaluate(() => !document.querySelector('#mmDo')));
135
+ await p.click('#mmSug [data-pick]');
136
+ const opt = await p.evaluate(() => ({ line: document.querySelector('#mmLine').textContent, pressed: [...document.querySelectorAll('[data-scope]')].map((b) => b.dataset.scope + ':' + b.getAttribute('aria-pressed')).join(), picked: document.querySelector('#mmSug .mtg-on') && document.querySelector('#mmSug .mtg-on').textContent }));
137
+ ok('M3 picking says what Add records, before the press', /Adds “Premium UX PRD” to this meeting\. The calendar is not written\./.test(opt.line) && opt.picked === 'Picked' && /meeting:true,series:false/.test(opt.pressed), JSON.stringify(opt));
138
+ await p.click('[data-scope=series]');
139
+ ok('M3 the line follows the scope', await p.evaluate(() => /to every meeting in the series\./.test(document.querySelector('#mmLine').textContent)));
140
+ await p.click('#mmCancel');
141
+ ok('M1 Cancel returns to the meeting and focus returns to Add material', await p.evaluate(() => !document.querySelector('.mtg-sheet') && document.activeElement && document.activeElement.id === 'mmAdd') && A.matPosts.length === 0);
142
+
143
+ /* M1 add */
144
+ await p.click('#mmAdd'); await until(() => p.evaluate(() => /Premium UX PRD/.test(document.querySelector('#mmSug').textContent)));
145
+ await p.click('#mmSug [data-pick]'); await p.click('[data-scope=series]'); await p.click('#mmDo');
146
+ await until(() => A.matPosts.length === 1);
147
+ ok('M1 Add posts one line to /api/meeting-material for the series', A.matPosts.length === 1 && A.matPosts[0].op === 'add' && A.matPosts[0].scope === 'series' && A.matPosts[0].item.ref === 'planning/prd/premium-ux-prd.md' && A.matPosts[0].event.series === 'sprint-planning' && A.matPosts[0].event.id === 'ev-sprint', JSON.stringify(A.matPosts));
148
+ const after = await until(() => p.evaluate(() => /Premium UX PRD/.test(document.querySelector('#oMain').textContent) && !document.querySelector('.mtg-sheet') ? { text: document.querySelector('#oMain').textContent, focus: document.activeElement && document.activeElement.id } : null));
149
+ ok('M3 the list is read again from the route and shows the new row, and the status says what was added', after && /Premium UX PRD/.test(after.text) && /for every meeting of this series/.test(after.text) && /Added “Premium UX PRD” to every meeting in the series\./.test(after.text) && after.focus === 'mmAdd', JSON.stringify(after));
150
+
151
+ /* M2 remove and undo */
152
+ const nRm = A.matPosts.length;
153
+ await p.click('.mtg-rm[aria-label="Remove Roadmap"]');
154
+ await until(() => A.matPosts.length === nRm + 1);
155
+ const rm = A.matPosts[nRm];
156
+ ok('M2 Remove posts the url at the scope the row was added', rm.op === 'remove' && rm.scope === 'meeting' && rm.item.url === 'https://x.example/road', JSON.stringify(rm));
157
+ const gone = await until(() => p.evaluate(() => /Removed “Roadmap” from this meeting\. The document itself is not changed\./.test(document.querySelector('#mtgStatus').textContent) && !/for this meeting.*Roadmap/.test(document.querySelector('#oMain').textContent) && !!document.querySelector('#mtgUndo')));
158
+ ok('M2 the row leaves after the list is read again, and the status offers Undo', gone);
159
+ await p.click('#mtgUndo');
160
+ await until(() => A.matPosts.length === nRm + 2);
161
+ ok('M2 Undo adds the same item back at the same scope', A.matPosts[nRm + 1].op === 'add' && A.matPosts[nRm + 1].scope === 'meeting' && A.matPosts[nRm + 1].item.url === 'https://x.example/road', JSON.stringify(A.matPosts[nRm + 1]));
162
+ ok('M2 the row is back and the status says so', await until(() => p.evaluate(() => /Put back\./.test(document.querySelector('#mtgStatus').textContent) && /Roadmap/.test(document.querySelector('#oMain').textContent))));
163
+ ok('M6 nothing else was written by the material work', A.planPosts.length === 0 && ![...A.reqs].some((r) => /\/api\/(notes|meeting-focus|calendar-links)/.test(r)));
164
+ ok('M6 no page error so far', A.errors.length === 0, JSON.stringify(A.errors));
165
+
166
+ /* M5 refusals */
167
+ const D = await open({ writeStatus: 403 });
168
+ await D.page.click('.mtg-rm');
169
+ const refused = await until(() => D.page.evaluate(() => /The material was not removed: a page press is required/.test(document.querySelector('#mtgStatus').textContent) && /Roadmap/.test(document.querySelector('#oMain').textContent)));
170
+ ok('M5 a refused Remove shows the reason and the row stays', refused && D.items.length === 1);
171
+ await D.page.click('#mmAdd'); await until(() => D.page.evaluate(() => /Premium UX PRD/.test(document.querySelector('#mmSug').textContent)));
172
+ await D.page.fill('#mmLinkIn', 'https://typed.example/page');
173
+ await D.page.click('#mmDo');
174
+ const refAdd = await until(() => D.page.evaluate(() => /The material was not saved: a page press is required/.test(document.querySelector('#mmLine').textContent) ? { still: !!document.querySelector('.mtg-sheet'), typed: document.querySelector('#mmLinkIn').value, again: !document.querySelector('#mmDo').disabled } : null));
175
+ ok('M5 a refused Add shows the reason, keeps the sheet and what was typed, and can be pressed again', refAdd && refAdd.still && refAdd.typed === 'https://typed.example/page' && refAdd.again, JSON.stringify(refAdd));
176
+ ok('M5 the refused writes changed nothing in the list', D.items.length === 1);
177
+
178
+ /* M4 make task */
179
+ const N = await open();
180
+ const steps = await text(N.page);
181
+ ok('M4 the next step has Make task, and decisions and questions have none', /Make task/.test(steps) && await N.page.evaluate(() => document.querySelectorAll('.mtg-task').length === 1));
182
+ await N.page.click('.mtg-task');
183
+ await until(() => N.planPosts.length === 1);
184
+ const pp = N.planPosts[0];
185
+ ok('M4 Make task posts one planned event in the first stage with the owner and due', pp.ws === 'w1' && pp.events.length === 1 && pp.events[0].ev === 'planned' && pp.events[0].initiative === 'premium-ux' && pp.events[0].stage === 'st1' && pp.events[0].title === 'Sam confirms the data fix owner' && pp.events[0].owner === 'person:Sam', JSON.stringify(pp));
186
+ const made = await until(() => N.page.evaluate(() => /Added to Premium UX, under Intake\./.test(document.querySelector('#mtgStatus').textContent) && document.querySelector('.mtg-task').textContent === 'Task made' && document.querySelector('.mtg-task').disabled ? true : null));
187
+ ok('M4 the step says Task made and the status says where it went', made);
188
+ await N.page.click('#mtgUndo');
189
+ await until(() => N.planPosts.length === 2);
190
+ ok('M4 Undo withdraws the item', N.planPosts[1].events[0].ev === 'withdrawn' && N.planPosts[1].events[0].item === 'item-9' && N.planPosts[1].events[0].initiative === 'premium-ux', JSON.stringify(N.planPosts[1]));
191
+ ok('M4 after Undo the step can be made a task again', await until(() => N.page.evaluate(() => document.querySelector('.mtg-task').textContent === 'Make task' && !document.querySelector('.mtg-task').disabled)));
192
+ const NI = await open({ replay: REPLAY_NOINI });
193
+ await NI.page.click('.mtg-task');
194
+ ok('M4 with no initiative the button says to link one and writes nothing', await until(() => NI.page.evaluate(() => /Link the note to an initiative first/.test(document.querySelector('#mtgStatus').textContent))) && NI.planPosts.length === 0);
195
+ const NS = await open({ stages: [] });
196
+ await NS.page.click('.mtg-task');
197
+ ok('M4 an initiative with no stage says so and writes nothing', await until(() => NS.page.evaluate(() => /The task was not made: The initiative has no stage/.test(document.querySelector('#mtgStatus').textContent))) && NS.planPosts.length === 0);
198
+ const NR = await open({ planStatus: 403 });
199
+ await NR.page.click('.mtg-task');
200
+ ok('M5 a refused Make task shows the reason and the step stays open', await until(() => NR.page.evaluate(() => /The task was not made: a page press is required/.test(document.querySelector('#mtgStatus').textContent) && document.querySelector('.mtg-task').textContent === 'Make task' && !document.querySelector('.mtg-task').disabled)));
201
+
202
+ /* M6 the allow-list */
203
+ const all = [].concat(A.reqs, D.reqs, N.reqs, NI.reqs, NS.reqs, NR.reqs);
204
+ const posts = [...new Set(all.filter((r) => /^POST /.test(r)))].sort();
205
+ ok('M6 the only writes the page sent are the material and the plan items', posts.join() === 'POST /api/meeting-material,POST /api/plan-items', posts.join());
206
+ ok('M6 no recording, Focus, note or calendar write was sent', !all.some((r) => /\/api\/(notes|meeting-focus)|POST \/api\/calendar/.test(r)));
207
+ ok('M6 no page error', [A, D, N, NI, NS, NR].every((x) => x.errors.length === 0), JSON.stringify([A, D, N, NI, NS, NR].map((x) => x.errors)));
208
+
209
+ /* M7 floors and fidelity */
210
+ for (const th of ['light', 'dark']) {
211
+ const P = await open({ w: 390, h: 844, theme: th });
212
+ const f1 = await P.page.evaluate(() => ({ scroll: document.documentElement.scrollWidth <= innerWidth + 1, btn: [...document.querySelectorAll('#mmAdd,.mtg-rm,.mtg-task')].map((b) => Math.min(b.getBoundingClientRect().width, b.getBoundingClientRect().height)) }));
213
+ await P.page.click('#mmAdd'); await until(() => P.page.evaluate(() => /Premium UX PRD/.test(document.querySelector('#mmSug').textContent)));
214
+ await P.page.click('#mmSug [data-pick]');
215
+ const f2 = await P.page.evaluate(() => ({ scroll: document.documentElement.scrollWidth <= innerWidth + 1 && document.querySelector('#oMain').scrollWidth <= document.querySelector('#oMain').clientWidth + 1, btn: [...document.querySelectorAll('#mmBack,#mmDo,#mmCancel,[data-scope],[data-pick],.mtg-in')].map((b) => Math.min(b.getBoundingClientRect().width, b.getBoundingClientRect().height)) }));
216
+ ok(`M7 at 390 px (${th}) the dialog and the sheet have no sideways scroll and every press is at least 44 px`, f1.scroll && f2.scroll && f1.btn.every((n) => n >= 44) && f2.btn.every((n) => n >= 44), JSON.stringify([f1, f2]));
217
+ await P.ctx.close();
218
+ }
219
+ const css = (page, sel) => page.evaluate((s) => { const e = document.querySelector(s); if (!e) return null; const c = getComputedStyle(e); return ['fontWeight', 'borderRadius'].map((k) => c[k]).join('|'); }, sel);
220
+ const mk = await browser.newContext({ viewport: { width: 1280, height: 900 } }); const mp = await mk.newPage();
221
+ await mp.setContent(MOCKUP); await mp.waitForTimeout(500);
222
+ const ctaM = await mp.evaluate(() => { const b = document.createElement('button'); b.className = 'cta'; document.body.appendChild(b); const c = getComputedStyle(b); return c.fontWeight + '|' + c.borderRadius; }), F1 = await open(), addB = await css(F1.page, '#mmAdd');
223
+ await F1.page.click('#mmAdd'); await until(() => F1.page.evaluate(() => /Premium UX PRD/.test(document.querySelector('#mmSug').textContent))); await F1.page.click('#mmSug [data-pick]');
224
+ const doB = await css(F1.page, '#mmDo');
225
+ ok('M7 fidelity: the buttons keep the mockup\'s pill radius and weight', ctaM && addB && addB === ctaM && doB === ctaM, ctaM + ' vs ' + addB + ' / ' + doB);
226
+ const labM = await mp.evaluate(() => { const e = document.querySelector('.label'); return e ? getComputedStyle(e).fontSize + '|' + getComputedStyle(e).textTransform : null; });
227
+ const labP = await F1.page.evaluate(() => { const e = document.querySelector('.mtg-sec .label'); return e ? getComputedStyle(e).fontSize + '|' + getComputedStyle(e).textTransform : null; });
228
+ ok('M7 fidelity: a sheet section label uses the mockup\'s label type', labM && labP && labM === labP, labM + ' vs ' + labP);
229
+ await mk.close();
230
+ return finish();
231
+ })().catch((e) => { console.error(e); finish(1); });
@@ -90,7 +90,11 @@ The Today card has a **Today / This week** switch. **This week** lists the meeti
90
90
 
91
91
  Press a meeting, from Today or from the week, to open the meeting dialog. It shows the time, the people, and what the meeting is about. It also shows the notes (decisions, next steps and open questions), the material, and, when a recording was kept, its length and the key points. Each part appears only when a record holds it.
92
92
 
93
- When the meeting is not linked, the dialog has a **Link it** press. You choose the portfolio, a board, an initiative or none. The press writes one calendar link, through a check that only a real press from this page can pass, so an agent session is refused. After the write, the page reads the week again. Adding or removing material, routing next steps, recording and Focus stay in the console for now.
93
+ When the meeting is not linked, the dialog has a **Link it** press. You choose the portfolio, a board, an initiative or none. The press writes one calendar link, through a check that only a real press from this page can pass, so an agent session is refused. After the write, the page reads the week again. The **Material** part has **Add material** and a **Remove** on each row. Add material opens a sheet in the dialog with three ways to pick: **Suggested** (the documents of the meeting's initiative and the newest report cycles), **Find in PMOS** (type two letters or more) and **Paste a link** (an https address). A **For** choice says whether the material belongs to this meeting or to every meeting in the series. Before you press Add, the sheet says what it records: one line in PMOS's own record of the meeting. The calendar invite is never changed. After a write, the list is read again from the record. Remove names its scope and says the document itself is not changed. A few seconds of **Undo** put a removed item back.
94
+
95
+ In **Notes**, each next step has **Make task** when the note is linked to an initiative. It adds the step to the first stage of that initiative's breakdown, with its owner and due day when the step names them, and the status says where it went. **Undo** withdraws the task. A note with no initiative explains that it must be linked first, and writes nothing. Both writes need the page's launch nonce, so an agent session is refused. A refused write shows its reason and changes nothing on screen.
96
+
97
+ Recording and Focus stay in the console for now.
94
98
 
95
99
  ## The dock
96
100
 
@@ -159,7 +163,10 @@ Board is the third place on the rail, at `/premium-board.html`. It reads what th
159
163
  - **Metrics** appears above the Initiatives card on the board of any workspace except the home one (PMOS itself), and counts from that workspace's own repository. It has four tiles. **Corrections per 100 runs** is the corrections logged on the week's runs in `planning/runs/agent-runs.jsonl`; a week with fewer than 10 runs is left blank. **Merged a week** counts the commits on the first-parent line of the trunk. **Blocked** and **Idle for a month** come from the workflow engine and keep no history, so they have no chart. Move over a chart, or use the arrow keys, to read a week. A tile that cannot be counted says **Not read** and why. Press a tile for its definition and values, with the read-only agent beside it. There are no targets, and Day and Month are off. It was tested only on made-up repositories, not on a real IDPF or microsite repository.
160
164
  - **The crumb** at the top names the board. With more than one board a menu switches between them, and the sparkle opens the board in the dialog with the read-only agent.
161
165
  - **Core documents** lists the board's documents with their state, cadence and writer, a summary (drafts to review, not started, up to date), a progress bar, a filter and a search. **Draft it** starts the existing read-only run that writes a draft and sends nothing; **Draft the N not started** does that for each document that can be drafted. **Set it up** and **Open** go to the console. **Add a document** opens a form (title, who writes it, where it lives) and saves a document the core set does not cover on the board's record, in `custom-docs.jsonl`. A document with no link reads "Not started". A document with a link to Confluence or Google Docs reads "Linked" and shows its address. PMOS does not read or sync the linked page, so a linked document is never counted as up to date. Issue and Drop are not on this page.
162
- - **Opening an initiative.** A click on an initiative opens its page (see "Initiative page"). The **Page / Popup** switch in the header changes that: Popup opens the initiative's dialog instead, which shows its record as a grid and the path of its file, with the read-only agent beside it. The choice is kept in this browser. The dialog holds no press: moving an initiative or starting work on it is not built here.
166
+ - **Opening an initiative.** A click on an initiative opens its page (see "Initiative page"). The **Page / Popup** switch in the header changes that: Popup opens the initiative's dialog instead, which shows its record as a grid and the path of its file, with the read-only agent beside it. The choice is kept in this browser. The dialog holds no press.
167
+ - **New asks** sits at the top of the right column on a team board. Each ask shows where it came from and the drafted title, lane and anchor. **Accept** makes it an initiative in the first stage, through the console's accept route; **Decline** asks for a reason first. The card says when nothing is left to triage.
168
+ - **New initiative** (beside the Initiatives heading, team boards only) asks for a title, a lane and an anchor (a KR or a health budget). It writes an ask and accepts it, as the console does. An unanchored initiative is refused on the page.
169
+ - **⋯ on a row** (and the bar under an initiative page's heading) moves it to the next or another stage, puts it on hold with a reason and a check-back day, cancels it with a reason, or archives it. Each press writes one line through the console's route, says what it recorded, and offers Undo for a few seconds. An on-hold row offers Resume; a cancelled one offers Reopen; an archived one offers Restore. Cancelled and archived initiatives leave the list and sit under a fold below it. On the PMOS board the workflow engine places each initiative, so the moves are not offered and New asks and New initiative are hidden.
163
170
 
164
171
  Not drawn, because PMOS holds no record for them: the Metrics card on the PMOS board, the mockup's demo measures (Activation, Partner uptime, API p95), targets, and the mockup's demo boards.
165
172
 
@@ -12,6 +12,8 @@
12
12
  * sprints GET /api/boards/sprints → { source: 'jira'|'none', readAt, sprints: [{ name, state, start, end, counts: { todo, doing, done } }] }
13
13
  * docs GET /api/core-docs?level=board → { scope, summary, docs: [{ key, title, for, cadence, by, kind, st, act, running }] }
14
14
  * nextRelease { id, type, at } | null
15
+ * held, cancelled, archived GET /api/boards/backlog?view=all&status=on hold | status=cancelled | archived=1 → rows (initiative premium-board-actions)
16
+ * asks GET /api/boards/asks → asks [{ id, line, source, by, at, draft: { title, lane, anchor_suggestion } }]; null when it was not read
15
17
  *
16
18
  * THE RULE THE FILE FOLLOWS (as the other premium models): a figure, chip, bar or date is made only from a field of a record. An owner, an end date,
17
19
  * a progress or a sprint that no record holds is not drawn. The header, the list, the stage columns and the dock read ONE set of counts. The Metrics
@@ -31,10 +33,28 @@ const STATUS_LABEL = { 'at risk': 'At risk', late: 'Late', 'on hold': 'On hold',
31
33
  const DOC_STATE = { missing: 'Not started', draft: 'Draft', ok: 'Up to date', stale: 'Stale', due: 'Due' };
32
34
  const BY = { drafts: 'PMOS drafts it', proposes: 'PMOS proposes', reviews: 'PMOS reviews', you: 'You write it', live: 'Live view' };
33
35
  const GO = { reports: 'rep', initiatives: 'init' };
36
+ const LANES = ['feature', 'discovery', 'chore', 'incident', 'content', 'prototype'];
34
37
 
35
38
  let last = null;
36
39
  const peekModel = () => last;
37
40
 
41
+ /** What the row's ⋯ menu and the initiative page's bar can do, from the row's own fields (initiative premium-board-actions): its workflow's stage names,
42
+ * its stage, its lifecycle (on hold or cancelled, with the reason and check-back day the lifecycle line holds) and its archive entry. */
43
+ function actsOf(r, boardNames) {
44
+ const own = Array.isArray(r.workflow) && r.workflow.length ? r.workflow.map((s) => s.name) : boardNames;
45
+ const st = r.stopped || {};
46
+ const life = r.status === 'on hold' ? 'hold' : r.status === 'cancelled' ? 'cancelled' : null;
47
+ return {
48
+ stages: own, stage: r.stage || null, life, reason: life ? clip(st.reason || '', 300) : '', back: life === 'hold' && st.back ? shortDate(st.back) : '', backDay: life === 'hold' && st.back ? String(st.back).slice(0, 10) : null,
49
+ archived: r.archived ? { reason: clip(r.archived.reason || '', 300), into: r.archived.into ? (r.archived.intoTitle || r.archived.into) : null } : null,
50
+ };
51
+ }
52
+ const askOf = (a) => {
53
+ const d = a.draft || {};
54
+ return { id: a.id, line: clip(a.line, 500), source: a.source || '', by: a.by || '', at: a.at ? shortDate(String(a.at).slice(0, 10)) : '',
55
+ draft: { title: clip(d.title || a.line, 120), lane: LANES.includes(d.lane) ? d.lane : null, anchor: d.anchor_suggestion || '' } };
56
+ };
57
+
38
58
  function rowOf(r, wf, today) {
39
59
  const names = (wf || []).map((s) => s.name), cur = names.indexOf(r.stage);
40
60
  const bad = r.status === 'late' || r.status === 'at risk';
@@ -51,11 +71,12 @@ function rowOf(r, wf, today) {
51
71
  stage: r.stage || null, cat: r.cat || null, stageNote: r.stageSource === 'derived' ? 'derived' : null,
52
72
  seg: names.map((n, j) => (j < cur ? 'p' : j === cur ? 'n' : '')), progress: r.progress != null ? Math.max(0, Math.min(100, Math.round(r.progress))) : null,
53
73
  finish: r.end ? shortDate(r.end) : 'Not planned', over: !!over, start: r.start || null, end: r.end || null,
74
+ acts: actsOf(r, names),
54
75
  dialog: {
55
76
  eye: 'Initiative', logTitle: 'Read from the board',
56
77
  log: ['Read the initiative from the board' + (r.stageSource === 'derived' ? ' (its stage is derived by the workflow engine)' : ''), 'Placed it in the ' + (r.stage || 'unknown') + ' stage', r.status ? 'Took its status from the record: ' + r.status : 'No status is on record'],
57
78
  say: r.title + ' is in ' + (r.stage || 'no stage') + (r.status ? ' and its status is ' + r.status : '') + '.' + (r.stageSource === 'derived' ? ' The stage comes from the workflow engine, not from a person.' : ''),
58
- head: 'Where it stands', facts, hold: 'Nothing here changes an initiative. Moving one, or starting work on it, is not built on this page.',
79
+ head: 'Where it stands', facts, hold: 'This dialog changes nothing. To move it, put it on hold, cancel or archive it, use ⋯ on its row or open its page.',
59
80
  pane: { label: 'Initiative record', file: 'planning/initiatives/' + r.id + '.md', rows: facts },
60
81
  },
61
82
  };
@@ -69,6 +90,9 @@ function build(f) {
69
90
  const missing = (f.missing || []).slice();
70
91
  const open = Number(counts.open) || 0, on = Number(st['on track']) || 0, risk = Number(st['at risk']) || 0, late = Number(st.late) || 0, hold = Number(st['on hold']) || 0;
71
92
  const rows = (f.rows || []).slice(0, MAX_LIST).map((r) => rowOf(r, wf, todayIso));
93
+ // the on-hold rows follow the open ones; the cancelled and archived rows sit under the list's fold (initiative premium-board-actions)
94
+ for (const r of (f.held || [])) if (rows.length < MAX_LIST + 50 && !rows.some((x) => x.id === r.id)) rows.push(rowOf(r, wf, todayIso));
95
+ const gone = { cancelled: (f.cancelled || []).slice(0, MAX_LIST).map((r) => rowOf(r, wf, todayIso)), archived: (f.archived || []).slice(0, MAX_LIST).map((r) => rowOf(r, wf, todayIso)) };
72
96
  // the list reads the board's own rank; "Do this first" only where a record says the first row is late
73
97
  if (rows[0] && rows[0].late) rows[0].first = true;
74
98
  const stages = (f.columns || []).map((c) => ({ stage: c.stage, cat: c.cat, count: Number(c.count) || 0, rows: (c.rows || []).slice(0, STAGE_ROWS).map((r) => rowOf(r, wf, todayIso)), more: Math.max(0, (Number(c.count) || 0) - STAGE_ROWS) }));
@@ -117,17 +141,19 @@ function build(f) {
117
141
  const model = {
118
142
  pending: !!f.pending,
119
143
  header: { text: 'Real data · as of ' + hhmm(now) + (missing.length ? ' · not read: ' + missing.join(', ') : '') + (f.pending ? ' · reading the board' : ''), missing },
120
- board: { name: board.name || '', id: board.id || null, ws: board.ws || null, switcher: (f.boards || []).length > 1 ? f.boards.map((b) => ({ id: b.id, ws: b.ws, name: b.name })) : null },
144
+ board: { name: board.name || '', id: board.id || null, ws: board.ws || null, self: !!board.self, stages: wf.map((s) => s.name), switcher: (f.boards || []).length > 1 ? f.boards.map((b) => ({ id: b.id, ws: b.ws, name: b.name })) : null },
121
145
  initiatives: {
122
146
  title: 'Initiatives', open, on, risk, late, hold, total: Number(counts.total) || 0,
123
147
  cap: open ? { on, open } : null,
124
148
  note: open ? (rows.length >= open ? 'All ' + open + ' open ' + plural(open, 'initiative is', 'initiatives are') + ' listed. Late and at-risk ones come first.' : rows.length + ' of ' + open + ' open initiatives are loaded: late and at-risk ones first, then the board\'s now view.') : 'The board has no open initiatives.',
125
149
  list: { rows, total: rows.length },
150
+ gone,
126
151
  stages, timeline,
127
152
  },
128
153
  sprint, release, docs,
154
+ asks: f.asks == null ? { missing: true, rows: [] } : { rows: f.asks.filter((a) => a && a.state !== 'accepted' && a.state !== 'declined').slice(0, 50).map(askOf) },
129
155
  dock: { needs: risk + late, label: 'need a look', next: (rows.find((r) => r.late) || rows.find((r) => r.bad) || {}).title || null },
130
- rows: rows.concat(stageRows.filter((r) => !rows.some((x) => x.key === r.key))).concat([{ key: 'board:this-board', id: null, title: board.name || 'This board', sub: 'Board', dialog: { eye: 'Board', logTitle: 'Read from the board', log: ['Read the board and its initiatives', 'Counted them by status', 'Changed nothing'], say: (board.name || 'This board') + ' has ' + open + ' open ' + plural(open, 'initiative', 'initiatives') + ': ' + on + ' on track, ' + risk + ' at risk, ' + late + ' late' + (hold ? ', ' + hold + ' on hold' : '') + '.', head: 'Where it stands', facts: [['Open initiatives', String(open)], ['On track', String(on)], ['At risk', String(risk)], ['Late', String(late)], ['On hold', hold ? String(hold) : '']].filter((x) => x[1] !== ''), hold: 'Nothing here changes a board.', pane: { label: 'Board record', file: '', note: 'The board as its records hold it.', rows: [['Open initiatives', String(open)], ['On track', String(on)], ['At risk', String(risk)], ['Late', String(late)], ['On hold', hold ? String(hold) : '']].filter((x) => x[1] !== '') } } }]),
156
+ rows: rows.concat(stageRows.filter((r) => !rows.some((x) => x.key === r.key)), gone.cancelled, gone.archived).concat([{ key: 'board:this-board', id: null, title: board.name || 'This board', sub: 'Board', dialog: { eye: 'Board', logTitle: 'Read from the board', log: ['Read the board and its initiatives', 'Counted them by status', 'Changed nothing'], say: (board.name || 'This board') + ' has ' + open + ' open ' + plural(open, 'initiative', 'initiatives') + ': ' + on + ' on track, ' + risk + ' at risk, ' + late + ' late' + (hold ? ', ' + hold + ' on hold' : '') + '.', head: 'Where it stands', facts: [['Open initiatives', String(open)], ['On track', String(on)], ['At risk', String(risk)], ['Late', String(late)], ['On hold', hold ? String(hold) : '']].filter((x) => x[1] !== ''), hold: 'Nothing here changes a board.', pane: { label: 'Board record', file: '', note: 'The board as its records hold it.', rows: [['Open initiatives', String(open)], ['On track', String(on)], ['At risk', String(risk)], ['Late', String(late)], ['On hold', hold ? String(hold) : '']].filter((x) => x[1] !== '') } } }]),
131
157
  };
132
158
  last = model;
133
159
  return model;
@@ -139,6 +139,14 @@ function build(f) {
139
139
  header: { text: 'Real data · as of ' + hhmm(now) + (missing.length ? ' · not read: ' + missing.join(', ') : ''), missing },
140
140
  board: { name: board.name || '', id: board.id || null, ws: board.ws || null },
141
141
  id, key, title: clip(row.title || id, 160), lane: row.lane || '', anchor: row.anchor || '',
142
+ // the bar's presses (initiative premium-board-actions): the workflow, the lifecycle and the archive entry the row holds
143
+ acts: {
144
+ self: !!board.self, stages: names, stage: row.stage || null,
145
+ life: status === 'on hold' ? 'hold' : status === 'cancelled' ? 'cancelled' : null,
146
+ reason: (status === 'on hold' || status === 'cancelled') && row.stopped ? clip(row.stopped.reason || '', 300) : '',
147
+ back: status === 'on hold' && row.stopped && row.stopped.back ? shortDate(row.stopped.back) : '', backDay: status === 'on hold' && row.stopped && row.stopped.back ? String(row.stopped.back).slice(0, 10) : null,
148
+ archived: row.archived ? { reason: clip(row.archived.reason || '', 300), into: row.archived.into ? (row.archived.intoTitle || row.archived.into) : null } : null,
149
+ },
142
150
  head, overview, health, warnings, checks, allSteps, tasks, docs, files, desc, crumbTitle, help,
143
151
  boards: f.boards || [], siblings: (f.siblings || []).slice(0, 100),
144
152
  dock: { label: head.statusLabel || 'No status', stage: row.stage || '', next: String(overview.h || '').replace(/^Next: /, '') },
@@ -4,10 +4,12 @@
4
4
  * 200 { ok, state: 'ready', model, as_of } | 202 { ok, state: 'reading' } | 500 { ok: false, state: 'error', error }
5
5
  * model is lib/board-premium.js build(), made from the answers of the routes the production Initiatives page reads: /api/boards, /api/boards/board,
6
6
  * /backlog, /columns, /sprints and /api/core-docs?level=board. Those routes derive the initiatives in the background and answer 202 while they do, so
7
- * this route answers 202 too and the page asks again: no request waits for the read. Read-only: the one press of the page (Draft it) goes to
8
- * POST /api/core-docs/draft from the page. */
7
+ * this route answers 202 too and the page asks again: no request waits for the read. Read-only: the page's presses go from the page to the
8
+ * console's own routes (POST /api/core-docs/draft, /api/boards/asks/*, /api/boards/move, /api/lifecycle, /api/boards/archive).
9
+ * initiative premium-board-actions adds the open asks (/api/boards/asks), the on-hold rows and the cancelled and archived rows (/backlog). */
9
10
  const BoardPremium = require('./board-premium.js');
10
11
  const BoardP = BoardPremium;
12
+ const Rows = require('./initiative-rows.js');
11
13
  const boards = require('./routes-boards.js');
12
14
  const coreDocs = require('./routes-core-docs.js');
13
15
  const Custom = require('./custom-docs.js');
@@ -65,15 +67,20 @@ module.exports = {
65
67
  const missing = [];
66
68
  // the late and at-risk initiatives first (the board's own `risk` view, late before at risk), then its `now` view, each initiative once
67
69
  const listOf = (a, n) => { const seen = new Set(), out = []; const rank = (r) => (r.status === 'late' ? 0 : 1); for (const r of [...((a && a.rows) || [])].sort((x, y) => rank(x) - rank(y))) { if (!seen.has(r.id)) { seen.add(r.id); out.push(r); } } for (const r of (n && n.rows) || []) if (!seen.has(r.id)) { seen.add(r.id); out.push(r); } return out.slice(0, 100); };
68
- const [risk, now, cols, spr, docs] = await Promise.all([
70
+ const [risk, now, cols, spr, docs, held, can, arc, asks] = await Promise.all([
69
71
  via(boards, '/api/boards/backlog' + q + '&view=risk&limit=100', req, ctx),
70
72
  via(boards, '/api/boards/backlog' + q + '&view=now&limit=100', req, ctx),
71
73
  via(boards, '/api/boards/columns' + q, req, ctx),
72
74
  via(boards, '/api/boards/sprints' + q, req, ctx),
73
75
  via(coreDocs, '/api/core-docs' + qs({ level: 'board', ws: pick.ws, board: pick.id }), req, ctx),
76
+ via(boards, '/api/boards/backlog' + q + '&view=all&status=' + encodeURIComponent('on hold') + '&limit=100', req, ctx),
77
+ via(boards, '/api/boards/backlog' + q + '&view=all&status=cancelled&limit=100', req, ctx),
78
+ via(boards, '/api/boards/backlog' + q + '&archived=1&limit=100', req, ctx),
79
+ via(boards, '/api/boards/asks' + q, req, ctx),
74
80
  ]);
75
81
  const ok = (r, name) => { if (r.status === 202 || !r.body || r.body.ok === false || r.body.pending) { missing.push(name); return null; } return r.body; };
76
82
  const rk = ok(risk, 'initiatives'), nw = ok(now, 'initiatives'), c = ok(cols, 'stages'), s = ok(spr, 'sprints'), d = ok(docs, 'core documents');
83
+ const hd = ok(held, 'on-hold initiatives'), cn = ok(can, 'cancelled initiatives'), ar = ok(arc, 'archived initiatives'), ak = ok(asks, 'new asks');
77
84
  // the documents the PM added (lib/custom-docs.js): one file read, no route
78
85
  let custom = [];
79
86
  try { const w = ctx.getWs ? ctx.getWs(pick.ws) : null; custom = w ? Custom.list(w.root, 'board:' + pick.id) : []; } catch { custom = []; missing.push('added documents'); }
@@ -81,8 +88,12 @@ module.exports = {
81
88
  now: Date.now(), pending: false, missing: missing.filter((m) => m !== 'core documents'), boards: all.map((x) => ({ ws: x.ws, id: x.id, name: x.name })),
82
89
  board: head.body.board, counts: head.body.counts, nextRelease: head.body.nextRelease || null,
83
90
  rows: listOf(rk, nw), columns: c ? c.columns : [], sprints: s || { source: 'none', sprints: [] }, docs: d, custom,
91
+ held: hd ? hd.rows : [], cancelled: cn ? cn.rows : [], archived: ar ? ar.rows : [], asks: ak ? ak.asks || [] : null,
84
92
  });
85
- ctx.json(res, { ok: true, state: 'ready', model, as_of: Date.now() });
93
+ // a press re-derives the rows in the background; while the answer is stale the page asks again (initiative premium-board-actions)
94
+ let stale = false;
95
+ try { const w = ctx.getWs ? ctx.getWs(pick.ws) : null; const pk = w ? Rows.peek(w.root) : null; stale = !!(pk && (pk.pending || pk.stale)); } catch { stale = false; }
96
+ ctx.json(res, { ok: true, state: 'ready', model, stale, as_of: Date.now() });
86
97
  return true;
87
98
  } catch (e) { return fail((e && e.message) || e); }
88
99
  },
@@ -60,7 +60,7 @@ module.exports = {
60
60
  try { const w = ctx.getWs ? ctx.getWs(pick.ws) : null; custom = w ? Custom.list(w.root, 'initiative:' + id) : []; } catch { custom = []; missing.push('added documents'); }
61
61
  const model = InitPremium.build({
62
62
  now: Date.now(), pending: false, missing: missing.filter((m) => m !== 'core documents'),
63
- board: { ws: own.ws || pick.ws, id: own.id, name: own.name, workflow: own.workflow },
63
+ board: { ws: own.ws || pick.ws, id: own.id, name: own.name, workflow: own.workflow, self: !!own.self },
64
64
  row: head.body.row, sheet: sh, items: it ? it.items : [], docs: dd, custom, ladder: lad,
65
65
  boards: all.map((x) => ({ ws: x.ws, id: x.id, name: x.name })), siblings: it ? (it.initiatives || []).map((x) => ({ id: x.id, title: x.title })) : [],
66
66
  });
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.265.0",
3
+ "version": "0.267.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.265.0",
9
+ "version": "0.267.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.265.0",
3
+ "version": "0.267.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",