create-pmos 0.313.0 → 0.315.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.313.0",
3
+ "version": "0.315.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@36b0e23
1
+ kernel-source: pmos@8c026d7
2
2
  assembled: 2026-10-19
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-19T13:24:33Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-19T13:49:40Z"}
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-19T13:24:33Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-19T13:49:40Z"}
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-19T13:24:33Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-19T13:49:40Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -129,7 +129,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
129
129
  { const R = await open(); await R.page.locator('#repDocs .dmo').first().click(); ok('I8 a report opens in the page\'s reader, not the console (premium-report-read R1)', await until(() => R.page.evaluate(() => document.querySelector('#dlg').classList.contains('rdrd') && document.querySelector('#dlg').classList.contains('on')), 5000) && /premium-insights\.html/.test(R.page.url()), R.page.url());
130
130
  await R.page.click('#dClose'); await R.page.click('#repOpen'); ok('I8 the Reports tab link still opens the console to edit or issue', await until(() => /\/console\.html\?tab=rep/.test(R.page.url()), 5000), R.page.url()); await R.ctx.close(); }
131
131
  /* I9 labels */
132
- ok('I9 no demo label, and the foot says what is left out', !(await p.evaluate(() => /demo/i.test(document.querySelector('main.stage').textContent))) && /Left out: run-based charts/.test(await txt('#foot')) && /Real data/.test(await txt('#snap')));
132
+ ok('I9 no demo label, and the foot says what is left out', !(await p.evaluate(() => /demo/i.test(document.querySelector('main.stage').textContent))) && /Left out: any measure no record holds/.test(await txt('#foot')) && /Board measures card/.test(await txt('#foot')) && /Real data/.test(await txt('#snap')));
133
133
  ok('I9 the page makes no write request on its own', A.posts.length === 0, A.posts.join());
134
134
  /* I10 empty */
135
135
  {
@@ -3,7 +3,7 @@
3
3
  /* briefing-premium-metrics-test.js — the Metrics card of the premium Board (initiative briefing-premium-metrics; planning/prd/briefing-premium-metrics-prd.md M1 to M10).
4
4
  * Serves the real page from the real server. The Board's answer and the card's answer are served from fixtures (the card's model is built by
5
5
  * lib/board-metrics-premium.js from made-up runs, commits and initiatives); the last blocks ask the real route and compare the card with the mockup.
6
- * C1 place and absence · C2 tiles · C3 reading a week · C4 dialog and agent · C5 pending and failure · C6 floors · C7 the real route · C8 fidelity */
6
+ * C1 place and absence · C2 tiles · C3 reading a week · C4 dialog and agent · C5 pending and failure · C6 floors · C7 the real route · C8 fidelity · C9 targets on the Board · C10 the Insights twin */
7
7
  const fs = require('fs');
8
8
  const path = require('path');
9
9
  const { spawn } = require('child_process');
@@ -71,7 +71,7 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
71
71
  /* C2 */
72
72
  const tiles = await p.evaluate(() => [...document.querySelectorAll('#metBody .mt1')].map((t) => ({ l: t.querySelector('span').textContent, v: t.querySelector('.mval').textContent, c: t.querySelector('.mwk').textContent, chart: !!t.querySelector('svg'), cls: t.className, chg: (t.querySelector('.mchg') || {}).textContent || '' })));
73
73
  ok('C2 the first tile is the latest week with its run count, and how it changed', tiles[0].l === 'Corrections per 100 runs' && tiles[0].v === '10.0' && /^week to .+, 10 runs$/.test(tiles[0].c) && tiles[0].chg === '▼ Down 15.0 vs last week' && tiles[0].chart && /\bok\b/.test(tiles[0].cls), JSON.stringify(tiles[0]));
74
- ok('C2 merges, blocked and idle are counted; blocked and idle have no chart and say no history is kept', tiles[1].v === '3' && tiles[1].chart && tiles[2].v === '1' && tiles[2].c === 'of 3 open. No history is kept' && !tiles[2].chart && tiles[3].v === '1' && !tiles[3].chart && /\bbad\b/.test(tiles[2].cls) && /\bwarn\b/.test(tiles[3].cls), JSON.stringify(tiles));
74
+ ok('C2 merges, blocked and idle are counted; blocked and idle chart from today and say plainly that their history starts today', tiles[1].v === '3' && tiles[1].chart && tiles[2].v === '1' && tiles[2].c === 'of 3 open · history starts today' && tiles[2].chart && tiles[3].v === '1' && tiles[3].c === 'of 3 open · history starts today' && tiles[3].chart && /\bbad\b/.test(tiles[2].cls) && /\bwarn\b/.test(tiles[3].cls), JSON.stringify(tiles));
75
75
  const per = await p.evaluate(() => [...document.querySelectorAll('#perTabs button')].map((b) => b.textContent + ':' + b.getAttribute('aria-pressed') + ':' + (b.getAttribute('aria-disabled') || '')).join('|'));
76
76
  ok('C2 only Week is available; Day and Month are disabled', per === 'Day:false:true|Week:true:|Month:false:true', per);
77
77
  ok('C2 no target, on-target chip, dashed line or demo label is drawn; the lead line says no measure has a target', await p.evaluate(() => !document.querySelector('#cMet .mchip.ok, #cMet .tg, #cMet .tgl') && !/on target|demo|dashed/i.test(document.querySelector('#metBody').textContent) && /No measure here has a target/.test(document.querySelector('#metHint').textContent)));
@@ -108,7 +108,7 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
108
108
  ok('C4 a question posts the metric\'s key and the text', await until(() => A.posts.length > n0 && A.posts[A.posts.length - 1].path === '/api/briefing-premium/ask' && A.posts[A.posts.length - 1].body.key === 'board:metric-corrections' && A.posts[A.posts.length - 1].body.text === 'Why did it fall?'), JSON.stringify(A.posts.slice(-1)));
109
109
  await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
110
110
  await p.locator('#metBody .mt1').nth(2).click(); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(400);
111
- ok('C4 a tile without a chart opens its definition too', await p.evaluate(() => document.querySelector('#dTitle').textContent === 'Blocked' && /blocked step/.test(document.querySelector('#oMain .lede').textContent) && document.querySelectorAll('#oMain .vtb div').length === 0));
111
+ ok('C4 Blocked opens its definition, and the weeks before its history started read Not kept yet', await p.evaluate(() => { const v = [...document.querySelectorAll('#oMain .vtb div b')].map((b) => b.textContent); return document.querySelector('#dTitle').textContent === 'Blocked' && /blocked step/.test(document.querySelector('#oMain .lede').textContent) && v.length === 8 && v.slice(0, 7).every((x) => x === 'Not kept yet') && v[7] === '1'; }));
112
112
  await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
113
113
  await p.click('#perTabs [data-per="day"]', { force: true }); ok('C4 a disabled period says why and changes nothing', await until(() => p.evaluate(() => /by week only/.test(document.querySelector('#toast').textContent))) && await p.evaluate(() => document.querySelector('#perTabs [data-per="week"]').getAttribute('aria-pressed') === 'true'));
114
114
  ok('0 no page error', A.errors.length === 0, A.errors.join(' | '));
@@ -148,6 +148,44 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
148
148
  await ctx.close();
149
149
  }
150
150
 
151
+ /* C9 a target set on Insights draws on the Board */
152
+ {
153
+ const R = await open({ answers: () => ready(metrics({ targets: { corrections: { target: 12 }, merges: { target: 5 } } })) }), q = R.page;
154
+ await until(() => q.evaluate(() => document.querySelectorAll('#metBody .mt1').length === 4));
155
+ const t = await q.evaluate(() => [...document.querySelectorAll('#metBody .mt1')].map((x) => ({ chip: (x.querySelector('.mchip') || {}).textContent || '', cls: (x.querySelector('.mchip') || {}).className || '', tg: !!x.querySelector('svg .tg'), tgl: !!x.querySelector('.tgl'), tgt: (x.querySelector('.mtg') || {}).textContent || '', off: x.classList.contains('off') })));
156
+ ok('C9 a measure on target carries the On target chip, its target and the dashed line, with no outline', t[0].chip === 'On target' && /\bok\b/.test(t[0].cls) && t[0].tg && t[0].tgl && t[0].tgt === 'target 12.0' && !t[0].off, JSON.stringify(t[0]));
157
+ ok('C9 a measure off target carries its gap, the dashed line and the orange outline', t[1].chip === '2 short' && /\bwarn\b/.test(t[1].cls) && t[1].tg && t[1].tgt === 'target 5' && t[1].off, JSON.stringify(t[1]));
158
+ ok('C9 a measure with no target draws no dashed line, and the lead line says the line is the target set on Insights', !t[2].tg && !t[3].tg && await q.evaluate(() => /The dashed line is the target set on Insights/.test(document.querySelector('#metHint').textContent)), JSON.stringify(t.slice(2)));
159
+ await q.locator('#metBody .mt1').first().click(); await until(() => q.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(300);
160
+ ok('C9 the dialog names the target and the gap', await q.evaluate(() => { const g = [...document.querySelectorAll('#oMain .kv2 span')].map((s) => s.textContent).join('|'); return /Target\|12\.0/.test(g) && /Gap\|On target/.test(g); }));
161
+ ok('C9 no page error', R.errors.length === 0, R.errors.join(' | '));
162
+ await R.ctx.close();
163
+ }
164
+
165
+ /* C10 the Insights page shows the same measures, and a target saved there is sent for the Board */
166
+ {
167
+ const IP = require('./lib/insights-premium.js'), IF = require('./fixtures/insights-premium-facts.js');
168
+ const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), q = await ctx.newPage(), errs = [], saves = [], asked = [];
169
+ let tg = {};
170
+ q.on('pageerror', (e) => errs.push(String((e && e.message) || e)));
171
+ await q.route('**/api/insights-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: IP.build(IF.facts()), as_of: 1 }) }));
172
+ await q.route('**/api/board-metrics-premium*', (r) => { asked.push(new URL(r.request().url()).searchParams.get('weeks')); return r.fulfill({ contentType: 'application/json', body: JSON.stringify(ready(metrics({ targets: tg })).body) }); });
173
+ await q.route('**/api/board-metric-targets/save', (r) => { const b = JSON.parse(r.request().postData() || '{}'); saves.push(b); tg = b.target == null ? {} : { [b.key]: { target: Number(b.target) } }; return r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, targets: tg }) }); });
174
+ await q.route('**/api/briefing-premium/**', (r) => r.fulfill({ contentType: 'application/json', body: '{"ok":true,"turns":[],"working":false}' }));
175
+ await q.goto(BASE + '/premium-insights.html');
176
+ const up = await until(() => q.evaluate(() => !document.querySelector('#cBm').hidden && document.querySelectorAll('#bmBody .mt1').length === 4), 20000);
177
+ ok('C10 Insights draws the Board measures card with the same four tiles as the Board', up && await q.evaluate(() => [...document.querySelectorAll('#bmBody .mt1 .mval')].map((v) => v.textContent).join('|') === '10.0|3|1|1' && /counted from idpf/.test(document.querySelector('#bmCap').textContent)));
178
+ ok('C10 Blocked and Idle say plainly on their charts that history starts today', await q.evaluate(() => [...document.querySelectorAll('#bmBody .mt1')].slice(2).every((t) => !!t.querySelector('svg') && t.querySelector('.mwk').textContent === 'of 3 open · history starts today')));
179
+ await q.locator('#bmRange [data-w="26"]').click();
180
+ ok('C10 a longer range asks for 26 weeks', await until(() => asked.includes('26')) && await until(() => q.evaluate(() => document.querySelector('#bmRange [data-w="26"]').getAttribute('aria-pressed') === 'true')), JSON.stringify(asked));
181
+ await q.locator('#bmBody .mt1').nth(1).click(); await until(() => q.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(300);
182
+ await q.fill('#bmT', '5'); await q.click('#bmGo');
183
+ ok('C10 Save target sends the measure and the number for this board', await until(() => saves.length === 1) && saves[0].ws === 'w1' && saves[0].key === 'merges' && saves[0].target === '5', JSON.stringify(saves));
184
+ ok('C10 the card redraws with the target: its gap chip, dashed line and outline', await until(() => q.evaluate(() => { const t = document.querySelectorAll('#bmBody .mt1')[1]; return t && (t.querySelector('.mchip') || {}).textContent === '2 short' && !!t.querySelector('svg .tg') && t.classList.contains('off'); })));
185
+ ok('C10 no page error', errs.length === 0, errs.join(' | '));
186
+ await ctx.close();
187
+ }
188
+
151
189
  /* C8 fidelity against the mockup */
152
190
  if (!fs.existsSync(MOCKUP)) ok('C8 the mockup is in the repository', false, MOCKUP);
153
191
  else {
@@ -17,6 +17,8 @@ const F = require('./fixtures/my-work-premium-facts.js');
17
17
  const BASE = T.BASE;
18
18
  const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
19
19
  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); } };
20
+ /* the Work queue shows one tab at a time: bring up the tab that holds a row before pressing it (each press redraws the tab row, so the button is found again) */
21
+ const showKey = (pg, key) => pg.evaluate((key) => { const has = () => document.querySelector(`#qBody .wrow[data-key="${key}"], #waitBody .wrow[data-key="${key}"]`); if (has()) return true; for (const k of [...document.querySelectorAll('#qTabs .qtb')].map((b) => b.dataset.tab)) { document.querySelector(`#qTabs [data-tab="${k}"]`).click(); if (has()) return true; } return false; }, key);
20
22
  const results = [];
21
23
  const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
22
24
  const more = async (pg) => { if (await pg.locator('#card [data-p="more"][aria-expanded="false"]').count()) await pg.click('#card [data-p="more"]'); };
@@ -53,12 +55,12 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
53
55
  await page.route('**/api/pm-items/**', (r) => { const rq = r.request(); posts.push({ path: new URL(rq.url()).pathname, body: JSON.parse(rq.postData() || '{}'), headers: rq.headers() }); r.fulfill({ status: answer.status, contentType: 'application/json', body: JSON.stringify(answer.body) }); });
54
56
  await page.route('**/api/briefing-premium/**', (r) => { const rq = r.request(); if (rq.method() === 'GET') return r.fulfill({ contentType: 'application/json', body: JSON.stringify(thread) }); posts.push({ path: new URL(rq.url()).pathname, body: JSON.parse(rq.postData() || '{}'), headers: rq.headers() }); return r.fulfill({ status: answer.status, contentType: 'application/json', body: JSON.stringify(answer.body) }); });
55
57
  await page.goto(BASE + '/premium-work.html?theme=' + theme);
56
- const up = await until(() => page.evaluate(() => document.querySelectorAll('#plateBody .wrow').length > 0), 20000);
58
+ const up = await until(() => page.evaluate(() => document.querySelectorAll('#qBody .wrow').length > 0), 20000);
57
59
  return { ctx, page, errors, posts, up, setModel: (m) => { current = m; }, set: (a) => { answer = a; }, setThread: (t) => { thread = t; }, gets: () => gets };
58
60
  };
59
61
 
60
62
  const A = await open();
61
- ok('0 the page draws the plate', A.up);
63
+ ok('0 the page draws the Work queue', A.up);
62
64
  if (!A.up) return finish(1);
63
65
  const p = A.page, M = mk();
64
66
  const txt = (s) => p.evaluate((q) => (document.querySelector(q) || {}).textContent || '', s);
@@ -92,26 +94,33 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
92
94
  /* M10 */
93
95
  ok('M10 the header says what is real and that Jira and Slack appear only when read', /^Real data · as of 18:05/.test(await txt('#snap')) && /only when an agent session has read them/.test(await txt('#snap')));
94
96
 
95
- /* M4 */
96
- const plate = await p.evaluate(() => ({ labels: [...document.querySelectorAll('#plateBody .wsec .label')].map((x) => x.textContent), counts: [...document.querySelectorAll('#plateBody .wsec em')].map((x) => x.textContent), cap: document.querySelector('#plateCap').textContent, first: [...document.querySelectorAll('.tgf')].map((x) => x.closest('.wrow').dataset.key), titles: [...document.querySelectorAll('#plateBody .wtit')].map((x) => x.textContent.replace('Do this first', '')), chips: [...document.querySelectorAll('#plateBody .due')].map((x) => x.textContent), od: [...document.querySelectorAll('#plateBody .due.od')].length, ck: [...document.querySelectorAll('#plateBody .wck')].map((b) => Math.round(b.getBoundingClientRect().height)), glyphs: [...document.querySelectorAll('#plateBody .inb .wgl')].map((x) => x.title) }));
97
- ok('M4 four places in order with their counts', plate.labels.join() === 'Inbox,Today,Upcoming,Someday' && plate.counts.join() === '3 open,3 open,2 open,1 open', JSON.stringify(plate));
98
- ok('M4 rows are the items, in order, with a due chip only where a date was set; the overdue one says so', plate.titles.length === 9 && plate.titles[3] === 'Sign off the fit-out contractor shortlist' && plate.chips.join() === 'Overdue · 15 Oct,Today,19 Oct,2 Nov' && plate.od === 1, JSON.stringify(plate.chips));
99
- ok('M4 "Do this first" tags the overdue item only', plate.first.length === 1 && plate.first[0] === 'work:wbs:alpha:4.2', JSON.stringify(plate.first));
100
- ok('M4 an inbox row shows its source, a check circle is 44 px', plate.glyphs.join() === 'Jira,Jira,Slack' && plate.ck.length === 6 && plate.ck.every((h) => h >= 44), JSON.stringify([plate.glyphs, plate.ck]));
101
- const dec = await p.evaluate(() => { const b = document.querySelector('.wrow[data-key="work:wbs:alpha:4.2"] .wck'); const r = b.closest('.wrow'); return { dec: b.classList.contains('dec'), eye: !!b.querySelector('circle'), label: b.getAttribute('aria-label'), first: r.classList.contains('first'), tagBlock: getComputedStyle(r.querySelector('.tgf')).display, bar: getComputedStyle(r).boxShadow !== 'none', others: [...document.querySelectorAll('#plateBody .wck')].filter((x) => x !== b).every((x) => !x.classList.contains('dec')) }; });
97
+ /* M4 the Work queue: one card, a tab for each place a thing waits */
98
+ const qtab = (k) => p.click(`#qTabs [data-tab="${k}"]`);
99
+ const q = await p.evaluate(() => ({ tabs: [...document.querySelectorAll('#qTabs .qtb')].map((b) => b.textContent), sel: [...document.querySelectorAll('#qTabs [aria-selected="true"]')].map((b) => b.dataset.tab), tops: new Set([...document.querySelectorAll('#qTabs .qtb')].map((b) => Math.round(b.getBoundingClientRect().top))).size, cap: document.querySelector('#qCap').textContent, first: [...document.querySelectorAll('.tgf')].map((x) => x.closest('.wrow').dataset.key), titles: [...document.querySelectorAll('#qBody .wtit')].map((x) => x.textContent.replace('Do this first', '')), chips: [...document.querySelectorAll('#qBody .due')].map((x) => x.textContent), od: [...document.querySelectorAll('#qBody .due.od')].length, ck: [...document.querySelectorAll('#qBody .wck')].map((b) => Math.round(b.getBoundingClientRect().height)), cols: getComputedStyle(document.querySelector('#qBody')).gridTemplateColumns.split(' ').length, old: ['#plate', '#agCard', '#trayCard'].filter((x) => document.querySelector(x)), title: document.querySelector('#hQueue').textContent }));
100
+ ok('M4 one Work queue card replaces On your plate, With agents and the tray', q.title === 'Work queue' && q.old.length === 0, JSON.stringify(q));
101
+ ok('M4 seven tabs in one pill row with their counts, and the card opens on Today', q.tabs.join() === 'Today3,Inbox4,Agents3,Upcoming2,Someday1,Kept0,Done0' && q.sel.join() === 'today' && q.tops === 1, JSON.stringify(q));
102
+ ok('M4 Today holds its rows in two columns, with a due chip only where a date was set; the overdue one says so', q.cols === 2 && q.titles.length === 3 && q.titles[0] === 'Sign off the fit-out contractor shortlist' && q.chips.join() === 'Overdue · 15 Oct,Today' && q.od === 1, JSON.stringify(q));
103
+ ok('M4 "Do this first" tags the overdue item only, and a check circle is 44 px', q.first.length === 1 && q.first[0] === 'work:wbs:alpha:4.2' && q.ck.length === 3 && q.ck.every((h) => h >= 44), JSON.stringify([q.first, q.ck]));
104
+ const dec = await p.evaluate(() => { const b = document.querySelector('#qBody .wrow[data-key="work:wbs:alpha:4.2"] .wck'); const r = b.closest('.wrow'); return { dec: b.classList.contains('dec'), eye: !!b.querySelector('circle'), label: b.getAttribute('aria-label'), first: r.classList.contains('first'), tagBlock: getComputedStyle(r.querySelector('.tgf')).display, bar: getComputedStyle(r).boxShadow !== 'none', others: [...document.querySelectorAll('#qBody .wck')].filter((x) => x !== b).every((x) => !x.classList.contains('dec')) }; });
102
105
  ok('M4 an item whose agent draft is ready has a highlighted eye circle (not a check), the first overdue row carries the ember bar and its tag sits on its own line', dec.dec && dec.eye && /^Review the agent draft/.test(dec.label) && dec.first && dec.tagBlock === 'block' && dec.bar && dec.others, JSON.stringify(dec));
103
- const tray = await p.evaluate(() => ({ cap: document.querySelector('#trayCap').textContent, titles: [...document.querySelectorAll('#trayBody .wtit')].map((x) => x.textContent), note: document.querySelector('#trayNote').textContent, checks: document.querySelectorAll('#trayBody .wck').length, inbox: [...document.querySelectorAll('#plateBody .wsec')].find((x) => x.dataset.lane === 'inbox').textContent }));
104
- ok('M4 your tray holds what you threw in and have not placed, apart from the plate, and says how it works', tray.cap === '1 to place' && tray.titles.join() === 'Is the payment-step experiment worth another week?' && /Nothing here counts as work to clear/.test(tray.note) && tray.checks === 0 && /3 open/.test(tray.inbox), JSON.stringify(tray));
106
+ await qtab('inbox');
107
+ const ib = await p.evaluate(() => ({ labels: [...document.querySelectorAll('#qBody .wsec .label')].map((x) => x.textContent), counts: [...document.querySelectorAll('#qBody .wsec em')].map((x) => x.textContent), glyphs: [...document.querySelectorAll('#qBody .inb .wgl')].map((x) => x.title), titles: [...document.querySelectorAll('#qBody .wtit')].map((x) => x.textContent), checks: document.querySelectorAll('#qBody .wck').length, note: document.querySelector('#qNote').textContent, focus: document.activeElement && document.activeElement.dataset.tab }));
108
+ ok('M4 Inbox holds what is new from Jira and Slack, then what you added, each with its source; nothing there has a check', ib.labels.join() === 'New from Jira and Slack,Added by you' && /^3 · counts to clear/.test(ib.counts[0]) && /^1 · not counted/.test(ib.counts[1]) && ib.glyphs.join() === 'Jira,Jira,Slack,Yours' && ib.titles[3] === 'Is the payment-step experiment worth another week?' && ib.checks === 0 && /counts to clear only once you place it/.test(ib.note) && ib.focus === 'inbox', JSON.stringify(ib));
109
+ await p.focus('#qTabs [data-tab="inbox"]'); await p.keyboard.press('ArrowRight');
110
+ ok('M4 the arrow keys move between tabs', await p.evaluate(() => document.activeElement.dataset.tab === 'agents' && document.querySelector('#qTabs [aria-selected="true"]').dataset.tab === 'agents'));
105
111
  ok('M4 the add box has no Enter label', !(await p.evaluate(() => !!document.querySelector('#cap kbd'))));
106
- ok('M4 no suggestion, no estimate and no demo label is drawn', !(await p.evaluate(() => /Accept all|~\d+ min|demo/i.test(document.querySelector('#plate').textContent))));
112
+ ok('M4 no suggestion, no estimate and no demo label is drawn', !(await p.evaluate(() => /Accept all|~\d+ min|demo|fold the laundry|on the shelf|composts/i.test(document.querySelector('#queue').textContent))));
107
113
 
108
- /* M5 */
109
- const ag = await p.evaluate(() => ({ tiles: [...document.querySelectorAll('#pipe .pst')].map((x) => x.textContent.replace(/\s+/g, ' ').trim()), hot: document.querySelectorAll('#pipe .pst.hot').length, rows: [...document.querySelectorAll('#agl .ws')].map((x) => x.textContent), cap: document.querySelector('#agCap').textContent, hold: document.querySelector('#agHold').textContent, buttons: [...document.querySelectorAll('#agCard button')].map((b) => b.textContent).join('|') }));
110
- ok('M5 three counts from the agent field and the rows that are running or ready', ag.tiles.join() === '1Running,1Failed,1To review' && ag.hot === 0 && ag.rows.length === 3 && /draft ready to review/.test(ag.rows[0]) && /the run failed/.test(ag.rows.join()) && ag.cap === 'one to review', JSON.stringify(ag));
111
- ok('M5 the With agents card offers no press of its own, and says nothing is posted before a confirm', !/\b(Give to agent|Approve|Revise|Retry)\b/i.test(ag.buttons) && /Nothing is posted until you confirm it/.test(ag.hold));
112
- const tile = async (k) => { await p.click(`#pipe [data-ag="${k}"]`); return p.evaluate(() => ({ pressed: [...document.querySelectorAll('#pipe [aria-pressed="true"]')].map((b) => b.dataset.ag), rows: [...document.querySelectorAll('#agl .ws')].map((x) => x.textContent), empty: (document.querySelector('#agl .empty3') || {}).textContent || '', focus: document.activeElement && document.activeElement.dataset.ag })); };
114
+ /* M5 the Agents tab */
115
+ const ag = await p.evaluate(() => ({ shown: !document.querySelector('#qPipe').hidden, tiles: [...document.querySelectorAll('#qPipe .pst')].map((x) => x.textContent.replace(/\s+/g, ' ').trim()), hot: document.querySelectorAll('#qPipe .pst.hot').length, rows: [...document.querySelectorAll('#qBody .ws')].map((x) => x.textContent), cap: document.querySelector('#qCap').textContent, hold: document.querySelector('#qNote').textContent, buttons: [...document.querySelectorAll('#qBody button')].map((b) => b.textContent).join('|') }));
116
+ ok('M5 the Agents tab shows three counts from the agent field and the rows that are running, failed or ready', ag.shown && ag.tiles.join() === '1Running,1Failed,1To review' && ag.hot === 0 && ag.rows.length === 3 && /draft ready to review/.test(ag.rows[0]) && /the run failed/.test(ag.rows.join()) && /one draft to review/.test(ag.cap), JSON.stringify(ag));
117
+ ok('M5 the Agents tab offers no press of its own, and says nothing is posted before a confirm', !/\b(Give to agent|Approve|Revise|Retry)\b/i.test(ag.buttons) && /Nothing is posted until you confirm it/.test(ag.hold));
118
+ const tile = async (k) => { await p.click(`#qPipe [data-ag="${k}"]`); return p.evaluate(() => ({ pressed: [...document.querySelectorAll('#qPipe [aria-pressed="true"]')].map((b) => b.dataset.ag), rows: [...document.querySelectorAll('#qBody .ws')].map((x) => x.textContent), focus: document.activeElement && document.activeElement.dataset.ag })); };
113
119
  const tf = await tile('failed'), tr = await tile('ready'), tc = await tile('ready');
114
120
  ok('M5 a count filters the list to that state, a second press shows every item again, and focus stays on the tile', tf.pressed.join() === 'failed' && tf.rows.length === 1 && /the run failed/.test(tf.rows[0]) && tr.pressed.join() === 'ready' && tr.rows.length === 1 && /draft ready to review/.test(tr.rows[0]) && tc.pressed.length === 0 && tc.rows.length === 3 && tc.focus === 'ready', JSON.stringify({ tf, tr, tc }));
121
+ await qtab('upcoming');
122
+ ok('M5 the counts show only on the Agents tab', await p.evaluate(() => document.querySelector('#qPipe').hidden && document.querySelectorAll('#qBody .wrow').length === 2));
123
+ await qtab('today');
115
124
 
116
125
  /* M6 */
117
126
  const wt = await p.evaluate(() => ({ cap: document.querySelector('#waitCap').textContent, rows: [...document.querySelectorAll('#waitBody .wtit')].map((x) => x.textContent), subs: [...document.querySelectorAll('#waitBody .ws')].map((x) => x.textContent), nudge: /Nudge/.test(document.querySelector('#waitCard').textContent) }));
@@ -122,31 +131,32 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
122
131
  ok('M7 the untouched card counts the items from the review list', !rv.hidden && /^2 items have sat untouched for 7 days/.test(rv.txt), JSON.stringify(rv));
123
132
 
124
133
  /* M9 */
125
- ok('M9 the hero, the plate and the dock agree on one count', await p.evaluate(() => document.querySelector('#plateCap').textContent === '7 to clear' && document.querySelector('#dN').textContent === '7' && document.querySelector('#dLab').textContent === 'to clear'));
134
+ ok('M9 the hero, the Work queue and the dock agree on one count', await p.evaluate(() => /^7 to clear/.test(document.querySelector('#qCap').textContent) && document.querySelector('#dN').textContent === '7' && document.querySelector('#dLab').textContent === 'to clear'));
126
135
 
127
136
  /* M3 add */
128
137
  A.set({ status: 200, body: { ok: true, item: { id: 'item-new', title: 'Reply to Lee', due: null, priority: 'P1' } } });
129
138
  { const v = F.view(); v.work.inbox.push(F.it('item-new', 'Reply to Lee', { priority: 'P1' })); A.setModel(WP.build({ v, now: F.NOW })); }
130
139
  await p.fill('#capIn', 'Reply to Lee !p1'); await p.press('#capIn', 'Enter');
131
- ok('M3 one line is posted to the Work page\'s add route, and the page shows what was read', await until(() => A.posts.some((x) => x.path === '/api/pm-items/add' && x.body.line === 'Reply to Lee !p1' && Object.keys(x.body).join() === 'line')) && await until(() => txt('#capHint').then((t) => /Added: Reply to Lee \(P1\)\. It is in your tray until you place it\./.test(t))));
132
- ok('M3 a new item lands in the tray, not on the plate, and its dialog opens at once so it can be placed', await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && document.querySelector('#dTitle').textContent === 'Reply to Lee' && /Tray/.test(document.querySelector('#oMain').textContent) && !!document.querySelector('#trayBody [data-key="work:item-new"]') && !document.querySelector('#plateBody [data-key="work:item-new"]')), 6000));
140
+ ok('M3 one line is posted to the Work page\'s add route, and the page shows what was read', await until(() => A.posts.some((x) => x.path === '/api/pm-items/add' && x.body.line === 'Reply to Lee !p1' && Object.keys(x.body).join() === 'line')) && await until(() => txt('#capHint').then((t) => /Added: Reply to Lee \(P1\)\. It is in your inbox until you place it\./.test(t))));
141
+ ok('M3 a new item lands in the Inbox tab under Added by you, and its dialog opens at once so it can be placed', await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && document.querySelector('#dTitle').textContent === 'Reply to Lee' && /Inbox, added by you/.test(document.querySelector('#oMain').textContent) && document.querySelector('#qBody').dataset.tab === 'inbox' && !!document.querySelector('#qBody [data-key="work:item-new"]')), 6000));
133
142
  await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on'))); A.setModel(mk());
134
143
  const n0 = A.posts.length; await p.fill('#capIn', ' '); await p.press('#capIn', 'Enter'); await sleep(200);
135
144
  ok('M3 an empty line is not posted', A.posts.length === n0 && /Write one line/.test(await txt('#capHint')));
145
+ await qtab('today'); // a line with no date opened the queue on Inbox
136
146
 
137
147
  /* M8 presses from a check circle, and from the dialog */
138
148
  {
139
149
  const n = A.posts.length;
140
- await p.locator('.wrow[data-key="work:wbs:alpha:4.2"] .wck.dec').click(); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
150
+ await showKey(p, 'work:wbs:alpha:4.2'); await p.locator('.wrow[data-key="work:wbs:alpha:4.2"] .wck.dec').click(); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
141
151
  ok('M8 the eye circle opens the item to review the draft and posts nothing', A.posts.length === n && (await p.textContent('#dTitle')) === 'Sign off the fit-out contractor shortlist' && /Agent draft · not checked/.test(await p.textContent('#oMain')));
142
152
  await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
143
153
  }
144
- const openKey = async (key) => { await p.locator(`.wrow[data-key="${key}"] .wrh`).first().click(); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(700); };
154
+ const openKey = async (key) => { await showKey(p, key); await p.locator(`.wrow[data-key="${key}"] .wrh`).first().click(); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(700); };
145
155
  const shut = async () => { await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on'))); };
146
156
  const lastPost = () => A.posts[A.posts.length - 1];
147
157
  A.set({ status: 200, body: { ok: true } });
148
158
  const g0 = A.gets();
149
- await p.locator('.wrow[data-key="work:item-bbbbbbbbbbb2"] .wck').click();
159
+ await showKey(p, 'work:item-bbbbbbbbbbb2'); await p.locator('.wrow[data-key="work:item-bbbbbbbbbbb2"] .wck').click();
150
160
  ok('M8 a check circle posts Done with the item id only, offers Undo, and the page reads again', await until(() => A.posts.some((x) => x.path === '/api/pm-items/done' && Object.keys(x.body).join() === 'id' && x.body.id === 'item-bbbbbbbbbbb2')) && await until(() => p.evaluate(() => /Undo/.test(document.querySelector('#toast').textContent))) && await until(() => A.gets() > g0));
151
161
  await p.locator('#toast .undo').click();
152
162
  ok('M8 Undo posts Reopen for that item', await until(() => A.posts.some((x) => x.path === '/api/pm-items/reopen' && x.body.id === 'item-bbbbbbbbbbb2')));
@@ -200,7 +210,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
200
210
  /* M2 / M4 degraded: an empty list */
201
211
  {
202
212
  const E = await open({ model: WP.build({ v: { today: '2026-10-16', work: {} }, now: F.NOW }) });
203
- ok('M2 an empty list says so, in one sentence, and the plate says nothing waits', await E.page.evaluate(() => document.querySelector('#brief').textContent === 'Your list is empty.' && /Nothing waits to be sorted/.test(document.querySelector('#plateBody').textContent) && document.querySelector('#revCard').hidden && /Nobody owes you anything/.test(document.querySelector('#waitBody').textContent) && document.querySelector('#dN').textContent === '0'));
213
+ ok('M2 an empty list says so, in one sentence, and the Work queue says nothing is placed for today', await E.page.evaluate(() => document.querySelector('#brief').textContent === 'Your list is empty.' && /Nothing is placed for today/.test(document.querySelector('#qBody').textContent) && document.querySelector('#revCard').hidden && /Nobody owes you anything/.test(document.querySelector('#waitBody').textContent) && document.querySelector('#dN').textContent === '0'));
204
214
  await E.ctx.close();
205
215
  }
206
216
  {
@@ -208,13 +218,13 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
208
218
  const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), pg = await ctx.newPage();
209
219
  await pg.route('**/api/my-work-premium', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, state: 'error', error: 'the list could not be read' }) }));
210
220
  await pg.goto(BASE + '/premium-work.html');
211
- ok('M10 a failed read says why and shows nothing instead of a guess', await until(() => pg.evaluate(() => /The reason: the list could not be read/.test(document.querySelector('#brief').textContent) && document.querySelectorAll('#plateBody .wrow').length === 0), 5000));
221
+ ok('M10 a failed read says why and shows nothing instead of a guess', await until(() => pg.evaluate(() => /The reason: the list could not be read/.test(document.querySelector('#brief').textContent) && document.querySelectorAll('#qBody .wrow').length === 0), 5000));
212
222
  await ctx.close();
213
223
  }
214
224
 
215
225
  {
216
226
  const R = await open({ w: 820, h: 1000 }), t = R.page;
217
- await t.locator('.wrow[data-key="work:item-aaaaaaaaaaa1"] .wrh').click(); await until(() => t.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(900);
227
+ await showKey(t, 'work:item-aaaaaaaaaaa1'); await t.locator('.wrow[data-key="work:item-aaaaaaaaaaa1"] .wrh').click(); await until(() => t.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(900);
218
228
  const g = await t.evaluate(() => { const r = document.querySelector('#dlg').getBoundingClientRect(); return { l: Math.round(r.left), w: Math.round(r.width), vw: innerWidth, tabs: getComputedStyle(document.querySelector('#dTabs')).display }; });
219
229
  ok('M12 on a tablet (820 px) the dialog is centred with a 12 px margin, and the Detail / Conversation switch is shown', Math.abs(g.l - (g.vw - g.w) / 2) <= 2 && g.w === g.vw - 24 && g.tabs !== 'none', JSON.stringify(g));
220
230
  await R.ctx.close();
@@ -222,7 +232,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
222
232
  /* M12 floors on a phone, both themes */
223
233
  for (const theme of ['light', 'dark']) {
224
234
  const R = await open({ w: 390, h: 844, theme }), q = R.page;
225
- await q.locator('.wrow[data-key="work:item-aaaaaaaaaaa1"] .wrh').click(); await until(() => q.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(800);
235
+ await showKey(q, 'work:item-aaaaaaaaaaa1'); await q.locator('.wrow[data-key="work:item-aaaaaaaaaaa1"] .wrh').click(); await until(() => q.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(800);
226
236
  const geo = () => q.evaluate(() => { const r = document.querySelector('#dlg').getBoundingClientRect(); return { l: Math.round(r.left), w: Math.round(r.width), vw: innerWidth }; });
227
237
  const g1 = await geo();
228
238
  ok(`M12 at 390 px (${theme}) the dialog opens on Detail at the full width of the screen`, g1.l === 0 && g1.w === g1.vw, JSON.stringify(g1));
@@ -232,12 +242,12 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
232
242
  const m = await q.evaluate(() => { const hs = (sel) => [...document.querySelectorAll(sel)].map((b) => Math.round(b.getBoundingClientRect().height)); return { over: document.documentElement.scrollWidth > innerWidth + 1 || document.querySelector('#dlg').scrollWidth > document.querySelector('#dlg').clientWidth + 1, small: [].concat(hs('#card .cta'), hs('#card .seg2 button'), hs('#wOn'), hs('.askbar input'), hs('#askGo')).filter((h) => h < 44) }; });
233
243
  ok(`M12 at 390 px (${theme}) the dialog has no sideways scroll and every control is 44 px`, !m.over && m.small.length === 0, JSON.stringify(m));
234
244
  await q.keyboard.press('Escape'); await sleep(300);
235
- const pg = await q.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1, small: [...document.querySelectorAll('.wck, .capb, .wrh, #revBtn, .fchip')].filter((b) => !b.closest('[hidden]') && b.getBoundingClientRect().height < 44 && b.getBoundingClientRect().height > 0).map((b) => b.className + ':' + Math.round(b.getBoundingClientRect().height)) }));
245
+ const pg = await q.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1, small: [...document.querySelectorAll('.wck, .capb, .wrh, #revBtn, .fchip, .qtb')].filter((b) => !b.closest('[hidden]') && b.getBoundingClientRect().height < 44 && b.getBoundingClientRect().height > 0).map((b) => b.className + ':' + Math.round(b.getBoundingClientRect().height)) }));
236
246
  ok(`M12 at 390 px (${theme}) the page has no sideways scroll and every control is 44 px`, !pg.over && pg.small.length === 0, JSON.stringify(pg));
237
247
  await R.ctx.close();
238
248
  }
239
249
  {
240
- const R = await open(); await R.page.locator('.wrow[data-key="work:item-aaaaaaaaaaa1"] .wrh').first().focus();
250
+ const R = await open(); await showKey(R.page, 'work:item-aaaaaaaaaaa1'); await R.page.locator('.wrow[data-key="work:item-aaaaaaaaaaa1"] .wrh').first().focus();
241
251
  await R.page.keyboard.press('Enter'); await until(() => R.page.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
242
252
  ok('M12 the page behind a dialog is inert, Escape closes it and focus returns to the row', await R.page.evaluate(() => ['.rail', 'main.stage', '#dock'].every((s) => document.querySelector(s).inert)) && (await R.page.keyboard.press('Escape'), await until(() => R.page.evaluate(() => !document.querySelector('#dlg').classList.contains('on') && document.activeElement.classList.contains('wrh')))));
243
253
  await R.ctx.close();
@@ -250,11 +260,11 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
250
260
  await pg.goto(BASE + '/premium-work.html');
251
261
  ok('E1 on an empty scratch state the real page says the list is empty', await until(() => pg.evaluate(() => document.querySelector('#brief').textContent === 'Your list is empty.'), 20000));
252
262
  await pg.fill('#capIn', 'Reply to Rina about SSO !p1'); await pg.press('#capIn', 'Enter');
253
- ok('E2 an added line comes back through the real routes in the tray, with its priority, not counted to clear, and its dialog opens', await until(() => pg.evaluate(() => /Reply to Rina about SSO/.test(document.querySelector('#trayBody').textContent) && /P1/.test(document.querySelector('#trayBody').textContent) && !/Reply to Rina/.test(document.querySelector('#plateBody').textContent) && document.querySelector('#dN').textContent === '0' && document.querySelector('#dlg').classList.contains('on')), 15000));
263
+ ok('E2 an added line comes back through the real routes in the Inbox tab, with its priority, not counted to clear, and its dialog opens', await until(() => pg.evaluate(() => document.querySelector('#qBody').dataset.tab === 'inbox' && /Reply to Rina about SSO/.test(document.querySelector('#qBody').textContent) && /P1/.test(document.querySelector('#qBody').textContent) && /Added by you/.test(document.querySelector('#qBody').textContent) && document.querySelector('#dN').textContent === '0' && document.querySelector('#dlg').classList.contains('on')), 15000));
254
264
  await sleep(700);
255
265
  await pg.locator('#card [data-p="flag"]').click();
256
- ok('E3 Do today, pressed in that dialog, moves it from the tray to Today through the real route', await until(() => pg.evaluate(() => { const s = [...document.querySelectorAll('#plateBody .wsec')].find((x) => x.dataset.lane === 'today'); return !!s && /1 open/.test(s.textContent) && /Nothing in your tray/.test(document.querySelector('#trayBody').textContent) && document.querySelector('#dN').textContent === '1'; }), 15000));
257
- await pg.locator('#plateBody .wck').first().click();
266
+ ok('E3 Do today, pressed in that dialog, moves it from the Inbox to Today through the real route', await until(() => pg.evaluate(() => document.querySelector('#qTabs [data-tab="today"]').textContent === 'Today1' && document.querySelector('#qTabs [data-tab="inbox"]').textContent === 'Inbox0' && document.querySelector('#dN').textContent === '1'), 15000));
267
+ await pg.click('#qTabs [data-tab="today"]'); await pg.locator('#qBody .wck').first().click();
258
268
  ok('E4 the check circle marks it done, and the list is empty again', await until(() => pg.evaluate(() => document.querySelector('#brief').textContent === 'Your list is empty.' && document.querySelector('#dN').textContent === '0'), 15000));
259
269
  const api = await fetch(BASE + '/api/my-work-premium').then((r) => r.json());
260
270
  ok('E5 the model route answers ready with the list the Work page reads', api.ok && api.state === 'ready' && api.model.dock.needs === 0);
@@ -270,8 +280,10 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
270
280
  /* M12 fidelity against the mockup: computed style and geometry of the regions both pages have */
271
281
  if (!fs.existsSync(MOCKUP)) ok('M12 the mockup is in the repository', false, MOCKUP);
272
282
  else {
273
- const PAIRS = [['rail', '.rail'], ['name', '.top .name'], ['date', '.hero .date'], ['brief', '.brief'], ['cap', '.cap'], ['capin', '.cap input'], ['capbtn', '.cap .capb'], ['plate', '#plate'], ['heading', '#hPlate'], ['section', '#plateBody .wsec'], ['label', '#plateBody .wsec .label'], ['row', '#plateBody .wrow'], ['title', '#plateBody .wtit'], ['sub', '#plateBody .ws'], ['glyph', '#plateBody .wgl'], ['due', '#plateBody .due:not(.od)'], ['agents', '#agCard'], ['tile', '#pipe .pst:not(.hot)'], ['pipe', '#pipe'], ['waitrow', '#waitBody .wrow'], ['dock', '.dock']];
274
- const SKIP_GEOM = { 1280: ['row', 'section'], 390: ['heading', 'row', 'section'] };
283
+ /* the Work queue (PM, 2026-10-19) replaced the mockup's plate with one full-width card, so its parts are matched by style and not by place */
284
+ const PAIRS = [['rail', '.rail'], ['name', '.top .name'], ['date', '.hero .date'], ['brief', '.brief'], ['cap', '.cap'], ['capin', '.cap input'], ['capbtn', '.cap .capb'], ['plate', '#plate', '#queue'], ['heading', '#hPlate', '#hQueue'], ['row', '#plateBody .wrow:not(.first)', '#qBody .wrow:not(.first)'], ['title', '#plateBody .wrow:not(.first) .wtit', '#qBody .wrow:not(.first) .wtit'], ['sub', '#plateBody .wrow:not(.first) .ws', '#qBody .wrow:not(.first) .ws'], ['due', '#plateBody .due:not(.od)', '#qBody .due:not(.od)'], ['waitrow', '#waitBody .wrow'], ['dock', '.dock']];
285
+ const QUEUE = ['plate', 'heading', 'row', 'title', 'sub', 'due', 'waitrow'];
286
+ const SKIP_GEOM = { 1280: QUEUE, 390: QUEUE };
275
287
  const PROPS = ['fontSize', 'fontWeight', 'fontFamily', 'color', 'backgroundColor', 'borderRadius', 'paddingTop', 'paddingLeft', 'letterSpacing', 'lineHeight', 'boxShadow', 'backdropFilter', 'borderTopColor'];
276
288
  const grab = (pg, pairs) => pg.evaluate(([pairs, props]) => { const o = {}; for (const [n, s0] of pairs) { const s = (n === 'rail' || n === 'dock') ? s0 : 'main.stage:not([hidden]) ' + s0; const e = document.querySelector(s); if (!e) { o[n] = null; continue; } const cs = getComputedStyle(e), r = e.getBoundingClientRect(), v = { left: Math.round(r.left), width: Math.round(r.width) }; props.forEach((k) => { v[k] = cs[k]; }); o[n] = v; } return o; }, [pairs, PROPS]);
277
289
  for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
@@ -283,7 +295,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
283
295
  const R = await open({ w, h, theme: th }); await sleep(500);
284
296
  /* a theme change starts a .3 s box-shadow transition; on a slow runner it can still be running, so let every animation finish before reading styles */
285
297
  for (const pg of [m, R.page]) await pg.evaluate(() => Promise.all(document.getAnimations().filter((a) => a.effect && a.effect.getComputedTiming().iterations !== Infinity).map((a) => a.finished.catch(() => null)))).catch(() => null);
286
- const a = await grab(m, PAIRS), c = await grab(R.page, PAIRS), diffs = [];
298
+ const a = await grab(m, PAIRS.map(([n, s0]) => [n, s0])), c = await grab(R.page, PAIRS.map(([n, s0, s1]) => [n, s1 || s0])), diffs = [];
287
299
  for (const [n] of PAIRS) {
288
300
  if (!a[n] || !c[n]) { diffs.push(n + ' missing'); continue; }
289
301
  for (const k of Object.keys(a[n])) {
@@ -204,11 +204,11 @@ My work is the second place on the rail, at `/premium-work.html`. It reads the l
204
204
 
205
205
  **Row suggestions and buttons.** A row shows a suggestion line only when a record backs it: an agent's offer on the item, a draft that is ready, or a date. A row has no button of its own. Press the row to open the item, where you review a draft, start the agent, or give the item a day. To act without opening it, swipe the row or press the right or left arrow key. A row in Today goes to Done (or opens its draft when one is ready) on the right and to Tomorrow on the left. Any other row goes to Today on the right and to Someday on the left. A row from Jira shows its Jira key.
206
206
 
207
- **Weekly review.** A card lists five steps: sort the inbox, place your tray, check who owes you, review agent drafts, and look at what sat untouched. Each step shows a count from your list and opens its first item. **Start the review** opens the first step that has something. On a Friday the card reads Friday review. PMOS keeps no review schedule and no timing, so the card shows none. The tray's tabs are drawn from your own items (see below). Answers, ideas and reports an agent files by itself are not shown, because PMOS holds no records for them.
207
+ **Weekly review.** A card lists five steps: sort the inbox, place what you added, check who owes you, review agent drafts, and look at what sat untouched. Each step shows a count from your list and opens its first item. **Start the review** opens the first step that has something. On a Friday the card reads Friday review. PMOS keeps no review schedule and no timing, so the card shows none. Answers, ideas and reports an agent files by itself are not shown, because PMOS holds no records for them.
208
208
 
209
209
  **Decide.** An inbox row shows a **Decide** button that opens the item, where you give it a day, put it in Someday or drop it.
210
210
 
211
- **Tray tabs.** The tray has six tabs, each built from your item records: **To place**, **Ready** (an agent draft is ready), **Working** (an agent is running), **Kept** (you pressed Keep), **Used** (done in the last 7 days) and **Compost** (untouched for the review days). A row shows a button that fits its tab: Today, Review, Use it, or Let go.
211
+ **Work queue.** One full-width card holds everything you sort, as tabs in one row: **Today**, **Inbox**, **Agents**, **Upcoming**, **Someday**, **Kept** and **Done**. Each tab shows its count, and the card opens on Today (or on the first tab that has something). Rows sit in two columns, one column on a narrow screen. The left and right arrow keys move between tabs. **Inbox** shows what is new from Jira and Slack first, then what you added. **Agents** holds drafts ready, runs working and runs failed. **Kept** gathers items you pressed Keep on, and **Done** shows what you added and marked done in the last 7 days. An item shows in one place tab only. Kept is a mark on an item, not a place, so a kept item also shows where it was placed. The card replaces the earlier On your plate, With agents and tray cards.
212
212
 
213
213
  **The item dialog.** The dialog shows **Done**, **Not yet** (Later today, Tomorrow, Next week, Do today) and **Drop it**. **More** opens the rest: Edit, Who does each step, Not before, Someday and Waiting on someone. Every action stays reachable.
214
214
 
@@ -218,10 +218,10 @@ My work is the second place on the rail, at `/premium-work.html`. It reads the l
218
218
 
219
219
  - **The hero** is built from counts of your list: new in the inbox, overdue, due today, people who owe you something (and the longest wait), agent drafts to review, and items untouched for seven days. A clause with no record is left out.
220
220
  - **One count.** "To clear" is the inbox, plus today, plus agent drafts to review. The hero, the card and the dock use it.
221
- - **Add** takes one line, read by the Work page's own parser (`Reply to Rina about SSO by Friday !p1`). A new item with no date waits in **Your tray** and its dialog opens at once, so you can place it. An item with a date goes where its date says.
222
- - **Your tray** holds what you threw in and have not placed. It is not counted to clear until you place it (Do today, Later, Not yet, Waiting, Done or Drop).
223
- - **On your plate** has Inbox, Today, Upcoming and Someday. A row shows where it came from (Yours, Jira, Slack, Board) and a due chip only when a date was set. The round check marks it done, with Undo for a few seconds. "Do this first" appears only on an overdue item.
224
- - **With agents** counts running, failed and to-review drafts from each item's agent field. Press a count to show only the items in that state; press it again to show every item. The dark tile is the filter you picked. A draft is labelled "Agent draft, not checked" and is never counted as done. The agent itself is started, stopped, edited, sent back or approved in the item's dialog (see below).
221
+ - **Add** takes one line, read by the Work page's own parser (`Reply to Rina about SSO by Friday !p1`). A new item with no date waits in the **Inbox** tab, under Added by you. The card opens on that tab and the item's dialog opens at once, so you can place it. An item with a date goes where its date says.
222
+ - **What you added** and have not placed is not counted to clear until you place it (Do today, Later, Not yet, Waiting, Done or Drop).
223
+ - **The Work queue's place tabs** are Today, Inbox, Upcoming and Someday. A row shows where it came from (Yours, Jira, Slack, Board) and a due chip only when a date was set. The round check marks it done, with Undo for a few seconds. "Do this first" appears only on an overdue item.
224
+ - **The Agents tab** counts running, failed and to-review drafts from each item's agent field. Press a count to show only the items in that state; press it again to show every item. The dark tile is the filter you picked. A draft is labelled "Agent draft, not checked" and is never counted as done. The agent itself is started, stopped, edited, sent back or approved in the item's dialog (see below).
225
225
  - **Waiting on others** lists who you wait for and for how long. There is no nudge.
226
226
  - **An item's dialog** offers Done, Not yet (later today, tomorrow, next week), Do today, Waiting on a name, Drop (with Undo), and Keep for an item untouched for seven days. The read-only agent from "Asking the agent" is beside it. Below those is a tool row with four more presses, each through the Work page's own route:
227
227
  - **Edit** changes the title, due day, priority, who you wait on and the job. A title that Jira, the breakdown or the morning brief owns is read-only, and the panel says so. Only the fields you changed are saved, and Undo writes the old values back.
@@ -230,9 +230,9 @@ My work is the second place on the rail, at `/premium-work.html`. It reads the l
230
230
  - **Someday** sends the item to Someday. On an item already there, the same button brings it back.
231
231
  - **The agent on an item** appears at the top of the dialog when the item has one. A *suggestion* shows what the agent will do (you can change the words) and **Let the agent draft this**. A *queued or working* agent shows its state and **Stop**. A *ready* draft is labelled the agent's and unchecked. **Post it to Jira** (or Slack, email and so on, from where the item came) first asks, names the place, shows exactly the text and posts nothing until you press **Post it now**. **Edit the draft** lets you change the text, and the post sends your text. **Send it back with a note** needs a note. **Mark it done** posts nothing. A failed run says why and offers **Try again** and **Stop**. An item you added has no place to post to, so it has no Post.
232
232
  - **Focus** sits under the add line. It shows the first of the (at most three) things PMOS suggests for today, grouped by the job they serve, with **Accept**. **See all** lists them with Accept, Not today and Clear, and your jobs with their open counts, and **Add a job** takes one line (`when …, I want …, so …`). An accepted group tags its Today rows with Focus. Focus starts empty each day. Editing and deleting a job stay in the console.
233
- - **Keys and swipe** work on the rows of the plate and the tray. J and K move between rows. The right arrow, or a drag to the right past 90 px, does Done on a Today row and In Today elsewhere; the left arrow, or a drag to the left, does Tomorrow on a Today row and Someday elsewhere. A Today row whose draft is ready offers Review on the right. A row in Waiting has none. Each one offers Undo, and under reduced motion the row does not slide.
233
+ - **Keys and swipe** work on the rows of the Work queue. J and K move between rows. The right arrow, or a drag to the right past 90 px, does Done on a Today row and In Today elsewhere; the left arrow, or a drag to the left, does Tomorrow on a Today row and Someday elsewhere. A Today row whose draft is ready offers Review on the right. A row in Waiting has none. Each one offers Undo, and under reduced motion the row does not slide.
234
234
 
235
- Not drawn, because no record backs them: answers and ideas an agent files by itself, "fold the laundry", the week bars and the capacity figure, and the mockup's suggested place on an inbox item.
235
+ Not drawn, because no record backs them: answers and ideas an agent files by itself, "fold the laundry", the "Next day" demo control, shelf life and "composts soon", the week bars and the capacity figure, and the mockup's suggested place on an inbox item.
236
236
 
237
237
  ## Board
238
238
 
@@ -243,7 +243,7 @@ Board is the third place on the rail, at `/premium-board.html`. It reads what th
243
243
  - **By stage** has one column for each stage of the board's workflow with the board's own count and its first five initiatives.
244
244
  - **List** and **Timeline** show ten tasks a page with Previous and Next; **By stage** shows six cards a column with Show more. **Timeline** draws a bar for each initiative that has both a start and an end date, with the days left or over, and counts the rest. With no dates on record it says so and draws nothing.
245
245
  - **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.
246
- - **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; a repository with no run log says **No runs yet**. The line above the tiles starts with how many tiles need a look, and those tiles have a **Needs a look** chip and an orange outline. The line ends with **open Insights**, which opens the same board's Insights page. 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.
246
+ - **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, which keeps no history. From the first day the card is read, PMOS keeps their counts once a day in the workspace's state folder (`board-metric-history.jsonl`), so their charts start on that day and their caption says **history starts today** (later, the date). Earlier weeks read **Not kept yet**. Move over a chart, or use the arrow keys, to read a week. A tile that cannot be counted says **Not read** and why; a repository with no run log says **No runs yet**. The line above the tiles starts with how many tiles need a look, and those tiles have a **Needs a look** chip and an orange outline. The line ends with **open Insights**, which opens the same board's Insights page. Press a tile for its definition and values, with the read-only agent beside it. A target is set on Insights, not here. A measure with a target shows it under the value, draws it as a dashed line, and carries **On target** or its gap (for example **2 short**); off target, it also has the orange outline. A measure without a target draws no line. Day and Month are off. It was tested only on made-up repositories, not on a real IDPF or microsite repository.
247
247
  - **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.
248
248
  - **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.
249
249
  - **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.
@@ -285,6 +285,7 @@ Insights is the fourth place on the rail, at `/premium-insights.html`. It reads
285
285
  - **Choose a deck or a document, and read the design brief.** On the Design tab, the **Format** chip offers **Deck** and **Document** for the next version. Versions you already made keep their form. Once a design is saved, a **Design brief** chip shows what PMOS reads each cycle: your description, your samples, the reference version, and what stays the same, what changes and what PMOS learned. The cycles drafted to match it are checked on the report itself.
286
286
  - **Point, make the next version, compare.** On the Design tab, click any part of a slide to attach a request to that spot: a numbered pin appears, and you type the request under the preview (**Point and say**; the switch turns pointing off). **Make the next version** sends the typed line and every pinned request to PMOS, which makes the next version; the pins are cleared once it starts. **Compare two** shows the same slide of two versions side by side; pick the version on each side.
287
287
  - **What stands out.** Up to three plain sentences taken from the series: behind its line for three readings in a row, behind and still moving away from the target, closing in, slipped, reached its target, or a large one-step move. There is no forecast and no cause.
288
+ - **Board measures.** The same four tiles as the Board's Metrics card, counted from the board's repository and drawn the same way. Choose **8 weeks**, **26 weeks** or **52 weeks**; the page keeps your choice. Press a measure to read its definition and values and to set its target: type a number and press **Save target**, or press **Clear target**. For Corrections, Blocked and Idle, lower is better, so the target is the most you accept; for Merged a week it is the least. The target goes to the workspace's state folder (`board-metric-targets.jsonl`) and the Board draws it too. An agent session cannot set one.
288
289
  - **No series recorded.** A KR metric with one reading or none is listed with the reason and is not drawn.
289
290
  - **Ask PMOS to set up a report.** Type what the report is for and press **Ask**. A background run proposes a report and does nothing else. The request is listed as Working, then Ready to review. A ready request opens with its proposal: **Set it up**, **Change it** (say what to change; the run revises it), or **Cancel**.
290
291
  - **Found in your work.** Up to three reports PMOS found in your calendar, mail or documents, each with why and what it saw. **Set it up** records the report and drafts its first cycle as a file. **Not a report** hides it and records it after 5 seconds, unless you press **Undo**. If the finding changed while the window was open, the window says what happened. It was already set up, it was marked not a report, or a new scan replaced it. The list is read again. Close the window and open the report from the list. If PMOS does not hear back, the window says nothing was recorded. Press the button to try again.
@@ -292,7 +293,7 @@ Insights is the fourth place on the rail, at `/premium-insights.html`. It reads
292
293
  - **Documents.** The report files of the workspace, with cadence, slot and whether each is a draft or issued. Pressing one opens it on the page at the normal dialog size, with a status line (Draft or Issued, the saved design version, the file). The **slide deck / Document** menu picks the view: a deck is a title slide, then one slide for each section, with the arrow keys and a strip of slides; a document is a page. The **Read** menu holds **Present**, which shows the slide on the whole screen (the arrow keys move and Escape stops), and **Print or save as PDF**, which prints one slide to a page. **Download** gives PowerPoint, Word, Excel, CSV or the Markdown file; the files carry the words, not the look. **Open in the console** is where a document is edited or issued. Nothing is sent from this page.
293
294
  - **Shape a report's look.** On a draft, **Add a sample** takes a PDF, PowerPoint, Word, PNG or JPG file to follow. Say how it should look in the conversation; PMOS draws the next design version (D1, D2, …) and says what it changed. Press a version to go back to it. **This is it** saves the version shown as the report's design, and PMOS draws the cycle to match. An issued cycle is frozen with its look.
294
295
 
295
- Not built: a second measure next to a chart, bar highlights, speaker notes and notes on a slide, changing a set-up report's audience, format or schedule, tile sizes and free layout, the finder's settings, run-based charts such as corrections per 100 runs (they belong to the Board's Metrics card), and any measure no record holds. The console's own dashboards are separate and unchanged. KR metric records belong to a workspace, so every board of a workspace shows the same charts.
296
+ Not built: a second measure next to a chart, bar highlights, speaker notes and notes on a slide, changing a set-up report's audience, format or schedule, tile sizes and free layout, the finder's settings, and any measure no record holds. The console's own dashboards are separate and unchanged. KR metric records belong to a workspace, so every board of a workspace shows the same charts.
296
297
 
297
298
  ## Welcome
298
299