create-pmos 0.478.0 → 0.479.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 (32) hide show
  1. package/package.json +13 -14
  2. package/payload/KIT-VERSION +1 -1
  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/workspace/briefing-premium-initiative-test.js +1 -1
  7. package/workspace/changelog.json +12 -0
  8. package/workspace/guide/home.md +2 -1
  9. package/workspace/guide/programs.md +15 -5
  10. package/workspace/lib/board-pack-route.js +10 -1
  11. package/workspace/lib/board-pack.js +31 -2
  12. package/workspace/lib/briefing-premium-products.js +5 -2
  13. package/workspace/lib/briefing-premium.js +5 -3
  14. package/workspace/lib/ready-reports.js +31 -6
  15. package/workspace/metric-drafts-ui-test.js +2 -1
  16. package/workspace/milestone-suggest-test.js +12 -6
  17. package/workspace/package-lock.json +2 -2
  18. package/workspace/package.json +1 -1
  19. package/workspace/program-charter-test.js +5 -5
  20. package/workspace/program-panel-test.js +28 -25
  21. package/workspace/public/pm/bd-prog-panel.js +84 -60
  22. package/workspace/public/pm/chat-md.js +5 -2
  23. package/workspace/public/pm/cozy-home.css +3 -0
  24. package/workspace/public/pm/dash-view.js +9 -5
  25. package/workspace/public/pm/goal-chat.js +3 -1
  26. package/workspace/public/pm/home-app.js +53 -21
  27. package/workspace/public/pm/home-chat.js +2 -2
  28. package/workspace/public/pm/premium.css +1 -0
  29. package/workspace/public/pm/prog-page.css +76 -0
  30. package/workspace/public/pm/prog-page.js +112 -0
  31. package/workspace/public/pm/readonly.js +8 -1
  32. package/workspace/ready-dash-ui-test.js +53 -73
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.478.0",
3
+ "version": "0.479.0",
4
4
  "description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -32,6 +32,18 @@
32
32
  "audit"
33
33
  ],
34
34
  "pmosChanges": [
35
+ {
36
+ "v": "0.479.0",
37
+ "at": "2026-11-01T10:19:06.142Z",
38
+ "f": 3,
39
+ "prs": [
40
+ {
41
+ "n": 1137,
42
+ "t": "Batch 21: feedback fixes (held for one merge)",
43
+ "s": "Batch 21: feedback fixes (held for one merge)"
44
+ }
45
+ ]
46
+ },
35
47
  {
36
48
  "v": "0.478.0",
37
49
  "at": "2026-11-01T08:32:21.933Z",
@@ -284,19 +296,6 @@
284
296
  "k": "fix"
285
297
  }
286
298
  ]
287
- },
288
- {
289
- "v": "0.459.0",
290
- "at": "2026-10-30T09:40:09.558Z",
291
- "f": 3,
292
- "prs": [
293
- {
294
- "n": 1109,
295
- "t": "Refresh saved task notes on reopen",
296
- "s": "Reopening a task after its notes save finishes shows the saved notes, including when the task was opened while the save was pending.",
297
- "k": "fix"
298
- }
299
- ]
300
299
  }
301
300
  ]
302
301
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@e2a358e4
1
+ kernel-source: pmos@06948cf0
2
2
  assembled: 2026-11-01
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-01T08:32:18Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-01T10:19:03Z"}
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-01T08:32:18Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-01T10:19:03Z"}
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-01T08:32:18Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-01T10:19:03Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -122,7 +122,7 @@ const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-
122
122
  ok('I1 the browser\'s Back closes the page and leads back to all work', await until(() => p.evaluate(() => !new URLSearchParams(location.search).get('ini') && !document.querySelector('#czViewer:not([hidden])') && !document.querySelector('#hmList [aria-current="true"][data-hm-sel^="i:"]'))), p.url());
123
123
  await p.evaluate(() => { window.__noReload = 1; });
124
124
  await p.click('#hmList [data-hm-prodopen]');
125
- ok('I1 a product heading\'s name opens the product in the Viewer with its goals and this week, and its own chat (HbCProduct)', await until(() => p.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); return !!v && /Product/.test((v.querySelector('.cz-vw-kind') || {}).textContent || '') && !!v.querySelector('section.hi-pg[aria-label="Goals"]') && !!v.querySelector('[data-hp="update"]') && /^Message Claude about /.test(document.querySelector('#hmIn').placeholder) && !!document.querySelector('#hmList .hv-prg.sel [data-hm-prodopen]'); })));
125
+ ok('I1 a product heading\'s name opens the product\'s one page in the Viewer with its goals and its Reports tab, and its own chat (HbCProduct, batch 21 item 2)', await until(() => p.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); return !!v && /Product/.test((v.querySelector('.cz-vw-kind') || {}).textContent || '') && !!v.querySelector('section.hi-pg[aria-label="Goals"]') && !!v.querySelector('[data-pv="tab"][data-k="reports"]') && /^Message Claude about /.test(document.querySelector('#hmIn').placeholder) && !!document.querySelector('#hmList .hv-prg.sel [data-hm-prodopen]'); })));
126
126
  await p.click('#czFab'); await p.click('#czMenu a[aria-current="page"]');
127
127
  ok('I1 Menu > Home closes the page and clears the selection, without a reload', await until(() => p.evaluate(() => window.__noReload === 1 && !document.querySelector('#czViewer:not([hidden])') && !document.querySelector('#hmList .sel, #hmList [aria-current="true"]') && /^Message Claude$/.test(document.querySelector('#hmIn').placeholder))));
128
128
  await p.goto(BASE + '/premium.html?ini=self-serve-v2&ws=w1&board=w1&theme=light'); await ready(p);
@@ -1,4 +1,16 @@
1
1
  [
2
+ {
3
+ "v": "0.479.0",
4
+ "at": "2026-11-01T10:19:06.142Z",
5
+ "f": 3,
6
+ "prs": [
7
+ {
8
+ "n": 1137,
9
+ "t": "Batch 21: feedback fixes (held for one merge)",
10
+ "s": "Batch 21: feedback fixes (held for one merge)"
11
+ }
12
+ ]
13
+ },
2
14
  {
3
15
  "v": "0.478.0",
4
16
  "at": "2026-11-01T08:32:21.933Z",
@@ -89,7 +89,7 @@ Press an initiative's name in the list, or open `?ini=<id>`. The list stays as i
89
89
  - Press **↻** beside Jira's last read in **Linked** to read Jira again (only when the board reads Jira).
90
90
  - Press the stage name on the stage card to open the stage picker (see below).
91
91
  - **The stage picker** lists every stage of the workflow. The current stage is marked. Press an earlier stage to move back, or a later stage to move on. Under the stages are the **Moves on by itself** switch, **Put on hold** (**Resume** when it is on hold), **Won't do** (**Back to Triage** after Won't do) and **Archive**. On a phone the picker is a sheet. **Cancel the initiative** is gone: use **Won't do**, which keeps the record.
92
- - **Delete** asks nothing. The initiative and its PMOS tasks go at once, and the message says, for example, "Deleted Email OTP and its 67 tasks" with **Undo** for 8 seconds. Undo brings back the initiative and every task. Delete never changes Jira. A deleted initiative leaves Home, the Board, Intelligence, Search and the reports. The board's ledger keeps the delete, so a later restore can bring it back.
92
+ - **Delete** asks nothing. The initiative and its PMOS tasks go at once, and the message says, for example, "Deleted Email OTP and its 67 tasks" with **Undo** for 8 seconds. Undo brings back the initiative and every task. Delete never changes Jira. A deleted initiative leaves Home, the Board, Intelligence, Search and the reports. The board's ledger keeps the delete, so a later restore can bring it back. A next step about a deleted initiative does not bring it back to Home.
93
93
  - An item that does not apply does not show. For example, a PMOS-self initiative has no stage moves and no workflow to change. To open the initiative wide, use the expand button in the header.
94
94
  - To go back to all work, press the browser's Back, or Menu > **Home**. Neither reloads the page. Close (×) closes the page but keeps the initiative's chat. See [Back and forward](#back-and-forward).
95
95
  - If there is no room beside the chat, the Viewer shows on top of the chat. The list stays.
@@ -187,6 +187,7 @@ There is no My work page. The list on Home is your list:
187
187
 
188
188
  - A conversation opens at its latest message.
189
189
  - A file that you send shows as a chip in your message, with a small picture for a photo. Press the chip to open the file beside the conversation.
190
+ - Your message shows as you typed it. Markdown that you paste (headings, lists, bold, code, tables) shows formatted.
190
191
  - Type `/` to see every command: `/goal`, the commands built into Claude Code, and the commands and skills in the workspace's `.claude` folder and in your own `~/.claude` folder.
191
192
  - The mic types what you say into the box. **Stop** keeps the words, and **Discard** puts the box back. Both end listening at once.
192
193
  - When Claude Code asks whether to trust the folder of a new chat, the chat shows the ask as a card: **Trust this folder** or **No, end the session**. Your first message waits until you answer, for up to 15 minutes, and is then sent. It is never typed into the question.
@@ -2,7 +2,7 @@
2
2
  type: Guide
3
3
  title: "Programs on the Board: All products, groupings and the program panel"
4
4
  description: "A program groups initiatives across products. How it shows on the Board (stage track, Kanban, timeline and List), the All products mode, the By product grouping, the program panel and the side panel width."
5
- timestamp: 2026-10-28
5
+ timestamp: 2026-11-01
6
6
  ---
7
7
 
8
8
  # Programs on the Board
@@ -37,10 +37,20 @@ Press a program's name on the Board to open its panel. Home links to it with `?p
37
37
  - The top shows the program's name, its owner and its span (for example "Sep 2026 to Jun 2028").
38
38
  - Press the program's name to rename it (see Home, "Rename a program, an initiative or a task"). The panel saves the whole charter again with the same id, so the rename never makes a new program.
39
39
  - The goal row shows the KRs of its initiatives for one half year, each with its name and a dot (met, on course or behind). Use the half-year picker to see another half. Earlier halves fold into one chip.
40
- - The milestone track shows the next 3 milestones. The done cluster and the **N more** cluster open the **Milestones** tab, which lists Done, Next and Later.
41
- - The rows that wait on you open in Home.
42
- - After **Make it a program**, a card counts the tasks that have no level yet. Press the arrow to ask Claude in Home to suggest a level for each task.
43
- - The tabs are **Tree**, **Tasks**, **Milestones** and **Documents**. The panel has no chat box: use Home to talk about the program.
40
+ - The goal card holds the milestone track with the next 3 milestones. The done cluster and the **N more** cluster open every milestone in the card: Done, Next and Later.
41
+ - The **Tasks** tab starts with what waits on you. Each row opens in Home.
42
+ - After **Make it a program**, a card counts the tasks that have no level yet. Press **Review the suggested homes** to ask Claude in Home to suggest a level for each task.
43
+ - The panel has no chat box: use Home to talk about the program.
44
+
45
+ ### One page for a program or a product
46
+
47
+ The Viewer of a program, and the product page, are one page. There is no Work and Dashboard switch.
48
+
49
+ - The top shows Claude's ✦ line, then the goal card with its milestones and the forecast bar. Goals show a short title, not the KR's full text.
50
+ - When Claude proposes changes, a folded row under the goal card counts them. Only the owner sees this row.
51
+ - The tabs are **Tasks**, **Initiatives** (the default), **Reports** and **Documents**.
52
+ - The product page also shows a **Programs** card and a **Health budgets** card.
53
+ - A teammate on a shared board sees the same page, with no proposals.
44
54
 
45
55
  ## Claude suggests milestones
46
56
 
@@ -5,7 +5,8 @@
5
5
  *
6
6
  * 200 { ok, pack } | 202 { ok, state: 'reading' } | 400 { ok: false, error } (a selection the board does not hold, or too big)
7
7
  * The data pack of a selection (lib/board-pack.js): the Board's own GET answers, read from the routes the Board reads, whitelisted and swept for what the
8
- * selection does not hold. Read-only: it writes nothing and publishes nothing. Publishing is a page press that comes with slice 2, after D103. The
8
+ * selection does not hold. A program or a product also carries its one page (GET /api/ready-reports/dashboard, batch 21 item 2) and its tasks
9
+ * (GET /api/boards/items), as a teammate may see them (lib/board-pack.js teammateDash). Read-only: it writes nothing and publishes nothing. Publishing is a page press that comes with slice 2, after D103. The
9
10
  * read-only Board opens a pack with ?pack=<url>. */
10
11
  const Pack = require('./board-pack.js');
11
12
  const BoardPremium = require('./routes-board-premium.js');
@@ -51,6 +52,14 @@ module.exports = {
51
52
  const t = await via(Trail, tk, req, ctx); if (t.body && t.body.ok) answers[tk] = t.body;
52
53
  for (const id of rows) { const lk = '/api/initiative-layout?initiative=' + encodeURIComponent(id) + '&ws=' + encodeURIComponent(ws); const l = await via(Layout, lk, req, ctx); if (l.body && l.body.ok) answers[lk] = l.body; }
53
54
  }
55
+ // the one program and product page (batch 21 item 2): each kept program's page, the product's page when it is shared, and the tasks
56
+ const progs = ((pg.body && pg.body.programs) || []).filter((p) => p && (p.members || []).some((m) => m && m.ws === ws));
57
+ const scopes = selection.some((s) => s.kind === 'product') ? ['product'].concat(progs.map((p) => 'program:' + p.id)) : selection.filter((s) => s.kind === 'program').map((s) => 'program:' + s.id);
58
+ if (scopes.length) {
59
+ const RRoutes = require('./routes-ready-reports.js'), Boards = require('./routes-boards.js');
60
+ for (const sc of scopes) { const dk = '/api/ready-reports/dashboard?' + new URLSearchParams({ ws, scope: sc }).toString(); const d = await via(RRoutes, dk, req, ctx); if (d.body && d.body.ok) answers[dk] = d.body; }
61
+ const ik = '/api/boards/items?ws=' + encodeURIComponent(ws) + '&board=' + encodeURIComponent(board); const it = await via(Boards, ik, req, ctx); if (it.body && it.body.ok) answers[ik] = it.body;
62
+ }
54
63
  const meta = { by: q.get('by') || '', at: q.get('at') || '', ends: q.get('ends') || '', viewer: q.get('viewer') || '', hub: q.get('hub') || '', view: q.get('view') || '' };
55
64
  ctx.json(res, { ok: true, pack: Pack.buildPack({ ws, board, selection, answers, meta }) });
56
65
  } catch (e) { return bad(String((e && e.message) || e).slice(0, 240), /not on this board|Pick at least|at most 2 MB|product, a program/.test(String(e && e.message)) ? 400 : 500); }
@@ -7,7 +7,8 @@
7
7
  * buildPack({ ws, board, selection, answers, meta }) → { schema, viewer, scope, by, at, ends, hub?, responses }
8
8
  * ws, board the board the answers are from (a product is a board)
9
9
  * selection [{ kind: 'product' | 'program' | 'initiative', id }], one or more; the pack holds the union
10
- * answers { '/api/…?query': body } — the Board's GET answers, as the workspace's own routes gave them. Pure: nothing is read here
10
+ * answers { '/api/…?query': body } — the Board's GET answers, as the workspace's own routes gave them. Pure: nothing is read here.
11
+ * The one program and product page (batch 21 item 2) reads two more: /api/ready-reports/dashboard (teammateDash) and /api/boards/items
11
12
  * meta { by, at, ends, viewer, hub? } — shown on the one line above the Board, and the version of the Board's code that reads the pack
12
13
  * assertSize(pack) throws the host's limit (2 MB, H5)
13
14
  *
@@ -109,6 +110,22 @@ function pruneRecords(v, outside) {
109
110
  return v;
110
111
  }
111
112
 
113
+ /** The one program or product page (batch 21 item 2) as a teammate may see it: what is decided and read, never what waits on the publisher.
114
+ * It keeps the ✦ line's words, the goals with their short titles, the milestones or launches, and the reports by name and state. It drops the
115
+ * proposals and their count, the goal Claude drafted, the promise date it guessed, Send by itself, a heads-up draft, a held source, and every
116
+ * report's press (its path, its issue slot): a copy sends nothing and opens no file of the publisher's. */
117
+ const DASH_DROP = new Set(['needs', 'needsN', 'drafts', 'trust', 'heldBy', 'opens']);
118
+ const REP_KEEP = ['id', 'kind', 'name', 'sub', 'state'];
119
+ function teammateDash(d) {
120
+ if (!d || typeof d !== 'object') return null;
121
+ const o = {};
122
+ for (const k of Object.keys(d)) if (!DASH_DROP.has(k)) o[k] = clone(d[k]);
123
+ if (o.handled && typeof o.handled === 'object') { delete o.handled.act; if (o.handled.tone === 'warn') delete o.handled; }
124
+ o.reports = (Array.isArray(d.reports) ? d.reports : []).filter((r) => r && r.kind !== 'heads-up' && r.state !== 'held')
125
+ .map((r) => { const x = {}; for (const k of REP_KEEP) if (r[k] != null) x[k] = r[k]; if (x.state === 'late' || r.calm) x.state = 'drafted'; return x; });
126
+ return o;
127
+ }
128
+
112
129
  function boardModelOf(answer) { return answer && answer.model ? clone(answer.model) : null; }
113
130
 
114
131
  function buildPack({ ws, board, selection, answers, meta }) {
@@ -144,6 +161,18 @@ function buildPack({ ws, board, selection, answers, meta }) {
144
161
  const body = clone(answers[k]); const pick = (o) => { if (!o || typeof o !== 'object') return o; const r = {}; for (const id of Object.keys(o)) if (R.keep.has(id)) r[id] = o[id]; return r; };
145
162
  if (body.items) body.items = pick(body.items);
146
163
  responses[p + '?' + qs.toString().replace(/%2C/g, ',')] = sweep(body, needles) || {};
164
+ } else if (p === '/api/ready-reports/dashboard') {
165
+ // the program page of a kept program, and the product page when the product is shared (batch 21 item 2); keyed without `from`, as the copy asks
166
+ const sc = q.get('scope') || '';
167
+ const want = sc === 'product' ? R.wholeBoard : /^program:/.test(sc) && kept.some((x) => x && x.id === sc.slice(8));
168
+ const d = want && answers[k] && answers[k].ok !== false && teammateDash(answers[k].dashboard);
169
+ if (d) responses[p + '?' + new URLSearchParams({ ws: q.get('ws') || ws, scope: sc }).toString()] = { ok: true, dashboard: sweep(d, needles) || {} };
170
+ } else if (p === '/api/boards/items') {
171
+ // the Tasks tab: the tasks of the selection's initiatives, nothing of another initiative
172
+ const body = clone(answers[k] || {});
173
+ if (Array.isArray(body.items)) body.items = body.items.filter((t) => t && R.keep.has(t.ini));
174
+ if (Array.isArray(body.initiatives)) body.initiatives = body.initiatives.filter((x) => x && R.keep.has(x.id || x));
175
+ responses[k] = sweep(settled(body), needles) || {};
147
176
  } else if (p === '/api/initiative-layout') {
148
177
  if (R.keep.has(q.get('initiative'))) responses[k] = sweep(clone(answers[k]), needles) || {};
149
178
  }
@@ -161,4 +190,4 @@ function buildPack({ ws, board, selection, answers, meta }) {
161
190
  return pack;
162
191
  }
163
192
 
164
- module.exports = { VIEWS, SCHEMA, MAX_BYTES, KINDS, MODEL_KEYS, buildPack, assertSize };
193
+ module.exports = { VIEWS, SCHEMA, MAX_BYTES, KINDS, MODEL_KEYS, buildPack, assertSize, teammateDash };
@@ -20,6 +20,9 @@ const path = require('path');
20
20
  const crypto = require('crypto');
21
21
  const BP = require('./briefing-premium.js');
22
22
  const W = require('./briefing-premium-writes.js');
23
+ const deleted = require('./ini-deleted.js');
24
+ /* A product's read with the initiatives the PM deleted left out, and their ids, so no next step brings one back to Home (batch 21 item 3). */
25
+ const gone = (root, f) => (f ? Object.assign({}, f, { initiatives: deleted.drop(root, f.initiatives || []), deleted: deleted.ids(root) }) : f);
23
26
 
24
27
  const STALE_MS = 5 * 60 * 1000;
25
28
  const RETRY_AFTER_ERROR_MS = 2 * 60 * 1000;
@@ -99,12 +102,12 @@ async function modelOfMany({ available, engine, runtimeDir, sources, agent, agen
99
102
  if (!s.kept || Date.now() - s.kept.at > STALE_MS) start(p, engine, runtimeDir);
100
103
  const product = { ws: p.ws, name: p.name };
101
104
  if (s.kept) {
102
- parts.push({ product, state: 'ready', f: s.kept.f });
105
+ parts.push({ product, state: 'ready', f: gone(p.root, s.kept.f) });
103
106
  asOf = asOf == null ? s.kept.at : Math.min(asOf, s.kept.at);
104
107
  if (s.inflight) refreshing = true;
105
108
  if (s.lastError) error = (error ? error + '; ' : '') + p.name + ': ' + s.lastError;
106
109
  } else if (s.partial) {
107
- parts.push({ product, state: 'ready', f: s.partial.f });
110
+ parts.push({ product, state: 'ready', f: gone(p.root, s.partial.f) });
108
111
  asOf = asOf == null ? s.partial.at : Math.min(asOf, s.partial.at);
109
112
  } else if (s.lastError && !s.inflight) parts.push({ product, state: 'error', f: null, error: s.lastError });
110
113
  else { parts.push({ product, state: 'reading', f: null }); elapsed = Math.max(elapsed, now - s.startedAt); }
@@ -230,7 +230,9 @@ function waitedRows(f) {
230
230
  const tagRow = (r, p) => Object.assign({}, r, { key: r.key + ':' + p.ws, product: p.name, ws: p.ws });
231
231
  /** Every row of one set of facts, in the order the rules give, with those the PM put off split out. Not yet cut to the page's cap. */
232
232
  function allRowsOf(f) {
233
- let every = [].concat(blockedRows(f), decisionRows(f), waitedRows(f));
233
+ // a row about an initiative the PM deleted is moot: it would bring the initiative back to Home (batch 21 item 3, lib/ini-deleted.js)
234
+ const del = f.deleted instanceof Set && f.deleted.size ? f.deleted : null;
235
+ let every = [].concat(blockedRows(f), decisionRows(f), waitedRows(f)).filter((r) => !del || !(r.from || []).some((id) => del.has(id)));
234
236
  if (f.product) every = every.map((r) => tagRow(r, f.product));
235
237
  const off = (r) => (f.defers && f.defers[r.key] > f.now); // put off by the PM until a time that has not come
236
238
  const all = every.filter((r) => !off(r));
@@ -615,7 +617,7 @@ async function refresh({ root, engine, runtimeDir }) {
615
617
  inits = await readInitiatives({ root, engine });
616
618
  }
617
619
  if (!inits) f.missing.push('workflow');
618
- kept = { at: Date.now(), root, key, ok: !!inits, initiatives: inits || [], model: hooks.build(Object.assign({}, f, { initiatives: deleted.drop(root, inits || []) })) };
620
+ kept = { at: Date.now(), root, key, ok: !!inits, initiatives: inits || [], model: hooks.build(Object.assign({}, f, { initiatives: deleted.drop(root, inits || []), deleted: deleted.ids(root) })) };
619
621
  partial = null; lastError = null; lastErrorAt = 0;
620
622
  if (runtimeDir) saveCache(runtimeDir, kept);
621
623
  }
@@ -653,7 +655,7 @@ async function rebuild({ root, runtimeDir }) {
653
655
  if (!kept || kept.root !== root) return false;
654
656
  const f = await readFast({ root, now: Date.now(), runtimeDir });
655
657
  if (!kept.ok) f.missing.push('workflow');
656
- kept = Object.assign({}, kept, { model: hooks.build(Object.assign({}, f, { initiatives: deleted.drop(root, kept.initiatives) })) });
658
+ kept = Object.assign({}, kept, { model: hooks.build(Object.assign({}, f, { initiatives: deleted.drop(root, kept.initiatives), deleted: deleted.ids(root) })) });
657
659
  if (runtimeDir) saveCache(runtimeDir, kept);
658
660
  return true;
659
661
  }
@@ -15,7 +15,8 @@
15
15
  * forecastOf(jira, today, promised) → { lo, hi, done, total, at, dot, why } the ship range from ticket throughput (PbA1, PbG9)
16
16
  * usualDays(rows, except) → the median planned days of the other initiatives, or null with fewer than 3
17
17
  * stageOf(level, f) → the stage block for where the scope is in its lifecycle (PbS1, PbA1, PbA2, PbS2, PbG7), or null
18
- * dashboardOf(f) → the Dashboard view's model (1-B renders it; the shape is agreed in the build threads)
18
+ * dashboardOf(f) → the one program and product page's model (batch 21 item 2; it was the batch 17 Dashboard view)
19
+ * shortTitle(title, anchor) → { short, kr } a goal's short title and its KR chip for the goal card (RdProgL)
19
20
  * looksGreen(f) → { text } | null Jira says done and the goal is flat (grill row 18)
20
21
  * headsUpOf(f) → [{ id, why, title, sub }] a broken health budget or a critical slip (PbG3)
21
22
  * rowsFor(o) → the Reports block's rows for one scope, each with its state (PbA1, PbG2, PbG7, PbG8)
@@ -228,6 +229,28 @@ function promiseOf(row, rows, kept) {
228
229
  }
229
230
 
230
231
  function goalDot(r) { return r.now === null ? 'none' : r.off ? 'behind' : r.ahead ? 'ahead' : 'on'; }
232
+ const SHORT_MAX = 56; // a goal card's title fits two lines of the Viewer at 390 px (batch 21 item 2, RdProgL)
233
+ /** A goal's short title for the one program page (RdProgL "Okta sign-in retired, every user on the new CIAM."): the KR id goes to its own chip,
234
+ * so it leaves the title; then the part before a dash, a colon or a bracket that carries the detail, when that part says enough (3 words or
235
+ * more); then cut at a word. Pure: it only shortens the record's own words, it never writes new ones. → { short, kr } */
236
+ function shortTitle(title, anchor) {
237
+ let t = String(title == null ? '' : title).replace(/\s+/g, ' ').trim();
238
+ let kr = '';
239
+ const lead = /^(?:O(\d+)\s*[·.\- ]?\s*)?KR\s*(\d+(?:\.\d+)?)\s*[:·—–-]?\s*/i.exec(t);
240
+ if (lead) { kr = 'KR ' + (lead[1] && !/\./.test(lead[2]) ? lead[1] + '.' : '') + lead[2]; t = t.slice(lead[0].length); }
241
+ if (!kr && anchor) { const k = BP.krShort(anchor); if (/^KR \d/.test(k)) kr = k; }
242
+ const cut = /^(.{12,}?)\s*(?:\s[—–-]\s|:\s|\s\()/.exec(t);
243
+ if (cut && cut[1].split(' ').length >= 3) t = cut[1];
244
+ t = t.replace(/[\s,;:·—–-]+$/, '');
245
+ if (t.length > SHORT_MAX) { const w = t.slice(0, SHORT_MAX).replace(/\s+\S*$/, ''); t = (w.length >= 20 ? w : t.slice(0, SHORT_MAX - 1)).replace(/[\s,;:·—–-]+$/, '') + '…'; }
246
+ return { short: t || String(title || ''), kr };
247
+ }
248
+ /** The goal's forecast range for the goal card (FcIntel's range bar, lib/forecast.js through the Intelligence model), or null with none. */
249
+ function fcOf(g) {
250
+ const F = g && g.forecast; if (!isObj(F) || !F.state) return null;
251
+ const n = (v) => (fin(v) ? Math.round(v * 100) / 100 : null);
252
+ return { state: String(F.state), low: n(F.low), high: n(F.high), likely: n(F.likely), target: n(fin(F.target) ? F.target : g.target), unit: String(g.unit || '') };
253
+ }
231
254
  /** The goal rows of a scope (the Claude-runs-the-OKRs goal row; the UI opens GsViewer on tap). Guardrails go to their own list. */
232
255
  function goalsOf(intel, scope, todayMs, multi) {
233
256
  if (!intel) return { goals: [], guardrails: [] };
@@ -235,7 +258,8 @@ function goalsOf(intel, scope, todayMs, multi) {
235
258
  const row = (g) => {
236
259
  const r = IR.rowOf(g, todayMs);
237
260
  const sub = r.now === null ? (g.firstAt ? 'first reading ' + short(g.firstAt) : 'no reading yet') : r.planTxt !== '—' && r.vsTxt !== '—' ? r.nowTxt + ' now · its line says ' + r.planTxt : r.nowTxt + ' now';
238
- return { id: g.id, title: g.title, owner: g.owner || '', dot: goalDot(r), sub, ...(multi && g.product ? { product: g.product } : {}) };
261
+ const T = shortTitle(g.title, g.anchor || g.key), fc = fcOf(g);
262
+ return { id: g.id, title: g.title, short: T.short, ...(T.kr ? { kr: T.kr } : {}), owner: g.owner || '', dot: goalDot(r), sub, ...(fc ? { fc } : {}), ...(multi && g.product ? { product: g.product } : {}) };
239
263
  };
240
264
  return { goals: G.filter((g) => g.role !== 'guardrail').map(row), guardrails: G.filter((g) => g.role === 'guardrail').map(row) };
241
265
  }
@@ -377,12 +401,12 @@ function dashboardOf(f) {
377
401
  const drafted = reports.find((r) => r.kind === 'weekly' && r.state === 'drafted' && !r.desk);
378
402
  const deskReady = reports.find((r) => r.kind === 'weekly' && r.state === 'drafted' && r.desk);
379
403
  const handled = handledOf({ deskReady: !!deskReady, now, heldBy: f.stale, heldDay: drafted || reports.find((r) => r.state === 'held') ? dayName(reports.find((r) => r.state === 'held' || r.state === 'drafted')) : '', green, behind, readAt, drafted: drafted ? dayName(drafted) : '', closed: closedWeek });
380
- const needs = (f.needs || []).filter(isObj)[0] || null;
404
+ const allNeeds = (f.needs || []).filter(isObj), needs = allNeeds[0] || null;
381
405
  return {
382
406
  scope: f.scope, level: P.level, name: f.name || '', sub: f.sub || '',
383
407
  opens: f.from === 'act' ? 'work' : 'dashboard',
384
408
  handled, goals, drafts: Object.keys(drafts).length ? drafts : null, stage, guardrails: stage && (stage.kind === 'did-it-work' || P.level === 'product') ? guardrails : [],
385
- needs, reports, heldBy: f.stale || null, trust: f.trust || null,
409
+ needs, needsN: allNeeds.length, reports, heldBy: f.stale || null, trust: f.trust || null,
386
410
  done: closedWeek ? { text: plural(closedWeek, 'ticket', 'tickets') + ' closed this week' } : null,
387
411
  products: P.level === 'program' && multi ? (f.products || []) : [],
388
412
  asOf: today,
@@ -478,7 +502,8 @@ function anchorGoalsOf(rows, covered) {
478
502
  return [...by.entries()].map(([a, L]) => {
479
503
  const bad = L.filter((r) => r.late || /risk|late|stalled|blocked/.test(String(r.status || '').toLowerCase()));
480
504
  const health = a === 'Health budget' || /^health:/.test(a);
481
- return { id: a, title: /^health:/.test(a) ? a.slice(7) + ' health budget' : a, ...(health ? { budget: true } : {}), owner: '', dot: bad.length ? 'behind' : 'on', from: 'anchor',
505
+ const title = /^health:/.test(a) ? a.slice(7) + ' health budget' : a;
506
+ return { id: a, title, short: shortTitle(title).short, ...(/^KR \d/.test(a) ? { kr: a } : {}), ...(health ? { budget: true } : {}), owner: '', dot: bad.length ? 'behind' : 'on', from: 'anchor',
482
507
  sub: bad.length ? clip(bad[0].title || bad[0].id, 50) + ' is ' + (bad[0].late ? 'running late' : String(bad[0].status || 'at risk').toLowerCase()) : 'No reading yet · ' + plural(L.length, 'initiative is', 'initiatives are') + ' on their dates' };
483
508
  });
484
509
  }
@@ -625,6 +650,6 @@ function movedOf({ today, tickets, goals, needs }) {
625
650
  module.exports = {
626
651
  LEDGER, EVENTS, LEVELS, KINDS, HOLD_ACTS, SCOPE_RE, KEY_RE, STALE_MS, TRUST_N,
627
652
  parseScope, keyOf, kindName, setupIdOf, ledgerFile, readLines, append, checkLine, fold, stateOf, switchOf,
628
- forecastOf, dotOf, usualDays, promiseOf, goalsOf, stageOf, looksGreen, headsUpOf, handledOf, dashboardOf,
653
+ forecastOf, dotOf, usualDays, promiseOf, goalsOf, shortTitle, SHORT_MAX, stageOf, looksGreen, headsUpOf, handledOf, dashboardOf,
629
654
  picksOf, stateOfReport, rowsFor, withDesk, anchorGoalsOf, libraryOf, overlapOf, readersOf, trustOf, autoOn, autoDue, AUTO_MS, autoOk, sponsorsCut, momentsOf, quarterEndOf, movedOf,
630
655
  };
@@ -126,7 +126,8 @@ const INITIATIVE = () => ({
126
126
  ok('P the read names the program and its product', D.gets.some((g) => g.scope === 'program' && g.id === 'project-ascent' && g.ws === 'idpf'), JSON.stringify(D.gets));
127
127
  const ps = await sizes(p, '#czViewer .md-card');
128
128
  ok('S the card uses the type scale only', ps.length && ps.every((x) => SCALE.has(x)), ps.join());
129
- ok('P the rest of the panel is as before: the summary, the goals and the folding rows follow', await p.evaluate(() => { const b = document.querySelector('#czViewer .pp-vw'); return !!b.querySelector('.md-card + .czs-sum') && !!b.querySelector('.czs-sum ~ .pp-goal') && !!b.querySelector('[data-czs-fold="tree"]'); }));
129
+ // batch 21 item 2: the panel is one page (prog-page.js): the proposed goal sits in the goal card, then the tabs with Initiatives open
130
+ ok('P the rest of the panel is the one page: the tabs follow, Initiatives open by default', await p.evaluate(() => { const b = document.querySelector('#czViewer .pp-vw'); return !!b.querySelector('.pv .md-card') && !!b.querySelector('.pv-tabs [data-pv="tab"][data-k="initiatives"][aria-selected="true"]') && !!b.querySelector('#pvp'); }));
130
131
  await shot(p, 'Iq9Program-proposed-built');
131
132
 
132
133
  /* ── K: ✓ keeps all ── */
@@ -74,7 +74,7 @@ const withReview = (open, o = {}) => F.programs().map((p) => ({ ...p, ...(o.empt
74
74
  await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: '{"ok":false,"error":"not in this check"}' }));
75
75
  if (home) { await page.goto(BASE + '/premium.html?ws=idpf'); return { page, ctx: c, errors, posts }; }
76
76
  await page.goto(BASE + '/premium-board.html?ws=idpf&program=' + programs[0].id);
77
- await until(() => page.evaluate(() => { const v = document.querySelector('#czViewer'); return !!v && !v.hidden && !!v.querySelector('.pp-vw .czs-sum'); }));
77
+ await until(() => page.evaluate(() => { const v = document.querySelector('#czViewer'); return !!v && !v.hidden && !!v.querySelector('.pp-vw .pv'); }));
78
78
  await until(() => page.evaluate(() => !/reading its board/.test((document.querySelector('#czViewer [data-czs-id="tree"]') || {}).textContent || '')), 6000);
79
79
  return { page, ctx: c, errors, posts };
80
80
  };
@@ -102,10 +102,14 @@ const withReview = (open, o = {}) => F.programs().map((p) => ({ ...p, ...(o.empt
102
102
  /* ── W: later changes in Waits on you ── */
103
103
  const D = await open();
104
104
  const p = D.page;
105
- const w = await rows(p, '#czViewer [data-czs-id="needs"]');
106
- const cnt = await p.evaluate(() => (document.querySelector('#czViewer [data-czs-fold="needs"] .czs-n, #czViewer [data-czs-id="needs"] .czs-n') || {}).textContent || '');
107
- ok('W the changes lead Waits on you, in plain words, each with why and its source', w.map((r) => r.t).join('|') === 'Move Pilot live to Dec 2|Partner SSO cut-over|Mark Legacy IdP off at risk' && w[0].src === 'Jira, read 2h ago' && /DSC-41/.test(w[0].why), JSON.stringify(w));
108
- ok('W the Waits on you count includes them', /^\d+$/.test(cnt.trim()) && Number(cnt) >= 3, cnt);
105
+ // batch 21 item 2: on the one page the changes lead the folded proposals row (✦ n), which opens in place
106
+ const sub = await p.evaluate(() => (document.querySelector('#czViewer [data-pv="props"]') || {}).textContent || '');
107
+ await p.click('#czViewer [data-pv="props"]');
108
+ await until(() => p.evaluate(() => !!document.querySelector('#czViewer .pv-props .msg-r')), 4000);
109
+ const w = await rows(p, '#czViewer .pv-props');
110
+ const cnt = (/(\d+)/.exec(sub) || [, ''])[1];
111
+ ok('W the changes lead the proposals, in plain words, each with why and its source', w.map((r) => r.t).join('|') === 'Move Pilot live to Dec 2|Partner SSO cut-over|Mark Legacy IdP off at risk' && w[0].src === 'Jira, read 2h ago' && /DSC-41/.test(w[0].why), JSON.stringify(w));
112
+ ok('W the proposals count includes them', /^\d+$/.test(cnt.trim()) && Number(cnt) >= 3, cnt);
109
113
  ok('W the track stays as it is until the PM keeps a change', await p.evaluate(() => !!document.querySelector('#czViewer .pp-mt') && !document.querySelector('#czViewer .msg-box')));
110
114
  ok('K the ◆ dates the page reads are reported once, so a moved date asks Claude for a review', await until(() => D.posts.filter((x) => x.path === '/api/programs/facts').length === 1, 4000) && /descope-parity:\d{4}-\d{2}-\d{2}/.test((D.posts.find((x) => x.path === '/api/programs/facts') || { body: {} }).body.fp || ''), JSON.stringify(D.posts.filter((x) => x.path === '/api/programs/facts')));
111
115
  await shot(p, 'XmsgB-asks-built');
@@ -148,7 +152,7 @@ const withReview = (open, o = {}) => F.programs().map((p) => ({ ...p, ...(o.empt
148
152
  ok('M Home\'s program card has one line for its milestone changes, first', hm === '3 milestone changes · Pilot live to Dec 2', String(hm));
149
153
  if (hm) {
150
154
  await M.page.click('[data-hm-sel="ms:project-ascent"]');
151
- ok('M a tap opens the program, where the changes lead Waits on you', !!(await until(() => M.page.evaluate(() => !!document.querySelector('#czViewer [data-czs-id="needs"] .msg-r')), 8000)));
155
+ ok('M a tap opens the program, where the changes lead its proposals', !!(await until(() => M.page.evaluate(() => { const b = document.querySelector('#czViewer [data-pv="props"]'); if (b && b.getAttribute('aria-expanded') !== 'true') b.click(); return !!document.querySelector('#czViewer .pv-props .msg-r'); }), 8000)));
152
156
  }
153
157
  // batch 16: on a desktop the greeting opens Your day in the Viewer, as on a phone; the calendar is under ⋯
154
158
  if (await M.page.$('[data-hm-day]')) {
@@ -161,6 +165,8 @@ const withReview = (open, o = {}) => F.programs().map((p) => ({ ...p, ...(o.empt
161
165
 
162
166
  /* ── H: a phone ── */
163
167
  const S = await open({ w: 390, h: 844 });
168
+ await S.page.click('#czViewer [data-pv="props"]');
169
+ await until(() => S.page.evaluate(() => !!document.querySelector('#czViewer [data-ms-act="keep"]')), 4000);
164
170
  const sp = await S.page.evaluate(() => { const b = document.querySelector('#czViewer [data-ms-act="keep"]'); const r = b && b.getBoundingClientRect(); return { size: r ? Math.round(r.width) : 0, wide: document.documentElement.scrollWidth <= innerWidth + 1 }; });
165
171
  ok('H on a phone the presses are 40 px and nothing scrolls sideways', sp.size >= 40 && sp.wide, JSON.stringify(sp));
166
172
  await S.page.evaluate(() => { const r = document.querySelector('#czViewer [data-czs-id="needs"]'); if (r) r.scrollIntoView(); });
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.478.0",
3
+ "version": "0.479.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.478.0",
9
+ "version": "0.479.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.478.0",
3
+ "version": "0.479.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",
@@ -60,7 +60,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
60
60
  await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: '{"ok":false,"error":"not in this check"}' }));
61
61
  if (home) { await page.goto(BASE + '/premium.html?ws=idpf'); return { page, ctx: c, errors, posts }; }
62
62
  await page.goto(BASE + '/premium-board.html?ws=idpf&program=' + programs[0].id);
63
- await until(() => page.evaluate(() => { const v = document.querySelector('#czViewer'); return !!v && !v.hidden && !!v.querySelector('.pp-vw .czs-sum'); }));
63
+ await until(() => page.evaluate(() => { const v = document.querySelector('#czViewer'); return !!v && !v.hidden && !!v.querySelector('.pp-vw .pv'); }));
64
64
  // the other product's board lands after the panel opens: the charter lists its initiative once it is read
65
65
  await until(() => page.evaluate(() => !/reading its board/.test((document.querySelector('#czViewer [data-czs-id="tree"]') || {}).textContent || '')), 6000);
66
66
  return { page, ctx: c, errors, posts };
@@ -71,7 +71,8 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
71
71
  const rowsOf = (p) => p.evaluate(() => [...document.querySelectorAll('#czViewer .pc-ln[data-m]')].map((r) => ({ id: r.dataset.m, name: r.querySelector('[data-f="name"]').value, day: r.querySelector('.pc-fd span').textContent, when: (r.querySelector('.pc-wch span:not(.sq):not(.bx)') || r.querySelector('.pc-via, .pc-mini') || {}).textContent || '', draft: r.classList.contains('sug') })));
72
72
 
73
73
  // into the charter by the Milestones pencil: the section is opened first when it is folded
74
- const toCharter = async (p) => { await p.evaluate(() => { const b = document.querySelector('#czViewer [data-czs-fold="ms"]'); if (b && b.getAttribute('aria-expanded') !== 'true') b.click(); }); await p.click('#czViewer [data-czs-id="ms"] [data-pp="edit"]'); };
74
+ // batch 21 item 2: the one page keeps the pencil beside "Program milestones" in the goal card
75
+ const toCharter = async (p) => { await p.click('#czViewer .pv-gc [data-pp="edit"]'); };
75
76
 
76
77
  /* ── desktop: the ways in, the fields, Save ── */
77
78
  const D = await open();
@@ -83,8 +84,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
83
84
  ok('W ⋯ holds no "Open the charter"', !(await p.evaluate(() => [...document.querySelectorAll('.cz-vw-menu button')].some((b) => /charter/i.test(b.textContent)))));
84
85
  await p.keyboard.press('Escape');
85
86
  await shot(p, 'MsB0Entry-built-track');
86
- await p.evaluate(() => { const b = document.querySelector('#czViewer [data-czs-fold="ms"]'); if (b && b.getAttribute('aria-expanded') !== 'true') b.click(); });
87
- ok('W the Milestones row carries a pencil', await p.evaluate(() => !!document.querySelector('#czViewer [data-czs-id="ms"] .czs-tail [data-pp="edit"]')));
87
+ ok('W the goal card\'s Program milestones carries a pencil', await p.evaluate(() => !!document.querySelector('#czViewer .pv-gc .pp-lh [data-pp="edit"][aria-label="Edit the milestones in the charter"]')));
88
88
  await shot(p, 'MsB0Entry-built');
89
89
  await p.click('#czViewer [data-pp="edit"]');
90
90
  ok('W the pencil opens the charter as a drill-in (← back to the program)', await charterShown(p));
@@ -231,7 +231,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
231
231
  const M = await open({ home: true });
232
232
  const prog = await until(() => M.page.$('#hmList [data-hm-prog]'), 10000);
233
233
  if (prog) await prog.click();
234
- const hp = await until(() => M.page.evaluate(() => { const v = document.querySelector('#czViewer'); if (!v || v.hidden || !v.querySelector('.pp-vw .czs-sum')) return null; return { tile: getComputedStyle(v.querySelector('.cz-vw-tile')).backgroundColor, prog: getComputedStyle(document.body).getPropertyValue('--pp-prog').trim() }; }));
234
+ const hp = await until(() => M.page.evaluate(() => { const v = document.querySelector('#czViewer'); if (!v || v.hidden || !v.querySelector('.pp-vw .pv')) return null; return { tile: getComputedStyle(v.querySelector('.cz-vw-tile')).backgroundColor, prog: getComputedStyle(document.body).getPropertyValue('--pp-prog').trim() }; }));
235
235
  ok('M on Home the program heading opens the program panel with its own purple (cozy-panel.css is on Home)', !!hp && !!hp.prog && !/rgba\(0, 0, 0, 0\)|transparent/.test(hp.tile), JSON.stringify(hp));
236
236
  if (hp) await toCharter(M.page);
237
237
  ok('M the charter opens from the panel on Home too', !!hp && !!(await charterShown(M.page)));