create-pmos 0.266.0 → 0.268.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.266.0",
3
+ "version": "0.268.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@f9ca693
1
+ kernel-source: pmos@37b2f3e
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-18T10:48:48Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-18T11:47:32Z"}
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-18T10:48:48Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-18T11:47:32Z"}
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-18T10:48:48Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-18T11:47:32Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -125,7 +125,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
125
125
  const docs = await p.evaluate(() => ({ cap: document.querySelector('#docCap').textContent, rows: [...document.querySelectorAll('#docBody .dmr')].map((r) => ({ t: r.querySelector('.dmn b').textContent, s: r.querySelector('.dmm .s').textContent.trim(), b: r.querySelector('.dmcta') ? r.querySelector('.dmcta').textContent.trim() : null, dis: r.querySelector('.dmcta') ? r.querySelector('.dmcta').disabled : null, kind: r.querySelector('.dmcta') ? (r.querySelector('.dmcta').dataset.draft ? 'draft' : 'go') : null })), all: document.querySelector('#cDocs').textContent }));
126
126
  ok('B7 the documents come from the record with their state, and the summary counts them', docs.cap === '6' && docs.rows.length === 6 && docs.rows[0].t === 'Board charter' && docs.rows[0].s === 'Not started' && docs.rows[1].s === 'Live' && docs.rows[3].s === 'Draft' && docs.rows[4].s === 'Stale', JSON.stringify(docs));
127
127
  ok('B7 the button is the record\'s own action: Draft it, Set it up, Open; a draft to review and a document with no action have none; a running one is off', docs.rows[0].b === 'Draft it' && docs.rows[0].kind === 'draft' && docs.rows[2].b === 'Set it up' && docs.rows[2].kind === 'go' && docs.rows[1].b === 'Open' && docs.rows[3].b === null && docs.rows[5].b === 'Drafting' && docs.rows[5].dis === true, JSON.stringify(docs.rows));
128
- ok('B7 Issue and Drop are not on the page', !/\b(Issue|Drop)\b/.test(docs.all));
128
+ ok('B7 Drop is not on the page, and the list has no Issue it press (it is in a draft\'s reader)', !/\bDrop\b/.test(docs.all) && await p.evaluate(() => !document.querySelector('#docBody [data-rd="issue"], #docBody button.dmcta')?.textContent.includes('Issue it')));
129
129
  A.set({ status: 200, body: { ok: true, run: 'r1' } });
130
130
  const g0 = A.calls();
131
131
  await p.locator('#docBody [data-draft="charter"]').click();
@@ -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); });
@@ -169,7 +169,7 @@ const HEALTH = { ok: true, path: 'planning/prd/self-serve-v2-prd.md', health: {
169
169
  A.set({ status: 409, body: { ok: false, error: 'a run is already drafting that document' } });
170
170
  await p.locator('#dmList [data-draft="problem"]').click();
171
171
  ok('I10 a refused press shows the route\'s reason and turns the button back on', await until(() => p.evaluate(() => /already drafting/.test(document.querySelector('#toast').textContent) && !document.querySelector('#dmList [data-draft="problem"]').disabled)));
172
- ok('I10 Issue, Drop and editing are not on the page', !/\b(Issue it|Drop|Accept|Edit)\b/.test(await txt('#iMain')));
172
+ ok('I10 Drop, Accept and editing are not on the page, and no Issue it press is in the list (it is on a draft\'s sheet)', !/\b(Drop|Accept|Edit)\b/.test(await txt('#iMain')) && await p.evaluate(() => ![...document.querySelectorAll('#iMain button')].some((b) => /Issue it/.test(b.textContent))));
173
173
  ok('I7 a running document shows Drafting and is off', await p.evaluate(() => { const b = document.querySelector('#dmList [data-draft="launch"]'); return !!b && b.disabled && /Drafting/.test(b.textContent); }));
174
174
 
175
175
  /* the batch press: one existing draft run for each document not started */
@@ -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
 
@@ -158,7 +162,7 @@ Board is the third place on the rail, at `/premium-board.html`. It reads what th
158
162
  - **Sprint** appears when an agent session has read Jira for the board. Otherwise it says there is none. **Coming up** shows the next release, from the releases ledger.
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
- - **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.
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. A document with a file opens in the dialog, read only, with its path and state; a draft there has **Issue it**, which marks it issued through the console's own route and sends nothing, and **Draft it again**, which starts a new draft that replaces this one (a board draft has no Edit tab). **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
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.
163
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.
164
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.
@@ -178,7 +182,7 @@ The initiative page is at `/premium-initiative.html?id=<initiative>`. A click on
178
182
  - **Checks** lists the engine's six steps (spec, contract, build, quality, review, accept) with their state and the evidence each states, and marks the next one. "All N workflow steps" lists every step.
179
183
  - **Tasks** lists the PRD requirements and the board's tracker items for this initiative. The repository records no result for each requirement, so a requirement says "No result" and is never drawn as done or open. **By stage** groups them by state. **Timeline** draws a bar for each task that has both a start and a due date, and lists the rest. Press a task to read its record; for a PMOS task you can change its status. **Add a task** writes a PMOS task to the board's own record; with no dates the board plans it from tomorrow for a week. Jira tickets stay read-only. **Add a document** works as on the Board, with a phase as well, and saves on the initiative's record.
180
184
  - **Core documents** has the same counts, filter and search as the Board's card, for this initiative. **Draft it** starts the existing read-only run that writes a draft and sends nothing. Technical documents (the record, the rubric, the stories, the review and the explainer) are grouped and not counted.
181
- - **The document sheet.** A document that has a file opens in a dialog with **Read** (the file's text, its front matter as a grid and an outline), **Edit** (the file as plain Markdown, a reason, and **Save**), **Proposals** (**Ask the agent**, the open proposals with **Accept** and **Reject**, and the closed ones), **Edit log** (the revisions and other entries of the document sheet) and **Health** (the document-health checks; a check with no input is not counted). The file changes only when you press Save or Accept, and every change is kept in the Edit log with its reason. Save and Reject need a reason. A proposal made on text that has since changed shows which sections are out of date and cannot take them. The agent beside the sheet still only reads. Bold and undo buttons, Issue and Drop are not built on this page.
185
+ - **The document sheet.** A document that has a file opens in a dialog with **Read** (the file's text, its front matter as a grid and an outline), **Edit** (the file as plain Markdown, a reason, and **Save**), **Proposals** (**Ask the agent**, the open proposals with **Accept** and **Reject**, and the closed ones), **Edit log** (the revisions and other entries of the document sheet) and **Health** (the document-health checks; a check with no input is not counted). The file changes only when you press Save or Accept, and every change is kept in the Edit log with its reason. Save and Reject need a reason. A proposal made on text that has since changed shows which sections are out of date and cannot take them. The agent beside the sheet still only reads. A draft shows a bar above its text: **Issue it** marks the draft issued, through the console's own route, and sends nothing; it refuses while the Edit tab holds unsaved changes. Bold and undo buttons and Drop are not built on this page.
182
186
 
183
187
  Not drawn, because PMOS holds no record for them: the mockup's demo tasks, its Jira data, and the owner "Agents" on a requirement.
184
188
 
@@ -131,7 +131,7 @@ function build(f) {
131
131
  cap: dd.summary ? [(dd.summary.missing + nCustomNone) ? (dd.summary.missing + nCustomNone) + ' not started' : null, dd.summary.draft ? dd.summary.draft + ' ' + plural(dd.summary.draft, 'draft', 'drafts') : null, dd.summary.stale ? dd.summary.stale + ' stale' : null, dd.summary.due ? dd.summary.due + ' due' : null].concat(nLinked ? [nLinked + ' linked'] : []).filter(Boolean).join(' · ') || 'all up to date' : '',
132
132
  scope: dd.scope || null,
133
133
  counts: null,
134
- rows: (dd.docs || []).map((d) => ({ key: d.key, title: d.title, what: d.for || '', state: d.kind === 'live' ? 'Live' : DOC_STATE[d.st] || d.st || '', st: d.st, cadence: d.cadence || '', by: BY[d.by] || d.by || '', running: !!d.running,
134
+ rows: (dd.docs || []).map((d) => ({ key: d.key, title: d.title, what: d.for || '', state: d.kind === 'live' ? 'Live' : DOC_STATE[d.st] || d.st || '', st: d.st, cadence: d.cadence || '', by: BY[d.by] || d.by || '', running: !!d.running, when: d.when ? shortDate(d.when) : '', path: d.open && d.open.path ? d.open.path : null, slot: d.st === 'draft' && d.draft && d.draft.slot ? d.draft.slot : '',
135
135
  act: d.act && d.act.do === 'draft' ? { kind: 'draft', label: d.running ? 'Drafting' : d.act.label || 'Draft it' } : d.act && d.act.go ? { kind: 'go', label: d.act.label || 'Open', tab: GO[d.act.go] || 'init' } : d.open && d.open.tab ? { kind: 'go', label: 'Open', tab: GO[d.open.tab] || 'init' } : null })).concat(custom),
136
136
  } : { cap: '', rows: custom, missing: true, scope: board.id ? 'board:' + board.id : null };
137
137
  docs.counts = dd || custom.length ? { all: docs.rows.length, none: docs.rows.filter((d) => d.st === 'missing').length, draft: docs.rows.filter((d) => d.st === 'draft').length, ok: docs.rows.filter((d) => d.st === 'ok').length } : { all: 0, none: 0, draft: 0, ok: 0 };
@@ -103,7 +103,7 @@ function build(f) {
103
103
  const dd = f.docs || null;
104
104
  const all = dd ? (dd.docs || []).map((d) => ({
105
105
  key: d.key, title: d.title, what: d.for || '', st: d.st, state: d.kind === 'live' ? 'Live' : DOC_STATE[d.st] || d.st || '', by: BY[d.by] || d.by || '', byKey: d.by || '',
106
- when: d.when ? shortDate(d.when) : '', cat: d.cat === 'Do' ? 'Build' : d.cat === 'Learn' ? 'Evaluate' : d.cat || 'Board', path: d.open && d.open.path ? d.open.path : null, running: !!d.running, tech: TECH.has(d.key),
106
+ when: d.when ? shortDate(d.when) : '', cat: d.cat === 'Do' ? 'Build' : d.cat === 'Learn' ? 'Evaluate' : d.cat || 'Board', path: d.open && d.open.path ? d.open.path : null, slot: d.st === 'draft' && d.draft && d.draft.slot ? d.draft.slot : '', running: !!d.running, tech: TECH.has(d.key),
107
107
  act: d.act && d.act.do === 'draft' ? { kind: 'draft', label: d.running ? 'Drafting' : d.act.label || 'Draft it' } : null,
108
108
  })) : [];
109
109
  const custom = (f.custom || []).map((d) => Object.assign(Custom.rowOf(d), { added: shortDate(d.at), cat: d.phase || 'Board' }));
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.266.0",
3
+ "version": "0.268.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.266.0",
9
+ "version": "0.268.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.266.0",
3
+ "version": "0.268.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",
@@ -0,0 +1,173 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* premium-core-doc-issue-test.js — Issue it on a core document draft, on the premium Board and the premium initiative page (initiative premium-core-doc-issue;
4
+ * planning/prd/premium-core-doc-issue-prd.md I1 to I7). A real server on a scratch `team` repository, never the PMOS checkout. The drafts are written by the
5
+ * core-docs writer (lib/core-docs.js writeDraft), so the pages read what the agent's run would leave. The real pages press the real route:
6
+ * R reading (slot and path) · B the Board reader and Issue it · I the initiative sheet, unsaved edits and a refusal · P the POST allow-list · F floors */
7
+ const fs = require('fs');
8
+ const path = require('path');
9
+ const { spawn } = require('child_process');
10
+ const { findBrowser } = require('./lib/find-browser');
11
+ const T = require('./test-run').configure({ name: 'premium-core-doc-issue' });
12
+ const { makeRepos, codeRepo, write, git } = require('./plan-test-repos');
13
+ const CD = require('./lib/core-docs.js');
14
+
15
+ const BASE = T.BASE;
16
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
17
+ const until = async (fn, ms = 20000, step = 150) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
18
+ const results = [];
19
+ const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 500) : ''}`); };
20
+ const R = makeRepos('premium-core-doc-issue');
21
+ const team = codeRepo(path.join(R.base, 'team'));
22
+ fs.mkdirSync(path.join(team, 'pmos', 'state'), { recursive: true });
23
+ write(team, 'planning/initiatives/pa-one.md', '---\ntype: Initiative\ntitle: Partner rate limits\ntimestamp: 2026-10-01\nid: pa-one\nlane: chore\nparent_kr: health:tech\nspecimen_test: "description-judgeable — x"\nsurface_check: "greenfield — x"\n---\n\nbody\n');
24
+ git(team, ['add', '-A']); git(team, ['commit', '-q', '-m', 'pa-one']);
25
+ let srv = null; let browser = null;
26
+ const finish = async (code) => {
27
+ if (browser) await browser.close().catch(() => {});
28
+ if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
29
+ T.killTmux(); R.cleanup();
30
+ const bad = results.filter((x) => !x.cond).length;
31
+ console.log(`\n${results.length - bad}/${results.length} premium-core-doc-issue assertions passed`);
32
+ process.exit(code !== undefined ? code : (bad ? 1 : 0));
33
+ };
34
+ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
35
+
36
+ const ledger = () => { const f = CD.ledgerFile(team); return fs.existsSync(f) ? fs.readFileSync(f, 'utf8').split('\n').filter(Boolean).map((x) => JSON.parse(x)) : []; };
37
+ const ALLOWED = /^\/api\/(?:core-docs\/issue|briefing-premium\/note)$/;
38
+ const BODY = '## Purpose\n\nWhy this board exists.\n\n## Scope\n\nWhat it covers.\n';
39
+
40
+ (async () => {
41
+ const exe = findBrowser();
42
+ if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
43
+ let chromium;
44
+ try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
45
+ srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT), PMOS_SELF_ROOT: team, PMOS_NO_OPEN: '1' }) });
46
+ await T.waitForServer(BASE);
47
+ const ready = await until(async () => { const r = await fetch(BASE + '/api/board-premium'); const j = await r.json().catch(() => null); return r.status === 200 && j && j.ok && j.state === 'ready' && j.model.initiatives.list.rows.length ? j : null; }, 90000, 400);
48
+ if (!ready) { ok('setup the real route reads the scratch board', false); return finish(1); }
49
+ const B = ready.model.board, bscope = ready.model.docs.scope;
50
+ const bkey = (ready.model.docs.rows.find((d) => d.act && d.act.kind === 'draft' && d.st === 'missing') || {}).key;
51
+ ok('setup the board has a core document not started, and a scope', !!bkey && /^board:/.test(bscope), JSON.stringify({ bscope, bkey }));
52
+ const d1 = CD.writeDraft(team, { scope: bscope, key: bkey, markdown: BODY, by: 'agent:test', now: Date.now() });
53
+ const iq = '?id=pa-one&ws=' + encodeURIComponent(B.ws) + '&board=' + encodeURIComponent(B.id);
54
+ const ini = await until(async () => { const r = await fetch(BASE + '/api/initiative-premium' + iq); const j = await r.json().catch(() => null); return r.status === 200 && j && j.ok && j.state === 'ready' ? j : null; }, 90000, 400);
55
+ /* the initiative documents PMOS keeps itself are Risks and Outcome review (lib/core-docs.js storable); the others are read from their own source */
56
+ const free = ini ? ['risks', 'outcome'].filter((k) => ini.model.docs.rows.some((d) => d.key === k && !d.tech)) : [];
57
+ const ikey = free[0];
58
+ const iscope = ini && ini.model.docs.scope;
59
+ ok('setup the initiative has two core documents not started', free.length >= 2 && iscope === 'initiative:pa-one', JSON.stringify({ iscope, ikey }));
60
+ if (!ikey) return finish(1);
61
+ const d2 = CD.writeDraft(team, { scope: iscope, key: ikey, markdown: BODY, by: 'agent:test', now: Date.now() });
62
+ const d3 = CD.writeDraft(team, { scope: iscope, key: free[1], markdown: BODY, by: 'agent:test', now: Date.now() });
63
+ ok('setup the writer left three drafts', d1.ok && d2.ok && d3.ok, JSON.stringify([d1, d2, d3]));
64
+
65
+ /* R reading */
66
+ const board2 = await (await fetch(BASE + '/api/board-premium')).json();
67
+ const br = board2.model.docs.rows.find((d) => d.key === bkey);
68
+ ok('R1 the board model carries the draft\'s slot and path from the core-docs answer', br.st === 'draft' && br.slot === d1.slot && br.path === d1.path, JSON.stringify(br));
69
+ const ini2 = await (await fetch(BASE + '/api/initiative-premium' + iq)).json();
70
+ const ir = ini2.model.docs.rows.find((d) => d.key === ikey);
71
+ ok('R2 the initiative model carries the draft\'s slot and path', ir.st === 'draft' && ir.slot === d2.slot && ir.path === d2.path, JSON.stringify(ir));
72
+
73
+ browser = await chromium.launch({ executablePath: exe });
74
+ const open = async (url, { w = 1280, h = 900, theme = 'light' } = {}) => {
75
+ const ctx = await browser.newContext({ viewport: { width: w, height: h } });
76
+ await ctx.addInitScript(() => { try { localStorage.setItem('pmos.premium.openAs', 'popup'); } catch { /* none */ } });
77
+ const page = await ctx.newPage(), errors = [], posts = [];
78
+ page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
79
+ page.on('request', (rq) => { if (rq.method() === 'POST') posts.push({ path: new URL(rq.url()).pathname, body: JSON.parse(rq.postData() || '{}'), headers: rq.headers() }); });
80
+ await page.goto(BASE + url);
81
+ if (theme === 'dark') await page.evaluate(() => { document.documentElement.dataset.theme = 'dark'; });
82
+ return { ctx, page, errors, posts };
83
+ };
84
+ const dlgOn = async (p) => { const v = await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(800); return v; };
85
+ const toastIs = (p, re) => until(() => p.evaluate((s) => { const t = document.querySelector('#toast'); return t.classList.contains('on') && new RegExp(s).test(t.textContent) ? t.textContent : null; }, re.source));
86
+ const H = await T.pressHeaders(BASE);
87
+ const nonce = H['x-pmos-nonce'];
88
+
89
+ /* B the Board reader */
90
+ const P = await open('/premium-board.html'), p = P.page;
91
+ ok('B1 a board document with a file is a button that opens the reader', await until(() => p.evaluate((k) => !!document.querySelector(`#docBody [data-doc="${k}"]`), bkey)));
92
+ ok('B1 a document with no file is not', await p.evaluate((k) => !document.querySelector('#docBody .dmo:not(button)') || [...document.querySelectorAll('#docBody .dmo:not(button)')].every((x) => !x.closest('.dmr').querySelector(`[data-doc="${k}"]`)), bkey));
93
+ await p.click(`#docBody [data-doc="${bkey}"]`); await dlgOn(p);
94
+ ok('B2 the reader shows the file\'s text and path, and the bar says nothing is sent', await until(() => p.evaluate((pt) => { const o = document.querySelector('#oMain'); return /Why this board exists/.test(o.textContent) && o.textContent.includes(pt) && !!o.querySelector('[data-issue-bar="draft"]') && /Nothing is sent/.test(o.querySelector('[data-issue-bar]').textContent) && !!o.querySelector('[data-rd="issue"]'); }, d1.path)), await p.evaluate(() => document.querySelector('#oMain').textContent));
95
+ ok('B2 the reader has no Edit tab', await p.evaluate(() => !document.querySelector('#oMain [data-sh]')));
96
+ const n0 = ledger().filter((l) => l.ev === 'issue').length;
97
+ await p.click('[data-rd="issue"]');
98
+ ok('B3 Issue it says it sent nothing', !!(await toastIs(p, /Issued\. Nothing was sent to anyone/)));
99
+ const sent = P.posts.filter((x) => x.path === '/api/core-docs/issue');
100
+ ok('B4 it posted the workspace, the scope, the key and the slot, and nothing else, with the launch nonce', sent.length === 1 && Object.keys(sent[0].body).sort().join() === 'key,scope,slot,ws' && sent[0].body.scope === bscope && sent[0].body.key === bkey && sent[0].body.slot === d1.slot && sent[0].body.ws === B.ws && sent[0].headers['x-pmos-nonce'] === nonce && !!nonce, JSON.stringify(sent));
101
+ const il = ledger().filter((l) => l.ev === 'issue');
102
+ ok('B5 the ledger has one new issue line for that draft, written by the PM', il.length === n0 + 1 && il[il.length - 1].slot === d1.slot && il[il.length - 1].scope === bscope && /pm/.test(String(il[il.length - 1].by)), JSON.stringify(il));
103
+ ok('B5 the file now says state: issued', /^state: issued$/m.test(fs.readFileSync(path.join(team, d1.path), 'utf8')));
104
+ ok('B6 the reader says it is issued, the Issue it press is gone, and the row reads Up to date', await until(() => p.evaluate(() => { const o = document.querySelector('#oMain'); return !!o.querySelector('[data-issue-bar="done"]') && !o.querySelector('[data-rd="issue"]') && /state: issued|issued/.test(o.textContent); })) && await until(() => p.evaluate((k) => { const r = document.querySelector(`#docBody [data-doc="${k}"]`); return r && /Up to date/.test(r.textContent); }, bkey)));
105
+ await p.screenshot({ path: path.join(R.base, 'board-issued.png') });
106
+ await P.ctx.close();
107
+
108
+ /* I the initiative sheet */
109
+ const I = await open('/premium-initiative.html' + iq), ip = I.page;
110
+ await until(() => ip.evaluate((k) => !!document.querySelector(`#dmList [data-doc="${k}"]`), ikey), 60000);
111
+ await ip.click(`#dmList [data-doc="${ikey}"]`); await dlgOn(ip);
112
+ ok('I1 the Read tab of a draft has the Issue it bar above the text', await until(() => ip.evaluate(() => { const o = document.querySelector('#oMain'); const b = o.querySelector('[data-issue-bar="draft"]'); return !!b && /Nothing is sent/.test(b.textContent) && /Why this board exists/.test(o.textContent) && b.compareDocumentPosition(o.querySelector('.dsbody')) & Node.DOCUMENT_POSITION_FOLLOWING; })));
113
+ await ip.click('[data-sh="edit"]');
114
+ await until(() => ip.evaluate(() => !!document.querySelector('#dsEd')));
115
+ await ip.fill('#dsEd', BODY + '\n## Added\n\nUnsaved line.\n');
116
+ await ip.click('[data-sh="read"]');
117
+ await until(() => ip.evaluate(() => !!document.querySelector('[data-ds="issue"]')));
118
+ const nI = I.posts.length;
119
+ await ip.click('[data-ds="issue"]');
120
+ ok('I2 Issue it with unsaved edits posts nothing and says to save or cancel first', await until(() => ip.evaluate(() => /unsaved changes.*Save or cancel/.test((document.querySelector('#dsErr') || {}).textContent || ''))) && I.posts.length === nI);
121
+ ok('I2 the ledger has no issue line for that draft yet', !ledger().some((l) => l.ev === 'issue' && l.slot === d2.slot && l.scope === iscope));
122
+ await ip.click('[data-sh="edit"]'); await until(() => ip.evaluate(() => !!document.querySelector('[data-ds="discard"]')));
123
+ await ip.click('[data-ds="discard"]'); await ip.click('[data-sh="read"]');
124
+ await until(() => ip.evaluate(() => !!document.querySelector('[data-ds="issue"]')));
125
+ /* a refusal: someone else issues the same draft first (the console, a second tab) */
126
+ const raced = await fetch(BASE + '/api/core-docs/issue', { method: 'POST', headers: H, body: JSON.stringify({ ws: B.ws, scope: iscope, key: ikey, slot: d2.slot }) });
127
+ ok('I3 setup the draft is issued behind the page\'s back', raced.status === 200);
128
+ await ip.click('[data-ds="issue"]');
129
+ ok('I3 a refused press shows the server\'s words and the sheet changes nothing else', await until(() => ip.evaluate(() => /already/.test((document.querySelector('#dsErr') || {}).textContent || ''))));
130
+ ok('I3 the refusal wrote no second issue line', ledger().filter((l) => l.ev === 'issue' && l.slot === d2.slot && l.scope === iscope).length === 1);
131
+ await ip.click('#dlg [data-act="close"], #dClose').catch(() => {});
132
+ await I.ctx.close();
133
+
134
+ /* I4 a fresh page: press Issue it on the third draft */
135
+ const J = await open('/premium-initiative.html' + iq), jp = J.page;
136
+ const k3 = d3.path.split('/').slice(-2)[0];
137
+ await until(() => jp.evaluate((k) => !!document.querySelector(`#dmList [data-doc="${k}"]`), k3), 60000);
138
+ await jp.click(`#dmList [data-doc="${k3}"]`); await dlgOn(jp);
139
+ await until(() => jp.evaluate(() => !!document.querySelector('[data-ds="issue"]')));
140
+ await jp.click('[data-ds="issue"]');
141
+ ok('I4 Issue it works from the sheet: the toast, the issued bar, and the row reads Up to date', !!(await toastIs(jp, /Issued\. Nothing was sent to anyone/)) && await until(() => jp.evaluate(() => !!document.querySelector('#oMain [data-issue-bar="done"]') && !document.querySelector('[data-ds="issue"]'))) && await until(() => jp.evaluate((k) => /Up to date/.test((document.querySelector(`#dmList [data-doc="${k}"]`) || {}).textContent || ''), k3)));
142
+ ok('I4 the file says state: issued and the ledger has its issue line', /^state: issued$/m.test(fs.readFileSync(path.join(team, d3.path), 'utf8')) && ledger().some((l) => l.ev === 'issue' && l.slot === d3.slot && l.scope === iscope));
143
+ await jp.screenshot({ path: path.join(R.base, 'ini-issued.png') });
144
+
145
+ /* P the POST allow-list and the refusals */
146
+ const all = P.posts.concat(I.posts, J.posts);
147
+ const other = all.filter((x) => !ALLOWED.test(x.path));
148
+ ok('P1 the pages post only to the issue route (and the conversation note)', all.length >= 3 && !other.length, JSON.stringify(other));
149
+ const sentAll = all.filter((x) => x.path === '/api/core-docs/issue');
150
+ ok('P2 every issue press carried the nonce and no writer field', sentAll.length >= 3 && sentAll.every((x) => x.headers['x-pmos-nonce'] === nonce && !['by', 'via', 'at', 'actor', 'pm', 'nonce'].some((k) => k in x.body)));
151
+ const bare = await fetch(BASE + '/api/core-docs/issue', { method: 'POST', headers: { 'Content-Type': 'application/json', Origin: BASE }, body: JSON.stringify({ ws: B.ws, scope: bscope, key: bkey, slot: d1.slot }) });
152
+ ok('P3 a press without the launch nonce is refused', bare.status === 403);
153
+ const agent = await fetch(BASE + '/api/core-docs/issue', { method: 'POST', headers: { ...H, 'x-pmos-session': 's1' }, body: JSON.stringify({ ws: B.ws, scope: bscope, key: bkey, slot: d1.slot }) });
154
+ ok('P4 an agent session gets 403', agent.status === 403);
155
+ ok('P5 no script error on any page', !P.errors.length && !I.errors.length && !J.errors.length, P.errors.concat(I.errors, J.errors).join(' | '));
156
+ await J.ctx.close();
157
+
158
+ /* F floors and fidelity: a fresh draft, at 390 and 1280, light and dark */
159
+ const d4 = CD.writeDraft(team, { scope: bscope, key: (board2.model.docs.rows.filter((d) => d.act && d.act.kind === 'draft' && d.st === 'missing' && d.key !== bkey)[0] || {}).key, markdown: BODY, by: 'agent:test', now: Date.now() });
160
+ const k4 = d4.path.split('/').slice(-2)[0];
161
+ for (const [w, h, theme] of [[390, 844, 'light'], [390, 844, 'dark'], [1280, 900, 'dark']]) {
162
+ const S = await open('/premium-board.html', { w, h, theme });
163
+ await until(() => S.page.evaluate((k) => !!document.querySelector(`#docBody [data-doc="${k}"]`), k4), 60000);
164
+ await S.page.click(`#docBody [data-doc="${k4}"]`); await dlgOn(S.page);
165
+ await until(() => S.page.evaluate(() => !!document.querySelector('[data-rd="issue"]')));
166
+ const f = await S.page.evaluate(() => ({ wide: document.documentElement.scrollWidth > innerWidth + 1, small: [...document.querySelectorAll('#oMain [data-rd]')].filter((b) => b.getBoundingClientRect().height < 44 || b.getBoundingClientRect().width < 44).map((b) => b.dataset.rd), bg: getComputedStyle(document.querySelector('[data-issue-bar]')).backgroundColor }));
167
+ ok(`F1 ${w} px ${theme}: no sideways scroll and the bar's buttons are at least 44 px`, !f.wide && !f.small.length, JSON.stringify(f));
168
+ await S.page.screenshot({ path: path.join(R.base, `bar-${w}-${theme}.png`) });
169
+ await S.ctx.close();
170
+ }
171
+ if (process.env.KEEP_SHOTS) { for (const f of fs.readdirSync(R.base).filter((x) => /\.png$/.test(x))) fs.copyFileSync(path.join(R.base, f), path.join(process.env.KEEP_SHOTS, f)); }
172
+ finish();
173
+ })();
@@ -2,9 +2,10 @@
2
2
  * lib/board-premium.js builds from the routes the production Initiatives page reads: the Initiatives card (List, By stage, Timeline), the Sprint and
3
3
  * Coming up cards, Core documents, the dock and the standard dialog. The presses are Draft it on a core document, through POST /api/core-docs/draft,
4
4
  * and the board's own presses of pm/premium-acts.js (initiative premium-board-actions): the New asks card, New initiative, and a row's menu (move,
5
- * hold, cancel, archive and their Undo). Nothing here issues a document. */
5
+ * hold, cancel, archive and their Undo). Issue it on a document draft, read in a dialog, is POST /api/core-docs/issue (initiative premium-core-doc-issue). */
6
6
  import { pmPost } from './http.js';
7
- import { $, $$, esc, openDlg, closeDlg, toast, loadThread, onScroll, wireRail, logHtml, turnA, ptx, pillOf, CHECK, store, crumbHtml, wireCrumb, kv, H, openAddDoc } from './premium-shell.js';
7
+ import { $, $$, esc, openDlg, closeDlg, toast, loadThread, onScroll, wireRail, logHtml, turnA, ptx, pillOf, CHECK, AI, store, crumbHtml, wireCrumb, kv, H, openAddDoc } from './premium-shell.js';
8
+ import { mdHtml, issueBody } from './premium-doc-edit.js';
8
9
  import { dotsBtn, openMenu, closeMenu, menuKey, asksHtml, onAsks, openIniForm } from './premium-acts.js';
9
10
 
10
11
  const MODE_KEY = 'pmos.premium.openAs';
@@ -105,7 +106,7 @@ function drawSide() {
105
106
  }
106
107
  function docRow(d) {
107
108
  const act = !d.act ? '' : d.act.kind === 'draft' ? `<button class="dmcta alt" data-draft="${esc(d.key)}"${d.running ? ' disabled' : ''}>${d.running ? '<span class="spin"></span>' : ICO('<path d="M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z"/>')}${esc(d.act.label)}</button>` : `<button class="dmcta alt" data-tab="${esc(d.act.tab)}">${esc(d.act.label)}</button>`;
108
- return `<div class="dmr" role="listitem"><span class="dmo"><span class="dmi c-Board">${ICO(DOCI)}</span><span class="dmn"><b>${esc(d.title)}</b><small>${esc(d.what)}</small><span class="dmm"><span class="s ${esc(d.st || 'live')}">${ICO(STATE_ICO[d.state] || STATE_ICO['Not started'])}${esc(d.state)}</span>${d.added ? `<span>${ICO('<rect x="3" y="5" width="18" height="16" rx="3"/><path d="M3 10h18M8 3v4M16 3v4"/>')}added ${esc(d.added)}</span>` : ''}${d.cadence ? `<span>${ICO('<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>')}${esc(d.cadence)}</span>` : ''}${d.by ? `<span>${ICO('<circle cx="12" cy="8" r="4"/><path d="M4 21a8 8 0 0 1 16 0"/>')}${esc(d.by)}</span>` : ''}</span></span></span><span class="dmq">${act}</span></div>`;
109
+ return `<div class="dmr ${esc(d.st || '')}" role="listitem">${d.path ? `<button class="dmo" data-doc="${esc(d.key)}" aria-haspopup="dialog">` : '<span class="dmo">'}<span class="dmi c-Board">${ICO(DOCI)}</span><span class="dmn"><b>${esc(d.title)}</b><small>${esc(d.what)}</small><span class="dmm"><span class="s ${esc(d.st || 'live')}">${ICO(STATE_ICO[d.state] || STATE_ICO['Not started'])}${esc(d.state)}</span>${d.added ? `<span>${ICO('<rect x="3" y="5" width="18" height="16" rx="3"/><path d="M3 10h18M8 3v4M16 3v4"/>')}added ${esc(d.added)}</span>` : ''}${d.cadence ? `<span>${ICO('<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>')}${esc(d.cadence)}</span>` : ''}${d.by ? `<span>${ICO('<circle cx="12" cy="8" r="4"/><path d="M4 21a8 8 0 0 1 16 0"/>')}${esc(d.by)}</span>` : ''}</span></span>${d.path ? '</button>' : '</span>'}<span class="dmq">${act}</span></div>`;
109
110
  }
110
111
  let docFilter = 'all', docQuery = '';
111
112
  const draftable = () => (M.docs.rows || []).filter((d) => d.st === 'missing' && d.act && d.act.kind === 'draft' && !d.running);
@@ -128,7 +129,7 @@ function drawDocs() {
128
129
  <label class="dmsr">${ICO('<circle cx="11" cy="11" r="6.5"/><path d="m20 20-4-4"/>')}<input id="dmQ" type="search" placeholder="Find a document" aria-label="Find a document" value="${esc(docQuery)}"></label></div>`;
129
130
  drawDocList();
130
131
  if (hadQ) { const q = $('#dmQ'); q.focus(); q.setSelectionRange(q.value.length, q.value.length); }
131
- $('#docNote').textContent = 'Draft it starts a read-only agent run that writes a draft for you to read. Nothing is sent. Issuing, dropping and adding a document are not built on this page.';
132
+ $('#docNote').textContent = 'Draft it starts a read-only agent run that writes a draft for you to read. Nothing is sent. Press a document to read it; a draft has Issue it, which marks it issued and sends nothing. Dropping a document is not built on this page.';
132
133
  }
133
134
  $('#docTop').addEventListener('click', async (e) => {
134
135
  const f = e.target.closest('[data-dmf]'); if (f) { docFilter = f.dataset.dmf; drawDocList(); return; }
@@ -141,6 +142,7 @@ $('#docTop').addEventListener('click', async (e) => {
141
142
  $('#docTop').addEventListener('input', (e) => { if (e.target.id === 'dmQ') { docQuery = e.target.value; drawDocList(); } });
142
143
  const GOTAB = { rep: '/c3.html?tab=rep', init: '/c3.html?tab=init' };
143
144
  $('#docBody').addEventListener('click', async (e) => {
145
+ const o = e.target.closest('[data-doc]'); if (o) { openReader(M.docs.rows.find((x) => x.key === o.dataset.doc)); return; }
144
146
  const t = e.target.closest('[data-tab]'); if (t) { location.assign(GOTAB[t.dataset.tab] || '/c3.html'); return; }
145
147
  const b = e.target.closest('[data-draft]'); if (!b || b.disabled) return;
146
148
  const key = b.dataset.draft, d = M.docs.rows.find((x) => x.key === key);
@@ -151,6 +153,64 @@ $('#docBody').addEventListener('click', async (e) => {
151
153
  await load();
152
154
  });
153
155
 
156
+ /* ── a board document: read it, and issue a draft (initiative premium-core-doc-issue) ────────────────────── */
157
+ let rd = null; // { d, text, md, err, busy, msg, issued }
158
+ const rdGet = async (url) => { try { const r = await fetch(url, { credentials: 'same-origin' }); return await r.json(); } catch { return null; } };
159
+ function rdBar(r) {
160
+ const d = r.d;
161
+ if (r.issued && d.st !== 'draft') return `<div class="dsiss dsok" data-issue-bar="done" role="status"><span>${CHECK}Issued. Nothing was sent to anyone. The row now reads ${esc(d.state)}.</span></div>`;
162
+ if (d.st !== 'draft' || !d.slot) return '';
163
+ return `<div class="dsiss" data-issue-bar="draft"><span>${AI}PMOS drafted this from its sources. Nothing is sent. Read it, then issue it, or draft it again.</span><span class="dsa"><button class="dmcta dark" data-rd="issue"${r.busy ? ' disabled' : ''}>Issue it</button><button class="dmcta alt" data-rd="again"${r.busy ? ' disabled' : ''}>Draft it again</button></span></div>`
164
+ + (r.msg ? `<p class="note" id="rdErr" role="alert" style="margin:-4px 0 10px;color:var(--ember-ink)">${esc(r.msg)}</p>` : '');
165
+ }
166
+ function drawReader() {
167
+ const r = rd, d = r.d;
168
+ let body;
169
+ if (r.err) body = `<p class="empty3 plain">${esc(r.err)}</p>`;
170
+ else if (r.text == null) body = '<p class="empty3 plain">Reading the file.</p>';
171
+ else { const m = r.md || (r.md = mdHtml(r.text)); body = (m.fm.length ? kv(m.fm) : '') + `<div class="dsrd no"><div class="dsbody">${m.html}</div></div>`; }
172
+ $('#oMain').innerHTML = `<article class="paper doc"><p class="dpath">${esc(d.path)}</p><div class="dsm"><span class="${d.st === 'ok' ? 'ok' : d.st === 'draft' ? 'warn' : 'mut'}">${esc(d.state)}</span>${d.when ? `<span>updated ${esc(d.when)}</span>` : ''}${d.by ? `<span>${esc(d.by)}</span>` : ''}</div>${rdBar(r)}<div id="shBody">${body}</div><p class="xn">${d.st === 'draft' ? 'A board draft is changed by drafting it again; the new draft replaces this one. ' : ''}The file changes only when you press Issue it.</p></article>`;
173
+ }
174
+ async function openReader(d) {
175
+ if (!d || !d.path) return;
176
+ const r = rd = { d, text: null, md: null, err: null, busy: false, msg: '', issued: false };
177
+ const say = d.title + ' is ' + d.state.toLowerCase() + (d.by ? '. ' + d.by + '.' : '.') + ' I can read the file with you and answer questions. I change nothing; only you issue it.';
178
+ openDlg({ eye: 'Document · real data', title: d.title, sub: M.board.name, say, stream: turnA(logHtml({ logTitle: 'Read from the repository', log: ['Found the file ' + d.path, 'Left the file as it is'] })) + turnA(ptx(say)), noteKey: 'doc:' + M.board.id + ':' + d.key, pane: '', label: 'Document' });
179
+ drawReader(); loadThread('doc:' + M.board.id + ':' + d.key);
180
+ await rdRead(r);
181
+ }
182
+ /** The file's latest revision, as the document sheet reads it (the log route first records an outside change, so an issue shows up). */
183
+ async function rdRead(r) {
184
+ const p = encodeURIComponent(r.d.path), ws = M.board.ws ? '&ws=' + encodeURIComponent(M.board.ws) : '';
185
+ const lg = await rdGet('/api/doc-sheet/log?path=' + p + ws); if (rd !== r) return;
186
+ const revs = lg && lg.ok ? lg.revisions || [] : [];
187
+ const at = revs.length ? await rdGet('/api/doc-sheet/at?path=' + p + '&rev=' + revs[revs.length - 1].rev + ws) : null; if (rd !== r) return;
188
+ r.err = null;
189
+ if (at && at.ok) r.text = at.text; else r.err = (at && at.error) || (lg && lg.error) || 'The file could not be read.';
190
+ r.md = null; drawReader();
191
+ }
192
+ $('#oMain').addEventListener('click', async (e) => {
193
+ const b = e.target.closest('[data-rd]'); if (!b || !rd || b.disabled) return;
194
+ const r = rd, d = r.d;
195
+ const fail = (m) => { r.busy = false; r.msg = m; drawReader(); };
196
+ r.msg = '';
197
+ if (b.dataset.rd === 'issue') {
198
+ const q = issueBody(M.board.ws, M.docs.scope, d.key, d.slot, false); if (q.error) return fail(q.error);
199
+ r.busy = true; drawReader();
200
+ const res = await pmPost('/api/core-docs/issue', q.body); if (rd !== r) return;
201
+ if (!res || res.ok !== true) return fail((res && res.error) || 'The document could not be issued.');
202
+ toast('Issued. Nothing was sent to anyone.');
203
+ r.issued = true; r.busy = false; await load(); if (rd !== r) return;
204
+ r.d = M.docs.rows.find((x) => x.key === d.key) || r.d; r.text = null; r.md = null; drawReader(); await rdRead(r);
205
+ } else if (b.dataset.rd === 'again') {
206
+ r.busy = true; drawReader();
207
+ const res = await pmPost('/api/core-docs/draft', { ws: M.board.ws, scope: M.docs.scope, key: d.key }); if (rd !== r) return;
208
+ if (!res || res.ok !== true) return fail((res && res.error) || 'The draft could not be started.');
209
+ toast('The agent is drafting “' + d.title + '” again. The new draft replaces this one when it is ready, and it sends nothing.');
210
+ r.busy = false; closeDlg(); await load();
211
+ }
212
+ });
213
+
154
214
  $('#addDoc').onclick = () => openAddDoc({ ws: M.board.ws, scope: M.docs.scope, sub: M.board.name, onAdded: load });
155
215
 
156
216
  /* ── new asks and New initiative (initiative premium-board-actions) ───────────────────────────────────────── */
@@ -1,6 +1,7 @@
1
1
  /* premium-doc-edit.js — the pure half of the premium document sheet's Edit and Proposals tabs (initiative briefing-premium-doc-edit).
2
2
  * No DOM and no fetch: it turns the answers of /api/doc-sheet/* into what the tabs draw, and builds the bodies of the presses. Every figure here is a
3
3
  * field of a route's answer; a proposal's section is stale only because the route says it is. */
4
+ const esc = (s) => String(s == null ? '' : s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
4
5
  const clip = (s, n) => { const t = String(s == null ? '' : s).replace(/\s+/g, ' ').trim(); return t.length > n ? t.slice(0, n - 1).trimEnd() + '…' : t; };
5
6
 
6
7
  /** One proposal as the tab draws it. `p` is a row of GET /api/doc-sheet/proposals. */
@@ -68,3 +69,32 @@ export function askLine(a) {
68
69
  if (a.state === 'failed') return a.error || 'The agent could not answer.';
69
70
  return '';
70
71
  }
72
+
73
+ /** Issue press (a core document draft). The route needs the workspace, the scope, the key and the draft's slot, and takes nothing else. */
74
+ export function issueBody(ws, scope, key, slot, unsaved) {
75
+ if (unsaved) return { error: 'You have unsaved changes in the Edit tab. Save or cancel them first, so the document you issue is the one you read.' };
76
+ if (!slot) return { error: 'This document has no open draft to issue.' };
77
+ return { body: { ws, scope, key, slot } };
78
+ }
79
+
80
+ /** The Read tab's text as html with its outline and front matter. Pure: the page puts the html in the sheet. */
81
+ export function mdHtml(text) {
82
+ const lines = String(text || '').replace(/\r/g, '').split('\n'), out = [], outline = [];
83
+ let i = 0, fm = [];
84
+ if (lines[0] === '---') { const e = lines.indexOf('---', 1); if (e > 0) { fm = lines.slice(1, e).map((l) => /^([A-Za-z_][\w -]*):\s*(.*)$/.exec(l)).filter(Boolean).slice(0, 10).map((m) => [m[1], m[2].replace(/^"(.*)"$/, '$1')]); i = e + 1; } }
85
+ let para = [], list = [];
86
+ const flushP = () => { if (para.length) { out.push(`<p>${esc(para.join(' '))}</p>`); para = []; } };
87
+ const flushL = () => { if (list.length) { out.push(`<ul>${list.map((x) => `<li>${esc(x)}</li>`).join('')}</ul>`); list = []; } };
88
+ for (; i < lines.length; i++) {
89
+ const l = lines[i];
90
+ if (/^```/.test(l)) { flushP(); flushL(); const buf = []; for (i++; i < lines.length && !/^```/.test(lines[i]); i++) buf.push(lines[i]); out.push(`<pre class="mdp">${esc(buf.join('\n'))}</pre>`); continue; }
91
+ const h = /^(#{1,4})\s+(.*)$/.exec(l);
92
+ if (h) { flushP(); flushL(); const n = outline.length; outline.push(h[2]); out.push(`<h3 class="d2" id="ds-h${n}">${esc(h[2])}</h3>`); continue; }
93
+ if (/^\s*[-*]\s+/.test(l)) { flushP(); list.push(l.replace(/^\s*[-*]\s+/, '')); continue; }
94
+ if (/^\|/.test(l)) { flushP(); flushL(); const buf = [l]; while (i + 1 < lines.length && /^\|/.test(lines[i + 1])) buf.push(lines[++i]); out.push(`<pre class="mdp">${esc(buf.join('\n'))}</pre>`); continue; }
95
+ if (!l.trim()) { flushP(); flushL(); continue; }
96
+ flushL(); para.push(l.trim());
97
+ }
98
+ flushP(); flushL();
99
+ return { html: out.join(''), outline, fm };
100
+ }
@@ -5,7 +5,7 @@
5
5
  * existing /api/doc-sheet routes, initiative briefing-premium-doc-edit), Add a task and a task's status, and the bar under the stages (initiative
6
6
  * premium-board-actions, pm/premium-acts.js): move to the next stage or back, hold, cancel, archive, resume, reopen and restore, each with Undo. Nothing here issues a document. */
7
7
  import { pmPost } from './http.js';
8
- import { proposalsModel, editBody, acceptBody, rejectBody, askBody, askLine } from './premium-doc-edit.js';
8
+ import { proposalsModel, editBody, acceptBody, rejectBody, askBody, askLine, issueBody, mdHtml } from './premium-doc-edit.js';
9
9
  import { $, $$, esc, openDlg, closeDlg, setMode, toast, loadThread, onScroll, wireRail, logHtml, turnA, ptx, pillOf, kv, H2, CHECK, crumbHtml, wireCrumb, AI, openAddDoc } from './premium-shell.js';
10
10
  import { barHtml, onBar, closeMenu } from './premium-acts.js';
11
11
 
@@ -182,7 +182,7 @@ function docsHtml() {
182
182
  <div class="dtool"><div class="seg" id="dmF" role="group" aria-label="Filter documents"><i class="pill"></i>${[['all', 'All', c.all], ['none', 'Not started', c.none], ['draft', 'Draft', c.draft], ['ok', 'Up to date', c.ok]].map(([k, l, n]) => `<button data-dmf="${k}" aria-pressed="${docFilter === k}">${l}<em>${n}</em></button>`).join('')}</div>
183
183
  <label class="dmsr">${ICO('<circle cx="11" cy="11" r="6.5"/><path d="m20 20-4-4"/>')}<input id="dmQ" type="search" placeholder="Find a document" aria-label="Find a document" value="${esc(docQuery)}"></label></div>
184
184
  <div id="dmList"></div>
185
- <p class="note" style="margin-top:12px">The core documents of this initiative. Press a row to read it, see its edit log or its health. Draft it starts a read-only agent run that writes a draft for you to read; nothing is sent. Editing, issuing and dropping a document are not built on this page. A document you add is saved on the record; PMOS does not read a linked page.</p></section>`;
185
+ <p class="note" style="margin-top:12px">The core documents of this initiative. Press a row to read it, see its edit log or its health. Draft it starts a read-only agent run that writes a draft for you to read; nothing is sent. Issue it on a draft's sheet marks the draft as issued; nothing is sent. Dropping a document is not built on this page. A document you add is saved on the record; PMOS does not read a linked page.</p></section>`;
186
186
  }
187
187
  $('#iMain').addEventListener('input', (e) => { if (e.target.id === 'dmQ') { docQuery = e.target.value; drawDocList(); } });
188
188
  const draftable = () => M.docs.rows.filter((d) => !d.tech && d.st === 'missing' && d.act && d.act.kind === 'draft' && !d.running);
@@ -223,25 +223,13 @@ let sheet = null; // { d, tab, text, log, health, props, draft, why, ask, askT
223
223
  const TABS = [['read', 'Read'], ['edit', 'Edit'], ['props', 'Proposals'], ['log', 'Edit log'], ['health', 'Health']];
224
224
  const wsq = () => (M.board.ws ? '&ws=' + encodeURIComponent(M.board.ws) : '');
225
225
  const propsM = (s) => proposalsModel(s.props || []);
226
- function mdHtml(text) {
227
- const lines = String(text || '').replace(/\r/g, '').split('\n'), out = [], outline = [];
228
- let i = 0, fm = [];
229
- if (lines[0] === '---') { const e = lines.indexOf('---', 1); if (e > 0) { fm = lines.slice(1, e).map((l) => /^([A-Za-z_][\w -]*):\s*(.*)$/.exec(l)).filter(Boolean).slice(0, 10).map((m) => [m[1], m[2].replace(/^"(.*)"$/, '$1')]); i = e + 1; } }
230
- let para = [], list = [];
231
- const flushP = () => { if (para.length) { out.push(`<p>${esc(para.join(' '))}</p>`); para = []; } };
232
- const flushL = () => { if (list.length) { out.push(`<ul>${list.map((x) => `<li>${esc(x)}</li>`).join('')}</ul>`); list = []; } };
233
- for (; i < lines.length; i++) {
234
- const l = lines[i];
235
- if (/^```/.test(l)) { flushP(); flushL(); const buf = []; for (i++; i < lines.length && !/^```/.test(lines[i]); i++) buf.push(lines[i]); out.push(`<pre class="mdp">${esc(buf.join('\n'))}</pre>`); continue; }
236
- const h = /^(#{1,4})\s+(.*)$/.exec(l);
237
- if (h) { flushP(); flushL(); const n = outline.length; outline.push(h[2]); out.push(`<h3 class="d2" id="ds-h${n}">${esc(h[2])}</h3>`); continue; }
238
- if (/^\s*[-*]\s+/.test(l)) { flushP(); list.push(l.replace(/^\s*[-*]\s+/, '')); continue; }
239
- if (/^\|/.test(l)) { flushP(); flushL(); const buf = [l]; while (i + 1 < lines.length && /^\|/.test(lines[i + 1])) buf.push(lines[++i]); out.push(`<pre class="mdp">${esc(buf.join('\n'))}</pre>`); continue; }
240
- if (!l.trim()) { flushP(); flushL(); continue; }
241
- flushL(); para.push(l.trim());
242
- }
243
- flushP(); flushL();
244
- return { html: out.join(''), outline, fm };
226
+ /** The bar above a draft (core document Issue, initiative premium-core-doc-issue). The words are fixed; the state is the row's own. */
227
+ function issueBar(s) {
228
+ const d = s.d;
229
+ if (s.issued && d.st !== 'draft') return `<div class="dsiss dsok" data-issue-bar="done" role="status"><span>${CHECK}Issued. Nothing was sent to anyone. The row now reads ${esc(d.state)}.</span></div>`;
230
+ if (d.st !== 'draft' || !d.slot) return '';
231
+ return `<div class="dsiss" data-issue-bar="draft"><span>${AI}PMOS drafted this from its sources. Nothing is sent. Read it, change what you like, then issue it.</span><button class="dmcta dark" data-ds="issue"${s.busy ? ' disabled' : ''}>Issue it</button></div>`
232
+ + (s.msg && s.tab === 'read' ? `<p class="note" id="dsErr" role="alert" style="margin:-4px 0 10px;color:var(--ember-ink)">${esc(s.msg)}</p>` : '');
245
233
  }
246
234
  function sheetPane() {
247
235
  const s = sheet, d = s.d;
@@ -251,7 +239,7 @@ function sheetPane() {
251
239
  if (s.err) body = `<p class="empty3 plain">${esc(s.err)}</p>`;
252
240
  else if (s.tab === 'read') {
253
241
  if (s.text == null) body = '<p class="empty3 plain">Reading the file.</p>';
254
- else { const m = s.md || (s.md = mdHtml(s.text)); body = (m.fm.length ? kv(m.fm) : '') + `<div class="dsrd${m.outline.length > 2 ? '' : ' no'}">${m.outline.length > 2 ? `<nav class="dso" aria-label="Outline"><p class="label">Outline <em>${m.outline.length} headings</em></p>${m.outline.map((t, n) => `<button data-go="${n}">${esc(t)}${s.props && propsM(s).marked.has(t) ? '<i></i>' : ''}</button>`).join('')}</nav>` : ''}<div class="dsbody">${m.html}</div></div>`; }
242
+ else { const m = s.md || (s.md = mdHtml(s.text)); body = issueBar(s) + (m.fm.length ? kv(m.fm) : '') + `<div class="dsrd${m.outline.length > 2 ? '' : ' no'}">${m.outline.length > 2 ? `<nav class="dso" aria-label="Outline"><p class="label">Outline <em>${m.outline.length} headings</em></p>${m.outline.map((t, n) => `<button data-go="${n}">${esc(t)}${s.props && propsM(s).marked.has(t) ? '<i></i>' : ''}</button>`).join('')}</nav>` : ''}<div class="dsbody">${m.html}</div></div>`; }
255
243
  } else if (s.tab === 'edit') {
256
244
  if (s.text == null) body = '<p class="empty3 plain">Reading the file.</p>';
257
245
  else {
@@ -355,6 +343,16 @@ async function sheetPress(act) {
355
343
  const fail = (m) => { s.busy = false; s.msg = m; drawSheet(); };
356
344
  if (act === 'rejno') { s.rejecting = null; s.msg = ''; drawSheet(); return; }
357
345
  if (act === 'discard') { s.draft = null; s.why = ''; s.msg = ''; drawSheet(); return; }
346
+ if (act === 'issue') {
347
+ const r = issueBody(M.board.ws, M.docs.scope, s.d.key, s.d.slot, s.draft != null && s.draft !== s.text); if (r.error) return fail(r.error);
348
+ s.busy = true; s.msg = ''; drawSheet();
349
+ const res = await pmPost('/api/core-docs/issue', r.body); if (sheet !== s) return;
350
+ if (!res || res.ok !== true) return fail((res && res.error) || 'The document could not be issued.');
351
+ toast('Issued. Nothing was sent to anyone.');
352
+ s.issued = true; await load(); if (sheet !== s) return;
353
+ s.d = M.docs.rows.find((x) => x.key === s.d.key) || s.d;
354
+ return reloadSheet(s);
355
+ }
358
356
  if (act === 'save') {
359
357
  const r = editBody(s.d.path, s.text, s.draft == null ? s.text : s.draft, s.why); if (r.error) return fail(r.error);
360
358
  s.busy = true; s.msg = ''; drawSheet();
@@ -1,7 +1,8 @@
1
- /* pm/premium-meeting.js — Calendar in the premium Briefing's Today card (initiative briefing-premium-calendar, slice 1).
2
- * The Today / This week switch, the week list and the meeting dialog. Reads GET /api/calendar-views?view=week, GET /api/meeting-replay and GET /api/meeting-material.
3
- * The one write is "Link it", through POST /api/calendar-links. Every word is a field of a record: the pure half (weekView, meetingView) takes the routes' answers and
4
- * returns what the page draws, so a test reads it without a DOM. Recording, Focus and material changes are later slices. */
1
+ /* pm/premium-meeting.js — Calendar in the premium Briefing's Today card (initiative briefing-premium-calendar, slices 1 and 2).
2
+ * The Today / This week switch, the week list and the meeting dialog. Reads GET /api/calendar-views?view=week, GET /api/meeting-replay, GET /api/meeting-material and
3
+ * GET /api/meeting-material/suggest. The writes are "Link it" (POST /api/calendar-links), Add and Remove material (POST /api/meeting-material) and Make task
4
+ * (POST /api/plan-items). Every word is a field of a record: the pure half (weekView, meetingView, the body builders) takes the routes' answers and returns what the page
5
+ * draws or sends, so a test reads it without a DOM. Recording and Focus are slice 3. */
5
6
 
6
7
  const pad = (n) => String(n).padStart(2, '0');
7
8
  const clip = (s, n) => { const t = String(s == null ? '' : s).replace(/\s+/g, ' ').trim(); return t.length > n ? t.slice(0, n - 1).trimEnd() + '…' : t; };
@@ -46,15 +47,16 @@ export function meetingView(row, replay, material) {
46
47
  const rep = replay && replay.state === 'ok' ? replay.body : null;
47
48
  const people = row.who && row.who.length ? row.who : (rep && rep.meeting && Array.isArray(rep.meeting.attendees) ? rep.meeting.attendees : []);
48
49
  const keys = rep && Array.isArray(rep.keys) ? rep.keys : [];
49
- const pick = (k) => keys.filter((x) => x.k === k).map((x) => ({ text: clip(x.text, 240), owner: x.owner || '', due: x.due || '', open: x.state === 'open' || x.state === 'owner' }));
50
- const notes = rep ? { title: clip((rep.note && rep.note.title) || '', 120), decisions: pick('decision'), actions: pick('action'), questions: pick('question') } : null;
50
+ const pick = (k) => keys.filter((x) => x.k === k).map((x) => ({ id: x.id == null ? '' : String(x.id), text: clip(x.text, 240), owner: x.owner || '', due: x.due || '', open: x.state === 'open' || x.state === 'owner' }));
51
+ const ini = rep && rep.note && rep.note.initiative && rep.note.initiative.id ? rep.note.initiative : null, nws = rep && rep.note ? (ini && ini.ws) || rep.note.ws || '' : '';
52
+ const notes = rep ? { title: clip((rep.note && rep.note.title) || '', 120), id: (rep.note && rep.note.id) || '', initiative: ini ? { id: ini.id, name: clip(ini.title || ini.name || ini.id, 70), ws: nws } : null, decisions: pick('decision'), actions: pick('action'), questions: pick('question') } : null;
51
53
  const heard = rep && Number(rep.length_ms) > 0 ? Math.round(rep.length_ms / 60000) : 0;
52
54
  return {
53
55
  people,
54
56
  notes, notesState: replay ? replay.state : 'none',
55
57
  notesLine: !replay ? 'Reading the notes.' : replay.state === 'error' ? 'The notes could not be read: ' + clip(replay.error, 120) : replay.state === 'none' ? 'No notes for this meeting.' : '',
56
58
  replay: rep && (rep.audio || heard) ? { minutes: heard, keyPoints: keys.length, lines: Array.isArray(rep.lines) ? rep.lines.length : 0 } : null,
57
- material: material && material.state === 'ok' ? (material.items || []).map((i) => ({ title: clip(i.title || i.ref || i.url, 120), kind: i.kind || '', scope: i.scope === 'series' ? 'every meeting of this series' : 'this meeting' })) : null,
59
+ material: material && material.state === 'ok' ? (material.items || []).map((i, n) => ({ n, title: clip(i.title || i.ref || i.url, 120), kind: i.kind || '', scope: i.scope === 'series' ? 'every meeting of this series' : 'this meeting', removable: i.from === 'you' && (i.scope === 'series' || i.scope === 'meeting'), line: removeLine(i) })) : null,
58
60
  materialLine: !material ? 'Reading the material.' : material.state === 'error' ? 'The material could not be read: ' + clip(material.error, 120) : (material.items || []).length ? '' : 'No material is linked to this meeting.',
59
61
  row,
60
62
  };
@@ -70,6 +72,53 @@ export function linkBody(row, choice, boards) {
70
72
  return null;
71
73
  }
72
74
 
75
+ /** The event the material routes key on: id, title and the series, as the calendar answer holds them. */
76
+ const eventOf = (row) => ({ id: row.id || undefined, title: row.title, ...(row.series ? { series: row.series } : {}) });
77
+ const isPmos = (k) => k === 'pmos-deck' || k === 'pmos-doc' || k === 'report';
78
+ const scopeText = (scope) => (scope === 'series' ? 'every meeting in the series' : 'this meeting');
79
+
80
+ /** A pasted address as the sheet shows it: an https address with a dot in its host. The server decides what kind it is when it saves. null for anything else. */
81
+ export function pasteOf(raw) {
82
+ const t = String(raw || '').trim();
83
+ if (!t || /\s/.test(t)) return null;
84
+ let u; try { u = new URL(/^[a-z][a-z0-9+.-]*:/i.test(t) ? t : 'https://' + t); } catch { return null; }
85
+ if (u.protocol !== 'https:' || !u.hostname.includes('.')) return null;
86
+ return { kind: 'link', url: u.href, title: u.hostname, meta: 'opens in a new tab · PMOS does not read it' };
87
+ }
88
+ /** The initiative whose documents the sheet suggests: the meeting's own level, when that is an initiative. */
89
+ export const levelInitiative = (row) => (row && row.level && row.level.kind === 'initiative' && row.level.id ? String(row.level.id) : '');
90
+ /** The query of GET /api/meeting-material/suggest. Suggested uses the level; Find in PMOS uses q (two letters or more). */
91
+ export function suggestQuery(row, { q, ws } = {}) {
92
+ const p = new URLSearchParams();
93
+ if (ws) p.set('ws', ws);
94
+ if (q) p.set('q', q); else if (levelInitiative(row)) p.set('initiative', levelInitiative(row));
95
+ return p.toString();
96
+ }
97
+ /** The body of POST /api/meeting-material for a pick made in the sheet. */
98
+ export function addBody(row, pick, scope) {
99
+ if (!pick || !(pick.url || pick.ref)) return null;
100
+ const item = isPmos(pick.kind) ? { kind: pick.kind, ref: pick.ref, title: pick.title, ...(pick.ws ? { ws: pick.ws } : {}) } : { url: pick.url, title: pick.title };
101
+ return { op: 'add', event: eventOf(row), scope: scope === 'series' ? 'series' : 'meeting', item };
102
+ }
103
+ /** The body of POST /api/meeting-material for a row of the list (a row the route returned). */
104
+ export function removeBody(row, item) {
105
+ if (!item || item.from !== 'you' || !['meeting', 'series'].includes(item.scope)) return null;
106
+ return { op: 'remove', event: eventOf(row), scope: item.scope, item: isPmos(item.kind) ? { kind: item.kind, ref: item.ref, ...(item.ws ? { ws: item.ws } : {}) } : { url: item.url } };
107
+ }
108
+ /** What a press records, said before the press (and after it, as the toast). */
109
+ export const addLine = (pick, scope) => `Adds “${clip(pick && pick.title, 80)}” to ${scopeText(scope)}. The calendar is not written.`;
110
+ export const removeLine = (item) => `Removes “${clip(item && item.title, 80)}” from ${scopeText(item && item.scope)}. The document itself is not changed.`;
111
+
112
+ /** Make task for a next step of the meeting's note: the planned event of the note's initiative, or the reason there is none. `stage` is the first stage of its breakdown. */
113
+ export function taskEvent(note, step, stage) {
114
+ if (!note || !note.initiative || !note.initiative.id || !note.initiative.ws) return { ok: false, reason: 'Link the note to an initiative first. Make task adds the step to its breakdown.' };
115
+ if (!stage || !stage.id) return { ok: false, reason: 'The initiative has no stage to put the step in.' };
116
+ const ev = { ev: 'planned', initiative: note.initiative.id, title: String(step.text || '').slice(0, 200), stage: stage.id, note: 'From the meeting note "' + (note.title || 'Untitled note') + '"' };
117
+ if (step.owner) ev.owner = /^(you|me)$/i.test(step.owner) ? 'you' : 'person:' + String(step.owner).slice(0, 60);
118
+ if (step.due && /^\d{4}-\d{2}-\d{2}$/.test(step.due)) ev.due = step.due;
119
+ return { ok: true, ws: note.initiative.ws, event: ev };
120
+ }
121
+
73
122
  /* ── the page half ─────────────────────────────────────────────────────────────────────────────────────── */
74
123
 
75
124
  /** deps: { $, $$, esc, openDlg, toast, pmGet, pmPost, turnA, ptx, kv, H, wsq(), ws() }. Returns { mode, draw, openToday }. */
@@ -110,8 +159,10 @@ export function mountMeeting(d) {
110
159
 
111
160
  /* the dialog */
112
161
  const sec = (label, body) => `<div class="mtg-sec"><span class="label">${esc(label)}</span>${body}</div>`;
113
- const items = (L) => `<ul class="mtg-l">${L.map((x) => `<li>${esc(x.text)}${x.owner || x.due ? `<em>${esc([x.owner, x.due].filter(Boolean).join(' · '))}</em>` : ''}</li>`).join('')}</ul>`;
114
- function paneHtml(v, boards, inis, saved) {
162
+ const items = (L, task) => `<ul class="mtg-l">${L.map((x, i) => `<li>${esc(x.text)}${x.owner || x.due ? `<em>${esc([x.owner, x.due].filter(Boolean).join(' · '))}</em>` : ''}${task ? `<button class="mtg-b mtg-task" data-task="${i}"${task.done.has(i) ? ' disabled' : ''}>${task.done.has(i) ? 'Task made' : 'Make task'}</button>` : ''}</li>`).join('')}</ul>`;
163
+ const pickLi = (it, key, on) => `<li class="mtg-pick"><span>${esc(clip(it.title, 120))}<em>${esc([it.kind, it.meta].filter(Boolean).join(' · '))}</em></span>${on ? '<span class="mtg-on">Picked</span>' : `<button class="mtg-b" data-pick="${esc(key)}">Pick</button>`}</li>`;
164
+
165
+ function detailHtml(v, boards, inis, saved, ui) {
115
166
  const r = v.row, lv = r.level;
116
167
  const aboutNow = lv ? aboutOf(lv) : saved || '';
117
168
  const opts = [['', aboutNow ? 'Change what it is about' : 'Choose what it is about'], ['portfolio', 'Portfolio']].concat(boards.map((b) => ['board|' + b.ws + '|' + b.id, 'Board: ' + b.name]), inis.map((i) => ['initiative|' + i.id, 'Initiative: ' + i.name]), [['none', 'Remove the link']]);
@@ -119,38 +170,125 @@ export function mountMeeting(d) {
119
170
  <div class="mtg-link"><select id="mtgSel" aria-label="What this meeting is about">${opts.map(([val, t]) => `<option value="${esc(val)}">${esc(t)}</option>`).join('')}</select><button class="cta" id="mtgLink" disabled>Link it</button></div>
120
171
  <p class="note" id="mtgMsg" role="status">The link applies to every occurrence of “${esc(r.title)}”. The calendar itself is never written.</p>`;
121
172
  const n = v.notes;
173
+ const task = n && n.actions.length ? { done: ui.tasked } : null;
122
174
  const notes = v.notesLine ? `<p class="note">${esc(v.notesLine)}</p>` : [n.title ? `<p><b>${esc(n.title)}</b></p>` : '',
123
- n.decisions.length ? `<h4 class="mtg-h">Decisions ${n.decisions.length}</h4>${items(n.decisions)}` : '', n.actions.length ? `<h4 class="mtg-h">Next steps ${n.actions.length}</h4>${items(n.actions)}` : '',
175
+ n.decisions.length ? `<h4 class="mtg-h">Decisions ${n.decisions.length}</h4>${items(n.decisions)}` : '', n.actions.length ? `<h4 class="mtg-h">Next steps ${n.actions.length}</h4>${items(n.actions, task)}` : '',
124
176
  n.questions.length ? `<h4 class="mtg-h">Open questions ${n.questions.length}</h4>${items(n.questions)}` : '', (n.decisions.length + n.actions.length + n.questions.length) ? '' : '<p class="note">The note holds no decisions, next steps or questions yet.</p>'].join('');
125
- const mat = v.materialLine ? `<p class="note">${esc(v.materialLine)}</p>` : `<ul class="mtg-l">${v.material.map((m) => `<li>${esc(m.title)}<em>${esc([m.kind, 'for ' + m.scope].filter(Boolean).join(' · '))}</em></li>`).join('')}</ul>`;
177
+ const mat = (v.materialLine ? `<p class="note">${esc(v.materialLine)}</p>` : `<ul class="mtg-l">${v.material.map((m) => `<li>${esc(m.title)}<em>${esc([m.kind, 'for ' + m.scope].filter(Boolean).join(' · '))}</em>${m.removable ? `<button class="mtg-b mtg-rm" data-rm="${m.n}" aria-label="Remove ${esc(m.title)}" title="${esc(m.line)}">Remove</button>` : ''}</li>`).join('')}</ul>`)
178
+ + `<div class="mtg-foot"><button class="mtg-b" id="mmAdd">Add material</button><span class="note">Your calendar invite is not changed.</span></div>`;
126
179
  const rep = v.replay ? `<p>A recording is kept: ${v.replay.minutes ? v.replay.minutes + ' min, ' : ''}${v.replay.keyPoints} key ${v.replay.keyPoints === 1 ? 'point' : 'points'}.</p><p class="note">Replay opens in the console for now.</p>` : '';
127
- return `<article class="paper doc mtg">${d.kv([['When', r.day + ' · ' + r.time + (r.len ? ' · ' + r.len : '')], ['People', v.people.join(', ') || 'The calendar lists no other people.']])}${sec('What it is about', about)}${sec('Notes', notes)}${sec('Material', mat)}${rep ? sec('Replay', rep) : ''}</article>`;
180
+ const status = ui.status ? `<p class="note mtg-status" id="mtgStatus" role="status">${esc(ui.status.text)}${ui.status.undo ? ' <button class="mtg-b" id="mtgUndo">Undo</button>' : ''}</p>` : '<p class="note mtg-status" id="mtgStatus" role="status" hidden></p>';
181
+ return `<article class="paper doc mtg">${status}${d.kv([['When', r.day + ' · ' + r.time + (r.len ? ' · ' + r.len : '')], ['People', v.people.join(', ') || 'The calendar lists no other people.']])}${sec('What it is about', about)}${sec('Notes', notes)}${sec('Material', mat)}${rep ? sec('Replay', rep) : ''}</article>`;
182
+ }
183
+ function sheetHtml(row) {
184
+ return `<article class="paper doc mtg mtg-sheet"><button class="mtg-b" id="mmBack">Back to the meeting</button>
185
+ <p class="note">${esc(row.title)} · ${esc(row.day)} ${esc(row.time)}. PMOS keeps the link on its record of this meeting. The invite in your calendar is not changed.</p>
186
+ ${sec('Suggested for this meeting', '<div id="mmSug"></div>')}${sec('Find in PMOS', '<input class="mtg-in" id="mmFind" type="search" placeholder="A document, report or deck" aria-label="Find a document, report or deck in PMOS" autocomplete="off"><div id="mmFound"></div>')}
187
+ ${sec('Or paste a link', '<input class="mtg-in" id="mmLinkIn" type="url" placeholder="Any https address" aria-label="Paste a link" autocomplete="off"><div id="mmPaste"></div>')}<div id="mmOpts"></div></article>`;
128
188
  }
129
189
 
130
190
  async function openRow(row, via) {
131
191
  let replay = null, material = null, boards = W ? W.boards : [], inis = W ? W.initiatives : [], saved = '';
132
- const paint = () => { $('#oMain').innerHTML = paneHtml(meetingView(row, replay, material), boards, inis, saved); };
192
+ const ui = { view: 'detail', status: null, tasked: new Set() }, SH = { sug: null, found: [], pick: null, scope: 'meeting', q: '', link: '', token: 0 };
193
+ let stT = null, findT = null, undoFn = null;
194
+ const view = () => meetingView(row, replay, material);
195
+ const say = (text, undo) => { clearTimeout(stT); undoFn = undo || null; ui.status = { text, undo: undo || null }; if (ui.view === 'detail') { paint(); stT = setTimeout(() => { ui.status = null; if (ui.view === 'detail') paint(); }, 9000); } else d.toast(text); };
196
+ const paint = () => { $('#oMain').innerHTML = ui.view === 'add' ? sheetHtml(row) : detailHtml(view(), boards, inis, saved, ui); if (ui.view === 'add') paintSheet(); };
197
+ function paintSheet() {
198
+ const list = (L, k) => (L.length ? `<ul class="mtg-l">${L.map((it, i) => pickLi(it, k + ':' + i, SH.pick && (SH.pick.ref || SH.pick.url) === (it.ref || it.url) && SH.pick.kind === it.kind)).join('')}</ul>` : '');
199
+ const q = $('#mmSug'); if (!q) return;
200
+ q.innerHTML = SH.sug == null ? '<p class="note">Looking in PMOS.</p>' : SH.sug.length ? list(SH.sug, 'sug') : '<p class="note">Nothing to suggest yet. Search below, or paste a link.</p>';
201
+ $('#mmFound').innerHTML = SH.q.length >= 2 ? (SH.foundBusy ? '<p class="note">Searching.</p>' : SH.found.length ? list(SH.found, 'found') : '<p class="note">Nothing in PMOS matches that.</p>') : '';
202
+ const pst = pasteOf(SH.link);
203
+ $('#mmPaste').innerHTML = pst ? list([pst], 'paste') : `<p class="note">${SH.link ? 'Paste an https address.' : 'A web page opens in a new tab and PMOS does not read it.'}</p>`;
204
+ const k = SH.pick;
205
+ $('#mmOpts').innerHTML = k ? `<div class="mtg-sec"><span class="label">For</span><div class="seg2" role="group" aria-label="For"><button class="mtg-b" data-scope="meeting" aria-pressed="${SH.scope === 'meeting'}">This meeting</button><button class="mtg-b" data-scope="series" aria-pressed="${SH.scope === 'series'}">${row.series ? 'Every meeting in the series' : 'Every meeting with this title'}</button></div>
206
+ <p class="note" id="mmLine">${esc(addLine(k, SH.scope))}</p><div class="mtg-foot"><button class="cta" id="mmDo">Add to the meeting</button><button class="mtg-b" id="mmCancel">Cancel</button></div></div>` : '';
207
+ }
208
+ async function reload() {
209
+ const mt = await d.pmGet(matPath());
210
+ material = mt && mt.ok === true ? { state: 'ok', items: mt.items || [] } : { state: 'error', error: (mt && mt.error) || 'no answer' };
211
+ }
212
+ const matPath = () => '/api/meeting-material?event=' + encodeURIComponent(row.id) + '&title=' + encodeURIComponent(row.title) + (row.series ? '&series=' + encodeURIComponent(row.series) : '') + '&date=' + row.day;
133
213
  d.openDlg({ eye: 'Calendar · real data', title: row.title, sub: [row.day, row.time, row.len].filter(Boolean).join(' · '), noteKey: via === 'today' ? 'ev:meeting:' + Date.parse(row.at) : null,
134
- stream: d.turnA(d.ptx('This meeting is in the calendar PMOS holds. Its notes, material and recording appear here only if PMOS holds them.')), pane: paneHtml(meetingView(row, null, null), boards, inis, ''), label: 'Meeting' });
214
+ stream: d.turnA(d.ptx('This meeting is in the calendar PMOS holds. Its notes, material and recording appear here only if PMOS holds them.')), pane: detailHtml(meetingView(row, null, null), boards, inis, '', ui), label: 'Meeting' });
135
215
  if (via !== 'today') $('#askF').hidden = true;
136
- const [rp, mt] = await Promise.all([d.pmGet('/api/meeting-replay?event=' + encodeURIComponent(row.id) + '&date=' + row.day), d.pmGet('/api/meeting-material?event=' + encodeURIComponent(row.id) + '&title=' + encodeURIComponent(row.title) + (row.series ? '&series=' + encodeURIComponent(row.series) : '') + '&date=' + row.day)]);
216
+ const [rp, mt] = await Promise.all([d.pmGet('/api/meeting-replay?event=' + encodeURIComponent(row.id) + '&date=' + row.day), d.pmGet(matPath())]);
137
217
  if ($('#dTitle').textContent !== row.title) return;
138
218
  replay = rp && rp.ok === true ? { state: 'ok', body: rp } : rp && rp.status === 404 ? { state: 'none' } : { state: 'error', error: (rp && rp.error) || 'no answer' };
139
219
  material = mt && mt.ok === true ? { state: 'ok', items: mt.items || [] } : { state: 'error', error: (mt && mt.error) || 'no answer' };
140
220
  paint();
141
- const sel = () => $('#mtgSel');
221
+
222
+ const write = async (body) => { const res = await d.pmPost('/api/meeting-material', body); return res && res.ok === true ? res : { ok: false, error: (res && res.error) || 'The material was not saved.' }; };
223
+ async function removeItem(item) {
224
+ const body = removeBody(row, item); if (!body) return;
225
+ const res = await write(body);
226
+ if (!res.ok) return say('The material was not removed: ' + res.error);
227
+ await reload();
228
+ say('Removed “' + clip(item.title, 80) + '” from ' + scopeText(item.scope) + '. The document itself is not changed.', async () => { const back = await write({ ...addBody(row, item, item.scope), ...(item.topic ? { topic: item.topic } : {}), present: !!item.present }); await reload(); say(back.ok ? 'Put back.' : 'It was not put back: ' + back.error); });
229
+ }
230
+ async function makeTask(i) {
231
+ const n = view().notes, step = n && n.actions[i]; if (!step) return;
232
+ if (!n.initiative) return say(taskEvent(n, step, null).reason);
233
+ const lay = await d.pmGet('/api/plan-items?ladder=0&ws=' + encodeURIComponent(n.initiative.ws) + '&id=' + encodeURIComponent(n.initiative.id));
234
+ const plan = taskEvent(n, step, lay && lay.ok && (lay.stages || [])[0]);
235
+ if (!plan.ok) return say('The task was not made: ' + plan.reason);
236
+ const res = await d.pmPost('/api/plan-items', { ws: plan.ws, events: [plan.event] });
237
+ if (!res || res.ok !== true) return say('The task was not made' + (res && res.error ? ': ' + res.error : '.'));
238
+ ui.tasked.add(i);
239
+ const item = res.written && res.written[0] && res.written[0].item;
240
+ say(`Added to ${n.initiative.name}, under ${(lay.stages[0].label || lay.stages[0].id)}.`, item ? async () => {
241
+ const u = await d.pmPost('/api/plan-items', { ws: plan.ws, events: [{ ev: 'withdrawn', item, initiative: n.initiative.id }] });
242
+ if (u && u.ok === true) { ui.tasked.delete(i); say('The task is withdrawn.'); } else say('The task was not withdrawn' + (u && u.error ? ': ' + u.error : '.'));
243
+ } : null);
244
+ }
245
+ async function openSheet() {
246
+ ui.view = 'add'; SH.sug = null; SH.found = []; SH.pick = null; SH.q = ''; SH.link = ''; paint();
247
+ $('#mmBack').focus();
248
+ const r = await d.pmGet('/api/meeting-material/suggest?' + suggestQuery(row, { ws: d.ws() }));
249
+ SH.sug = r && r.ok && Array.isArray(r.suggested) ? r.suggested : []; if (ui.view === 'add') paintSheet();
250
+ }
251
+ const closeSheet = (focusAdd) => { ui.view = 'detail'; paint(); if (focusAdd && $('#mmAdd')) $('#mmAdd').focus(); };
252
+ const pickOf = (key) => { const [k, i] = key.split(':'); return (k === 'sug' ? SH.sug : k === 'found' ? SH.found : [pasteOf(SH.link)])[+i] || null; };
253
+
254
+ $('#oMain').oninput = (e) => {
255
+ if (e.target.id === 'mmLinkIn') { SH.link = e.target.value.trim(); const p = pasteOf(SH.link); if (p) SH.pick = p; else if (SH.pick && !SH.pick.ref) SH.pick = null; paintSheet(); }
256
+ if (e.target.id === 'mmFind') {
257
+ SH.q = e.target.value.trim(); SH.found = []; SH.foundBusy = SH.q.length >= 2; paintSheet(); clearTimeout(findT);
258
+ if (!SH.foundBusy) return;
259
+ const my = ++SH.token;
260
+ findT = setTimeout(async () => { const r = await d.pmGet('/api/meeting-material/suggest?' + suggestQuery(row, { q: SH.q, ws: d.ws() })); if (my !== SH.token || ui.view !== 'add') return; SH.foundBusy = false; SH.found = r && r.ok && Array.isArray(r.found) ? r.found : []; paintSheet(); }, 220);
261
+ }
262
+ };
142
263
  $('#oMain').onchange = (e) => { if (e.target.id === 'mtgSel') $('#mtgLink').disabled = !e.target.value; };
143
264
  $('#oMain').onclick = async (e) => {
144
- if (!e.target.closest('#mtgLink')) return;
145
- const body = linkBody(row, sel().value, boards);
265
+ const t = e.target.closest('button'); if (!t) return;
266
+ if (t.id === 'mmAdd') return openSheet();
267
+ if (t.id === 'mmBack' || t.id === 'mmCancel') return closeSheet(true);
268
+ if (t.dataset.pick) { SH.pick = pickOf(t.dataset.pick); paintSheet(); return; }
269
+ if (t.dataset.scope) { SH.scope = t.dataset.scope; paintSheet(); return; }
270
+ if (t.id === 'mmDo') {
271
+ const body = addBody(row, SH.pick, SH.scope); if (!body) return;
272
+ t.disabled = true;
273
+ const res = await write(body);
274
+ if (!res.ok) { t.disabled = false; $('#mmLine').textContent = 'The material was not saved: ' + res.error; return; }
275
+ await reload(); ui.view = 'detail';
276
+ say('Added “' + clip(SH.pick.title, 80) + '” to ' + scopeText(SH.scope) + '.');
277
+ if ($('#mmAdd')) $('#mmAdd').focus();
278
+ return;
279
+ }
280
+ if (t.dataset.rm !== undefined) { const it = ((material && material.items) || [])[+t.dataset.rm]; if (it) await removeItem(it); return; }
281
+ if (t.dataset.task !== undefined) { t.disabled = true; await makeTask(+t.dataset.task); if (!ui.tasked.has(+t.dataset.task)) paint(); return; }
282
+ if (t.id === 'mtgUndo') { const fn = undoFn; undoFn = null; if (fn) await fn(); return; }
283
+ if (t.id !== 'mtgLink') return;
284
+ const body = linkBody(row, $('#mtgSel').value, boards);
146
285
  if (!body) return;
147
- const go = $('#mtgLink'); go.disabled = true;
286
+ t.disabled = true;
148
287
  const res = await d.pmPost('/api/calendar-links', body);
149
- if (!res || res.ok !== true) { go.disabled = false; $('#mtgMsg').textContent = (res && res.error) || 'The link could not be saved.'; return; }
150
- saved = body.kind === 'none' ? '' : sel().selectedOptions[0].textContent;
288
+ if (!res || res.ok !== true) { t.disabled = false; $('#mtgMsg').textContent = (res && res.error) || 'The link could not be saved.'; return; }
289
+ saved = body.kind === 'none' ? '' : $('#mtgSel').selectedOptions[0].textContent;
151
290
  d.toast(body.kind === 'none' ? 'The link is removed for every occurrence of this meeting.' : 'Linked. It applies to every occurrence of this meeting.');
152
291
  await readWeek(); paint(); if (mode === 'week') draw();
153
- $('#oMain').onchange = (ev) => { if (ev.target.id === 'mtgSel') $('#mtgLink').disabled = !ev.target.value; };
154
292
  };
155
293
  }
156
294
 
@@ -1329,6 +1329,16 @@ button.dsn:hover{box-shadow:inset 0 0 0 1.5px rgb(79,109,245)}
1329
1329
  .mtg-link{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:10px 0 8px}
1330
1330
  .mtg-link select{flex:1 1 220px;min-width:0;min-height:44px;border-radius:18px;border:1px solid var(--hair);background:var(--well);padding:0 14px;font:inherit;color:inherit}
1331
1331
  @media (max-width:700px){#todayCard .ch{flex-wrap:wrap;row-gap:8px}}
1332
+ .mtg-b{min-height:44px;padding:0 16px;border-radius:var(--r-chip);background:var(--well);color:var(--ink);font-weight:650;font-size:var(--t-small);display:inline-flex;align-items:center;transition:transform .35s var(--spring)}
1333
+ .mtg-b:disabled{opacity:.55}
1334
+ .mtg-l li:has(>.mtg-b){display:grid;grid-template-columns:1fr auto;column-gap:12px;align-items:center}.mtg-l li>.mtg-b{grid-row:1 / span 2;grid-column:2}
1335
+ .mtg-foot{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin-top:12px}.mtg-foot .note{margin:0}
1336
+ .mtg-in{width:100%;min-height:44px;border-radius:18px;border:1px solid var(--hair);background:var(--well);padding:0 14px;font:inherit;color:inherit;margin-bottom:8px}
1337
+ .mtg-pick{display:grid;grid-template-columns:1fr auto;column-gap:12px;align-items:center}.mtg-on{font-size:var(--t-small);color:var(--ember-ink);font-weight:600}
1338
+ .mtg-status{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:0 0 12px;padding:10px 14px;border-radius:18px;background:var(--well);color:var(--ink-2)}.mtg-status[hidden]{display:none}
1339
+ .mtg-sheet>.mtg-b{margin-bottom:10px}
1340
+ .mtg-sheet .seg2 button{min-height:44px}
1341
+
1332
1342
 
1333
1343
  /* Agent sessions dialog and its header button (initiative premium-sessions) */
1334
1344
  .sbtn{position:relative}
@@ -1352,3 +1362,11 @@ button.dsn:hover{box-shadow:inset 0 0 0 1.5px rgb(79,109,245)}
1352
1362
  .ssdone{color:var(--ok);font-weight:650}
1353
1363
  .sse{padding:34px 20px;text-align:center;border-radius:var(--r-in);background:var(--well)}.sse b{display:block;font-size:17px;font-weight:650}.sse p{color:var(--ink-2);margin-top:6px;font-size:var(--t-small)}
1354
1364
  @media (max-width:700px){.ssr{grid-template-columns:auto minmax(0,1fr)}.ssr>.cta{grid-column:2}}
1365
+
1366
+ /* Issue it on a core document draft (initiative premium-core-doc-issue) */
1367
+ .dsiss{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 16px;border-radius:14px;background:color-mix(in oklab,var(--ember) 12%,transparent);margin:0 0 12px;font-size:12.5px}
1368
+ .dsiss>span:first-child{display:inline-flex;gap:8px;align-items:center;flex:1 1 220px;min-width:0}
1369
+ .dsiss svg{width:15px;height:15px;flex:none;color:var(--ember-ink)}
1370
+ .dsiss .dsa{display:flex;gap:8px;flex-wrap:wrap}
1371
+ .dsiss.dsok{background:color-mix(in oklab,var(--ok) 12%,transparent)}
1372
+ .dsiss.dsok svg{color:var(--ok)}
@@ -46,6 +46,7 @@
46
46
  "briefing-premium-reports.test.js",
47
47
  "briefing-premium-doc-edit.test.js",
48
48
  "briefing-premium-calendar.test.js",
49
+ "briefing-premium-calendar-2.test.js",
49
50
  "briefing-premium-products.test.js",
50
51
  "briefing-premium-sources.test.js",
51
52
  "briefing-premium-metrics.test.js",
@@ -213,6 +214,7 @@
213
214
  "briefing-premium-reports.test.js": 1,
214
215
  "briefing-premium-doc-edit.test.js": 1,
215
216
  "briefing-premium-calendar.test.js": 1,
217
+ "briefing-premium-calendar-2.test.js": 1,
216
218
  "briefing-premium-products.test.js": 1,
217
219
  "briefing-premium-sources.test.js": 1,
218
220
  "briefing-premium-metrics.test.js": 1,
@@ -9,6 +9,7 @@
9
9
  "briefing-premium-adddoc-test.js",
10
10
  "briefing-premium-doc-edit-test.js",
11
11
  "briefing-premium-calendar-test.js",
12
+ "briefing-premium-calendar-2-test.js",
12
13
  "briefing-premium-products-test.js",
13
14
  "briefing-premium-sources-test.js",
14
15
  "briefing-premium-metrics-test.js",
@@ -23,6 +24,7 @@
23
24
  "briefing-premium-adddoc-test.js": 120,
24
25
  "briefing-premium-doc-edit-test.js": 90,
25
26
  "briefing-premium-calendar-test.js": 90,
27
+ "briefing-premium-calendar-2-test.js": 90,
26
28
  "briefing-premium-products-test.js": 90,
27
29
  "briefing-premium-sources-test.js": 90,
28
30
  "briefing-premium-metrics-test.js": 120,
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "Initiative premium-core-doc-issue: Issue it on a core document draft, from the premium Board's reader and the premium initiative sheet, against the real server on a scratch team repo.",
3
+ "panels": [
4
+ "premium-core-doc-issue-test.js"
5
+ ],
6
+ "seconds": {
7
+ "premium-core-doc-issue-test.js": 150
8
+ }
9
+ }