create-pmos 0.348.0 → 0.350.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.348.0",
3
+ "version": "0.350.0",
4
4
  "description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -32,6 +32,30 @@
32
32
  "audit"
33
33
  ],
34
34
  "pmosChanges": [
35
+ {
36
+ "v": "0.350.0",
37
+ "at": "2026-10-20T06:51:36.341Z",
38
+ "f": 2,
39
+ "prs": [
40
+ {
41
+ "n": 949,
42
+ "t": "The My work item dialog as labelled fields and one Done bar",
43
+ "s": "Each choice is one labelled field with its value from the record and a chevron, like a simple ordering app."
44
+ }
45
+ ]
46
+ },
47
+ {
48
+ "v": "0.349.0",
49
+ "at": "2026-10-20T06:33:28.050Z",
50
+ "f": 2,
51
+ "prs": [
52
+ {
53
+ "n": 947,
54
+ "t": "Simpler premium Decision dialog (evidence rows, one Why field, Later + Record bar)",
55
+ "s": "It follows the approved simple-UI mockup (#3)."
56
+ }
57
+ ]
58
+ },
35
59
  {
36
60
  "v": "0.348.0",
37
61
  "at": "2026-10-20T06:24:40.333Z",
@@ -267,35 +291,6 @@
267
291
  "s": "The prep read carries brief=1."
268
292
  }
269
293
  ]
270
- },
271
- {
272
- "v": "0.330.0",
273
- "at": "2026-10-20T00:02:20.686Z",
274
- "f": 2,
275
- "prs": [
276
- {
277
- "n": 925,
278
- "t": "Draw the premium calendar the way the console draws it",
279
- "s": "The grid follows the console's Calendar."
280
- },
281
- {
282
- "n": 917,
283
- "t": "Updates and What's new in premium Settings, with a summary per published kit",
284
- "s": "Premium Settings opens with Updates."
285
- }
286
- ]
287
- },
288
- {
289
- "v": "0.329.0",
290
- "at": "2026-10-19T23:44:17.780Z",
291
- "f": 2,
292
- "prs": [
293
- {
294
- "n": 911,
295
- "t": "Insights leads with an insight, the pinned dashboard on top, one paged list",
296
- "s": "The page opens with an insight: the strongest finding across the board's measures, the reason with its numbers, two more findings, and Ask PMOS why / See the chart."
297
- }
298
- ]
299
294
  }
300
295
  ]
301
296
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@d3097286
1
+ kernel-source: pmos@b162de35
2
2
  assembled: 2026-10-20
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-20T06:24:37Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-20T06:51:33Z"}
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-20T06:24:37Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-20T06:51:33Z"}
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-20T06:24:37Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-20T06:51:33Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -289,7 +289,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
289
289
  ok('R6 the right pane is a draft decision record that says nothing is written until Record', /Decision record/.test(dc.label) && /pm-decisions.md · draft entry/.test(dc.pane) && /Nothing is written to the journal until you press Record/.test(dc.pane) && /Choose an option to draft the entry/.test(dc.pane));
290
290
  await p.locator('#card .op').nth(1).click();
291
291
  const dc2 = await p.evaluate(() => ({ pressed: document.querySelector('#card .op[aria-pressed="true"]').textContent, cta: document.querySelector('#card .cta').textContent, dis: document.querySelector('#card .cta').disabled, pane: document.querySelector('#oMain').textContent }));
292
- ok('R6 choosing an option updates the button and the draft, and the button stays off', /Extend the date/.test(dc2.pressed) && /Record: extend/.test(dc2.cta) && dc2.dis && /Extend the date/.test(dc2.pane) && /extend the date/.test(dc2.pane), JSON.stringify(dc2).slice(0, 200));
292
+ ok('R6 choosing an option updates the button and the draft, and the button stays off', /Extend the date/.test(dc2.pressed) && /Record: extend/i.test(dc2.cta) && dc2.dis && /Extend the date/.test(dc2.pane) && /extend the date/.test(dc2.pane), JSON.stringify(dc2).slice(0, 200));
293
293
  ok('W3 "Not yet" has three live choices', dc.snooze);
294
294
  await p.keyboard.press('Escape');
295
295
  await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
@@ -338,7 +338,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
338
338
  const btn = () => pg.evaluate(() => { const b = document.querySelector('#recBtn'); return { dis: b.disabled, t: b.textContent.trim(), h: b.getBoundingClientRect().height }; });
339
339
  ok('W1 before a choice the record button is off', (await btn()).dis);
340
340
  await pg.locator('#card .op').nth(1).click();
341
- ok('W1 with a choice and no reason it is still off', (await btn()).dis && /Record: extend/.test((await btn()).t));
341
+ ok('W1 with a choice and no reason it is still off', (await btn()).dis && /Record: extend/i.test((await btn()).t));
342
342
  await pg.fill('#why', 'ab');
343
343
  ok('W1 a reason under three characters keeps it off', (await btn()).dis);
344
344
  await pg.fill('#why', 'Give it a quarter');
@@ -356,6 +356,8 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
356
356
  ok('W7 the page says where it was recorded', await pg.evaluate(() => /pm-decisions\.md/.test(document.querySelector('#toast').textContent)));
357
357
  // not yet
358
358
  await openIdx(3);
359
+ ok('W3 "Later" is one quiet button in the bottom bar, and its menu stays shut until pressed', await pg.evaluate(() => { const b = document.querySelector('#card .dbar #laterBtn'), m = document.querySelector('#laterMenu'); return !!b && b.getAttribute('aria-expanded') === 'false' && m.hidden && !!document.querySelector('#card .dbar #recBtn') && !document.querySelector('#card .mv2'); }));
360
+ await pg.click('#laterBtn');
359
361
  await pg.locator('#card .seg2 button[data-until="tomorrow"]').click();
360
362
  ok('W3 "Tomorrow" posts the key and the time, and closes the dialog', await until(() => posts.some((x) => x.path === '/api/briefing-premium/put-off' && x.body.key === 'decision:KC5' && x.body.until === 'tomorrow')) && await until(() => pg.evaluate(() => !document.querySelector('#dlg').classList.contains('on'))));
361
363
  // slice 3: the read-only agent behind the reply box
@@ -401,7 +403,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
401
403
  await until(() => q.evaluate(() => document.querySelectorAll('#rank .rr').length > 0));
402
404
  await q.locator('#rank .rhd').nth(3).click(); await until(() => q.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(800);
403
405
  await q.click('#dTabs [data-t="chat"]'); await sleep(300);
404
- await q.locator('#card .op').nth(0).click(); await q.fill('#why', 'A reason');
406
+ await q.locator('#card .op').nth(0).click(); await q.fill('#why', 'A reason'); await q.click('#laterBtn');
405
407
  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 .seg2 button'), hs('#recBtn'), hs('.askbar input'), hs('#askGo'), hs('#card .op')).filter((h) => h < 44) }; });
406
408
  ok('W10 at 390 px (' + theme + ') the decision card has no sideways scroll and every new control is 44 px', !m.over && m.small.length === 0, JSON.stringify(m));
407
409
  await c.close();
@@ -23,7 +23,9 @@ const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for
23
23
  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);
24
24
  const results = [];
25
25
  const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
26
- const more = async (pg) => { if (await pg.locator('#card [data-p="more"][aria-expanded="false"]').count()) await pg.click('#card [data-p="more"]'); };
26
+ /* the dialog's fields (premium-simple-ui): a field opens its panel; When holds Today, Not yet, Not before and Someday */
27
+ const field = async (pg, k) => { if (await pg.locator(`#card .ffd[data-k="${k}"][aria-expanded="false"]`).count()) await pg.click(`#card .ffd[data-k="${k}"]`); };
28
+ const more = (pg) => field(pg, 'when');
27
29
  let srv = null; let browser = null;
28
30
  const finish = async (code) => {
29
31
  if (browser) await browser.close().catch(() => {});
@@ -155,21 +157,26 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
155
157
  await p.locator('#toast .undo').click();
156
158
  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')));
157
159
  await openKey('work:item-aaaaaaaaaaa1');
158
- const dlg = await p.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, btn: [...document.querySelectorAll('#card button')].map((b) => b.textContent.trim()), mod: document.querySelector('#dlg').getAttribute('aria-modal'), ask: !!document.querySelector('#askGo'), wDis: true }));
159
- const quiet = dlg.btn.slice(3).join();
160
- await more(p); dlg.btn = [...(await p.evaluate(() => [...document.querySelectorAll('#card button')].map((b) => b.textContent.trim())))]; dlg.wDis = await p.evaluate(() => document.querySelector('#wBtn').disabled);
161
- ok('M8 a dialog offers the agent, Done, Not yet, Do today, More and Drop it; More opens the tool row and Waiting, and the agent box; Keep only where the review list holds the item', dlg.title === 'Decide how partial refunds are handled' && quiet === 'Let the agent draft this,Done,Later today,Tomorrow,Next week,Do today,More,Drop it' && dlg.btn.slice(3).join() === 'Let the agent draft this,Done,Later today,Tomorrow,Next week,Do today,Fewer options,Drop it,Edit,Who does each step,Not before…,Someday,Wait for them' && dlg.mod === 'true' && dlg.ask && dlg.wDis, JSON.stringify(dlg));
160
+ const dlg = await p.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, mod: document.querySelector('#dlg').getAttribute('aria-modal'), ask: !!document.querySelector('#askGo'),
161
+ fields: [...document.querySelectorAll('#card .ffd small')].map((x) => x.textContent).join(), when: document.querySelector('#card .ffd[data-k="when"] b').textContent,
162
+ bar: [...document.querySelectorAll('#card .fbar button')].map((b) => b.textContent.trim()).join(), solid: [...document.querySelectorAll('#card .fbar .cta')].length }));
163
+ await more(p); dlg.opts = await p.evaluate(() => [...document.querySelectorAll('#card .fmenu .fopt > span')].map((x) => x.textContent).join());
164
+ await field(p, 'wait'); dlg.wDis = await p.evaluate(() => document.querySelector('#wBtn').disabled);
165
+ ok('M8 a dialog shows labelled fields (the agent, When, Waiting on, Who does it, Priority · Due) and one bar with Done; When holds Today, Not yet, Not before and Someday; Waiting needs a name', dlg.title === 'Decide how partial refunds are handled'
166
+ && dlg.fields === 'The agent,When,Waiting on,Who does it,Priority · Due' && /^Inbox/.test(dlg.when) && dlg.bar === 'Drop it,Done' && dlg.solid === 1
167
+ && dlg.opts === 'Today,Later today,Tomorrow,Next week,Not before a date…,Someday' && dlg.mod === 'true' && dlg.ask && dlg.wDis, JSON.stringify(dlg));
168
+ await more(p);
162
169
  await p.locator('#card [data-p="notyet"][data-when="tomorrow"]').click();
163
170
  ok('M8 Not yet posts the item and the day, and closes the dialog', await until(() => A.posts.some((x) => x.path === '/api/pm-items/notyet' && x.body.id === 'item-aaaaaaaaaaa1' && x.body.when === 'tomorrow' && Object.keys(x.body).sort().join() === 'id,when')) && await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on'))));
164
171
  for (const [sel, route, check] of [['[data-p="flag"]', '/api/pm-items/flag', (b) => b.flagged === true], ['[data-p="xt"][data-k="someday"]', '/api/pm-items/someday', (b) => Object.keys(b).join() === 'id'], ['[data-p="done"]', '/api/pm-items/done', (b) => Object.keys(b).join() === 'id'], ['[data-p="remove"]', '/api/pm-items/remove', (b) => Object.keys(b).join() === 'id']]) {
165
172
  await openKey('work:item-aaaaaaaaaaa2'); const n = A.posts.length;
166
- if (sel.includes('someday')) await more(p);
173
+ if (sel.includes('someday') || sel.includes('flag')) await more(p);
167
174
  await p.locator('#card ' + sel).click();
168
175
  ok(`M8 ${route.split('/').pop()} posts exactly what the Work page's route takes`, await until(() => A.posts.length > n && lastPost().path === route && lastPost().body.id === 'item-aaaaaaaaaaa2' && check(lastPost().body)), JSON.stringify(lastPost()));
169
176
  await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
170
177
  }
171
178
  ok('M8 Done and Drop offer Undo for a short time', await p.evaluate(() => /Undo/.test(document.querySelector('#toast').textContent)));
172
- await openKey('work:item-aaaaaaaaaaa3'); await more(p); await p.fill('#wOn', ' Priya ');
179
+ await openKey('work:item-aaaaaaaaaaa3'); await field(p, 'wait'); await p.fill('#wOn', ' Priya ');
173
180
  ok('M8 Waiting needs a name', await p.evaluate(() => !document.querySelector('#wBtn').disabled));
174
181
  await p.click('#wBtn');
175
182
  ok('M8 Waiting posts the name', await until(() => A.posts.some((x) => x.path === '/api/pm-items/waiting' && x.body.id === 'item-aaaaaaaaaaa3' && x.body.on === 'Priya')));
@@ -256,8 +263,8 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
256
263
  await pg.fill('#capIn', 'Reply to Rina about SSO !p1'); await pg.press('#capIn', 'Enter');
257
264
  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));
258
265
  await sleep(700);
259
- await pg.locator('#card [data-p="flag"]').click();
260
- 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));
266
+ await more(pg); await pg.locator('#card [data-p="flag"]').click();
267
+ ok('E3 Today, picked in the When field of 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));
261
268
  await pg.click('#qTabs [data-tab="today"]'); await pg.locator('#qBody .wck').first().click();
262
269
  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));
263
270
  const api = await fetch(BASE + '/api/my-work-premium').then((r) => r.json());
@@ -1,4 +1,28 @@
1
1
  [
2
+ {
3
+ "v": "0.350.0",
4
+ "at": "2026-10-20T06:51:36.341Z",
5
+ "f": 2,
6
+ "prs": [
7
+ {
8
+ "n": 949,
9
+ "t": "The My work item dialog as labelled fields and one Done bar",
10
+ "s": "Each choice is one labelled field with its value from the record and a chevron, like a simple ordering app."
11
+ }
12
+ ]
13
+ },
14
+ {
15
+ "v": "0.349.0",
16
+ "at": "2026-10-20T06:33:28.050Z",
17
+ "f": 2,
18
+ "prs": [
19
+ {
20
+ "n": 947,
21
+ "t": "Simpler premium Decision dialog (evidence rows, one Why field, Later + Record bar)",
22
+ "s": "It follows the approved simple-UI mockup (#3)."
23
+ }
24
+ ]
25
+ },
2
26
  {
3
27
  "v": "0.348.0",
4
28
  "at": "2026-10-20T06:24:40.333Z",
@@ -209,7 +209,7 @@ Every markdown document opens as one page in a tab: a report, a PRD, a new docum
209
209
 
210
210
  A Confluence page or Google Doc opens as a tab too. From a document's **Copies**, press **Preview** on a copy. If the last check found the same text in both, the PMOS file is shown as the page, with **Same as PMOS** and the check time. If the copy changed, the tab says so and shows the PMOS version dimmed. **Use the … version** writes the copy's text into the PMOS file after five seconds; press **Undo** to stop it. From a meeting's **Material**, press the page icon on a Google Doc or Confluence link. PMOS holds only the address of such a page, so the tab says so. **Read it now** starts one session that reads the page with your connector and keeps the text in PMOS; it changes nothing in Google Docs or Confluence. The tab then shows the text with when it was read. Press **Read again** for later edits.
211
211
 
212
- A decision opens with no option chosen, because no recommendation is on record. Choose one and the draft entry on the right changes. Nothing is written. The main button, "Not yet" and "Return this run to the agent" are off in this version, and each says why.
212
+ A decision opens with no option chosen, because no recommendation is on record. Its card shows the evidence as label and value rows, the options, and one **Why** field. One bar at the bottom holds a quiet **Later ▾** and the only main button, named after your choice (for example **Record: Extend the date**). Choose one and the draft entry on the right changes. Nothing is written. The main button, "Not yet" and "Return this run to the agent" are off in this version, and each says why.
213
213
 
214
214
  ## The conversation
215
215
 
@@ -229,7 +229,7 @@ Each button writes one record, through a check that only a real press from this
229
229
  | Approve, Dismiss, Undo, Scan now, Stop (the horizon scan) | The scan's own records | `scan.jsonl` in the state folder |
230
230
  | Refresh, Refresh all (data freshness) | A new read of the source | the source's own store |
231
231
  | Done, Undo (the phone card) | The item is marked done, or reopened | the Work list |
232
- | Not yet: Later today, Tomorrow, Next week | A put-off record. The row leaves the list until then and the page names it. It does not count as done. | `briefing-premium-deferred.jsonl` in the state folder |
232
+ | Later ▾: Later today, Tomorrow, Next week | A put-off record. The row leaves the list until then and the page names it. It does not count as done. | `briefing-premium-deferred.jsonl` in the state folder |
233
233
 
234
234
  Later today means three hours from now. Tomorrow and Next week mean 09:00, tomorrow and next Monday.
235
235
 
@@ -258,7 +258,7 @@ My work is the second place on the rail, at `/premium-work.html`. It reads the l
258
258
 
259
259
  **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.
260
260
 
261
- **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.
261
+ **The item dialog.** The dialog shows one labelled field for each choice. Each field shows its value from the record and opens when you press it: **When** (Today, Later today, Tomorrow, Next week, Not before a date, Someday), **Waiting on**, **Who does it** (the steps) and **Priority · Due** (the edit panel). One bar at the bottom holds **Done**, with **Keep it** and **Drop it** beside it. Every action stays reachable.
262
262
 
263
263
  **The agent's draft.** The draft shows as formatted text in the detail panel on the right, labelled as the agent's and not checked, with **Open** and **Copy**. Its heading names the item ("Draft for IDPF-2989", or "Draft for you"), the round and the time of the latest round, and an approved step shows as "Step when you approve". A long draft is cut short, with **Show all**. It appears there as soon as the agent finishes, even while the dialog is open. The left column keeps the conversation (with **View round**) and the decision cards, in the console's words: **Post it to Jira** (marked outward, with exactly the text that goes), **Edit the draft**, **Keep it as a draft** and **Mark it done**. Post asks you to confirm the exact text first, and nothing is posted before that.
264
264
 
@@ -271,12 +271,14 @@ My work is the second place on the rail, at `/premium-work.html`. It reads the l
271
271
  - **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.
272
272
  - **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).
273
273
  - **Waiting on others** lists who you wait for and for how long. There is no nudge.
274
- - **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:
275
- - **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.
276
- - **Who does each step** lists the item's steps. Each step is done by You, the Agent drafts it, or the Agent does it. A step that sends something to a person is only ever drafted by the agent, and the page says when it set that for you. **Add** adds a step.
277
- - **Not before** hides the item until a day: Tomorrow, Monday, In a week, or a date you pick. **Clear the date** brings it back.
278
- - **Someday** sends the item to Someday. On an item already there, the same button brings it back.
279
- - **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.
274
+ - **An item's dialog** offers Done, Drop (with Undo), and Keep for an item untouched for seven days, in the bar at the bottom. Its fields hold the rest, each through the Work page's own route:
275
+ - **When** shows where the item is (Today, Inbox, Upcoming, Waiting, Someday, or Not before a day). It offers Today, Not yet (later today, tomorrow, next week), Not before a date and Someday.
276
+ - **Waiting on** shows who you wait on, or Nobody. Type a name and press **Wait for them**.
277
+ - **Priority · Due** opens the edit panel. It 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.
278
+ - **Who does it** names who does the steps and how many there are. It lists the item's steps. Each step is done by You, the Agent drafts it, or the Agent does it. A step that sends something to a person is only ever drafted by the agent, and the page says when it set that for you. **Add** adds a step.
279
+ - **Not before a date** (in When) hides the item until a day: Tomorrow, Monday, In a week, or a date you pick. **Clear the date** brings it back.
280
+ - **Someday** (in When) sends the item to Someday. On an item already there, **Bring back from Someday** brings it back.
281
+ - **The agent on an item** appears at the top of the dialog when the item has one. A *suggestion* is a field, **The agent**, that opens to show 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.
280
282
  - **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.
281
283
  - **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.
282
284
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.348.0",
3
+ "version": "0.350.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.348.0",
9
+ "version": "0.350.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.348.0",
3
+ "version": "0.350.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",
@@ -17,7 +17,9 @@ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
17
17
  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); } };
18
18
  const results = [];
19
19
  const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
20
- const more = async (pg) => { if (await pg.locator('#card [data-p="more"][aria-expanded="false"]').count()) await pg.click('#card [data-p="more"]'); };
20
+ /* the dialog's fields (premium-simple-ui): a field opens its panel; When holds Today, Not yet, Not before and Someday */
21
+ const field = async (pg, k) => { if (await pg.locator(`#card .ffd[data-k="${k}"][aria-expanded="false"]`).count()) await pg.click(`#card .ffd[data-k="${k}"]`); };
22
+ const more = (pg) => field(pg, 'when');
21
23
  let srv = null; let browser = null;
22
24
  const finish = async (code) => {
23
25
  if (browser) await browser.close().catch(() => {});
@@ -128,9 +130,9 @@ const mk = (edit) => { const v = F.view(); if (edit) edit(v); return WP.build({
128
130
 
129
131
  /* W3 steps */
130
132
  await openKey(p, 'work:item-bbbbbbbbbbb2');
131
- await more(p); const sbtn = await txt('[data-p="xt"][data-k="steps"]');
132
- ok('W3 the tool row counts the item\'s steps', /Who does each step · 2/.test(sbtn), sbtn);
133
- await more(p); await p.click('[data-p="xt"][data-k="steps"]');
133
+ const sbtn = await txt('[data-p="xt"][data-k="steps"]');
134
+ ok('W3 the Who does it field counts the item\'s steps and names who does them', /Who does it/.test(sbtn) && /You, Agent drafts · 2 steps/.test(sbtn), sbtn);
135
+ await field(p, 'steps');
134
136
  const st = await p.evaluate(() => ({ items: [...document.querySelectorAll('.xsteps li .xst')].map((x) => x.textContent), pressed: [...document.querySelectorAll('.xsteps [aria-pressed="true"]')].map((x) => x.textContent), h: [...document.querySelectorAll('.xpan .cta, .xpan input')].map((b) => Math.round(b.getBoundingClientRect().height)) }));
135
137
  ok('W3 each step shows who does it, from the record', st.items.join('|') === 'List the open questions|Send the agenda to the team' && st.pressed.join() === 'You,Agent drafts' && st.h.every((x) => x >= 44), JSON.stringify(st));
136
138
  A.replies['/api/pm-items/steps/who'] = { ok: true, who: 'agent-drafts', forced: true };
@@ -146,7 +148,7 @@ const mk = (edit) => { const v = F.view(); if (edit) edit(v); return WP.build({
146
148
 
147
149
  /* W4 Not before */
148
150
  await openKey(p, 'work:item-ccccccccccc1');
149
- await more(p); ok('W4 an item with a Not before day says it on the tool', /From 18 Oct/.test(await txt('[data-p="xt"][data-k="defer"]')));
151
+ ok('W4 an item with a Not before day says it on the When field', /Not before 18 Oct/.test(await txt('#card .ffd[data-k="when"]')));
150
152
  await more(p); await p.click('[data-p="xt"][data-k="defer"]');
151
153
  const dq = await p.evaluate(() => [...document.querySelectorAll('[data-p="xdq"]')].map((b) => [b.textContent, b.dataset.v].join('=')));
152
154
  ok('W4 Tomorrow, Monday and In a week are dates from the server\'s day (Fri 16 Oct)', dq.join() === 'Tomorrow=2026-10-17,Monday=2026-10-19,In a week=2026-10-23', dq.join());
@@ -169,13 +171,13 @@ const mk = (edit) => { const v = F.view(); if (edit) edit(v); return WP.build({
169
171
  ok('W9 Undo posts unpark', A.last().path === '/api/pm-items/unpark' && A.last().body.id === 'item-aaaaaaaaaaa2', JSON.stringify(A.last()));
170
172
  await dlgOff(p);
171
173
  await openKey(p, 'work:item-eeeeeeeeeee1');
172
- await more(p); ok('W5 an item already in Someday says so and the press brings it back', /In Someday/.test(await txt('[data-p="xt"][data-k="someday"]')) && await p.evaluate(() => document.querySelector('[data-p="xt"][data-k="someday"]').getAttribute('aria-pressed') === 'true'));
174
+ await more(p); ok('W5 an item already in Someday says so and the press brings it back', /Someday/.test(await txt('#card .ffd[data-k="when"]')) && /Bring back from Someday/.test(await txt('[data-p="xt"][data-k="someday"]')) && await p.evaluate(() => document.querySelector('[data-p="xt"][data-k="someday"]').getAttribute('aria-pressed') === 'true'));
173
175
  await more(p); await p.click('[data-p="xt"][data-k="someday"]');
174
176
  ok('W5 …by posting unpark', await wait(() => A.last().path === '/api/pm-items/unpark' && A.last().body.id === 'item-eeeeeeeeeee1'), JSON.stringify(A.last()));
175
177
  await dlgOff(p);
176
178
 
177
179
  /* W7 the agent */
178
- await openKey(p, 'work:item-aaaaaaaaaaa1');
180
+ await openKey(p, 'work:item-aaaaaaaaaaa1'); await field(p, 'agent');
179
181
  const ag1 = await p.evaluate(() => ({ state: document.querySelector('.agblk').dataset.state, ask: document.querySelector('#agAsk').value, say: document.querySelector('.agblk .nodef').textContent, btn: [...document.querySelectorAll('.agblk button')].map((b) => b.textContent.trim()) }));
180
182
  ok('W7 a suggestion shows what the agent will do, where nothing goes, the three choices and the press of the picked one', ag1.state === 'suggest' && ag1.ask === 'Draft your reply: partial refunds' && /Nothing goes to Jira until you post it/.test(ag1.say) && ag1.btn.length === 4 && /^SuggestedLet the agent draft this/.test(ag1.btn[0]) && /^Do it today/.test(ag1.btn[1]) && /^Not before /.test(ag1.btn[2]) && ag1.btn[3] === 'Let the agent draft this', JSON.stringify(ag1));
181
183
  await p.fill('#agAsk', 'Draft your reply: partial refunds, short');
@@ -358,7 +360,7 @@ const mk = (edit) => { const v = F.view(); if (edit) edit(v); return WP.build({
358
360
  ok('E8 Someday parks the real record', (await get('/api/pm-items')).work.someday.some((i) => i.id === it.id));
359
361
  await undoOf(pg, true); await sleep(300);
360
362
  ok('E9 Undo brings it back (unpark)', !(await get('/api/pm-items')).work.someday.some((i) => i.id === it.id));
361
- await pg.locator('#qBody .wrh').first().click(); await dlgOn(pg); await sleep(700); await pg.click('[data-p="flag"]'); await dlgOff(pg);
363
+ await pg.locator('#qBody .wrh').first().click(); await dlgOn(pg); await sleep(700); await more(pg); await pg.click('[data-p="flag"]'); await dlgOff(pg);
362
364
  ok('E10 once the item is in Today, Focus suggests it and the bar says why', await until(() => pg.evaluate(() => /Suggested · /.test(document.querySelector('#xFocus').textContent)), 8000));
363
365
  await pg.click('#xFocus [data-xf="acc"]');
364
366
  ok('E11 Accept writes the group to today\'s Focus, and the Today row carries the Focus tag', await until(async () => (await get('/api/pm-items')).focus.accepted.length === 1, 8000) && (await qTab(pg, 'today'), await until(() => pg.evaluate(() => !!document.querySelector('#qBody .xfc')), 8000)));
@@ -170,6 +170,10 @@ function decideHtml(r, a, step, w) {
170
170
 
171
171
  /* the agent block: one state, the controls that state allows, and nothing is posted before the confirm */
172
172
  function agentHtml(r) {
173
+ const a = r.dialog.agent, h = a ? agentInner(r) : '';
174
+ return h ? `<div class="agblk" data-state="${esc(a.state)}"><p class="ct">The agent</p>${h}</div>` : '';
175
+ }
176
+ function agentInner(r) {
173
177
  const a = r.dialog.agent;
174
178
  if (!a) return '';
175
179
  const w = a.where || 'anyone', dr = a.draft;
@@ -194,17 +198,35 @@ function agentHtml(r) {
194
198
  } else if (a.state === 'sent') {
195
199
  h = `<p class="nodef" role="status">${a.mine ? 'The draft is kept on this item.' : `You posted it to ${esc(w)}${a.sent_at ? ' at ' + esc(hhmm(a.sent_at)) : ''}.`}${a.link ? ` <a href="${esc(a.link)}" target="_blank" rel="noopener">Open what was posted</a>` : ''}</p>${draftBox}`;
196
200
  }
197
- return h ? `<div class="agblk" data-state="${esc(a.state)}"><p class="ct">The agent</p>${h}</div>` : '';
201
+ return h;
198
202
  }
199
203
 
200
- /* the tool row: Edit, Who does each step, Not before, Someday, and the panel of the one that is open */
201
- function toolsHtml(r) {
202
- const d = r.dialog, x = ui.xp || '', S = d.steps || [], nb = d.defer && d.defer > M.today ? d.defer : null;
203
- const b = (k, l) => `<button class="xtb" data-p="xt" data-k="${k}" aria-expanded="${x === k}">${l}</button>`;
204
- let h = `<div class="xtools" role="group" aria-label="More for this item">${b('edit', 'Edit')}${b('steps', 'Who does each step' + (S.length ? ' · ' + S.length : ''))}${b('defer', nb ? 'From ' + esc(dayLabel(nb)) : 'Not before…')}<button class="xtb" data-p="xt" data-k="someday" aria-pressed="${d.someday}">${d.someday ? 'In Someday' : 'Someday'}</button></div>`;
204
+ /* the dialog's fields (initiative premium-simple-ui): one labelled field for each choice, showing its value from the record, with a chevron.
205
+ * A field opens its panel under it, one at a time. When holds Today, Not yet, Not before and Someday; Waiting on, Who does it and Priority · Due
206
+ * hold the Waiting, Steps and Edit panels. One action bar at the bottom: Done, with Keep it and Drop it beside it. Every press is the same route as before. */
207
+ const CHEV = '<svg class="i chev" viewBox="0 0 24 24"><path d="m6 9 6 6 6-6"/></svg>';
208
+ const PLACE = { today: ['Today', ''], inbox: ['Inbox', 'not placed yet'], tray: ['Not placed yet', 'you added it'], upcoming: ['Upcoming', ''], waiting: ['Waiting', ''], someday: ['Someday', ''] };
209
+ function whenOf(r) {
210
+ const d = r.dialog, nb = d.defer && d.defer > M.today ? d.defer : null;
211
+ if (nb) return ['Not before ' + dayLabel(nb), 'off your lists until then'];
212
+ const p = PLACE[r.list] || ['On your list', ''];
213
+ return r.list === 'upcoming' && d.edit.due ? [p[0], 'due ' + dayLabel(d.edit.due)] : p;
214
+ }
215
+ function fieldHtml(k, label, val, sub, open) {
216
+ return `<button class="ffd" data-p="xt" data-k="${k}" aria-expanded="${open}"><span class="ffv"><small>${esc(label)}</small><b>${esc(val)}${sub ? ` <em>· ${esc(sub)}</em>` : ''}</b></span>${CHEV}</button>`;
217
+ }
218
+ function panelHtml(r, x) {
219
+ const d = r.dialog, a = d.write.actions, S = d.steps || [];
220
+ if (x === 'agent') return `<div class="xpan agblk" data-state="${esc(d.agent.state)}">${agentInner(r)}</div>`;
221
+ if (x === 'when') {
222
+ const o = (attrs, l, sub) => `<button class="fopt" ${attrs}><span>${l}</span>${sub ? `<small>${sub}</small>` : ''}</button>`;
223
+ return `<div class="xpan fmenu" role="group" aria-label="When">${a.includes('flag') ? o('data-p="flag"', 'Today') : ''}${NOTYET.map(([k, t]) => o(`data-p="notyet" data-when="${k}"`, t, 'comes back by itself')).join('')}`
224
+ + o('data-p="xt" data-k="defer"', 'Not before a date…', 'leaves your lists') + o(`data-p="xt" data-k="someday" aria-pressed="${d.someday}"`, d.someday ? 'Bring back from Someday' : 'Someday') + '</div>';
225
+ }
226
+ if (x === 'wait') return `<div class="xpan"><div class="cact two"><input id="wOn" class="why one" maxlength="80" placeholder="A name" aria-label="Waiting on" autocomplete="off" value="${esc(ui.wo)}"><button class="cta quiet" data-p="waiting" id="wBtn"${ui.wo.trim() ? '' : ' disabled'}><span>Wait for them</span></button></div></div>`;
205
227
  if (x === 'edit') {
206
228
  const e = ui.ed || (ui.ed = { title: d.edit.title, due: d.edit.due, priority: d.edit.priority, wo: d.edit.waiting_on, job: d.edit.job }), ro = !!d.edit.title_ro;
207
- h += `<div class="xpan"><label class="xf"><span>Title</span><input id="xeT" maxlength="250" value="${esc(e.title)}"${ro ? ' disabled' : ''}></label>${ro ? `<p class="note">${esc(d.edit.title_ro)}</p>` : ''}`
229
+ return `<div class="xpan"><label class="xf"><span>Title</span><input id="xeT" maxlength="250" value="${esc(e.title)}"${ro ? ' disabled' : ''}></label>${ro ? `<p class="note">${esc(d.edit.title_ro)}</p>` : ''}`
208
230
  + `<label class="xf"><span>Due</span><input type="date" id="xeD" value="${esc(e.due)}"></label>`
209
231
  + `<div class="xf"><span>Priority</span><span class="seg2" role="group" aria-label="Priority">${PRIS.map((p) => `<button data-p="xpri" data-v="${p}" aria-pressed="${e.priority === p}">${p || 'None'}</button>`).join('')}</span></div>`
210
232
  + `<label class="xf"><span>Waiting on</span><input id="xeW" maxlength="80" value="${esc(e.wo)}" placeholder="A name moves it to Waiting"></label>`
@@ -212,29 +234,37 @@ function toolsHtml(r) {
212
234
  + `<div class="cact two"><button class="cta" data-p="xsave">${CHECK}<span>Save</span></button><button class="cta alt" data-p="xt" data-k="edit"><span>Cancel</span></button></div></div>`;
213
235
  }
214
236
  if (x === 'steps') {
215
- h += `<div class="xpan"><ul class="xsteps">${S.map((s) => `<li><span class="xst">${esc(s.text)}</span><span class="seg2" role="group" aria-label="Who does: ${esc(s.text)}">${WHO.map(([k, l]) => `<button data-p="xwho" data-sid="${esc(s.id)}" data-v="${k}" aria-pressed="${s.who === k}">${l}</button>`).join('')}</span></li>`).join('') || '<li class="note">No steps yet.</li>'}</ul>`
237
+ return `<div class="xpan"><ul class="xsteps">${S.map((s) => `<li><span class="xst">${esc(s.text)}</span><span class="seg2" role="group" aria-label="Who does: ${esc(s.text)}">${WHO.map(([k, l]) => `<button data-p="xwho" data-sid="${esc(s.id)}" data-v="${k}" aria-pressed="${s.who === k}">${l}</button>`).join('')}</span></li>`).join('') || '<li class="note">No steps yet.</li>'}</ul>`
216
238
  + `<p class="note">A step that sends something to a person is only ever drafted by the agent. You release it.</p>`
217
239
  + `<div class="xadd"><input id="xsIn" maxlength="200" placeholder="Add a step" aria-label="A new step" value="${esc(ui.sn)}"><button class="cta alt" data-p="xsadd">Add</button></div></div>`;
218
240
  }
219
241
  if (x === 'defer') {
220
242
  const dd = ui.dd || '';
221
- h += `<div class="xpan"><p class="note">It leaves your lists until that day.</p><span class="seg2" role="group" aria-label="Quick dates"><button data-p="xdq" data-v="${addIso(M.today, 1)}">Tomorrow</button><button data-p="xdq" data-v="${nextMonday(M.today)}">Monday</button><button data-p="xdq" data-v="${addIso(M.today, 7)}">In a week</button></span>`
243
+ return `<div class="xpan"><p class="note">It leaves your lists until that day.</p><span class="seg2" role="group" aria-label="Quick dates"><button data-p="xdq" data-v="${addIso(M.today, 1)}">Tomorrow</button><button data-p="xdq" data-v="${nextMonday(M.today)}">Monday</button><button data-p="xdq" data-v="${addIso(M.today, 7)}">In a week</button></span>`
222
244
  + `<label class="xf"><span>Or a date</span><input type="date" id="xdD" min="${addIso(M.today, 1)}" value="${esc(dd)}"></label>`
223
245
  + `<div class="cact two"><button class="cta" data-p="xdgo"${dd ? '' : ' disabled'}>${CHECK}<span>Not before ${dd ? esc(dayLabel(dd)) : 'that day'}</span></button>${d.defer ? '<button class="cta alt" data-p="xdclr"><span>Clear the date</span></button>' : ''}</div></div>`;
224
246
  }
225
- return h;
247
+ return '';
226
248
  }
227
249
  function cardInner(r) {
228
- const d = r.dialog, a = d.write.actions;
229
- const open = ui.more || !!ui.xp, move = a.includes('flag');
230
- const more = toolsHtml(r)
231
- + (a.includes('waiting') ? `<label class="whyl" for="wOn">Waiting on someone</label><div class="cact two"><input id="wOn" class="why one" maxlength="80" placeholder="A name" autocomplete="off" value="${esc(ui.wo)}"><button class="cta quiet" data-p="waiting" id="wBtn"${ui.wo.trim() ? '' : ' disabled'}><span>Wait for them</span></button></div>` : '');
232
- return agentHtml(r) + `<p class="ct">What you can do</p>`
233
- + `<div class="cact two"><button class="cta" data-p="done">${CHECK}<span>Done</span></button>${a.includes('keep') ? '<button class="cta quiet" data-p="keep"><span>Keep it</span></button>' : ''}</div>`
234
- + `<div class="mv2">Not yet <span class="seg2">${NOTYET.map(([k, t]) => `<button data-p="notyet" data-when="${k}">${t}</button>`).join('')}${move ? '<button data-p="flag">Do today</button>' : ''}</span></div>`
235
- + `<div class="cact two"><button class="cta quiet xmore" data-p="more" aria-expanded="${open}" aria-controls="xmoreBox"><span>${open ? 'Fewer options' : 'More'}</span></button><button class="cta quiet" data-p="remove"><span>Drop it</span></button></div>`
236
- + (open ? `<div id="xmoreBox" class="xmorebox">${more}</div>` : '')
237
- + '<p class="nodef err" id="cardErr" role="alert" hidden></p>';
250
+ const d = r.dialog, a = d.write.actions, x = ui.xp || '', S = d.steps || [], e = d.edit, ag = d.agent;
251
+ const steps = S.length ? S.length + (S.length === 1 ? ' step' : ' steps') : 'no steps yet';
252
+ const whos = [...new Set(S.map((s) => (WHO.find((w) => w[0] === s.who) || [0, 'You'])[1]))];
253
+ const fld = (k, label, val, sub, open = x === k) => fieldHtml(k, label, val, sub, open) + (open ? panelHtml(r, k) : '');
254
+ const when = whenOf(r);
255
+ let h = '';
256
+ /* an agent that is working, ready, failed or posted needs the PM's eye, so its block stays open; one that only can draft is a field */
257
+ if (ag && ag.state === 'suggest') h += fld('agent', 'The agent', 'Can draft this for you', ag.mine ? 'nothing leaves PMOS' : 'you read it first');
258
+ else h += agentHtml(r);
259
+ h += `<div class="ffds">`
260
+ + fieldHtml('when', 'When', when[0], when[1], x === 'when' || x === 'defer') + (x === 'when' || x === 'defer' ? panelHtml(r, x) : '')
261
+ + fld('wait', 'Waiting on', e.waiting_on || 'Nobody', '')
262
+ + fld('steps', 'Who does it', whos.length ? whos.join(', ') : 'You', steps)
263
+ + fld('edit', 'Priority · Due', e.priority || 'None', e.due ? 'due ' + dayLabel(e.due) : 'no date')
264
+ + `</div>`;
265
+ h += `<div class="fbar"><div class="fmeta">${a.includes('keep') ? '<button class="flink" data-p="keep">Keep it</button>' : ''}<button class="flink" data-p="remove">Drop it</button></div>`
266
+ + `<button class="cta fdone" data-p="done">${CHECK}<span>Done</span></button></div>`;
267
+ return h + '<p class="nodef err" id="cardErr" role="alert" hidden></p>';
238
268
  }
239
269
  const cardHtml = (r) => `<div class="acard" id="card">${cardInner(r)}</div>`;
240
270
  function paneHtml(r) {
@@ -2262,6 +2262,48 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
2262
2262
  .ub{white-space:normal}
2263
2263
  .toolline{display:block;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font:400 var(--fs-1) var(--mono);color:var(--ink-3);opacity:.85}
2264
2264
  .toolline::before{content:"";display:inline-block;vertical-align:middle;margin:0 8px 2px 0;width:6px;height:6px;border-radius:50%;background:var(--ink-3);opacity:.6}
2265
+ /* The item dialog's labelled fields and one action bar (initiative premium-simple-ui): a small label, the value from the record, a chevron.
2266
+ A field opens its panel under it. The bar holds one solid button, Done; Keep it and Drop it are plain words beside it. */
2267
+ .ffds{display:grid;gap:10px}
2268
+ .ffd{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:60px;padding:10px 16px;border-radius:16px;background:var(--card);box-shadow:inset 0 0 0 1px var(--hair);text-align:left;transition:box-shadow .25s}
2269
+ .ffd:hover,.ffd[aria-expanded="true"]{box-shadow:inset 0 0 0 1.5px var(--b3)}
2270
+ .ffv{min-width:0}.ffv small{display:block;font-size:var(--fs-2);color:var(--ink-3)}
2271
+ .ffv b{display:block;font-size:var(--fs-4);font-weight:500;line-height:1.3;overflow-wrap:anywhere}.ffv em{font-style:normal;font-weight:400;color:var(--ink-3);font-size:var(--fs-3)}
2272
+ .ffd .chev{color:var(--ink-2);transition:transform .25s var(--ease)}.ffd[aria-expanded="true"] .chev{transform:rotate(180deg)}
2273
+ .fmenu{padding:6px;gap:2px}
2274
+ .fopt{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;padding:0 12px;border-radius:10px;font-size:var(--fs-3)}
2275
+ .fopt:hover,.fopt[aria-pressed="true"]{background:var(--well)}.fopt small{font-size:var(--fs-2);color:var(--ink-3)}
2276
+ .fbar{display:grid;gap:10px;padding-top:14px;border-top:1px solid var(--hair)}
2277
+ .fmeta{display:flex;justify-content:flex-end;gap:4px}
2278
+ .flink{min-height:44px;padding:0 10px;font-size:var(--fs-3);font-weight:500;color:var(--ink-2);text-decoration:underline;text-underline-offset:3px}.flink:hover{color:var(--ink)}
2279
+ .fdone{width:100%;justify-content:center;height:52px;font-size:var(--fs-4)}
2280
+ @media (max-width:640px){.acard .fdone{height:52px}}
2281
+ /* Simple Decision dialog (premium-simple-ui #3): evidence as label-value rows, the reason as one labelled field, one bottom bar with Later ▾ and Record */
2282
+ .dsim{gap:12px}
2283
+ .dsim .dkv{margin:0;background:var(--card);border-radius:var(--r-in);padding:4px 16px}
2284
+ .dsim .dkv>div{display:flex;justify-content:space-between;align-items:baseline;gap:16px;padding:11px 0;border-top:1px solid var(--hair)}
2285
+ .dsim .dkv>div:first-child{border-top:0}
2286
+ .dsim .dkv dt{color:var(--ink-3);font-size:var(--fs-2);flex:none;max-width:45%}
2287
+ .dsim .dkv dd{margin:0;font-size:var(--fs-3);font-weight:500;text-align:right;min-width:0;overflow-wrap:anywhere}
2288
+ .dsim .dwhy{background:var(--card);border-radius:var(--r-in);padding:10px 14px 4px}
2289
+ .dsim .dwhy .whyl{margin:0 0 2px;font:500 var(--fs-1) var(--sans);letter-spacing:0;text-transform:none;color:var(--ink-3)}
2290
+ .dsim .dwhy .why{min-height:52px;padding:4px 0 8px;background:transparent;border-radius:0}
2291
+ .dsim .dwhy:focus-within{box-shadow:0 0 0 2px var(--b3)}
2292
+ .dsim .dwhy .why:focus-visible{box-shadow:none}
2293
+ .dsim .dinfo{margin:0;display:flex;gap:8px;align-items:center;font-size:var(--fs-2);color:var(--ink-3)}
2294
+ .dsim .dinfo i{flex:none;width:16px;height:16px;border-radius:50%;box-shadow:inset 0 0 0 1.4px var(--ink-3);display:grid;place-items:center;font:600 var(--fs-1)/1 var(--mono);font-style:normal}
2295
+ .dsim .dbar{display:flex;align-items:center;gap:10px;margin:2px -22px -20px;padding:14px 22px 16px;border-top:1px solid var(--hair)}
2296
+ .dsim .dbar .cta{flex:1;justify-content:center;min-width:0;height:auto;min-height:48px;padding:6px 16px}
2297
+ .dsim .dbar .cta span{text-align:center;line-height:1.25}
2298
+ .dsim .dlater{position:relative;flex:none}
2299
+ .dsim .dlb{display:inline-flex;align-items:center;gap:4px;height:44px;padding:0 14px;border-radius:999px;background:var(--card);font-size:var(--fs-2);font-weight:600;color:var(--ink-2)}
2300
+ .dsim .dlb svg{width:16px;height:16px}
2301
+ .dsim .dlb[aria-expanded="true"] svg{transform:rotate(180deg)}
2302
+ .dsim .dlb[aria-expanded="true"]{box-shadow:inset 0 0 0 1.5px var(--b1);color:var(--ink)}
2303
+ .dsim .dlm{position:absolute;left:0;bottom:calc(100% + 8px);z-index:5;display:grid;gap:2px;min-width:170px;padding:6px;border-radius:var(--r-in);background:var(--card-solid,var(--well));box-shadow:0 10px 30px rgba(0,0,0,.18),0 0 0 1px var(--hair)}
2304
+ .dsim .dlm[hidden]{display:none}
2305
+ .dsim .dlm button{display:flex;align-items:center;width:100%;height:44px;justify-content:flex-start;text-align:left;background:transparent;border-radius:10px}
2306
+ .dsim .dlm button:hover,.dsim .dlm button:focus-visible{background:var(--well)}
2265
2307
  /* Agent proposals, the simple dialog (premium-simple-ui #2): one card per proposal, a bottom bar with Keep as the only primary, the notes behind one ⓘ */
2266
2308
  .pc-list{gap:12px}
2267
2309
  .bd-it.pcard,.bd-list>.bd-it.pcard:first-child{padding:14px 18px;border:1px solid var(--hair);border-radius:16px;background:var(--card-solid);cursor:pointer;transition:box-shadow .2s}
@@ -201,8 +201,12 @@ function cardHtml(r) {
201
201
  const opts = d.opts.length ? `<div class="opts2">${d.opts.map((x) => `<button class="op" data-op="${esc(x.k)}" aria-pressed="${x.k === sel}"><i></i><span><b>${esc(x.t)}</b><small>${esc(x.d)}</small></span></button>`).join('')}</div>` : '';
202
202
  const head = `<div class="acard" id="card"><p class="ct">${esc(d.head)}</p>${facts}`;
203
203
  if (w && w.kind === 'decision') {
204
- const label = o ? d.prim[o.k].replace(/^Hold to record: /, 'Record: ') : 'Your call: choose one';
205
- return `${head}${opts}${d.nodef ? `<p class="nodef">${esc(d.nodef)}</p>` : ''}${whyBox(r, 'Why (required, kept in the journal)')}${err}<div class="cact" id="cardAct"><button class="cta" id="recBtn" data-rec="decision" disabled>${CHECK}<span>${esc(label)}</span></button></div><div class="mv2">Not yet <span class="seg2">${[['later', 'Later today'], ['tomorrow', 'Tomorrow'], ['nextweek', 'Next week']].map(([k, t]) => `<button data-until="${k}">${t}</button>`).join('')}</span></div></div>`;
204
+ // the simple decision card: the evidence as label-value rows, the option cards, the reason as one labelled field, and one bottom bar
205
+ // with a quiet "Later" and the only primary, named after the chosen option
206
+ const label = o ? 'Record: ' + o.t : 'Your call: choose one';
207
+ const ev = d.facts.length ? `<p class="ct">${esc(d.head)}</p><dl class="dkv">${d.facts.map(([a, b]) => `<div><dt>${esc(a)}</dt><dd>${esc(b)}</dd></div>`).join('')}</dl>` : '';
208
+ const later = [['later', 'Later today'], ['tomorrow', 'Tomorrow'], ['nextweek', 'Next week']].map(([k, t]) => `<button type="button" role="menuitem" data-until="${k}">${t}</button>`).join('');
209
+ return `<div class="acard dsim" id="card">${ev}${d.opts.length ? '<p class="ct">Your call</p>' : ''}${opts}<div class="dwhy">${whyBox(r, 'Why · kept in the journal')}</div>${d.nodef ? `<p class="dinfo"><i aria-hidden="true">i</i><span>${esc(d.nodef)}</span></p>` : ''}${err}<div class="dbar" id="cardAct"><div class="dlater"><button type="button" class="dlb" id="laterBtn" aria-haspopup="menu" aria-expanded="false" aria-controls="laterMenu">Later <svg class="i" viewBox="0 0 24 24" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg></button><div class="seg2 dlm" id="laterMenu" role="menu" aria-label="Put it off until" hidden>${later}</div></div><button class="cta" id="recBtn" data-rec="decision" disabled>${CHECK}<span>${esc(label)}</span></button></div></div>`;
206
210
  }
207
211
  if (w && w.kind === 'return') {
208
212
  return `${head}<p class="ct">Return this run: why</p><div class="seg2" id="retWhy">${RET_REASONS.map((x) => `<button data-ret="${esc(x)}" aria-pressed="${RET[r.key] === x}">${esc(x)}</button>`).join('')}</div>${err}<div class="cact"><button class="cta" id="recBtn" data-rec="return" disabled>${CHECK}<span>${esc(d.action)}</span></button></div></div>`;
@@ -282,6 +286,9 @@ $('#dBody').addEventListener('click', (e) => {
282
286
  }
283
287
  const rt = e.target.closest('[data-ret]');
284
288
  if (rt) { WHY[openR.key] = ($('#why') || {}).value || ''; RET[openR.key] = rt.dataset.ret; $('#card').outerHTML = cardHtml(openR); ctaState(openR); return; }
289
+ const lb = e.target.closest('#laterBtn'), lm = $('#laterMenu');
290
+ if (lb) { const v = lm.hidden; lm.hidden = !v; lb.setAttribute('aria-expanded', v); return; }
291
+ if (lm && !lm.hidden && !e.target.closest('#laterMenu')) { lm.hidden = true; $('#laterBtn').setAttribute('aria-expanded', 'false'); }
285
292
  const un = e.target.closest('[data-until]');
286
293
  if (un) { write('put-off', { key: openR.key, until: un.dataset.until }, async () => { toast('Put off. It comes back by itself, and it is not counted as done.'); closeDlg(); await load(); }); return; }
287
294
  const rec = e.target.closest('#recBtn');