create-pmos 0.715.0 → 0.717.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.715.0",
3
+ "version": "0.717.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": {
@@ -33,6 +33,32 @@
33
33
  "audit"
34
34
  ],
35
35
  "pmosChanges": [
36
+ {
37
+ "v": "0.717.0",
38
+ "at": "2026-11-22T21:55:40.797Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1588,
43
+ "t": "Every chart says its point and lights the one reading it names (job #1587)",
44
+ "s": "Every chart says its point and lights the one reading it names (job #1587)",
45
+ "k": "new"
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "v": "0.716.0",
51
+ "at": "2026-11-22T20:55:20.302Z",
52
+ "f": 4,
53
+ "prs": [
54
+ {
55
+ "n": 1586,
56
+ "t": "One-minute ease check per page from the local use log (job #1585)",
57
+ "s": "One-minute ease check per page from the local use log (job #1585)",
58
+ "k": "new"
59
+ }
60
+ ]
61
+ },
36
62
  {
37
63
  "v": "0.715.0",
38
64
  "at": "2026-11-22T20:02:36.257Z",
@@ -452,32 +478,6 @@
452
478
  "k": "new"
453
479
  }
454
480
  ]
455
- },
456
- {
457
- "v": "0.679.0",
458
- "at": "2026-11-22T06:54:44.843Z",
459
- "f": 4,
460
- "prs": [
461
- {
462
- "n": 1475,
463
- "t": "Next milestones labels never overlap, and the strip scrolls apart from the table",
464
- "s": "/mnt/project-files/milestones-strip/after-1440.png, all 9 milestones from 20 Nov 2026 to 15 Nov 2027 on one width, 0 overlaps (measured from the labels' bounding boxes), no horizontal scroll.",
465
- "k": "fix"
466
- }
467
- ]
468
- },
469
- {
470
- "v": "0.678.0",
471
- "at": "2026-11-22T06:40:11.793Z",
472
- "f": 4,
473
- "prs": [
474
- {
475
- "n": 1473,
476
- "t": "Every old Home address opens Today; on a desk its chat, session or setup opens in the popup",
477
- "s": "Every old Home address opens Today; on a desk its chat, session or setup opens in the popup",
478
- "k": "new"
479
- }
480
- ]
481
481
  }
482
482
  ]
483
483
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@550cd9e6
1
+ kernel-source: pmos@cb32d99a
2
2
  assembled: 2026-11-22
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-11-22T20:02:32Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T21:55:37Z"}
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-11-22T20:02:32Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T21:55:37Z"}
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-11-22T20:02:32Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T21:55:37Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,30 @@
1
1
  [
2
+ {
3
+ "v": "0.717.0",
4
+ "at": "2026-11-22T21:55:40.797Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1588,
9
+ "t": "Every chart says its point and lights the one reading it names (job #1587)",
10
+ "s": "Every chart says its point and lights the one reading it names (job #1587)",
11
+ "k": "new"
12
+ }
13
+ ]
14
+ },
15
+ {
16
+ "v": "0.716.0",
17
+ "at": "2026-11-22T20:55:20.302Z",
18
+ "f": 4,
19
+ "prs": [
20
+ {
21
+ "n": 1586,
22
+ "t": "One-minute ease check per page from the local use log (job #1585)",
23
+ "s": "One-minute ease check per page from the local use log (job #1585)",
24
+ "k": "new"
25
+ }
26
+ ]
27
+ },
2
28
  {
3
29
  "v": "0.715.0",
4
30
  "at": "2026-11-22T20:02:36.257Z",
@@ -2,7 +2,7 @@
2
2
  type: Guide
3
3
  title: "Reports and dashboards: set up, shape, design, draft and issue"
4
4
  description: "Set up a report by asking, shape what it says, design how it looks, draft and issue a cadence report, and the ready-made dashboards."
5
- timestamp: 2026-11-08
5
+ timestamp: 2026-11-22
6
6
  ---
7
7
 
8
8
  # Reports and dashboards
@@ -386,7 +386,7 @@ An order is a default order of slides, for example the Weekly Review order. The
386
386
 
387
387
  The library also has seven report templates: weekly-review, program-kickoff, meeting-recap, portfolio-snapshot, quarterly-review, decision-brief and incident-review. A template is a default order of slides, not a fixed structure. `pmos report library --template <id>` draws one template with placeholder words, and `pmos report make <id> --template <id>` starts a report from it. The writer uses its order and adds or drops slides when the findings say so. A recurring report keeps the outline its readers agreed, so the template is used only for a report that has none.
388
388
 
389
- A slide can also hold a PMOS component instead of a layout: today, the KR metric tile of the Insights page, as a line, bars, a meter or a number. PMOS draws it from the KR metric record when the report is written and keeps a dated snapshot with the report, so an old issue shows the figures of its day. The slide says when the snapshot was taken, and the PowerPoint file draws the same tile.
389
+ A slide can also hold a PMOS component instead of a layout: today, the KR metric tile of the Insights page, as a line, bars, a meter or a number. PMOS draws it from the KR metric record when the report is written and keeps a dated snapshot with the report, so an old issue shows the figures of its day. The slide says when the snapshot was taken, and the PowerPoint file draws the same tile. Above the tile, one line answers it, for example "Signups is 14, 6 short of the target of 20." or, with no target, "Signups is 12, down 4 from its high of 16 on 2 Nov." The line and the bars mark only the reading that line names.
390
390
 
391
391
  ### The window
392
392
 
@@ -11,7 +11,7 @@ Press the round menu button at the bottom of any page, then the **Settings** ico
11
11
 
12
12
  | Section | What it holds |
13
13
  |---|---|
14
- | General | The theme (Light, Dark or Auto), the products Home, the Board and Intelligence read, **New work starts as** (Product, Project or Full SDLC: the kind a new initiative starts as when its name gives no hint; see [what each kind shows](initiatives-and-next-steps.md)), when Your day ends, the Your impact switch, and that agents write to Jira only after you press Commit. When a new PMOS is ready, a card here says so. Under **Extras**, **Adler ›**, **Jev and Laya ›** and **Use log ›** open their own settings (see below). |
14
+ | General | The theme (Light, Dark or Auto), the products Home, the Board and Intelligence read, **New work starts as** (Product, Project or Full SDLC: the kind a new initiative starts as when its name gives no hint; see [what each kind shows](initiatives-and-next-steps.md)), when Your day ends, the Your impact switch, and that agents write to Jira only after you press Commit. When a new PMOS is ready, a card here says so. Under **Extras**, **Adler ›**, **Jev and Laya ›**, **Use log ›** and **Ease check ›** open their own settings (see below). |
15
15
  | How PMOS decides | One suggestion from PMOS when it sees a pattern in what you kept, each kind of change PMOS makes by itself, the calls that are **Always yours**, and PMOS's **Lessons**. |
16
16
  | Checks | When PMOS grills an initiative by itself and the monthly credit for its checks. |
17
17
  | Prototype rules | What every prototype version is checked for before you see it. |
@@ -76,6 +76,7 @@ At the bottom of **General**, **Extras** has three rows. Press the arrow on a ro
76
76
  - **Jev and Laya ›**: the TypeSafe key for Jev, the local model Laya, and the switches for each repository: whether Jev may read it, sort documents, check claims and label notes.
77
77
  - **Use log ›**: what PMOS notes on this computer about how you use it: the pages you open and the buttons you press, kept 30 days. A button is noted by its code name, never by its text or anything you typed. The log stays in the PMOS folder on this computer and is never sent. The panel shows the last 30 days (days, page opens, presses, and the pages and buttons you use most). Press **Clear** to empty it.
78
78
  - **Hidden buttons**: after 14 days, when a page has buttons you saw on many days and never pressed, PMOS offers on that page to hide them (✦, Yes or No; while it shows, those buttons are outlined). Yes hides them and a Toast offers Undo; No keeps them, and PMOS does not suggest them again. Every hidden button is listed here with **Show**, and **Show all** puts them all back. Buttons in the menu, a list, a table, a dialog or a form are never suggested.
79
+ - **Ease check ›**: how easy each page is for you, read from the use log on this computer. For each page, PMOS takes the button you press most there as the page's main task, and shows the usual number of presses and seconds from opening the page to that press. A page over 3 presses or 10 seconds is listed first as slow. It reads the last 14 days, and a page needs 3 visits that reach its main task before it shows. Nothing is sent.
79
80
 
80
81
  ## Checks: when PMOS grills, and what it may spend
81
82
 
@@ -0,0 +1,78 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* ease-check.js — the one-minute ease check per page (bet A453, initiative page-ease-check). A PURE FOLD over the local use log
4
+ * (lib/use-log.js): for each page, its main task and how many presses and seconds it takes the person to reach it.
5
+ * lib/routes-use-log.js serves it (GET /api/use-log/ease); Settings › General › Use log › Ease check shows it.
6
+ *
7
+ * LOCAL ONLY. It reads <runtime>/use-log.jsonl on this computer, writes nothing and sends nothing.
8
+ *
9
+ * THE RULE.
10
+ * visit an `open` of a page and the `use` lines on that page after it, until the next `open` of that page or a gap over GAP_MS
11
+ * main task the page's most-pressed control in the last WINDOW_DAYS days (key-miss, a key that found nothing, never counts)
12
+ * per visit that reached the main task: presses up to and including its first press, and seconds from the open to it
13
+ * per page the median of each; MIN_TASKS or more such visits for a verdict; slow = presses over BAR.presses or seconds over BAR.seconds
14
+ *
15
+ * visits(lines) → [{ page, open, uses: [{ control, t }] }] PURE
16
+ * check(lines, now) → { window, bar, slow, pages: [{ page, opens, control, tasks, presses, seconds, slow }] } PURE, slow first
17
+ * count(lines, days, now) → the presses of the ease check itself (OPEN_ID) in the last `days` days PURE, the health number
18
+ * CLI: node lib/ease-check.js count [--days 7] → that count on its last line */
19
+ const UL = require('./use-log.js');
20
+
21
+ const WINDOW_DAYS = 14;
22
+ const GAP_MS = 5 * 60e3;
23
+ const MIN_TASKS = 3;
24
+ const BAR = { presses: 3, seconds: 10 };
25
+ const TOP = 12;
26
+ const OPEN_ID = 'evEaseCheck';
27
+ const DAY = 864e5;
28
+
29
+ function visits(lines) {
30
+ const L = (Array.isArray(lines) ? lines : []).filter((l) => l && typeof l.at === 'string' && Number.isFinite(Date.parse(l.at)))
31
+ .map((l) => ({ l, t: Date.parse(l.at) })).sort((a, b) => a.t - b.t);
32
+ const open = new Map(), out = [];
33
+ for (const { l, t } of L) {
34
+ if (l.kind === 'open') { const v = { page: l.page, open: t, last: t, uses: [] }; open.set(l.page, v); out.push(v); continue; }
35
+ if (l.kind !== 'use') continue;
36
+ const v = open.get(l.page);
37
+ if (!v) continue;
38
+ if (t - v.last > GAP_MS) { open.delete(l.page); continue; }
39
+ v.uses.push({ control: l.control, t }); v.last = t;
40
+ }
41
+ return out.map(({ page, open: o, uses }) => ({ page, open: o, uses }));
42
+ }
43
+
44
+ const median = (xs) => { const s = [...xs].sort((a, b) => a - b), m = s.length >> 1; return s.length % 2 ? s[m] : (s[m - 1] + s[m]) / 2; };
45
+
46
+ function check(lines, now = Date.now()) {
47
+ const from = now - WINDOW_DAYS * DAY;
48
+ const L = (Array.isArray(lines) ? lines : []).filter((l) => { const t = Date.parse(l && l.at); return t >= from && t <= now + DAY; });
49
+ const byPage = new Map();
50
+ for (const v of visits(L)) { if (!byPage.has(v.page)) byPage.set(v.page, []); byPage.get(v.page).push(v); }
51
+ const pages = [];
52
+ for (const [page, V] of byPage) {
53
+ const n = new Map();
54
+ for (const v of V) for (const u of v.uses) if (u.control !== 'key-miss' && u.control !== OPEN_ID) n.set(u.control, (n.get(u.control) || 0) + 1);
55
+ const control = [...n].sort((a, b) => b[1] - a[1] || (a[0] < b[0] ? -1 : 1)).map(([c]) => c)[0] || null;
56
+ const P = [], S = [];
57
+ if (control) for (const v of V) { const i = v.uses.findIndex((u) => u.control === control); if (i >= 0) { P.push(i + 1); S.push((v.uses[i].t - v.open) / 1000); } }
58
+ const tasks = P.length, presses = tasks ? median(P) : null, seconds = tasks ? Math.round(median(S)) : null;
59
+ pages.push({ page, opens: V.length, control, tasks, presses, seconds, slow: tasks >= MIN_TASKS && (presses > BAR.presses || seconds > BAR.seconds) });
60
+ }
61
+ pages.sort((a, b) => (b.slow - a.slow) || (b.opens - a.opens) || (a.page < b.page ? -1 : 1));
62
+ const top = pages.slice(0, TOP);
63
+ return { window: WINDOW_DAYS, bar: { ...BAR }, slow: pages.filter((p) => p.slow).length, pages: top };
64
+ }
65
+
66
+ function count(lines, days = 7, now = Date.now()) {
67
+ const from = now - Math.max(1, Number(days) || 7) * DAY;
68
+ return (Array.isArray(lines) ? lines : []).filter((l) => l && l.kind === 'use' && l.control === OPEN_ID && Date.parse(l.at) >= from && Date.parse(l.at) <= now + DAY).length;
69
+ }
70
+
71
+ module.exports = { WINDOW_DAYS, GAP_MS, MIN_TASKS, BAR, OPEN_ID, visits, check, count };
72
+
73
+ if (require.main === module) {
74
+ if (process.argv[2] !== 'count') { console.error('usage: node lib/ease-check.js count [--days 7] (how many times the ease check was opened)'); process.exit(2); }
75
+ const dir = require('./state-root.js').defaultRoot({ env: process.env });
76
+ const i = process.argv.indexOf('--days');
77
+ console.log(String(count(UL.readLines(dir), i > 0 ? process.argv[i + 1] : 7)));
78
+ }
@@ -5,6 +5,7 @@
5
5
  * GET /api/use-log → { ok, keep, days, opens, uses, pages, controls } Settings › General › Use log
6
6
  * POST /api/use-log { events } → { ok, wrote } the page side (public/pm/use-log.js), in batches
7
7
  * POST /api/use-log/clear {} → { ok } Clear, in Settings (also forgets what pages showed)
8
+ * GET /api/use-log/ease → { ok, window, bar, slow, pages } Settings › Use log › Ease check (bet A453, lib/ease-check.js)
8
9
  * Hide the buttons nobody presses (idea A454; the store and the rule are lib/unused-controls.js):
9
10
  * GET /api/use-log/hidden[?page=] → { ok, hidden: [{ page, control, at }] } the page at load; Settings › Use log
10
11
  * POST /api/use-log/unused { page, present } → { ok, hidden, propose } what the page shows (ids), and the ✦
@@ -18,13 +19,20 @@
18
19
  const guard = require('./pm-guard.js');
19
20
  const UL = require('./use-log.js');
20
21
  const UC = require('./unused-controls.js');
22
+ const EC = require('./ease-check.js');
21
23
  const POSTS = ['', 'clear', 'unused', 'hide', 'show', 'decline'];
22
24
 
23
25
  async function handle(req, res, url, ctx) {
24
26
  const send = (status, body) => { ctx.json(res, body, status); return true; };
25
27
  const what = url.pathname.replace(/^\/api\/use-log\/?/, '');
26
- if (!POSTS.includes(what) && what !== 'hidden') return send(404, { ok: false, error: 'no such use-log route' });
28
+ if (!POSTS.includes(what) && what !== 'hidden' && what !== 'ease') return send(404, { ok: false, error: 'no such use-log route' });
27
29
  const dir = ctx.runtimeDir || null;
30
+ if (what === 'ease') {
31
+ if (req.method !== 'GET') return send(405, { ok: false, error: 'GET only' });
32
+ const r = EC.check(UL.readLines(dir));
33
+ console.log(`[ease-check] read: ${r.pages.length} pages, ${r.slow} slow`);
34
+ return send(200, { ok: true, ...r });
35
+ }
28
36
  if (what === '' && req.method === 'GET') return send(200, { ok: true, ...UL.summary(UL.readLines(dir)) });
29
37
  if (what === 'hidden') {
30
38
  if (req.method !== 'GET') return send(405, { ok: false, error: 'GET only' });
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.715.0",
3
+ "version": "0.717.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.715.0",
9
+ "version": "0.717.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.715.0",
3
+ "version": "0.717.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",
@@ -74,7 +74,7 @@ async function pmSend(method, path, body) {
74
74
  catch (e) { return { ok: false, error: 'could not reach the workspace server — ' + ((e && e.message) || String(e)) }; }
75
75
  }
76
76
  const SECTIONS = SD.SECTIONS;
77
- const SUBS = { adler: 'Adler', jl: 'Jev and Laya', workflows: 'Workflows', uselog: 'Use log' }; // General › Extras and Workspaces › Workflows: each opens as a sub-panel of its section (U4, U1)
77
+ const SUBS = { adler: 'Adler', jl: 'Jev and Laya', workflows: 'Workflows', uselog: 'Use log', ease: 'Ease check' }; // General › Extras and Workspaces › Workflows: each opens as a sub-panel of its section (U4, U1)
78
78
  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' };
79
79
  const T = { lsOpen: false, el: null, sec: 'general', sub: '', ws: null, st: {}, src: null, con: {}, conn: [], set: null, prods: null, msg: '', busy: false, phase: '', say: '', back: null, fresh: null, reading: '', note: {}, info: false, fold: false, dir: null, q: '', cat: 'all', wait: null, dress: false, more: false, bday: false, dset: {}, wkOpen: new Set(), wkMore: new Set(), arc: false };
80
80
  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; };
@@ -101,6 +101,7 @@ function general() {
101
101
  if (T.sub === 'adler') return T.dress ? dressSec() : subHead('adler') + adlerSec();
102
102
  if (T.sub === 'jl') return subHead('jl') + JL.html();
103
103
  if (T.sub === 'uselog') return subHead('uselog') + useLogSec();
104
+ if (T.sub === 'ease') return subHead('ease') + easeSec();
104
105
  const theme = (() => { const t = store.get('pmos.c3.theme'); return t === 'light' || t === 'dark' ? t : 'auto'; })();
105
106
  const P = T.prods, on = P ? P.filter((x) => x.on) : null;
106
107
  // the product the pages read (workspace grill W4): the page's own ?ws= first, then the pick; "No product" only when none is registered
@@ -120,7 +121,8 @@ function general() {
120
121
  + '<h4 class="pm-h-sm">Extras</h4>'
121
122
  + trow('Adler', 'How much of PMOS’s face shows, motion, celebrations, quiet hours and Dress for the day', subBtn('adler'))
122
123
  + trow('Jev and Laya', 'The TypeSafe key, Laya on this computer and the repositories it reads', subBtn('jl'))
123
- + trow('Use log', 'The pages you open and the buttons you press, kept 30 days. It stays on this computer and is never sent.', subBtn('uselog'));
124
+ + trow('Use log', 'The pages you open and the buttons you press, kept 30 days. It stays on this computer and is never sent.', subBtn('uselog'))
125
+ + trow('Ease check', 'How many presses and seconds each page’s main task takes you, from the use log', `<button type="button" class="ev-ib pm-btn" id="evEaseCheck" data-ev-sub="ease" aria-label="Ease check" title="Ease check">${svg(CHEV, 18)}</button>`);
124
126
  }
125
127
  /* General › Extras › Use log (bet A466): what lib/use-log.js keeps for the last 30 days (GET /api/use-log), and Clear (POST /api/use-log/clear) */
126
128
  const UL_PAGE = { today: 'Today', premium: 'Home', 'premium-board': 'Work', 'premium-goals': 'Goals', 'premium-intelligence': 'Intelligence', 'premium-library': 'Library', 'premium-events': 'Events', 'premium-routine': 'Routine', 'premium-viewer': 'Viewer' };
@@ -131,6 +133,24 @@ async function loadUseLog() {
131
133
  T.uh = h && h.ok && Array.isArray(h.hidden) ? h.hidden : [];
132
134
  draw();
133
135
  }
136
+ /* General › Extras › Ease check (bet A453): lib/ease-check.js over the use log (GET /api/use-log/ease). Summary first, slow pages first;
137
+ * a page with too few visits says nothing. The row's button has the id evEaseCheck, so the use log counts the opens (the kill count). */
138
+ async function loadEase() {
139
+ const r = await pmGet('/api/use-log/ease');
140
+ T.ec = r && r.ok ? r : { error: (r && r.error) || 'PMOS could not read the use log.' };
141
+ draw();
142
+ }
143
+ function easeSec() {
144
+ const E = T.ec;
145
+ if (!E) return '<p class="ev-mut">Reading…</p>';
146
+ if (E.error) return `<p class="ev-mut">${esc(E.error)}</p>`;
147
+ const about = `<p class="ev-mut">For each page, PMOS takes the button you press most there as its main task, and counts the presses and seconds from opening the page to that press. A page over ${E.bar.presses} presses or ${E.bar.seconds} seconds is slow. It reads the last ${E.window} days of your use log, on this computer only, and sends nothing.</p>`;
148
+ const P = (E.pages || []).filter((x) => x.tasks >= 3);
149
+ if (!P.length) return about + '<p class="ev-mut">Not enough use yet. A page needs 3 visits that reach its main task.</p>';
150
+ const slow = P.filter((x) => x.slow), plural = (n, w) => `${n} ${n === 1 ? w : w + 'es'}`;
151
+ const head = slow.length ? `<p><b>${slow.length} ${slow.length === 1 ? 'page is' : 'pages are'} slow:</b> ${esc(slow.map((x) => ulPage(x.page)).join(', '))}.</p>` : '<p><b>No page is slow.</b></p>';
152
+ return about + head + `<ul class="ev-ul-list">${P.map((x) => `<li>${esc(ulPage(x.page))} <span class="ev-mut">${esc(x.control)} · ${plural(x.presses, 'press')} · ${x.seconds} s · ${x.tasks} times</span>${x.slow ? ' <span class="pm-badge alert">Slow</span>' : ''}</li>`).join('')}</ul>`;
153
+ }
134
154
  /* Hidden buttons (idea A454): what PMOS hid after a Yes on its ✦ (lib/unused-controls.js). Each one comes back with Show, or all with Show all,
135
155
  * so a hidden button is never lost. A button is named by its id, never its text. */
136
156
  function hiddenSec() {
@@ -659,7 +679,7 @@ async function press(e) {
659
679
  if ('evFold' in t.dataset) { T.fold = !T.fold; draw(); return; }
660
680
  if (t.dataset.evMore) { T.wkMore.add(t.dataset.evMore); draw(); return; }
661
681
  if (t.dataset.evGo) { T.sec = t.dataset.evGo; T.sub = ''; draw(); return; }
662
- if (t.dataset.evSub !== undefined) { const k = t.dataset.evSub, was = T.sub; T.sub = k; if (k === 'uselog') { T.ul = null; loadUseLog(); } T.dress = false; T.more = false; T.bday = false; T.msg = ''; draw(); const f = T.el.querySelector(k ? '[data-ev-sub=""]' : `[data-ev-sub="${was}"]`); if (f) f.focus(); return; }
682
+ if (t.dataset.evSub !== undefined) { const k = t.dataset.evSub, was = T.sub; T.sub = k; if (k === 'uselog') { T.ul = null; loadUseLog(); } if (k === 'ease') { T.ec = null; loadEase(); } T.dress = false; T.more = false; T.bday = false; T.msg = ''; draw(); const f = T.el.querySelector(k ? '[data-ev-sub=""]' : `[data-ev-sub="${was}"]`); if (f) f.focus(); return; }
663
683
  if (t.dataset.evSeg && t.dataset.evSeg.startsWith('claude.way:')) { await saveWay(t.dataset.evSeg.slice(11), t.dataset.v); return; }
664
684
  if (t.dataset.evSeg === 'work.role') {
665
685
  const r = await pmPost('/api/settings', { key: 'work.role', value: t.dataset.v });
@@ -1,6 +1,8 @@
1
1
  /* pm/premium-chart-draw.js — a chart tile in one of four forms: line, bars, number, meter (initiative premium-studio-chart C3). The Insights page and the
2
2
  * Chart tab beside a chat (initiative premium-reports-from-chat, slice C) share this drawing. A KR metric's own chart is a line; a chart the PM saved
3
- * carries its form. Bars and a meter start at zero, so a series with a value below zero is drawn as a line and says so. Pure strings: no DOM. */
3
+ * carries its form. Bars and a meter start at zero, so a series with a value below zero is drawn as a line and says so. Pure strings: no DOM.
4
+ * Every form says its point (bet A349, initiative chart-headline-point): headlineOf answers the chart in one sentence above it, and the line
5
+ * and bars light only the reading that sentence names (Charts system: the answer is the heading; one lit thing). */
4
6
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
5
7
  export const W = 220, H = 60, P = 5;
6
8
  export const X = (fx) => P + fx * (W - 2 * P), Y = (fy) => P + (1 - fy) * (H - 2 * P);
@@ -8,35 +10,57 @@ export const unitTxt = (c, v) => { const u = c.unit || '', s = String(Math.round
8
10
  function chgHtml(c) {
9
11
  return c.step === 0 ? '' : `<span class="mchg ${c.good === null ? '' : c.good ? 'good' : 'bad'}">${c.step > 0 ? '▲ ' : '▼ '}${esc(Math.abs(c.step) + (c.unit && /^[%°]/.test(c.unit) ? c.unit : c.unit ? ' ' + c.unit : ''))} since the last reading</span>`;
10
12
  }
13
+ const r2 = (v) => Math.round(v * 100) / 100;
14
+ /** The chart's answer as one sentence, and the index of the reading it names (bet A349). With a target: the gap to it, or reached
15
+ * (a limit when lower is better); the point is the latest reading. Without one: the highest or lowest so far, else the change from
16
+ * the high (the low, when lower is better) and that reading is the point. */
17
+ export function headlineOf(c) {
18
+ const vs = c.pts.map((p) => p.v), last = vs.length - 1, now = vs[last], t = c.title + ' is ' + c.v;
19
+ if (c.target !== null && c.target !== undefined) {
20
+ const tg = c.target, T = unitTxt(c, tg), gap = r2(Math.abs(tg - now)), G = unitTxt(c, gap);
21
+ if (!gap) return { text: `${t}, at its target of ${T}.`, i: last };
22
+ if (c.dir < 0) return { text: now <= tg ? `${t}, within the limit of ${T}.` : `${t}, ${G} over the limit of ${T}.`, i: last };
23
+ if (c.dir > 0) return { text: now >= tg ? `${t}, past the target of ${T}.` : `${t}, ${G} short of the target of ${T}.`, i: last };
24
+ return { text: `${t}, ${G} ${now < tg ? 'below' : 'above'} the target of ${T}.`, i: last };
25
+ }
26
+ const hi = Math.max(...vs), lo = Math.min(...vs);
27
+ if (hi === lo) return { text: `${c.title} is flat at ${c.v}.`, i: last };
28
+ if (now === hi) return { text: `${t}, its highest reading so far.`, i: last };
29
+ if (now === lo) return { text: `${t}, its lowest reading so far.`, i: last };
30
+ const low = c.dir < 0, i = vs.lastIndexOf(low ? lo : hi), p = c.pts[i];
31
+ return { text: `${t}, ${low ? 'up' : 'down'} ${unitTxt(c, r2(Math.abs(now - p.v)))} from its ${low ? 'low' : 'high'} of ${p.txt} on ${p.d}.`, i };
32
+ }
33
+ const headOf = (hd) => `<p class="mhead" data-headline>${esc(hd.text)}</p>`;
11
34
  const chipOf = (c) => `<i class="mchip ${c.chipKind === 'bad' ? 'warn' : c.chipKind}">${esc(c.chip)}</i>`;
12
35
  const capOf = (c) => 'on ' + c.at + (c.targetTxt ? ' · ' + c.targetTxt : '');
13
36
  export function tileHtml(c) {
14
37
  const f = c.form || 'line', neg = c.pts.some((p) => p.v < 0) || (c.target !== null && c.target < 0);
15
- const h = f === 'number' ? numTile(c) : f === 'bars' && !neg ? barsTile(c) : f === 'meter' && !neg && c.target !== null ? meterTile(c) : lineTile(c, f !== 'line' && f !== 'number' ? (neg ? 'A value is below zero, so it is drawn as a line.' : 'No target is set, so it is drawn as a line.') : '');
38
+ const hd = headlineOf(c);
39
+ const h = f === 'number' ? numTile(c, hd) : f === 'bars' && !neg ? barsTile(c, hd) : f === 'meter' && !neg && c.target !== null ? meterTile(c, hd) : lineTile(c, hd, f !== 'line' && f !== 'number' ? (neg ? 'A value is below zero, so it is drawn as a line.' : 'No target is set, so it is drawn as a line.') : '');
16
40
  return h + (c.note ? `<p class="mnote">${esc(c.note)}</p>` : '');
17
41
  }
18
- function lineTile(c, why) {
42
+ function lineTile(c, hd, why) {
19
43
  const d = c.pts.map((p, i) => (i ? 'L' : 'M') + X(p.fx).toFixed(1) + ',' + Y(p.fy).toFixed(1)).join('');
20
- const last = c.pts[c.pts.length - 1];
21
- return `<div class="mt1 mch ${c.chipKind}${c.off ? ' off' : ''}" data-key="${esc(c.key)}" tabindex="0" role="img" aria-label="${esc(c.title)}, ${c.pts.length} readings, now ${esc(c.v)}${c.targetTxt ? ', ' + esc(c.targetTxt) : ''}. Use the arrow keys to read each reading."><span class="mlab">${esc(c.title)}${chipOf(c)}</span><b class="mval">${esc(c.v)}</b><em class="mwk">${esc(capOf(c))}</em>${chgHtml(c)}`
22
- + `<svg viewBox="0 0 ${W} ${H}"><path class="ar" d="${d}L${X(1)},${H}L${X(0)},${H}Z"/>${c.ty !== null ? `<line class="tg" x1="${P}" x2="${W - P}" y1="${Y(c.ty)}" y2="${Y(c.ty)}"/>` : ''}<path class="ln2" d="${d}"/><line class="cx" x1="0" x2="0" y1="0" y2="${H}"/><circle class="dt" cx="${X(last.fx)}" cy="${Y(last.fy)}" r="3.5"/></svg>`
44
+ const last = c.pts[c.pts.length - 1], ans = c.pts[hd.i], lit = hd.i === c.pts.length - 1;
45
+ return `<div class="mt1 mch ${c.chipKind}${c.off ? ' off' : ''}" data-key="${esc(c.key)}" tabindex="0" role="img" aria-label="${esc(hd.text)} ${esc(c.title)}, ${c.pts.length} readings, now ${esc(c.v)}${c.targetTxt ? ', ' + esc(c.targetTxt) : ''}. Use the arrow keys to read each reading."><span class="mlab">${esc(c.title)}${chipOf(c)}</span>${headOf(hd)}<b class="mval">${esc(c.v)}</b><em class="mwk">${esc(capOf(c))}</em>${chgHtml(c)}`
46
+ + `<svg viewBox="0 0 ${W} ${H}"><path class="ar" d="${d}L${X(1)},${H}L${X(0)},${H}Z"/>${c.ty !== null ? `<line class="tg" x1="${P}" x2="${W - P}" y1="${Y(c.ty)}" y2="${Y(c.ty)}"/>` : ''}<path class="ln2" d="${d}"/><line class="cx" x1="0" x2="0" y1="0" y2="${H}"/><circle class="dt${lit ? ' f-read' : ''}" cx="${X(last.fx)}" cy="${Y(last.fy)}" r="3.5"/>${lit ? '' : `<circle class="ans f-read" cx="${X(ans.fx).toFixed(1)}" cy="${Y(ans.fy).toFixed(1)}" r="3.5"/>`}</svg>`
23
47
  + `<span class="mfoot"><i>${esc(c.ticks[0])}</i>${c.target !== null ? '<i class="tgl">dashed line is the target</i>' : ''}<i>${esc(c.ticks[1])}</i></span>${why ? `<span class="mwhy">${esc(why)}</span>` : ''}</div>`;
24
48
  }
25
- function barsTile(c) {
49
+ function barsTile(c, hd) {
26
50
  const n = c.pts.length, hi = Math.max(...c.pts.map((p) => p.v), c.target !== null ? c.target : 0) || 1, pc = (v) => (v / hi * 84).toFixed(1);
27
- const cols = c.pts.map((p, i) => `<span class="bw" title="${esc(p.d + ': ' + p.txt)}">${i === n - 1 ? `<b class="bl">${esc(p.txt)}</b>` : ''}<i class="${i === n - 1 ? 'bk' : 'bg'}" style="height:${pc(p.v)}%"></i></span>`).join('');
28
- return `<div class="mt1 mfm bars ${c.chipKind}${c.off ? ' off' : ''}" data-key="${esc(c.key)}" role="img" aria-label="${esc(c.title)}, ${n} readings as bars from zero, now ${esc(c.v)}${c.targetTxt ? ', ' + esc(c.targetTxt) : ''}"><span class="mlab">${esc(c.title)}${chipOf(c)}</span><b class="mval">${esc(c.v)}</b><em class="mwk">${esc(capOf(c))}</em>${chgHtml(c)}`
51
+ const cols = c.pts.map((p, i) => `<span class="bw" title="${esc(p.d + ': ' + p.txt)}">${i === hd.i ? `<b class="bl">${esc(p.txt)}</b>` : ''}<i class="${i === hd.i ? 'bk' : 'bg'}" style="height:${pc(p.v)}%"></i></span>`).join('');
52
+ return `<div class="mt1 mfm bars ${c.chipKind}${c.off ? ' off' : ''}" data-key="${esc(c.key)}" role="img" aria-label="${esc(hd.text)} ${esc(c.title)}, ${n} readings as bars from zero, now ${esc(c.v)}${c.targetTxt ? ', ' + esc(c.targetTxt) : ''}"><span class="mlab">${esc(c.title)}${chipOf(c)}</span>${headOf(hd)}<b class="mval">${esc(c.v)}</b><em class="mwk">${esc(capOf(c))}</em>${chgHtml(c)}`
29
53
  + `<div class="bplot">${cols}${c.target !== null ? `<i class="btg" style="bottom:${pc(c.target)}%"></i>` : ''}</div>`
30
54
  + `<span class="mfoot"><i>${esc(c.ticks[0])}</i><i class="tgl">${c.target !== null ? 'dashed line is the target' : 'bars start at zero'}</i><i>${esc(c.ticks[1])}</i></span></div>`;
31
55
  }
32
- function numTile(c) {
56
+ function numTile(c, hd) {
33
57
  const d = c.pts.map((p, i) => (i ? 'L' : 'M') + X(p.fx).toFixed(1) + ',' + (2 + (1 - p.fy) * 26).toFixed(1)).join('');
34
- return `<div class="mt1 mfm num ${c.chipKind}${c.off ? ' off' : ''}" data-key="${esc(c.key)}" role="img" aria-label="${esc(c.title)}, now ${esc(c.v)}${c.targetTxt ? ', ' + esc(c.targetTxt) : ''}"><span class="mlab">${esc(c.title)}${chipOf(c)}</span><b class="mval mhero">${esc(c.v)}</b><em class="mwk">${esc(capOf(c))}</em>${chgHtml(c)}`
58
+ return `<div class="mt1 mfm num ${c.chipKind}${c.off ? ' off' : ''}" data-key="${esc(c.key)}" role="img" aria-label="${esc(hd.text)} ${esc(c.title)}, now ${esc(c.v)}${c.targetTxt ? ', ' + esc(c.targetTxt) : ''}"><span class="mlab">${esc(c.title)}${chipOf(c)}</span>${headOf(hd)}<b class="mval mhero">${esc(c.v)}</b><em class="mwk">${esc(capOf(c))}</em>${chgHtml(c)}`
35
59
  + `<svg class="nspk" viewBox="0 0 ${W} 30" aria-hidden="true"><path d="${d}"/></svg></div>`;
36
60
  }
37
- function meterTile(c) {
61
+ function meterTile(c, hd) {
38
62
  const v = c.pts[c.pts.length - 1].v, tg = c.target, hi = Math.max(v, tg) * 1.15 || 1, lower = c.dir < 0, ok = lower ? v <= tg : v >= tg;
39
- return `<div class="mt1 mfm prg ${c.chipKind}${c.off ? ' off' : ''}" data-key="${esc(c.key)}" role="img" aria-label="${esc(c.title)} is ${esc(c.v)} against ${lower ? 'a limit' : 'a target'} of ${esc(unitTxt(c, tg))}. ${ok ? 'It is on the right side of it.' : 'It is not there yet.'}"><span class="mlab">${esc(c.title)}${chipOf(c)}</span><b class="mval">${esc(c.v)}</b><em class="mwk">${esc(ok ? (lower ? 'Within the limit' : 'At or past the target') : (lower ? 'Over the limit' : 'Short of the target'))}</em>`
63
+ return `<div class="mt1 mfm prg ${c.chipKind}${c.off ? ' off' : ''}" data-key="${esc(c.key)}" role="img" aria-label="${esc(hd.text)} ${esc(c.title)} is ${esc(c.v)} against ${lower ? 'a limit' : 'a target'} of ${esc(unitTxt(c, tg))}. ${ok ? 'It is on the right side of it.' : 'It is not there yet.'}"><span class="mlab">${esc(c.title)}${chipOf(c)}</span>${headOf(hd)}<b class="mval">${esc(c.v)}</b><em class="mwk">${esc(ok ? (lower ? 'Within the limit' : 'At or past the target') : (lower ? 'Over the limit' : 'Short of the target'))}</em>`
40
64
  + `<div class="mtrk"><i class="mfil ${ok ? 'ok' : 'warn'}" style="width:${(v / hi * 100).toFixed(1)}%"></i><i class="mtgt" style="left:${(tg / hi * 100).toFixed(1)}%"></i></div>`
41
65
  + `<span class="mfoot"><i>0</i><i class="tgl">${lower ? 'limit' : 'target'} ${esc(unitTxt(c, tg))}</i><i>${esc(unitTxt(c, hi))}</i></span></div>`;
42
66
  }
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "Charts say their point (bet A349, initiative chart-headline-point, done test planning/done-tests/chart-headline-point.md H1-H5): the one-line headline of a chart in its four forms and the one lit reading. No server, network or browser.",
3
+ "modules": [
4
+ "chart-headline.test.js"
5
+ ],
6
+ "seconds": {
7
+ "chart-headline.test.js": 1
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "The one-minute ease check per page (bet A453, initiative page-ease-check, done test planning/done-tests/page-ease-check.md E1-E6): visits from the local use log, the main task, median presses and seconds, the slow bar, the count CLI, the route in process and the Settings sub-panel. No server, network or browser.",
3
+ "modules": [
4
+ "ease-check.test.js"
5
+ ],
6
+ "seconds": {
7
+ "ease-check.test.js": 2
8
+ }
9
+ }