create-pmos 0.456.0 → 0.458.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/package.json +101 -80
  2. package/payload/KIT-VERSION +2 -2
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/payload/state/log.md +1 -1
  7. package/workspace/briefing-premium-adddoc-test.js +1 -1
  8. package/workspace/briefing-premium-board-test.js +17 -17
  9. package/workspace/briefing-premium-initiative-test.js +8 -10
  10. package/workspace/changelog.json +270 -1845
  11. package/workspace/ev-everywhere-test.js +24 -1
  12. package/workspace/guide/adler.md +1 -1
  13. package/workspace/guide/initiatives-screen.md +12 -2
  14. package/workspace/guide/settings.md +13 -3
  15. package/workspace/ini-workflow-test.js +5 -9
  16. package/workspace/lib/kit-update.js +1 -1
  17. package/workspace/lib/settings-store.js +1 -1
  18. package/workspace/metric-drafts-ui-test.js +11 -9
  19. package/workspace/package-lock.json +2 -2
  20. package/workspace/package.json +1 -1
  21. package/workspace/premium-board-actions-test.js +3 -3
  22. package/workspace/premium-vw-backlog-test.js +1 -1
  23. package/workspace/premium-vw-item-test.js +1 -1
  24. package/workspace/premium-vw-jira-test.js +1 -1
  25. package/workspace/program-panel-test.js +2 -2
  26. package/workspace/public/pm/cozy-ev.css +21 -4
  27. package/workspace/public/pm/cozy-settings.js +43 -19
  28. package/workspace/public/pm/ini-about.js +145 -0
  29. package/workspace/public/pm/ini-tasks.js +6 -34
  30. package/workspace/public/pm/ini-view-model.js +12 -2
  31. package/workspace/public/pm/ini-view.css +180 -143
  32. package/workspace/public/pm/ini-view.js +137 -145
  33. package/workspace/public/pm/metric-drafts.js +8 -2
  34. package/workspace/public/pm/mission.js +159 -135
  35. package/workspace/public/pm/premium-shell.js +24 -24
  36. package/workspace/public/pm/premium.css +11 -14
  37. package/workspace/public/pm/stage-line.js +4 -1
  38. package/workspace/public/pm/upd-weeks.js +56 -0
  39. package/workspace/split-merge-ui-test.js +1 -1
  40. package/workspace/stage-card-tasks-test.js +2 -2
  41. package/workspace/stage-card-test.js +48 -51
  42. package/workspace/task-links-test.js +8 -9
  43. package/workspace/task-press-test.js +2 -2
  44. package/workspace/task-views-test.js +15 -76
  45. package/workspace/test-lists/initiative-mission-control.json +5 -0
  46. package/workspace/test-lists/mission.json +7 -3
  47. package/workspace/test-lists/update-weeks.json +5 -0
  48. package/workspace/tk-tasks-test.js +3 -3
@@ -142,10 +142,33 @@ const put = (root, rel, text) => { fs.mkdirSync(path.dirname(path.join(root, rel
142
142
  await until(() => pg.evaluate(() => !document.querySelector('#evSettings:not([hidden])')));
143
143
  await menu(pg); await pg.click('#czMenu [data-cz-settings]');
144
144
  const st = await until(() => pg.evaluate(() => { const d = document.querySelector('#evSettings:not([hidden])'); return d ? { nav: [...d.querySelectorAll('[data-ev-sec]')].map((a) => a.textContent.replace(/\d+$/, '').trim()), h: (d.querySelector('#evStTitle') || {}).textContent, t: d.textContent } : null; }));
145
- ok('R2 Settings opens on General (or Connectors while a source is stale), with Connectors, Workspaces, Updates and What\'s new', !!st && st.h === (stale ? 'Connectors' : 'General') && ['General', 'Connectors', 'Workspaces', 'Updates', 'What\'s new'].every((k) => st.nav.some((n) => n.startsWith(k))) && (stale || /Theme/.test(st.t)), JSON.stringify(st && { nav: st.nav, h: st.h }));
145
+ ok('R2 Settings opens on General (or Connectors while a source is stale), with Connectors, Workspaces and Updates, and no What\'s new of its own', !!st && st.h === (stale ? 'Connectors' : 'General') && ['General', 'Connectors', 'Workspaces', 'Updates'].every((k) => st.nav.some((n) => n.startsWith(k))) && !st.nav.some((n) => /What/.test(n)) && (stale || /Theme/.test(st.t)), JSON.stringify(st && { nav: st.nav, h: st.h }));
146
146
  await snap(pg, 'settings-1440-light');
147
147
  await pg.click('#evSettings [data-ev-sec="workspaces"]');
148
148
  ok('R2 Workspaces lists the product', !!(await until(() => pg.evaluate(() => /EVPROD/.test(document.querySelector('#evSettings').textContent)))));
149
+ /* W2: Settings › Updates checks on open, shows what's new by week, and installs without a second question (stubbed kit routes; nothing reaches npm) */
150
+ const hits = { check: 0, update: 0, upgrade: 0 };
151
+ const day = (n) => new Date(Date.now() - n * 864e5).toISOString();
152
+ await pg.route('**/api/kit/status*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, app: { version: '0.442.0' }, kit: { present: true, version: '0.442.0' }, latest: '0.451.0', appBehind: true, kitBehind: true, checkDaily: true,
153
+ changes: [{ v: '0.451.0', at: day(0), prs: [{ n: 1098, t: 'Claude settings', s: 'Settings has a Claude section.', k: 'new' }, { n: 1100, t: 'Hide linked worktrees', s: 'They no longer show as repositories.', k: 'fix' }] }, { v: '0.441.0', at: day(8), prs: [{ n: 1078, t: 'Ready-made dashboards', s: 'Every program has one.', k: 'new' }] }] }) }));
154
+ await pg.route('**/api/kit/check', (r) => { hits.check++; r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, latest: '0.451.0', appBehind: true, kitBehind: true, latestChanges: [] }) }); });
155
+ await pg.route('**/api/kit/update', (r) => { hits.update++; r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true }) }); });
156
+ await pg.route('**/api/kit/upgrade-app', (r) => { hits.upgrade++; r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'stubbed: not installing' }) }); });
157
+ await pg.keyboard.press('Escape'); await until(() => pg.evaluate(() => !document.querySelector('#evSettings:not([hidden])')));
158
+ await menu(pg); await pg.click('#czMenu [data-cz-settings]'); await pg.waitForSelector('#evSettings:not([hidden])'); // reopen: the routes above answer the status read
159
+ await pg.click('#evSettings [data-ev-sec="updates"]');
160
+ const wk = await until(() => pg.evaluate(() => { const d = document.querySelector('#evSettings'); const h = d.querySelector('.ev-wkh'); return h ? { head: h.textContent, groups: [...d.querySelectorAll('.ev-wk > .ev-wkm .ev-wgl')].map((x) => x.textContent), t: d.querySelector('.ev-wk > .ev-wkm').textContent, arc: !!d.querySelector('[data-ev-arc][aria-expanded="false"]'), rows: d.querySelectorAll('[data-ev-wk]').length } : null; }), 20000);
161
+ const first = await (async () => { await sleep(800); return hits.check; })();
162
+ await pg.click('#evSettings [data-ev-sec="general"]'); await pg.click('#evSettings [data-ev-sec="updates"]'); await sleep(500);
163
+ ok('W2 opening Updates asks for the latest kit by itself (one read for each workspace), and only once while Settings stays open', first >= 1 && hits.check === first, JSON.stringify(hits));
164
+ ok('W2 what\'s new shows this week open: New and Fixed groups, no empty Improved group, the earlier week folded in a closed Archive', !!wk && /^This week/.test(wk.head) && wk.groups.join() === 'New,Fixed' && /Claude settings\./.test(wk.t) && /#1100/.test(wk.t) && wk.arc && wk.rows === 0, JSON.stringify(wk));
165
+ await pg.click('#evSettings [data-ev-arc]'); await pg.click('#evSettings [data-ev-wk]');
166
+ ok('W2 the Archive opens to the earlier weeks, and a week opens on press', !!(await until(() => pg.evaluate(() => /Ready-made dashboards\./.test(document.querySelector('#evSettings').textContent)))));
167
+ await snap(pg, 'updates-1440-light');
168
+ await pg.click('#evSettings [data-ev-upd="update"]');
169
+ await until(() => hits.upgrade > 0, 8000);
170
+ ok('W2 Update installs at once: the kit and the app are posted with no Restart and update step', hits.update >= 1 && hits.upgrade === 1 && !(await pg.evaluate(() => /Restart and update/.test(document.querySelector('#evSettings').textContent))), JSON.stringify(hits));
171
+ await pg.unroute('**/api/kit/status*'); await pg.unroute('**/api/kit/check'); await pg.unroute('**/api/kit/update'); await pg.unroute('**/api/kit/upgrade-app');
149
172
  await pg.keyboard.press('Escape');
150
173
  ok('R2 Escape closes Settings', !!(await until(() => pg.evaluate(() => !document.querySelector('#evSettings:not([hidden])')))));
151
174
 
@@ -31,7 +31,7 @@ Each mood comes from real state. When nothing happens, Adler is calm or he rests
31
31
  - **Claude's suggestions.** Adler asks with his worried face when Claude suggests a split or a merge, milestones, a goal or a success measure.
32
32
  - **Intelligence.** His face in Claude's line at the top only. Charts, numbers and key results never show him.
33
33
  - **Search.** Adler with a telescope when nothing matches.
34
- - **Initiative mission.** The scene at the top of an initiative card uses the same art: the rocket on its pad (a blueprint, then built, then lift-off), the planet, the dish and the clouds. While Discover is open, Adler stands at the telescope; when Discover is done, he is gone. On a festival, the day's things hang in the sky in place of the clouds. When the news is bad (the initiative is late) the festival goes. With **Face only** or **Off**, neither he nor the festival shows.
34
+ - **Initiative mission.** The telemetry card at the top of an initiative uses the same art: the rocket on its pad (a blueprint, then built, then lift-off), the planet, the dish and the clouds. The rocket flies a path that runs from left to right in time. While Discover is open, Adler stands at the telescope; when Discover is done, he is gone. On a festival, the day's things hang in the sky in place of the clouds. When the news is bad (the initiative is late) the festival goes. With **Face only** or **Off**, neither he nor the festival shows.
35
35
  - **Welcome.** Adler says hello once on the first step, and shows his thinking face while PMOS reads your folder.
36
36
  - **Board.** His small face on the Jira chip: calm when Jira was read in the last day and a half, honest when it was not, and his thinking face while a press reads it again. He heads **New asks**: needs you while asks wait. When a delivery is missed, his honest face stands once in the Deliveries lane's header; hover it to see which. When you open a milestone that was delivered, he celebrates once in the panel (at most once a week); after that his face is calm. The diamond on the timeline stays plain, and nothing is sent to anyone.
37
37
  - **Program charter.** His face on the check line, with his thinking face while Claude checks the milestones.
@@ -2,7 +2,7 @@
2
2
  type: Guide
3
3
  title: "Initiatives: the Roadmap, the List and the initiative sheet"
4
4
  description: "How to read and order the initiatives of a repository on the Roadmap and the List, open the initiative sheet, make a new initiative, and review the cycle."
5
- timestamp: 2026-10-06
5
+ timestamp: 2026-10-29
6
6
  ---
7
7
 
8
8
  # Initiatives: the Roadmap, the List and the initiative sheet
@@ -11,7 +11,17 @@ The Initiatives place shows every initiative of the selected repository. Each in
11
11
 
12
12
  Press **Roadmap** or **List** at the top to change the view. The workspace keeps your choice in this browser.
13
13
 
14
- An open initiative uses one column. On a wide screen, a compact mission summary shows the current stage, dates and next-stage action above the milestones. Tasks fills the width below and scrolls with the page. On a narrow screen, tap the mission picture to see its dates and milestones.
14
+ An open initiative uses one column. At its top is the **mission**: one panel with three parts, and Tasks fills the width below it.
15
+
16
+ ### The mission
17
+
18
+ - **The telemetry card.** It shows the stage, the plan dates, **Time left** and **Elapsed**. A picture fills the card. Time runs from left to right, from the plan start to the plan end, and the months are marked along the bottom. The path runs on the ground while the rocket is made, and it rises at lift-off, in the middle of Build, to the planet at the release. Each stage is a colour of the path: done stages are green, the current stage is thicker and blue, a late stage is orange, and a stage on hold is grey. A diamond on the path is a milestone. Press a diamond, the planet or the dish to open its task. Milestones that are close together are one diamond with a number.
19
+ - **To finish this stage.** It shows how many tasks of the stage are done, the stage's open milestone tasks with their dates, and the move to the next stage. The move is blue only when every task of the stage is done and nothing waits on you. At other times it is quiet. Under the rows are the owner, the stakeholders, the workflow and the program. On a wide screen this part stands beside the telemetry card.
20
+ - **About.** It has the description and the success measure. The description is the first paragraph of the PRD's Problem section. Press **Show more** to read all of it, or **Open the PRD** to open the file. The success measure is the one Claude drafts. A proposal opens About until you press its check mark. A kept measure shows each row with its now value and its target. When there is no description or no measure, About gives you a link that asks Claude in Home to write it.
21
+
22
+ Press the arrow on the telemetry card to hide all three parts. A banner stays: the stage, the dates, the days left, the count of tasks done, the success measure and the move to the next stage. Press the arrow again to show the telemetry card first. **To finish this stage** and **About** each have their own arrow, and they stay as you left them when you hide and show the mission. The workspace keeps these choices for each initiative in this browser. On a phone, the first screen shows **To finish this stage** and **About** closed.
23
+
24
+ Tasks has no **Full width** icon: use the split panel to make the Viewer wider. On a phone, Tasks is a list only. The workspace keeps a Timeline or Kanban view that you chose on a larger screen, and shows it again there.
15
25
 
16
26
  ### Scan repository
17
27
 
@@ -36,7 +36,7 @@ Settings is not a tab. While it is open, no tab is selected. Press a tab to go b
36
36
  | Privacy and data | A list of what leaves this computer and when. Whether a TypeSafe key is saved, the local model that answers when there is no key (Off, Winnow or Laya), and the data folder. |
37
37
  | Appearance | The theme (Same as system, Light or Dark) and the page that opens first. |
38
38
  | Claude | The Claude profile that new Claude sessions start with, and the Anthropic API key for Claude's own runs on the API (see below). |
39
- | Updates | The version of the app and of each workspace's kit. Check for updates, and how updates are found and applied. |
39
+ | Updates | The version of the app and of each workspace's kit, the check for updates, and what changed in each week's kits (what's new). See below. |
40
40
 
41
41
  Type in **Search settings** to find a setting in any section. Press **Open section** to go to its section.
42
42
 
@@ -58,12 +58,22 @@ Some rows show a feature that PMOS does not have yet, such as choosing calendars
58
58
 
59
59
  ## Update PMOS and the kit
60
60
 
61
- Open **Updates** and press **Check now**. PMOS asks the npm registry for the latest version only when you press it.
61
+ Open **Updates**. PMOS asks the npm registry for the latest version at once, and the card says if a newer one is ready. **Check now** asks again. PMOS also checks once a day while a page is open. To check only when you press **Check now**, set the update check to press (the `upd.check` setting, or `PMOS_UPDATE_CHECK=press`).
62
62
 
63
- - **Update to** a version on the **PMOS app** row updates the app. The row asks first: press **Restart and update**, or **Cancel**. PMOS stops, installs the new version, and starts again. Open terminals keep running. The page that you are on reloads when the new version starts. PMOS does not open a new tab. If the update is refused, or PMOS starts again on the old version, or PMOS does not come back, the row says so and names the update log.
63
+ - **Update to** a version on the **PMOS app** row updates the app. Press **Update** (or **Restart to update**) and PMOS starts at once, with no second question. PMOS stops, installs the new version, and starts again. Open terminals keep running. The page that you are on reloads when the new version starts. PMOS does not open a new tab. If the update is refused, or PMOS starts again on the old version, or PMOS does not come back, the row says so and names the update log.
64
64
  - When PMOS runs from a PMOS checkout, the row says to update it with `git pull`. There is no Update button.
65
65
  - **Update** on a workspace row updates the kit in that repository. It replaces the kit files in its `pmos/` folder (AGENTS.md, skills, scripts, templates, `okf/core`, the mod and KIT-VERSION). It does not change `state/`, `planning/` or `okf/product/`, and it does not commit. Review the change in the repository as a normal pull request.
66
66
 
67
+ ### What's new
68
+
69
+ Under the update card, **Updates** shows what changed in the published kits. **This week** is open: it is the one you need. A week runs Monday to Sunday. Every earlier week, last week included, is folded into **Archive**. Press **Archive** to list the earlier weeks (**Week of** a date), each with its counts, and press a week to read it. When there is nothing for this week yet, the newest week with changes is the open one.
70
+
71
+ - Each week has up to three groups: **New** (a feature), **Improved** (a faster or better thing that already existed) and **Fixed** (a problem that is gone). A group with nothing in it is not shown, and a week with nothing to show is not listed.
72
+ - Each line is a bold name and one sentence, copied from the pull request that made the change, with its number at the end. Work that you cannot see in PMOS (notes, tests, run logs) is left out.
73
+ - A week shows **Ready to install** when one of its kits is newer than the version you run.
74
+ - A kit published before PMOS kept the kind of each change has no kind. Its title decides: a word such as "fix" or "no longer" puts it under **Fixed**, and anything else under **Improved**.
75
+ - **What's new** is not a section of its own any more. The button on the update card in **General** opens **Updates**.
76
+
67
77
  ## Claude: the profile and the API key
68
78
 
69
79
  **Claude profile.** Pick one of the profiles on this computer, or **No profile**. New Claude sessions start with it. The list comes from the profile files in `~/.claude/profiles/`.
@@ -97,15 +97,12 @@ const BRIEF = BRP.build(BRF.facts());
97
97
  const pickStage = async (p, label) => { await p.click(V + ' [data-iv-stagepick]'); await until(() => p.evaluate(() => !!document.querySelector('.hi-pop [data-sp-life]'))); await p.click(`.hi-pop [data-sp-life]:has(> span:text-is("${label}"))`); };
98
98
  const pickMore = async (p, label) => { await p.click('#czViewer [data-cz-vw="more"]'); await until(() => p.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); await p.click(`#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${label}"))`); };
99
99
 
100
- const openMi = async (p) => { if (!(await p.evaluate((v) => !!document.querySelector(v + ' .iv-mio'), V))) await p.click(V + ' [data-iv-mi]', { position: { x: 8, y: 8 } }); await until(() => p.evaluate((v) => !!document.querySelector(v + ' .iv-mio'), V)); };
101
100
  const A = await open(), p = A.page;
102
101
  ok('W1 the page opens on the initiative with the workflow on its meta line', A.up, await txt(p, V + ' .cz-vw-kind'));
103
102
  ok('W1 the kind line names the workflow and the anchor: "Tender · KR 1.1" (Kind becomes Workflow)', /^Tender · KR 1\.1$/.test(await txt(p, V + ' .cz-vw-kind')), await txt(p, V + ' .cz-vw-kind'));
104
- ok('W1 the card names the stage of that workflow: Triage', (await txt(p, V + ' .iv-sch > b, .iv-sch .iv-stc b')) === 'Triage', await txt(p, V + ' .iv-sch'));
105
- ok('W1 the mission strip draws the ten stages of Tender', await p.evaluate((v) => document.querySelectorAll(v + ' .mi-svg :is(.mi-st, .mi-dsh)').length === 10, V));
106
- await openMi(p);
107
- ok('W1 the next stage is Tender\'s own: the → names Requirements', await p.evaluate((v) => /^Next: Requirements/.test(document.querySelector(v + ' .iv-scgo').getAttribute('aria-label')), V));
108
- await p.click(V + ' [data-iv-mi]', { position: { x: 8, y: 8 } });
103
+ ok('W1 the card names the stage of that workflow: Triage', (await txt(p, V + ' .iv-tel-t .iv-shn b')) === 'Triage', await txt(p, V + ' .iv-tel-t'));
104
+ ok('W1 the telemetry card names its place among the ten stages of Tender: stage 1 of 10', await p.evaluate((v) => /^Stage 1 of 10 of Tender: Triage\./.test(document.querySelector(v + ' .iv-tel').getAttribute('aria-label')), V));
105
+ ok('W1 the next stage is Tender\'s own: the → names Requirements', await p.evaluate((v) => /^Next: Requirements/.test(document.querySelector(v + ' .iv-gx .iv-scgo').getAttribute('aria-label')), V));
109
106
  ok('W1 the icon names the workflow for a screen reader', await p.evaluate((v) => /Workflow: Tender/.test(document.querySelector(v + ' [data-iv-wf]').getAttribute('aria-label')), V));
110
107
  ok('W2 PMOS set it from the BRD: the toast says so, with Undo (WfTriage)', await until(() => p.evaluate(() => { const t = document.getElementById('hiToast'); return !!t && !t.hidden && /Set to Tender from the BRD/.test(t.textContent) && !!t.querySelector('[data-hi-undo]'); })));
111
108
  await shot(p, 'triage-1440');
@@ -147,8 +144,7 @@ const BRIEF = BRP.build(BRF.facts());
147
144
  await p.reload();
148
145
  await until(() => p.evaluate((v) => !!document.querySelector(v + ' .hi-end'), V), 30000);
149
146
  ok('W7 the page of a Won’t do says why, and offers Back to Triage', /Won't do · No budget: Moved to next year’s budget\./.test(await txt(p, V + ' .hi-end')), await txt(p, V + ' .hi-end'));
150
- await openMi(p);
151
- ok('W7 its stage does not move: the card has no next stage to move to', !(await p.evaluate((v) => !!document.querySelector(v + ' .iv-sc .iv-scgo, ' + v + ' [data-iv-next]'), V)), await txt(p, V + ' .iv-sc'));
147
+ ok('W7 its stage does not move: the card has no next stage to move to', !(await p.evaluate((v) => !!document.querySelector(v + ' .iv-mc .iv-scgo, ' + v + ' [data-iv-next]'), V)), await txt(p, V + ' .iv-mc'));
152
148
  ok('W7 the stage chip has Back to Triage in place of Won’t do', await stageLabels(p).then((l) => l.includes('Back to Triage') && !l.includes('Won’t do')));
153
149
  await shot(p, 'wontdo-page-1440');
154
150
  await p.click(V + ' .hi-end [data-wf-back]');
@@ -158,7 +154,7 @@ const BRIEF = BRP.build(BRF.facts());
158
154
 
159
155
  // W8 the phone, and dark
160
156
  const P = await open({ w: 390, h: 844, fresh: false, B: board('requirements') });
161
- ok('W8 the phone opens the page with the workflow at Requirements, the second of its ten bars', P.up && (await txt(P.page, V + ' .iv-sch > b, .iv-sch .iv-stc b')) === 'Requirements' && await P.page.evaluate((v) => { const t = [...document.querySelectorAll(v + ' .mi-svg :is(.mi-st, .mi-dsh)')]; return t.length === 10 && /\b(nw|late)\b/.test(t[1].getAttribute('class')); }, V));
157
+ ok('W8 the phone opens the page with the workflow at Requirements, the second of its ten stages', P.up && (await txt(P.page, V + ' .iv-tel-t .iv-shn b')) === 'Requirements' && await P.page.evaluate((v) => /^Stage 2 of 10 of Tender: Requirements\./.test(document.querySelector(v + ' .iv-tel').getAttribute('aria-label')) && !!document.querySelector(v + ' .mi-svg .mi-pt:is(.nw, .late)'), V));
162
158
  ok('W8 the toast shows once only: seen before, not again', !(await P.page.evaluate(() => { const t = document.getElementById('hiToast'); return !!t && !t.hidden; })));
163
159
  await shot(P.page, 'page-390');
164
160
  await P.page.click(V + ' [data-iv-wf]');
@@ -30,7 +30,7 @@
30
30
  * newer kits' entries in the same `npm view` call, so the page can say what an update brings before it runs.
31
31
  *
32
32
  * NETWORK. These are the workspace's only egress to the npm registry. No HTTP client is opened here: npm and npx open
33
- * their own. Every call is reached only from a POST the page sends when the PM presses a button (server.js
33
+ * their own. Every call is reached only from a POST the page sends: when the PM presses a button, or when the PM opens Updates (unless upd.check is press) (server.js
34
34
  * /api/kit/check, /api/kit/update, /api/kit/upgrade-app); no timer and no GET reaches them. no-network.test.js holds
35
35
  * that.
36
36
  */
@@ -107,7 +107,7 @@ const DEFS = Object.freeze({
107
107
  * shows; `off` is the value that turns the thing off, or null when any value wins. */
108
108
  const ENV = Object.freeze([
109
109
  { key: 'notes.language', env: 'PMOS_WHISPER_LANG', off: null, effect: 'Every line is transcribed in this language, whatever the picker says.' },
110
- { key: 'upd.check', env: 'PMOS_UPDATE_CHECK', off: 'press', effect: 'Updates are checked only when you press Check on this computer.' },
110
+ { key: 'upd.check', env: 'PMOS_UPDATE_CHECK', off: 'press', effect: 'Updates are checked only when you press Check now on this computer, not when you open Updates.' },
111
111
  { key: 'rec.echo', env: 'PMOS_NOTES_ECHO', off: 'off', effect: 'Echo removal is off on this computer.' },
112
112
  { key: 'rec.final', env: 'PMOS_NOTES_FINAL', off: 'off', effect: 'The pass after Stop is off on this computer.' },
113
113
  { key: 'notes.wispr', env: 'PMOS_NOTES_WISPR', off: 'off', effect: 'Wispr Flow notes are not fetched on this computer.' },
@@ -154,10 +154,10 @@ const INITIATIVE = () => ({
154
154
  await until(() => p.evaluate(() => { const b = document.querySelector('#czViewer [data-czs-fold="tree"]'); if (b && b.getAttribute('aria-expanded') !== 'true') b.click(); return !!document.querySelector('#czViewer button.pp-open[data-ini="descope-parity"]'); }));
155
155
  await p.click('#czViewer button.pp-open[data-ini="descope-parity"]');
156
156
  const ic = await until(() => p.evaluate(() => { const c = document.querySelector('#czViewer .iv .md-card'); if (!c) return null;
157
- return { after: !!c.closest('.iv-cl') && !!(c.previousElementSibling && c.previousElementSibling.classList.contains('iv-card')), hd: c.querySelector('.md-hd b').textContent, src: c.querySelector('.md-src').textContent,
157
+ return { after: !!c.closest('.iv-cl') && !!c.closest('.iv-mc .iv-ab .ab-m'), hd: c.querySelector('.md-hd b').textContent, src: c.querySelector('.md-src').textContent,
158
158
  rows: [...c.querySelectorAll('.md-mr')].map((r) => [r.querySelector('.md-role').textContent, r.querySelector('.md-nm b').textContent, (r.querySelector('small') || {}).textContent || '', r.querySelector('.md-now').textContent, r.querySelector('.md-to').textContent].join(' | ')),
159
159
  why: c.querySelector('.md-why').textContent, presses: [...c.querySelectorAll('.md-ft .md-ib')].map((b) => ({ label: b.getAttribute('aria-label'), title: b.getAttribute('title'), text: b.textContent.trim(), solid: b.classList.contains('solid'), href: b.getAttribute('href') || '' })) }; }));
160
- ok('I the proposed success measure sits under the card, with where it came from', !!ic && ic.after && ic.hd === 'Proposed success measure' && ic.src === 'from the PRD and the desktop launch', JSON.stringify(ic));
160
+ ok('I the proposed success measure sits in About, open while it waits, with where it came from', !!ic && ic.after && ic.hd === 'Proposed success measure' && ic.src === 'from the PRD and the desktop launch', JSON.stringify(ic));
161
161
  ok('I three groups in order, each Now → Target', !!ic && ic.rows.join(' / ') === 'Proves it worked · 4 weeks after release | Mobile checkout login drop-off | Moves your key result “drop-off under 15%” | 27% | 19% / Early signal · shows in days | Inline form completion | Ticket ESHOP-981 drafted | — | 80% week 1 / Guardrail | Checkout conversion | A faster login must not cost orders | 3.1% | ≥ 3.1%', ic && ic.rows.join(' / '));
162
162
  ok('I one line of why', !!ic && /^Desktop fell 7 points/.test(ic.why));
163
163
  ok('I Edit (in place, batch 16) and a solid ✓ Keep this success measure: icon-only, each with a label and a title', !!ic && ic.presses.map((x) => x.label).join() === 'Edit the proposed success measure,Keep this success measure'
@@ -168,14 +168,16 @@ const INITIATIVE = () => ({
168
168
  await p.click('#czViewer .iv .md-card [data-md="keep"]');
169
169
  const ki = await until(() => D.posts.find((x) => x.path === '/api/metric-drafts/keep-all' && x.body.scope === 'initiative'));
170
170
  ok('I ✓ keeps all (POST /api/metric-drafts/keep-all, scope initiative)', !!ki && ki.body.id === 'descope-parity', JSON.stringify(ki));
171
- const kf = await until(() => p.evaluate(() => { const k = document.querySelector('#czViewer .iv .md-kept-i'); if (!k) return null; const f = k.querySelector('[data-md="fold"]');
172
- return { b: f.querySelector('b').textContent, pill: f.querySelector('.md-ok').textContent, n: f.querySelector('.n').textContent, open: f.getAttribute('aria-expanded'), undo: (k.querySelector('[data-md="undo"]') || {}).title || '', card: !!document.querySelector('#czViewer .iv .md-card') }; }));
173
- ok('I kept: the folded "Success measure · Set before the build · 3", with Undo', !!kf && kf.b === 'Success measure' && kf.pill === 'Set before the build' && kf.n === '3' && kf.open === 'false' && kf.undo === 'Undo' && !kf.card, JSON.stringify(kf));
174
- await p.click('#czViewer .iv .md-kept-i [data-md="fold"]');
175
- const lst = await until(() => p.evaluate(() => { const L = [...document.querySelectorAll('#czViewer .iv .md-kept-i .md-lr')]; return L.length ? L.map((x) => x.textContent) : null; }));
176
- ok('I the fold opens on its rows', !!lst && lst.join(' / ') === 'Mobile checkout login drop-off27% → 19%, 4 weeks after release / Inline form completionWaits on ESHOP-981 / Checkout conversionStays at ≥ 3.1%', JSON.stringify(lst));
171
+ // kept: About folds back by itself (nothing waits on a ✓), and its one line carries the first measure; open, it lists the rows with Undo
172
+ const kf = await until(() => p.evaluate(() => { const h = document.querySelector('#czViewer .iv .iv-ab-h'); if (!h || !/Mobile checkout login drop-off/.test(h.textContent)) return null;
173
+ return { sum: h.textContent.replace(/\s+/g, ' ').trim(), open: h.getAttribute('aria-expanded'), card: !!document.querySelector('#czViewer .iv .md-card') }; }));
174
+ ok('I kept: About folds and says the first measure in one line; no proposal card is left', !!kf && /^About ?Mobile checkout login drop-off27% → 19%$/.test(kf.sum) && kf.open === 'false' && !kf.card, JSON.stringify(kf));
175
+ await p.click('#czViewer .iv .iv-ab-h');
176
+ const lst = await until(() => p.evaluate(() => { const L = [...document.querySelectorAll('#czViewer .iv .iv-ab .ab-mr')]; return L.length ? L.map((x) => x.textContent) : null; }));
177
+ ok('I About opens on the rows: the role, the name and Now → Target', !!lst && lst.join(' / ') === 'Proves it worked · 4 weeks after releaseMobile checkout login drop-off27% → 19% / Early signal · shows in daysInline form completionWaits on ESHOP-981 / GuardrailCheckout conversionStays at ≥ 3.1%', JSON.stringify(lst));
178
+ ok('I Undo is beside the rows, icon-only', await p.evaluate(() => { const u = document.querySelector('#czViewer .iv .iv-ab [data-md="undo"]'); return !!u && u.title === 'Undo' && !u.textContent.trim(); }));
177
179
  await shot(p, 'Iq9Initiative-kept-built');
178
- await p.click('#czViewer .iv .md-kept-i [data-md="undo"]');
180
+ await p.click('#czViewer .iv .iv-ab [data-md="undo"]');
179
181
  await until(() => D.posts.filter((x) => x.path === '/api/metric-drafts/undo' && x.body.scope === 'initiative').length === 3, 5000);
180
182
  ok('I Undo makes it a proposal again', !!(await until(() => p.evaluate(() => !!document.querySelector('#czViewer .iv .md-card')))));
181
183
  ok('0 no page error (desk)', D.errors.length === 0, D.errors.join(' | '));
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.456.0",
3
+ "version": "0.458.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.456.0",
9
+ "version": "0.458.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@anthropic-ai/sdk": "^1.3.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.456.0",
3
+ "version": "0.458.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",
@@ -201,7 +201,7 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
201
201
  const I = await open('/premium-initiative.html?id=pa-one&ws=' + encodeURIComponent(B.ws) + '&board=' + encodeURIComponent(B.id));
202
202
  const ip = I.page;
203
203
  const viaMore = async (pg, label) => { const it = (l) => `#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${l}"))`, more = async () => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); }, view = (v) => until(() => pg.evaluate((x) => !!document.querySelector(`#czViewer:not([hidden]) [data-hi-v="${x}"]`), v)); if ((await pg.$('#czViewer:not([hidden]) [data-hi-v="page"]')) && (await pg.$('#czViewer:not([hidden]) [data-iv-docs]')) && !['Split into a new initiative', 'Merge into', 'Program', 'Open on the Board', 'Copy', 'The record', 'Delete'].includes(label)) { await pg.click('#czViewer:not([hidden]) [data-iv-docs]'); await view('docs'); if (label === 'Documents') return; } await more(); for (let i = 0; i < 20 && !(await pg.$(it(label))) && !(await pg.$(it('Stage'))); i++) { await pg.keyboard.press('Escape'); await pg.waitForTimeout(250); await more(); } if (!(await pg.$(it(label))) && (await pg.$(it('Stage')))) { await pg.click(it('Stage')); await view('stage'); if (label === 'Stage') return; await more(); } await pg.click(it(label)); }; // batch 16 item 5c: the page's ⋯ is short; Documents opens from its fold, and the Documents view's ⋯ holds Stage, whose ⋯ holds Documents, Open the full record and Sprint
204
- const landed = await until(() => ip.evaluate(() => { const q = new URLSearchParams(location.search); return location.pathname === '/premium.html' && q.get('ini') === 'pa-one' && !!q.get('ws') && !!q.get('board') && !!document.querySelector('#czViewer .iv-sc'); }), 60000);
204
+ const landed = await until(() => ip.evaluate(() => { const q = new URLSearchParams(location.search); return location.pathname === '/premium.html' && q.get('ini') === 'pa-one' && !!q.get('ws') && !!q.get('board') && !!document.querySelector('#czViewer .iv-mc'); }), 60000);
205
205
  ok('I0 the expand link lands on Home with the initiative selected, ws and board kept', !!landed, await ip.evaluate(() => location.href));
206
206
  // the page holds the Tasks (batch 11 item 20)
207
207
  await until(() => ip.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]')), 60000);
@@ -239,8 +239,8 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
239
239
  await ip.click('#czViewer [data-cz-vw="back"]'); // ← from Stage: the initiative's page again (canvas HbCDrill)
240
240
  // the card (stage card D): its last node, the next stage, opens the move popover with Move now and Back; Back always asks for a reason,
241
241
  // and the move line carries it (InStage)
242
- const openNext = async () => { if (!(await ip.evaluate(() => { const n = document.querySelector('.iv-sc [data-iv-next]'); return !!(n && n.offsetParent); }))) await ip.click('.iv-sc [data-iv-mi]'); // the next stage sits under the picture until it is the main step (XvpE2Stages)
243
- await until(() => ip.evaluate(() => { const n = document.querySelector('.iv-sc [data-iv-next]'); return !!(n && n.offsetParent); }), 30000); await ip.click('.iv-sc [data-iv-next]'); return until(() => ip.evaluate(() => !!document.querySelector('.hi-pop [data-hi-goback]'))); };
242
+ const openNext = async () => { // the next-stage move sits in the way to finish, always drawn (initiative-mission-control)
243
+ await until(() => ip.evaluate(() => { const n = document.querySelector('.iv-mc .iv-gx [data-iv-next]'); return !!(n && n.offsetParent); }), 30000); await ip.click('.iv-mc .iv-gx [data-iv-next]'); return until(() => ip.evaluate(() => !!document.querySelector('.hi-pop [data-hi-goback]'))); };
244
244
  const back = await openNext();
245
245
  ok('I4 the card\'s next stage opens Move to the next stage now and Back', back && await ip.evaluate(() => /^Move to .+ now$/.test(((document.querySelector('.hi-pop [data-hi-go]') || {}).textContent || '').trim())));
246
246
  if (back) {
@@ -57,7 +57,7 @@ const SPRINTS = { ok: true, source: 'jira', readAt: '2026-10-19T09:00:00Z', velo
57
57
  await page.route('**/api/initiative-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: IMODEL, as_of: Date.now() }) }));
58
58
  await page.goto(BASE + '/premium-initiative.html?id=self-serve-v2&ws=w1&board=w1&theme=' + theme);
59
59
  // the Board's expand link lands on Home's initiative layout (premium-agreed-design); its Overview has the Sprint press, and the Viewer shows one item at a time
60
- S.up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer .iv-sc') && !!window.__premiumViewer && !!window.__premiumVwJira), 20000);
60
+ S.up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer .iv-mc') && !!window.__premiumViewer && !!window.__premiumVwJira), 20000);
61
61
  if (S.up) { await (async (g) => { const P = '#czViewer:not([hidden]) [data-hi-v="page"]', r = '#hmList [data-hm-sel^="i:"][aria-current="true"]'; for (let i = 0; i < 4 && !(await g.$(P)) && (await g.$('#czViewer:not([hidden]) [data-cz-vw="back"]')); i++) { await g.click('#czViewer [data-cz-vw="back"]'); await g.waitForTimeout(150); } if (await g.$(P)) return; if (await g.$(r)) await g.click(r); else await g.reload(); await g.waitForSelector(P + ' .iv', { timeout: 30000 }); })(page); /* ← back to the initiative's page, else its row, else the address again (an initiative the list does not show) */ /* the page holds the Tasks (batch 11 item 20) */ S.up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]'))); }
62
62
  S.reads.length = 0;
63
63
  return { page, ctx, S };
@@ -48,7 +48,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
48
48
  await page.route('**/api/initiative-premium*', (r) => { const u = r.request().url(); S.gets.push(u); if (!r.request().headers()['x-pmos-nonce']) S.vgets.push(u); const a = answer ? answer(u, S.gets.filter((x) => x === u).length) : { status: 200, body: { ok: true, state: 'ready', model: MODEL, as_of: Date.now() } }; r.fulfill({ status: a.status, contentType: 'application/json', body: JSON.stringify(a.body) }); });
49
49
  await page.route('**/api/briefing-premium/**', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, turns: [], working: false }) }));
50
50
  await page.goto(BASE + '/premium.html?ini=self-serve-v2&ws=w1&board=w1&theme=' + theme);
51
- S.up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer .iv-sc') && !!window.__premiumWorkItem), 20000);
51
+ S.up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer .iv-mc') && !!window.__premiumWorkItem), 20000);
52
52
  return { page, ctx, S };
53
53
  };
54
54
  const viaMore = async (pg, label) => { const it = (l) => `#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${l}"))`, more = async () => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); }, view = (v) => until(() => pg.evaluate((x) => !!document.querySelector(`#czViewer:not([hidden]) [data-hi-v="${x}"]`), v)); if ((await pg.$('#czViewer:not([hidden]) [data-hi-v="page"]')) && (await pg.$('#czViewer:not([hidden]) [data-iv-docs]')) && !['Split into a new initiative', 'Merge into', 'Program', 'Open on the Board', 'Copy', 'The record', 'Delete'].includes(label)) { await pg.click('#czViewer:not([hidden]) [data-iv-docs]'); await view('docs'); if (label === 'Documents') return; } await more(); for (let i = 0; i < 20 && !(await pg.$(it(label))) && !(await pg.$(it('Stage'))); i++) { await pg.keyboard.press('Escape'); await pg.waitForTimeout(250); await more(); } if (!(await pg.$(it(label))) && (await pg.$(it('Stage')))) { await pg.click(it('Stage')); await view('stage'); if (label === 'Stage') return; await more(); } await pg.click(it(label)); }; // batch 16 item 5c: the page's ⋯ is short; Documents opens from its fold, and the Documents view's ⋯ holds Stage, whose ⋯ holds Documents, Open the full record and Sprint
@@ -87,7 +87,7 @@ const TICKETS = {
87
87
  await page.route('**/api/initiative-premium*', (r) => json(r, { ok: true, state: 'ready', model: IMODEL, as_of: Date.now() }));
88
88
  await page.route('**/api/briefing-premium/**', (r) => json(r, { ok: true, turns: [], working: false }));
89
89
  await page.goto(BASE + '/premium-initiative.html?id=self-serve-v2&ws=w1&board=w1&theme=' + theme); // the Board's expand link: Home with the initiative
90
- await until(() => page.evaluate(() => !!document.querySelector('#czViewer .iv-sc') && !!window.__premiumVwJira), 20000);
90
+ await until(() => page.evaluate(() => !!document.querySelector('#czViewer .iv-mc') && !!window.__premiumVwJira), 20000);
91
91
  await overview(page);
92
92
  await sleep(300); reads.length = 0; posts.length = 0; // Home's own reads; the checks below are about the sprint view's
93
93
  return { ctx, page, errors, posts, reads };
@@ -119,8 +119,8 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
119
119
  await fold(p, 'tree');
120
120
  await until(() => p.evaluate(() => !!document.querySelector('#czViewer button.pp-open[data-ini="descope-parity"]')));
121
121
  await p.click('#czViewer button.pp-open[data-ini="descope-parity"]');
122
- const ip = await until(() => p.evaluate(() => { const v = document.querySelector('#czViewer'); if (!v || v.hidden || !/Initiative/.test(v.getAttribute('aria-label') || '')) return null; return { t: v.querySelector('.cz-vw-title').textContent, peek: !document.querySelector('#peek'), stg: v.querySelectorAll('.mi-svg :is(.mi-st, .mi-dsh)').length }; }));
123
- ok('O an initiative in the tree opens the Board\'s initiative in the same shell, with its eight steps (XvABoard)', !!ip && ip.t === 'Descope feature parity' && ip.peek && ip.stg === 8, JSON.stringify(ip));
122
+ const ip = await until(() => p.evaluate(() => { const v = document.querySelector('#czViewer'); if (!v || v.hidden || !/Initiative/.test(v.getAttribute('aria-label') || '')) return null; return { t: v.querySelector('.cz-vw-title').textContent, peek: !document.querySelector('#peek'), stg: +((/^Stage \d+ of (\d+)/.exec(((v.querySelector('.iv-tel') || { getAttribute: () => '' }).getAttribute('aria-label')) || '') || [])[1] || 0) }; }));
123
+ ok('O an initiative in the tree opens the Board\'s initiative in the same shell, with its eight stages (XvABoard)', !!ip && ip.t === 'Descope feature parity' && ip.peek && ip.stg === 8, JSON.stringify(ip));
124
124
  await p.keyboard.press('Escape');
125
125
  await until(() => p.evaluate(() => document.querySelector('#czViewer').hidden));
126
126
  await p.click('#ibBody [data-prog="project-ascent"]');
@@ -217,14 +217,30 @@
217
217
  .ev-st .ev-ad { display: inline-flex; align-items: center; flex: none; }
218
218
  .ev-st .ev-say.honest { display: flex; align-items: center; gap: 8px; }
219
219
  .ev-st .ev-upd p { flex: 1; margin: 0; }
220
+ .ev-st .ev-upd.first { margin-top: 0; }
220
221
  .ev-st .ev-sw { height: 28px; min-width: 52px; border-radius: 999px; border: 0; background: var(--cz-well2); color: var(--cz-ink3); font: inherit; font-size: var(--fs-2); font-weight: 700; cursor: pointer; }
221
222
  .ev-st .ev-sw[aria-checked="true"] { background: var(--cz-bluebg); color: var(--cz-blueink); }
222
223
  .ev-st .ev-add { display: flex; gap: 8px; margin-top: 8px; }
223
- .ev-st .ev-kv { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
224
- .ev-st .ev-kv li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--cz-hair); }
225
- .ev-st .ev-kv li b { width: 64px; flex: none; }
226
- .ev-st .ev-kv li .ev-tx p { margin: 0 0 2px; font-size: var(--fs-2); color: var(--cz-ink2); }
227
224
  .ev-st [role="status"] { min-height: 1.2em; margin: 0; font-size: var(--fs-2); color: var(--cz-ink3); }
225
+ /* Updates › what's new: this week open, the earlier weeks folded into an Archive */
226
+ .ev-st .ev-wk { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--cz-hair); }
227
+ .ev-st .ev-wkh { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; }
228
+ .ev-st .ev-wkh b { font-size: var(--fs-4); font-weight: 800; }
229
+ .ev-st .ev-wkm { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
230
+ .ev-st .ev-wg { display: flex; flex-direction: column; gap: 6px; }
231
+ .ev-st .ev-wgl { display: flex; align-items: center; gap: 8px; font-size: var(--fs-1); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--cz-ink2); }
232
+ .ev-st .ev-wi { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
233
+ .ev-st .ev-wi li { font-size: var(--fs-3); line-height: 1.5; color: var(--cz-ink2); max-width: 68ch; overflow-wrap: anywhere; }
234
+ .ev-st .ev-wi li b { color: var(--cz-ink); font-weight: 700; }
235
+ .ev-st .ev-pr { font-size: var(--fs-1); font-variant-numeric: tabular-nums; }
236
+ .ev-st .ev-arc { display: flex; flex-direction: column; border-top: 1px solid var(--cz-hair); }
237
+ .ev-st .ev-arcb, .ev-st .ev-wkt { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; width: 100%; min-height: 44px; padding: 10px 0; border: 0; background: none; font: inherit; color: var(--cz-ink); text-align: left; cursor: pointer; }
238
+ .ev-st .ev-arcb svg, .ev-st .ev-wkt svg { margin-left: auto; align-self: center; fill: none; stroke: currentColor; stroke-width: 2; color: var(--cz-ink3); transition: transform .15s; }
239
+ .ev-st .ev-arcb[aria-expanded="true"] svg, .ev-st .ev-wkt[aria-expanded="true"] svg { transform: rotate(180deg); }
240
+ .ev-st .ev-wkr { display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; border-top: 1px solid var(--cz-hair); }
241
+ .ev-st .ev-wkr .ev-wkm { padding: 0 0 4px; }
242
+ .ev-st .ev-wkt .ev-tl { margin-right: 8px; }
243
+ @media (prefers-reduced-motion: reduce) { .ev-st .ev-arcb svg, .ev-st .ev-wkt svg { transition: none; } }
228
244
  @media (max-width: 760px) {
229
245
  .ev-st { left: 0; top: 0; transform: none; width: 100vw; height: 100%; border-radius: 0; flex-direction: column; }
230
246
  .ev-st-nav { width: auto; flex-direction: row; overflow-x: auto; padding: 14px 12px 8px; gap: 4px; scrollbar-width: none; }
@@ -233,6 +249,7 @@
233
249
  .ev-st-main { padding: 16px 16px 32px; }
234
250
  .ev-st .ev-trow { flex-wrap: wrap; }
235
251
  .ev-st .ev-upd { flex-wrap: wrap; }
252
+ .ev-st .ev-upd .ev-tx { flex: 1 1 180px; }
236
253
  .ev-st .ev-sw, .ev-st .ev-pick, .ev-st select.ev-inp, .ev-st input.ev-inp { min-height: 44px; font-size: var(--fs-4); }
237
254
  .ev-st .ev-seg button { min-height: 40px; }
238
255
  }
@@ -13,8 +13,9 @@
13
13
  * /api/proactive/settings)
14
14
  * Workspaces the repositories PMOS works in (GET and POST /api/workspaces, POST /api/workspaces/forget; the folder is never touched)
15
15
  * Workflows a link to its own page, /premium-workflows.html (pm/wf-page.js, D99): the stages each kind of initiative goes through
16
- * Updates the versions and Check now, Update, Restart to update (GET /api/kit/status, POST /api/kit/check | update | upgrade-app)
17
- * What's new what each published kit changed, newest first (the kit status's changelog lines)
16
+ * Updates the versions and Check now, Update, Restart to update (GET /api/kit/status, POST /api/kit/check | update | upgrade-app); opening it
17
+ * asks for the latest kit. Under it, what's new: the published kits grouped by week as New, Improved and Fixed, this week open and every earlier
18
+ * week folded into an Archive (pm/upd-weeks.js). It was a section of its own, What's new.
18
19
  * Adler's moments (batch 17 item 4-B, AdM4): one face per section, where Claude speaks. Updates: glasses while it checks or installs,
19
20
  * holding the card when a version is ready, calm when up to date. General: holding the update card, else the Jira promise (only after
20
21
  * Commit). A failure in the status line takes the honest face, and then the section's face steps back (one Adler per screen).
@@ -27,17 +28,18 @@ import { esc, svg, ICON, toast, wsParam, wsQ } from './cozy-evui.js';
27
28
  import { sourceRows, staleOf, partsOf } from './cozy-evmodel.js';
28
29
  import * as AD from './cozy-adler.js';
29
30
  import * as SE from './cozy-seasons.js';
31
+ import { weeksOf, lineOf, KINDS } from './upd-weeks.js';
30
32
 
31
33
  /** PUT or DELETE with the page's launch nonce (pressFetch). Only the key row needs them. */
32
34
  async function pmSend(method, path, body) {
33
35
  try { const res = await pressFetch(path, { method, ...(body === undefined ? {} : { body: JSON.stringify(body) }) }); const out = await res.json(); if (out && typeof out === 'object' && !res.ok) out.status = res.status; return out; }
34
36
  catch (e) { return { ok: false, error: 'could not reach the workspace server — ' + ((e && e.message) || String(e)) }; }
35
37
  }
36
- const SECTIONS = [['general', 'General'], ['claude', 'Claude'], ['adler', 'Adler'], ['connectors', 'Connectors'], ['workspaces', 'Workspaces'], ['workflows', 'Workflows'], ['updates', 'Updates'], ['whatsnew', "What's new"]];
38
+ const SECTIONS = [['general', 'General'], ['claude', 'Claude'], ['adler', 'Adler'], ['connectors', 'Connectors'], ['workspaces', 'Workspaces'], ['workflows', 'Workflows'], ['updates', 'Updates']];
37
39
  const PAGE_LINKS = { workflows: '/premium-workflows.html' }; // a section that is a page of its own: the row goes there
38
40
  const SRC = { calendar: 'Calendar', wispr: 'Wispr Flow', mail: 'Mail', slack: 'Slack', jira: 'Jira', confluence: 'Confluence', github: 'GitHub', drive: 'Google Drive', figma: 'Figma', website: 'Your websites' };
39
41
  const VIEWER_KEY = 'pmos.cz.viewer';
40
- const T = { el: null, sec: 'general', ws: null, st: {}, src: null, con: {}, conn: [], set: null, prods: null, msg: '', busy: false, phase: '', say: '', back: null, fresh: null, reading: '', note: {}, lines: null, dress: false, more: false, bday: false, dset: {} };
42
+ const T = { el: null, sec: 'general', ws: null, st: {}, src: null, con: {}, conn: [], set: null, prods: null, msg: '', busy: false, phase: '', say: '', back: null, fresh: null, reading: '', note: {}, lines: null, dress: false, more: false, bday: false, dset: {}, wkOpen: new Set(), arc: false };
41
43
  const cmpVer = (a, b) => { const x = String(a || '0').split('-')[0].split('.').map(Number), y = String(b || '0').split('-')[0].split('.').map(Number); for (let i = 0; i < 3; i++) if ((x[i] || 0) !== (y[i] || 0)) return (x[i] || 0) < (y[i] || 0) ? -1 : 1; return 0; };
42
44
  const home = () => (T.ws && T.ws[0] ? T.st[T.ws[0].id] : null);
43
45
  const latest = () => { const s = home(); return (s && (s.latest || (s.lastCheck && s.lastCheck.latest))) || null; };
@@ -67,7 +69,7 @@ function general() {
67
69
  const pname = !P ? 'Reading' : !P.length ? 'No product' : on.length === 1 ? on[0].name : on.length + ' of ' + P.length + ' products';
68
70
  const we = T.set && Array.isArray(T.set.settings) ? T.set.settings.find((x) => x.key === 'time.workEnd') : null, end = we ? Number(we.value) : 18;
69
71
  const hours = []; for (let h = 13; h <= 23; h++) hours.push(h);
70
- const upd = ready() ? `<div class="ev-card ev-upd">${adFace('needs-you')}<span class="ev-pill y">Update</span><p><b>PMOS ${esc(latest())} is ready.</b> <span class="ev-mut">${esc(firstLine())}</span></p><button type="button" class="ev-btn sm" data-ev-go="whatsnew">What's new</button><button type="button" class="ev-btn sm dark" data-ev-upd="update">${appBehind() ? 'Restart to update' : 'Update'}</button></div>` : '';
72
+ const upd = ready() ? `<div class="ev-card ev-upd">${adFace('needs-you')}<span class="ev-pill y">Update</span><p><b>PMOS ${esc(latest())} is ready.</b> <span class="ev-mut">${esc(firstLine())}</span></p><button type="button" class="ev-btn sm" data-ev-go="updates">What's new</button><button type="button" class="ev-btn sm dark" data-ev-upd="update">${appBehind() ? 'Restart to update' : 'Update'}</button></div>` : '';
71
73
  return trow('Theme', 'Auto follows your computer', seg('Theme', 'theme', theme, [['light', 'Light'], ['dark', 'Dark'], ['auto', 'Auto']]))
72
74
  + trow('Viewer opens as', 'A column beside the chat, or a popup over it', seg('Viewer opens as', 'viewer', vw, [['column', 'Column'], ['popup', 'Popup']]))
73
75
  + trow('Product', 'Which products Home, Board and Intelligence read', `<button type="button" class="ev-pick" data-ev-products aria-haspopup="menu">${esc(pname)} ${svg(ICON.down, 14)}</button>`)
@@ -199,16 +201,29 @@ function updates() {
199
201
  : ready() ? `<b>PMOS ${esc(L)} is ready</b><p class="ev-small ev-mut">You have ${esc(app)}.${appBehind() ? ' PMOS stops for about a minute while it installs. Open terminals keep running.' : ''}</p>`
200
202
  : L ? `<b>PMOS ${esc(app)} is up to date</b><p class="ev-small ev-mut">${fromGit() && s.appBehind ? esc(L) + ' is published. This PMOS runs from a checkout: update it with git pull.' : 'The newest published kit is ' + esc(L) + '.'}</p>`
201
203
  : `<b>PMOS ${esc(app)}</b><p class="ev-small ev-mut">Press Check now to ask for the latest version.</p>`;
202
- const acts = T.phase === 'busy' ? '' : T.phase === 'confirm' ? '<button type="button" class="ev-btn sm" data-ev-upd="cancel">Cancel</button><button type="button" class="ev-btn sm dark" data-ev-upd="go">Restart and update</button>'
203
- : `<button type="button" class="ev-btn sm" data-ev-upd="check"${T.busy ? ' disabled' : ''}>Check now</button>${ready() ? `<button type="button" class="ev-btn sm dark" data-ev-upd="update">${appBehind() ? 'Restart to update' : 'Update'}</button>` : ''}`;
204
+ const acts = T.phase === 'busy' ? '' : `<button type="button" class="ev-btn sm" data-ev-upd="check"${T.busy ? ' disabled' : ''}>Check now</button>${ready() ? `<button type="button" class="ev-btn sm dark" data-ev-upd="update">${appBehind() ? 'Restart to update' : 'Update'}</button>` : ''}`;
204
205
  const kits = (T.ws || []).map((w) => { const k = T.st[w.id], kit = k && k.kit; return trow(w.label || w.name || w.id, kit && kit.present ? 'kit ' + (kit.version || 'vendored by hand') : 'no kit in this workspace', k && k.kitBehind && L ? `<span class="ev-pill y">${esc(L)} ready</span>` : kit && kit.present && (k.lastCheck || k.latest) ? '<span class="ev-pill ok">Up to date</span>' : ''); }).join('');
205
206
  const last = s.lastCheck ? 'Last checked ' + new Date(s.lastCheck.at).toLocaleString() + '. ' : '';
206
- return `<div class="ev-card ev-upd">${mood ? adFace(mood) : ''}<div class="ev-tx ev-grow">${head}</div>${acts}</div>${kits}<p class="ev-small ev-mut">${esc(last)}${s.checkDaily ? 'PMOS checks once a day while a page is open; Check now asks again.' : 'PMOS checks only when you press Check now.'}</p>`;
207
+ return `<div class="ev-card ev-upd first">${mood ? adFace(mood) : ''}<div class="ev-tx ev-grow">${head}</div>${acts}</div>${kits}<p class="ev-small ev-mut">${esc(last)}${s.checkDaily ? 'PMOS checks when you open Updates and once a day while a page is open; Check now asks again.' : 'PMOS checks only when you press Check now.'}</p>${weeks()}`;
207
208
  }
208
- function whatsnew() {
209
- const L = changes(), s = home(), mine = s && s.app && !fromGit() ? s.app.version : null;
210
- if (!L.length) return '<p class="ev-small ev-mut">No kit summaries yet. Each kit published from now on carries one, and Check now reads the newest ones.</p>';
211
- return `<ul class="ev-kv">${L.slice(0, 40).map((e) => `<li><b>${esc(e.v)}</b><div class="ev-tx">${mine && e.v === mine ? '<span class="ev-pill">Yours</span> ' : mine && cmpVer(e.v, mine) > 0 ? '<span class="ev-pill y">Newer</span> ' : ''}${(e.prs || []).map((p) => `<p>${esc(p.t && p.t !== p.s ? p.t + ': ' + p.s : p.s)}${p.n ? ' <span class="ev-mut">#' + esc(p.n) + '</span>' : ''}</p>`).join('') || '<p class="ev-mut">No summary was recorded for this kit.</p>'}</div></li>`).join('')}</ul>`;
209
+ /** One week: its name and dates, then New, Improved and Fixed with a line for each published PR. */
210
+ function weekBody(w) {
211
+ const dot = { new: 'you', imp: 'ok', fix: 'risk' };
212
+ const grp = KINDS.filter(([k]) => w.groups[k].length).map(([k, label]) => `<div class="ev-wg"><div class="ev-wgl"><i class="ev-dot ${dot[k]}"></i>${label}</div><ul class="ev-wi">${w.groups[k].map((p) => { const x = lineOf(p); return `<li>${x.b ? `<b>${esc(x.b)}${/[.!?]$/.test(x.b) ? '' : '.'}</b> ` : ''}${esc(x.s)}${p.n ? ` <span class="ev-mut ev-pr">#${esc(p.n)}</span>` : ''}</li>`; }).join('')}</ul></div>`).join('');
213
+ return `<div class="ev-wkm">${grp}</div>`;
214
+ }
215
+ const kitsOf = (w) => (w.kits[0] === w.kits[1] ? w.kits[0] : w.kits[0] + ' – ' + w.kits[1]);
216
+ /** What's new, under the update card: this week (the newest week) open, and every earlier week folded into the Archive. */
217
+ function weeks() {
218
+ const s = home(), mine = s && s.app && !fromGit() ? s.app.version : null;
219
+ const W = weeksOf(changes(), Date.now(), mine);
220
+ if (!W.length) return '<p class="ev-small ev-mut">No kit summaries yet. Each kit published from now on carries one, and Check now reads the newest ones.</p>';
221
+ const [w, ...old] = W.slice(0, 13);
222
+ const head = (x) => `<div class="ev-wkh"><b>${esc(x.name)}</b><span class="ev-small ev-mut">${esc(x.range)} · kits ${esc(kitsOf(x))}</span>${x.newer ? '<span class="ev-pill y">Ready to install</span>' : ''}</div>`;
223
+ const tally = (x) => [['new', 'new'], ['imp', 'improved'], ['fix', 'fixed']].filter(([k]) => x.groups[k].length).map(([k, l]) => x.groups[k].length + ' ' + l).join(' · ');
224
+ const rows = old.map((x) => { const on = T.wkOpen.has(x.key); return `<div class="ev-wkr"><button type="button" class="ev-wkt" data-ev-wk="${esc(x.key)}" aria-expanded="${on}"><b>${esc(x.name)}</b><span class="ev-small ev-mut">${esc(x.range)}</span><span class="ev-small ev-mut ev-tl">${esc(tally(x))}</span>${svg(ICON.down, 14)}</button>${on ? weekBody(x) : ''}</div>`; }).join('');
225
+ const arc = old.length ? `<div class="ev-arc"><button type="button" class="ev-arcb" data-ev-arc aria-expanded="${T.arc}"><b>Archive</b><span class="ev-small ev-mut">${old.length} earlier ${old.length === 1 ? 'week' : 'weeks'}</span>${svg(ICON.down, 14)}</button>${T.arc ? rows : ''}</div>` : '';
226
+ return `<div class="ev-wk">${head(w)}${weekBody(w)}${arc}</div>`;
212
227
  }
213
228
  /* Settings > Claude: which Claude profile PMOS starts Claude sessions with, and the API key for Claude's own runs (D101).
214
229
  * The key is typed here and goes to this computer only; the page never gets it back, only whether one is set and where from. */
@@ -226,7 +241,7 @@ function claudeSec() {
226
241
  + trow('API key', keySub, keyRight)
227
242
  + (k.present && C.off ? trow('Runs on the API', 'Off: PMOS_GRILL_API is off in the environment.', '<span class="ev-pill">Off</span>') : '');
228
243
  }
229
- const BODY = { general, claude: claudeSec, adler: adlerSec, connectors, workspaces, updates, whatsnew };
244
+ const BODY = { general, claude: claudeSec, adler: adlerSec, connectors, workspaces, updates };
230
245
  function draw() {
231
246
  const el = T.el; if (!el || el.hidden) return;
232
247
  // a redraw replaces the nodes: keep focus on the same control (by its data-ev-* key), else on the open section, never on the body
@@ -238,6 +253,7 @@ function draw() {
238
253
  const all = T.sec === 'connectors' ? `<button type="button" class="ev-ib" data-ev-readall aria-label="Read every source again" title="Read all again"${T.reading ? ' disabled' : ''}>${svg(RD, 18)}</button>` : '';
239
254
  el.querySelector('.ev-st-main').innerHTML = staleHtml() + `<div class="ev-top"><h3 class="ev-h2" id="evStTitle">${esc(label)}</h3>${all}<button type="button" class="ev-ib" data-ev-close aria-label="Close settings" title="Close settings">${svg(ICON.close, 18)}</button></div>`
240
255
  + BODY[T.sec]() + `<p role="status"${T.msg && AD.moodOfText(T.msg) === 'honest' ? ' class="ev-say honest"' : ''}>${T.msg && AD.moodOfText(T.msg) === 'honest' ? AD.adler('honest', 24, { label: false }) : ''}${esc(T.msg)}</p>`;
256
+ const cur = el.querySelector('.ev-st-nav [aria-current="page"]'); if (cur && cur.scrollIntoView) cur.scrollIntoView({ block: 'nearest', inline: 'nearest' }); // on a phone the section row scrolls: keep the open one in view
241
257
  if (had && !ae.isConnected) { const f = (key && el.querySelector(`[${key.name}="${CSS.escape(key.value)}"]`)) || el.querySelector('[aria-current="page"]'); if (f) f.focus(); }
242
258
  }
243
259
  function mount() {
@@ -272,8 +288,10 @@ function mount() {
272
288
  }
273
289
  async function press(e) {
274
290
  const t = e.target.closest('a[data-ev-sec], button'); if (!t) return;
275
- if (t.dataset.evSec) { e.preventDefault(); T.sec = t.dataset.evSec; T.msg = ''; T.dress = false; draw(); const f = T.el.querySelector(`[data-ev-sec="${T.sec}"]`); if (f) f.focus(); return; }
291
+ if (t.dataset.evSec) { e.preventDefault(); T.sec = t.dataset.evSec; T.msg = ''; T.dress = false; draw(); const f = T.el.querySelector(`[data-ev-sec="${T.sec}"]`); if (f) f.focus(); openCheck(); return; }
276
292
  if ('evClose' in t.dataset) { closeSettings(); return; }
293
+ if (t.dataset.evWk) { const k = t.dataset.evWk; if (T.wkOpen.has(k)) T.wkOpen.delete(k); else T.wkOpen.add(k); draw(); return; }
294
+ if ('evArc' in t.dataset) { T.arc = !T.arc; draw(); return; }
277
295
  if (t.dataset.evGo) { T.sec = t.dataset.evGo; draw(); return; }
278
296
  if (t.dataset.evSeg === 'theme') { const M = await import('./cozy-nav.js'); M.setTheme(t.dataset.v); draw(); return; }
279
297
  if (t.dataset.evSeg && t.dataset.evSeg.startsWith('adler.')) { const r = await AD.savePref(pmPost, t.dataset.evSeg, t.dataset.v); T.msg = r && r.ok ? 'Saved.' : (r && r.error) || 'Not saved.'; draw(); return; }
@@ -325,17 +343,22 @@ async function press(e) {
325
343
  } finally { T.busy = false; }
326
344
  draw();
327
345
  }
328
- async function upd(a) {
329
- if (a === 'cancel') { T.phase = ''; return; }
346
+ /** Opening Updates asks for the latest kit once per open, unless Settings turned the automatic check off (upd.check = press). */
347
+ async function openCheck() {
348
+ const s = home();
349
+ if (T.sec !== 'updates' || T.auto || !T.ws || !s || !s.checkDaily || T.checking || T.phase === 'busy') return;
350
+ T.auto = true;
351
+ await upd('check', true); draw();
352
+ }
353
+ async function upd(a, quiet) {
330
354
  if (a === 'check') {
331
355
  T.checking = true; T.msg = ''; draw();
332
356
  try {
333
357
  for (const w of T.ws || []) { const r = await pmPost('/api/kit/check', { ws: w.id }); if (r && r.ok) T.st[w.id] = { ...(T.st[w.id] || {}), ...r }; else T.msg = (r && r.error) || 'The check failed.'; }
334
358
  } finally { T.checking = false; }
335
- if (!T.msg) toast(ready() ? 'PMOS ' + latest() + ' is ready' : 'Checked. PMOS is up to date');
359
+ if (!T.msg && !quiet) toast(ready() ? 'PMOS ' + latest() + ' is ready' : 'Checked. PMOS is up to date');
336
360
  return;
337
361
  }
338
- if (a === 'update' && appBehind()) { T.sec = 'updates'; T.phase = 'confirm'; return; }
339
362
  const v = latest(); T.sec = 'updates'; T.phase = 'busy';
340
363
  for (const w of kitsBehind()) {
341
364
  T.say = 'Updating the kit in ' + (w.label || w.name || w.id) + '.'; draw();
@@ -397,11 +420,12 @@ async function load() {
397
420
  draw();
398
421
  await Promise.all(T.ws.map(async (x) => { const r = await pmGet('/api/kit/status?ws=' + encodeURIComponent(x.id)); if (r && r.ok) T.st[x.id] = r; }));
399
422
  draw();
423
+ openCheck();
400
424
  }
401
425
  export function openSettings(section) {
402
426
  const el = mount();
403
427
  if (section === 'dress') { T.sec = 'adler'; T.dress = true; } else if (section && BODY[section]) { T.sec = section; T.dress = false; }
404
- if (el.hidden) { const ae = document.activeElement; T.back = ae && ae !== document.body ? ae : null; T.ws = null; T.src = null; T.msg = ''; T.phase = ''; T.fresh = null; T.note = {}; T.dset = {}; T.cl = null; }
428
+ if (el.hidden) { const ae = document.activeElement; T.back = ae && ae !== document.body ? ae : null; T.ws = null; T.src = null; T.msg = ''; T.phase = ''; T.auto = false; T.wkOpen = new Set(); T.arc = false; T.fresh = null; T.note = {}; T.dset = {}; T.cl = null; }
405
429
  el.hidden = false; document.getElementById('evStScrim').hidden = false; el.setAttribute('data-esc-layer', '');
406
430
  draw();
407
431
  const f = el.querySelector('[aria-current="page"]'); if (f) f.focus();