create-pmos 0.610.0 → 0.612.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 (164) hide show
  1. package/package.json +135 -27
  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/board-columns-test.js +2 -1
  8. package/workspace/board-deliveries-test.js +2 -1
  9. package/workspace/board-programs-test.js +7 -3
  10. package/workspace/board-publish-ui-test.js +2 -1
  11. package/workspace/board-shared-ui-test.js +2 -1
  12. package/workspace/board-workflows-test.js +2 -1
  13. package/workspace/briefing-premium-board-test.js +3 -2
  14. package/workspace/briefing-premium-calendar-2-test.js +3 -2
  15. package/workspace/briefing-premium-calendar-3-test.js +1 -1
  16. package/workspace/briefing-premium-calendar-test.js +1 -1
  17. package/workspace/briefing-premium-doc-edit-test.js +2 -1
  18. package/workspace/briefing-premium-insights-test.js +4 -3
  19. package/workspace/briefing-premium-test.js +3 -2
  20. package/workspace/calm-timeline-test.js +2 -1
  21. package/workspace/changelog.json +134 -0
  22. package/workspace/core-docs-workflow-test.js +2 -1
  23. package/workspace/ev-everywhere-test.js +3 -2
  24. package/workspace/guide/home.md +2 -2
  25. package/workspace/guide/index.md +4 -0
  26. package/workspace/guide/layout.md +97 -3
  27. package/workspace/guide/programs.md +16 -2
  28. package/workspace/guide/routine.md +65 -0
  29. package/workspace/guide/scheduled-tasks-and-cli.md +1 -1
  30. package/workspace/guide/settings-and-switches.md +2 -2
  31. package/workspace/impact-screens-test.js +3 -1
  32. package/workspace/ini-workflow-test.js +2 -1
  33. package/workspace/lib/board-premium.js +12 -4
  34. package/workspace/lib/classic-board.js +15 -0
  35. package/workspace/lib/cos-chat.js +1 -0
  36. package/workspace/lib/doc-library.js +43 -12
  37. package/workspace/lib/doc-path.js +30 -0
  38. package/workspace/lib/engine/boards.js +4 -2
  39. package/workspace/lib/events-place.js +368 -0
  40. package/workspace/lib/events-stated.js +129 -0
  41. package/workspace/lib/initiative-chat.js +1 -0
  42. package/workspace/lib/insights-premium.js +13 -1
  43. package/workspace/lib/library-find.js +162 -0
  44. package/workspace/lib/library-items.js +250 -0
  45. package/workspace/lib/notes.js +9 -1
  46. package/workspace/lib/plan-items.js +17 -3
  47. package/workspace/lib/route-modules.js +4 -0
  48. package/workspace/lib/routes-artefacts.js +5 -2
  49. package/workspace/lib/routes-boards.js +6 -2
  50. package/workspace/lib/routes-doc-sheet.js +1 -0
  51. package/workspace/lib/routes-events-place.js +203 -0
  52. package/workspace/lib/routes-library.js +155 -0
  53. package/workspace/lib/routes-pop-work.js +39 -0
  54. package/workspace/lib/routes-report-setups.js +32 -1
  55. package/workspace/lib/routes-today-log.js +48 -0
  56. package/workspace/lib/routine-reports.js +84 -0
  57. package/workspace/lib/status-when.js +36 -0
  58. package/workspace/lib/task-items.js +5 -3
  59. package/workspace/lib/today-log.js +131 -0
  60. package/workspace/live-pill-round-test.js +10 -7
  61. package/workspace/metric-drafts-ui-test.js +3 -1
  62. package/workspace/milestone-pins-test.js +2 -1
  63. package/workspace/milestone-suggest-test.js +3 -1
  64. package/workspace/package-lock.json +2 -2
  65. package/workspace/package.json +1 -1
  66. package/workspace/panels-test.js +2 -1
  67. package/workspace/premium-board-actions-test.js +3 -1
  68. package/workspace/premium-rec-tab-test.js +2 -1
  69. package/workspace/premium-vw-backlog-test.js +3 -1
  70. package/workspace/premium-vw-item-test.js +3 -1
  71. package/workspace/premium-vw-jira-test.js +3 -1
  72. package/workspace/premium-vw-meet-test.js +2 -1
  73. package/workspace/premium-vw-notes-test.js +3 -2
  74. package/workspace/product-lane-test.js +2 -1
  75. package/workspace/program-charter-test.js +3 -1
  76. package/workspace/program-leave-test.js +2 -1
  77. package/workspace/program-order-test.js +2 -1
  78. package/workspace/program-panel-test.js +3 -1
  79. package/workspace/public/pm/artefact-kind.js +87 -0
  80. package/workspace/public/pm/bd-ini-panel.js +77 -12
  81. package/workspace/public/pm/bd-prog-panel.js +55 -8
  82. package/workspace/public/pm/bd-span.js +5 -0
  83. package/workspace/public/pm/bd-work.css +192 -0
  84. package/workspace/public/pm/bd-work.js +483 -0
  85. package/workspace/public/pm/cozy-bar.css +11 -0
  86. package/workspace/public/pm/cozy-bar.js +99 -0
  87. package/workspace/public/pm/cozy-day-pick.css +27 -0
  88. package/workspace/public/pm/cozy-day-pick.js +97 -0
  89. package/workspace/public/pm/cozy-ev.css +2 -5
  90. package/workspace/public/pm/cozy-events-view.js +274 -0
  91. package/workspace/public/pm/cozy-events.css +179 -0
  92. package/workspace/public/pm/cozy-events.js +278 -0
  93. package/workspace/public/pm/cozy-evmodel.js +1 -1
  94. package/workspace/public/pm/cozy-goals.css +172 -0
  95. package/workspace/public/pm/cozy-library.css +125 -0
  96. package/workspace/public/pm/cozy-live-pill.js +1 -0
  97. package/workspace/public/pm/cozy-nav.js +6 -7
  98. package/workspace/public/pm/cozy-pick.css +3 -0
  99. package/workspace/public/pm/cozy-pop-work.css +224 -0
  100. package/workspace/public/pm/cozy-pop-work.js +668 -0
  101. package/workspace/public/pm/cozy-popup.css +11 -2
  102. package/workspace/public/pm/cozy-popup.js +67 -9
  103. package/workspace/public/pm/cozy-routine-job.js +203 -0
  104. package/workspace/public/pm/cozy-routine-model.js +219 -0
  105. package/workspace/public/pm/cozy-routine-pop.js +318 -0
  106. package/workspace/public/pm/cozy-routine.css +155 -0
  107. package/workspace/public/pm/cozy-routine.js +335 -0
  108. package/workspace/public/pm/cozy-schedwork.js +6 -5
  109. package/workspace/public/pm/cozy-settings.js +1 -5
  110. package/workspace/public/pm/cozy-status-when.js +48 -0
  111. package/workspace/public/pm/cozy-today-app.js +236 -0
  112. package/workspace/public/pm/cozy-today-model.js +176 -0
  113. package/workspace/public/pm/cozy-today-page.css +100 -0
  114. package/workspace/public/pm/cozy-today-view.js +76 -0
  115. package/workspace/public/pm/cozy-viewer.js +19 -8
  116. package/workspace/public/pm/cozy-vw-mtg.css +39 -0
  117. package/workspace/public/pm/goals-model.js +205 -0
  118. package/workspace/public/pm/goals-open.js +124 -0
  119. package/workspace/public/pm/home-app.js +18 -3
  120. package/workspace/public/pm/home-chat.js +4 -2
  121. package/workspace/public/pm/home-ini.js +43 -10
  122. package/workspace/public/pm/ini-edit.js +3 -1
  123. package/workspace/public/pm/ini-view-model.js +1 -1
  124. package/workspace/public/pm/library-model.js +197 -0
  125. package/workspace/public/pm/library-open.js +37 -0
  126. package/workspace/public/pm/page-chat.js +12 -2
  127. package/workspace/public/pm/pop-work-model.js +493 -0
  128. package/workspace/public/pm/premium-board.js +204 -17
  129. package/workspace/public/pm/premium-goals.js +213 -0
  130. package/workspace/public/pm/premium-library.js +436 -0
  131. package/workspace/public/pm/premium-shell.js +1 -1
  132. package/workspace/public/pm/premium-vw-mtg.js +79 -1
  133. package/workspace/public/pm/scope-chip.js +204 -0
  134. package/workspace/public/premium-board.html +1 -0
  135. package/workspace/public/premium-events.html +44 -0
  136. package/workspace/public/premium-goals.html +37 -0
  137. package/workspace/public/premium-library.html +39 -0
  138. package/workspace/public/premium-routine.html +33 -0
  139. package/workspace/public/today.html +50 -0
  140. package/workspace/ready-dash-ui-test.js +3 -1
  141. package/workspace/rename-test.js +2 -1
  142. package/workspace/run-tests.js +4 -1
  143. package/workspace/server.js +4 -2
  144. package/workspace/sort-order-test.js +2 -1
  145. package/workspace/split-merge-ui-test.js +3 -1
  146. package/workspace/stage-card-tasks-test.js +3 -1
  147. package/workspace/stage-card-test.js +2 -1
  148. package/workspace/task-delete-test.js +2 -1
  149. package/workspace/task-links-test.js +2 -1
  150. package/workspace/task-milestones-test.js +4 -2
  151. package/workspace/task-plans-test.js +3 -1
  152. package/workspace/task-press-test.js +3 -1
  153. package/workspace/task-views-test.js +3 -1
  154. package/workspace/test-lists/doc-path.json +9 -0
  155. package/workspace/test-lists/events-place.json +11 -0
  156. package/workspace/test-lists/goals-place.json +9 -0
  157. package/workspace/test-lists/library-place.json +9 -0
  158. package/workspace/test-lists/pop-work.json +9 -0
  159. package/workspace/test-lists/routine-place.json +9 -0
  160. package/workspace/test-lists/status-when.json +9 -0
  161. package/workspace/test-lists/today-log.json +9 -0
  162. package/workspace/test-lists/work-view.json +9 -0
  163. package/workspace/timeline-holds-test.js +3 -1
  164. package/workspace/tk-tasks-test.js +2 -1
@@ -21,6 +21,8 @@
21
21
  * POST /api/report-setups/move { ws, id, to } → { ok, id, to, moved } ✦ Move to <product>: definition, drafts and setup go to
22
22
  * the workspace `to`; a report with an issued issue is 409 (redesign R)
23
23
  * POST /api/report-setups/remove { ws, id } → { ok } delete a TEMPLATE: its schedule stops; its drafts and issued reports stay (L2)
24
+ * POST /api/report-setups/drop { ws, id } → { ok } ✕ on a report PMOS proposes: its draft definition moves to
25
+ * definitions/.dropped/ (lib/routine-reports.js dropDefinition); a set-up report is 409
24
26
  * POST /api/report-setups/from-dashboard { ws, key, name, output, schedule, audience } → { ok, setup }
25
27
  * POST /api/report-setups/finder { ws, cadence?, sources? } → { ok, finder }
26
28
  * GET /api/report-setups/storyline?ws&board&scope&story? → { ok, storyline, defaults, checks, proposals } a report from Intelligence (batch 15 item 4,
@@ -30,6 +32,8 @@
30
32
  * report from Intelligence and drafts issue 1 from the live model (source intelligence:<scope>)
31
33
  * POST /api/report-setups/strip-dismiss { ws, id } → { ok } Not now on a report the ✦ strip proposed
32
34
  * GET /api/report-documents?ws → { docs: [{ path, id, setup, name, slot, state: draft|issued, source, output, made_by: schedule|you|agent, v, copy }] }
35
+ * GET /api/report-setups/routine?ws → { ok, ws, name, reports: [row] } every report of the workspace as one row of Routine (lib/routine-reports.js;
36
+ * slice 8 of the six-place navigation). Read-only: it settles nothing and migrates nothing.
33
37
  * POST /api/report-documents/discard { ws, path } → { ok, doc } delete an UNISSUED draft; an issued report is 409 and untouched (L3)
34
38
  * POST /api/report-documents/archive { ws, path, archived } → { ok, doc, archived } hide (or bring back) an ISSUED report; a draft is 409 (L4)
35
39
  * GET /api/report-export?ws&path&fmt=pptx|xlsx|docx|csv → the file, Content-Disposition: attachment. PDF is printed by the browser: there is no route.
@@ -65,7 +69,7 @@ const headless = require('./headless.js');
65
69
 
66
70
  const text = (v) => (typeof v === 'string' ? v : '');
67
71
  const bad = (status, error) => ({ status, body: { ok: false, error } });
68
- const POSTS = ['ask', 'change', 'cancel', 'setup', 'draft', 'dismiss', 'pause', 'resume', 'from-dashboard', 'finder', 'edit', 'remove', 'documents/discard', 'documents/archive', 'strip-dismiss', 'confirm', 'move'];
72
+ const POSTS = ['ask', 'change', 'cancel', 'setup', 'draft', 'dismiss', 'pause', 'resume', 'from-dashboard', 'finder', 'edit', 'remove', 'documents/discard', 'documents/archive', 'strip-dismiss', 'confirm', 'move', 'drop'];
69
73
  const IR = require('./intel-report.js');
70
74
  const MADE_BY = ['schedule', 'you', 'agent'];
71
75
 
@@ -335,6 +339,24 @@ async function handle(req, res, url, ctx) {
335
339
  const preview = IR.documentOf(m, { id: 'preview', name: S.name, audience: defaults.audience, output: defaults.output, source: IR.sourceOf(scope), storyline: story }, { slot: m.today, issue: 1 });
336
340
  return send({ status: 200, body: { ok: true, storyline: S, defaults, checks: IR.storyChecks(preview), proposals: IR.proposalsOf(m, { findings, dismissed: [...st.stripDismissed], weekly: weeklyOpen(ctx, w.id), covered: [...st.setups.values()].map((x) => IR.scopeOf(x.source)).filter(Boolean) }), as_of: m.today } });
337
341
  }
342
+ if (sub === 'routine') {
343
+ // Routine (slice 8 of the six-place navigation, lib/routine-reports.js): every report of the workspace as one row, with its one ✓. Read-only.
344
+ if (req.method !== 'GET') return send(bad(405, 'GET only'));
345
+ const w = wsOf(ctx, url.searchParams.get('ws'));
346
+ if (!w) return send(bad(404, 'no such workspace'));
347
+ const now = new Date();
348
+ let defs = [];
349
+ try { defs = RS.definitionsOf(w.root); } catch { defs = []; }
350
+ const boards = typeof ctx.workspaceList === 'function' ? ctx.workspaceList().map((x) => ({ ws: x.id, name: x.name })) : [];
351
+ // the setups as the ledger holds them, read only (listAnswer would settle a stale ask: a write); next is the same nextDraftAt it uses
352
+ const setups = [...RS.fold(RS.readLines(RS.ledgerFile(w.root))).setups.values()].map((s) => {
353
+ let next = null;
354
+ if (s.status === 'active' && s.schedule) { try { const n = RS.nextDraftAt(s.schedule, s.last_run, now); next = n ? n.toISOString() : null; } catch { next = null; } }
355
+ return { id: s.id, name: s.name, purpose: s.purpose, audience: s.audience, source: s.source, output: s.output, schedule: s.schedule, label: RS.scheduleLabel(s.schedule), next_draft: next, status: s.status, ...(s.ready ? { ready: s.ready } : {}) };
356
+ });
357
+ const reports = require('./routine-reports.js').routineReports({ setups, docs: documentsOf(ctx, w).docs, defs, boards, here: w.id });
358
+ return send({ status: 200, body: { ok: true, ws: w.id, name: w.name || w.id, reports } });
359
+ }
338
360
  if (!docPost && (isDocs || isExport || (sub === '' && req.method === 'GET'))) {
339
361
  if (req.method !== 'GET') return send(bad(405, 'GET only'));
340
362
  if ((isDocs && p !== '/api/report-documents') || (isExport && p !== '/api/report-export')) return send(bad(404, 'no such report route'));
@@ -533,6 +555,15 @@ async function handle(req, res, url, ctx) {
533
555
  if (ctx.invalidateNeedsAgg) ctx.invalidateNeedsAgg();
534
556
  return send({ status: 200, body: Object.assign({ to: t.id }, r) });
535
557
  }
558
+ if (sub === 'drop') {
559
+ const id = text(body.id);
560
+ const s = RS.fold(RS.readLines(file)).setups.get(id);
561
+ if (s && s.status !== 'removed') return send(bad(409, 'it is set up: pause or delete it instead'));
562
+ const r = require('./routine-reports.js').dropDefinition(root, id);
563
+ if (!r.ok) return fail(r);
564
+ if (ctx.invalidateNeedsAgg) ctx.invalidateNeedsAgg();
565
+ return send({ status: 200, body: { ok: true } });
566
+ }
536
567
  if (sub === 'remove') {
537
568
  const r = RS.remove(root, text(body.id), opts);
538
569
  if (!r.ok) return fail(r);
@@ -0,0 +1,48 @@
1
+ 'use strict';
2
+ /* routes-today-log.js — Today's log (slice 5 of the six-place navigation; lib/today-log.js is the store).
3
+ *
4
+ * GET /api/today-log?day=YYYY-MM-DD → { ok, day, entries, marks } the PM's own entries and the marks on the rows of that day
5
+ * POST /api/today-log/add { text, day, bullet?, first? } → { ok, entry } a task, an event or a note typed in the first line
6
+ * POST /api/today-log/mark { key, act, day, until?, snap? } → { ok } done, undone, later (until a later day), now (back to today), drop, undrop, keep
7
+ *
8
+ * The day is the PM's local day, sent by the page. Every POST passes pm-guard requirePagePress: the page only. A mark changes only the
9
+ * log: done on a task or an item of the PM is sent to that record's own route by the page, and the mark is the log's line beside it.
10
+ * STATE: <runtime>/today-log/log.jsonl, append-only, one writer (lib/today-log.js appendLine). */
11
+ const path = require('path');
12
+ const crypto = require('crypto');
13
+ const guard = require('./pm-guard.js');
14
+ const TL = require('./today-log.js');
15
+
16
+ const fileOf = (ctx) => path.join(ctx.runtimeDir, 'today-log', 'log.jsonl');
17
+ const localDay = (now = new Date()) => new Date(now.getTime() - now.getTimezoneOffset() * 60000).toISOString().slice(0, 10);
18
+
19
+ module.exports = {
20
+ prefixes: ['/api/today-log'],
21
+ fileOf,
22
+ handle: async (req, res, url, ctx) => {
23
+ const p = url.pathname;
24
+ if (!ctx.runtimeDir) { ctx.json(res, { ok: false, error: 'PMOS has no state folder here, so Today cannot keep a log' }, 503); return true; }
25
+ if (p === '/api/today-log' && req.method === 'GET') {
26
+ const day = url.searchParams.get('day') || localDay();
27
+ if (!TL.DAY_RE.test(day)) { ctx.json(res, { ok: false, error: 'day is YYYY-MM-DD' }, 400); return true; }
28
+ const f = TL.fold(TL.readLines(fileOf(ctx)), day);
29
+ ctx.json(res, { ok: true, day, entries: f.entries, marks: f.marks });
30
+ return true;
31
+ }
32
+ if (req.method !== 'POST' || (p !== '/api/today-log/add' && p !== '/api/today-log/mark')) return false;
33
+ const got = await ctx.readJson(req);
34
+ if (!got.ok) { ctx.json(res, { ok: false, error: 'invalid JSON body' }, 400); return true; }
35
+ const body = got.body || {};
36
+ const g = guard.requirePagePress(req, body);
37
+ if (!g.ok) { ctx.json(res, { ok: false, error: g.error }, g.status); return true; }
38
+ const day = String(body.day || '');
39
+ const r = p === '/api/today-log/add' ? TL.addEvent(body, day, 'tl-' + crypto.randomBytes(6).toString('hex')) : TL.markEvent(body, day);
40
+ if (r.error) { ctx.json(res, { ok: false, error: r.error }, 400); return true; }
41
+ TL.appendLine(fileOf(ctx), r.event);
42
+ if (p === '/api/today-log/add') {
43
+ const e = r.event;
44
+ ctx.json(res, { ok: true, entry: { id: e.id, key: 'own:' + e.id, bullet: e.bullet, text: e.text, first: e.first, time: e.time, day: e.day, done: false } });
45
+ } else ctx.json(res, { ok: true });
46
+ return true;
47
+ },
48
+ };
@@ -0,0 +1,84 @@
1
+ 'use strict';
2
+ /* routine-reports.js — every report of a workspace as one row of Routine (initiative routine-place, slice 8 of the six-place navigation;
3
+ * board 11 on Exploring 2; done test planning/done-tests/routine-place.md T1).
4
+ *
5
+ * routineReports({ setups, docs, defs, boards, here }) → [row] PURE
6
+ * setups GET /api/report-setups setups (lib/routes-report-setups.js listAnswer): { id, name, purpose, audience, source, output, schedule, ready?,
7
+ * label, next_draft, status: active | paused }
8
+ * docs the report documents (routes-report-setups.js documentsOf docs): { path, setup, name, slot, state: draft | issued, archived, source, output }
9
+ * defs the definitions (lib/report-setups.js definitionsOf): { id, title, audience, status, source, output }
10
+ * boards [{ ws, name }] and here: the workspace the reports sit in (for the ✦ Move of lib/report-acts.js)
11
+ * row: { id, name, audience, purpose, when, schedule, next, status: 'active' | 'paused' | null, output, source, about, definition, act, issues, latest }
12
+ * when the setup's schedule in words; '' when no setup says it (a definition drafted by a skill has no schedule here)
13
+ * next the setup's next draft (ISO) while it is active, else null
14
+ * act the report's one ✓ (lib/report-acts.js reportActOf): move | confirm | issue | resume, or null
15
+ * issues its files, newest first: { path, slot, state, archived }; latest is the newest one not archived, or null
16
+ *
17
+ * A report is a row when it has a setup or at least one issue. A definition with neither is not drawn (zero is silence). Nothing is filled with a
18
+ * guess: a field the records leave silent is '' or null. routineReports only reads.
19
+ *
20
+ * dropDefinition(root, id) → { ok } | { ok: false, status, error } ✕ on a report PMOS proposes (Routine round 3 item 1): the definition
21
+ * moves to definitions/.dropped/<id>.md, so it is no longer read (definitionsOf reads *.md of definitions/ only) and nothing is lost: moving it
22
+ * back brings the proposal back. Only a proposed definition (status: draft) with no setup can be dropped; the route checks the setup.
23
+ */
24
+ const fs = require('fs');
25
+ const path = require('path');
26
+ const RA = require('./report-acts.js');
27
+
28
+ const str = (v) => (typeof v === 'string' ? v : '');
29
+
30
+ function routineReports(f = {}) {
31
+ const setups = (f.setups || []).filter((s) => s && s.id);
32
+ const docs = (f.docs || []).filter((d) => d && d.path);
33
+ const defs = new Map((f.defs || []).filter((d) => d && d.id).map((d) => [d.id, d]));
34
+ const cadenceOf = (d) => d.setup || str(d.cadence) || String(d.path).split('/').slice(-2, -1)[0] || '';
35
+ const ids = [...new Set(setups.map((s) => s.id).concat(docs.map(cadenceOf)).filter(Boolean))];
36
+ const out = [];
37
+ for (const id of ids) {
38
+ const s = setups.find((x) => x.id === id) || null, def = defs.get(id) || null;
39
+ const issues = docs.filter((d) => cadenceOf(d) === id).map((d) => ({ path: d.path, slot: str(d.slot), state: d.state === 'issued' ? 'issued' : 'draft', archived: !!d.archived }))
40
+ .sort((a, b) => (a.slot < b.slot ? 1 : a.slot > b.slot ? -1 : 0));
41
+ const setup = s ? { ...s, paused: s.status === 'paused' } : null;
42
+ const about = setup ? RA.reportAboutOf([s.name, s.purpose].join(' · '), f.boards, f.here) : null;
43
+ const act = RA.reportActOf({ id, setup, rows: issues, def, about });
44
+ const named = docs.find((d) => cadenceOf(d) === id && d.name && d.name !== id);
45
+ out.push({
46
+ id, name: (s && s.name) || RA.defTitleOf(def) || (named && named.name) || id,
47
+ audience: str(s && s.audience) || str(def && def.audience), purpose: str(s && s.purpose),
48
+ when: s ? str(s.label) : '', schedule: s && s.schedule ? s.schedule : null, next: s && s.status === 'active' ? s.next_draft || null : null,
49
+ status: s ? (s.status === 'paused' ? 'paused' : 'active') : null,
50
+ output: str(s && s.output) || str(def && def.output) || str(named && named.output), source: str(s && s.source) || str(def && def.source) || str(named && named.source),
51
+ about: aboutOf(s), // the program or project (initiative) its setup is about, for Routine's chip; null for a product's report
52
+ definition: str(def && def.path) || null, // the definition file, whose body is the report's Instruction (round 3 item 3)
53
+ act, issues, latest: issues.find((x) => !x.archived) || null,
54
+ });
55
+ }
56
+ // a set-up report first, then by name: the table's order inside its group
57
+ return out.sort((a, b) => (a.status ? 0 : 1) - (b.status ? 0 : 1) || a.name.localeCompare(b.name));
58
+ }
59
+
60
+ /** What a setup is about, from the setup only: a ready-made report's scope, an initiative dashboard, or an Intelligence scope. */
61
+ function aboutOf(s) {
62
+ if (!s) return null;
63
+ const m = /^(program|initiative):(.+)$/.exec(String((s.ready && s.ready.scope) || ''))
64
+ || /^dashboard:(initiative):(.+)$/.exec(str(s.source)) || /^intelligence:(program|initiative):(.+)$/.exec(str(s.source));
65
+ return m ? { level: m[1], id: m[2] } : null;
66
+ }
67
+
68
+ const DEF_ID = /^[a-z][a-z0-9-]{0,39}$/;
69
+ function dropDefinition(root, id) {
70
+ if (!DEF_ID.test(String(id || ''))) return { ok: false, status: 400, error: 'no such proposal' };
71
+ const abs = path.resolve(String(root));
72
+ const dir = path.join(abs, require('./report-draft.js').stateRel(abs), 'reports', 'definitions');
73
+ const from = path.join(dir, id + '.md');
74
+ let txt;
75
+ try { txt = fs.readFileSync(from, 'utf8'); } catch { return { ok: false, status: 404, error: 'no such proposal' }; }
76
+ const fm = /^---\r?\n([\s\S]*?)\r?\n---/.exec(txt);
77
+ const st = fm && /^status:\s*["']?([\w-]+)/m.exec(fm[1]);
78
+ if (!st || st[1] !== 'draft') return { ok: false, status: 409, error: 'it is not a proposal: it was confirmed, so pause or delete it instead' };
79
+ const to = path.join(dir, '.dropped');
80
+ try { fs.mkdirSync(to, { recursive: true }); fs.renameSync(from, path.join(to, id + '.md')); } catch (e) { return { ok: false, status: 500, error: 'it could not be dropped: ' + e.message }; }
81
+ return { ok: true };
82
+ }
83
+
84
+ module.exports = { routineReports, dropDefinition, aboutOf };
@@ -0,0 +1,36 @@
1
+ 'use strict';
2
+ /* lib/status-when.js — the day a status move really happened (popup round 3 point 18). A person often moves a task late, so the move can carry
3
+ * `happened` (YYYY-MM-DD) apart from `at`, the time it was recorded. The server checks it here; pm/cozy-status-when.js asks it on the page.
4
+ *
5
+ * checkHappened(v, { today, floor }) → null, or the refusal in plain words. v is a YYYY-MM-DD day, never after today (today is the server's
6
+ * UTC day; one day of slack lets a person east of UTC say their own today), never before floor (the
7
+ * previous move's day, or the day the task was made)
8
+ * floorOf(t) → that floor for a folded PMOS task: the day of its last move (its happened, else its at), else its at
9
+ * lateDays(due, done) → whole days a Done came after its due day (0 when on time or a day is missing) */
10
+ const DAY_RE = /^\d{4}-\d{2}-\d{2}$/;
11
+ const DAY = 864e5;
12
+ const ms = (v) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(v || '')); return m ? Date.UTC(+m[1], +m[2] - 1, +m[3]) : null; };
13
+ const iso = (n) => new Date(n).toISOString().slice(0, 10);
14
+ const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
15
+ const words = (v) => { const d = new Date(ms(v)); return d.getUTCDate() + ' ' + MON[d.getUTCMonth()] + ' ' + d.getUTCFullYear(); };
16
+
17
+ function checkHappened(v, o = {}) {
18
+ if (typeof v !== 'string' || !DAY_RE.test(v) || iso(ms(v)) !== v) return 'happened is a day, YYYY-MM-DD';
19
+ const today = o.today || iso(Date.now());
20
+ if (ms(v) > ms(today) + DAY) return 'A move cannot happen in the future.';
21
+ const floor = o.floor && DAY_RE.test(String(o.floor).slice(0, 10)) ? String(o.floor).slice(0, 10) : null;
22
+ if (floor && v < floor) return 'The previous change was on ' + words(floor) + '. Pick that day or later.';
23
+ return null;
24
+ }
25
+ function floorOf(t) {
26
+ if (!t) return null;
27
+ const h = (t.history || []).filter((x) => x && x.state);
28
+ const last = h[h.length - 1];
29
+ const v = last ? last.happened || last.at : t.at;
30
+ return v ? String(v).slice(0, 10) : null;
31
+ }
32
+ function lateDays(due, done) {
33
+ const a = ms(due), b = ms(done);
34
+ return a == null || b == null || b <= a ? 0 : Math.round((b - a) / DAY);
35
+ }
36
+ module.exports = { checkHappened, floorOf, lateDays, DAY_RE };
@@ -8,7 +8,8 @@
8
8
  * STATE_OF[item.state] → its task state: todo To do · doing, review In progress · done Done
9
9
  * rowsOf(root, ids, board) → the items of those initiatives as work items (routes-boards itemsOf's shape, src 'pmos', store 'item')
10
10
  * itemOf(root, id) → the folded item, or null (a withdrawn item is gone: it was Won't do)
11
- * stateEvents(it, state, why) → the plan-items lines that set a task state: a move, or a withdraw for Won't do and Archived
11
+ * stateEvents(it, state, why, happened) → the plan-items lines that set a task state: a move (happened: the day it really happened), or a
12
+ * withdraw for Won't do and Archived
12
13
  * deleteEvents(it, why) · restoreEvents(id) → a Delete (a withdraw with why "deleted") and its Undo (batch 11 item 16)
13
14
  * goneOf(root, id) → a withdrawn item as it was, or null: what a restore brings back
14
15
  * editEvents(it, edit) → the lines of a rename, a reschedule or the Viewer's edits (title, owner, notes, start, due)
@@ -60,7 +61,7 @@ function rowsOf(root, ids, board) {
60
61
  const it = f.items[id];
61
62
  if (!it || it.proposed || !ids.has(it.initiative)) continue;
62
63
  out.push({ uid: it.id, key: '', kind: 'Task', src: 'pmos', store: 'item', title: it.title, status: STATE_OF[it.state] || 'To do', blocked: !!it.blocked, owner: ownerName(it.owner),
63
- notes: it.note || '', ini: it.initiative, epic: null, start: it.start || null, end: it.due || null, ref: it.id, board, ...(it.milestone ? { milestone: true } : {}),
64
+ notes: it.note || '', ini: it.initiative, epic: null, start: it.start || null, end: it.due || null, ref: it.id, board, ...(it.milestone ? { milestone: true } : {}), ...((it.history || []).some((h) => h.ev === 'moved') ? { since: planItems.sinceOf(it) } : {}),
64
65
  // the breakdown's own stage (plan-tree) and order: the one view places the item in the workflow stage of the same name
65
66
  ...(it.stage ? { itemStage: it.stage } : {}), ...(Number.isFinite(it.order) ? { order: it.order } : {}) });
66
67
  }
@@ -68,12 +69,13 @@ function rowsOf(root, ids, board) {
68
69
  }
69
70
 
70
71
  /** → { events } | { same: true } | { error } */
71
- function stateEvents(it, state, why) {
72
+ function stateEvents(it, state, why, happened) {
72
73
  if (state === "Won't do" || state === 'Archived') return { events: [{ ev: 'withdrawn', item: it.id }] };
73
74
  const to = MOVE_TO[state];
74
75
  if (!to) return { error: `state is one of ${Object.keys(MOVE_TO).concat("Won't do", 'Archived').join(', ')}` };
75
76
  if (STATE_OF[it.state] === state) return { same: true };
76
77
  const ev = { ev: 'moved', item: it.id, to };
78
+ if (happened) ev.happened = happened;
77
79
  // the reason a person gave is the Done's evidence: an agent Done with none goes to the PM to check (lib/plan-items.js noEvidence)
78
80
  if (to === 'done' && typeof why === 'string' && why.trim()) ev.evidence = { kind: 'note', ref: why.trim().replace(/\s+/g, ' ').slice(0, 200) };
79
81
  return { events: [ev] };
@@ -0,0 +1,131 @@
1
+ 'use strict';
2
+ /* today-log.js — Today's log, the store (slice 5 of the six-place navigation, board 1 on Exploring 2; build plan
3
+ * /mnt/project-files/nav-structure/build-plan.md, initiative today-log-page).
4
+ *
5
+ * Today's log is a table kept the Bullet Journal way. Most rows come from what PMOS already reads (the ranked asks, the PM's tasks,
6
+ * the next steps, the PM's own items); this file keeps only what Today adds:
7
+ * - the PM's own entries typed in the first line: a task (•), an event (○, with a time when the words name one) or a note (–),
8
+ * "!" in front marks what comes first;
9
+ * - the PM's marks on any row of the log: done today, moved to a later day (and back), dropped from the log, kept after PMOS suggested
10
+ * to drop it.
11
+ * A mark never changes the record a row comes from. Done on a task or an item goes through that record's own route; the mark is the
12
+ * log's own line, so the row keeps its × for the rest of the day.
13
+ *
14
+ * parseEntry(text) → { bullet: 'task' | 'event' | 'note', text, first, time } | null PURE
15
+ * fold(lines, day) → { entries, marks } PURE. entries: open own entries of `day` and of the days before it
16
+ * (carried), and the ones done on `day`; marks: { [key]: { done?, until?, dropped?, kept? } }
17
+ * addEvent(body, day, id) → { event } | { error } PURE: the line POST /api/today-log/add appends
18
+ * markEvent(body, day) → { event } | { error } PURE: the line POST /api/today-log/mark appends
19
+ * readLines(file) · appendLine(file, line, now) the one file, append-only, <runtime>/today-log/log.jsonl
20
+ *
21
+ * SINGLE WRITER: appendLine() is the only function that writes the file. `at` is set there. The day is the PM's local day, sent by
22
+ * the page (the server may run on a host in another time zone), and checked to be YYYY-MM-DD.
23
+ */
24
+ const fs = require('fs');
25
+ const path = require('path');
26
+
27
+ const DAY_RE = /^\d{4}-\d{2}-\d{2}$/;
28
+ const KEY_RE = /^[A-Za-z0-9][A-Za-z0-9._:@/+-]{0,199}$/;
29
+ const ID_RE = /^tl-[0-9a-z]{6,20}$/;
30
+ const BULLETS = ['task', 'event', 'note'];
31
+ const ACTS = ['done', 'undone', 'later', 'now', 'drop', 'undrop', 'keep'];
32
+ const MAX_TEXT = 240;
33
+ const SNAP = ['title', 'work', 'job'];
34
+
35
+ /** One line the PM typed. A leading "!" marks it first; "o " or "○ " makes it an event, "- " or "– " a note, "• " or nothing a task.
36
+ * An event's time ("10:30", "9.15", "14:00") is read from its words and kept apart. */
37
+ function parseEntry(text) {
38
+ let t = String(text == null ? '' : text).replace(/\s+/g, ' ').trim();
39
+ let first = false, bullet = 'task';
40
+ for (let i = 0; i < 2; i++) {
41
+ if (/^!\s*/.test(t)) { first = true; t = t.replace(/^!\s*/, ''); continue; }
42
+ const b = /^([o○•\-–—])\s+/.exec(t);
43
+ if (b) { bullet = /[o○]/.test(b[1]) ? 'event' : /[-–—]/.test(b[1]) ? 'note' : 'task'; t = t.slice(b[0].length); continue; }
44
+ }
45
+ let time = null;
46
+ if (bullet === 'event') {
47
+ const m = /(?:^|\s)(?:at\s+)?([01]?\d|2[0-3])[:.]([0-5]\d)(?=\s|$)/i.exec(t);
48
+ if (m) { time = String(m[1]).padStart(2, '0') + ':' + m[2]; t = (t.slice(0, m.index) + ' ' + t.slice(m.index + m[0].length)).replace(/\s+/g, ' ').trim(); }
49
+ }
50
+ t = t.slice(0, MAX_TEXT).trim();
51
+ if (!t) return null;
52
+ return { bullet, text: t, first, time };
53
+ }
54
+
55
+ /** The line POST /api/today-log/add appends. body: { text, day, bullet? (overrides the typed bullet), first? }. */
56
+ function addEvent(body, day, id) {
57
+ if (!DAY_RE.test(String(day || ''))) return { error: 'day is YYYY-MM-DD' };
58
+ if (!ID_RE.test(String(id || ''))) return { error: 'bad id' };
59
+ const e = parseEntry(body && body.text);
60
+ if (!e) return { error: 'write the task, the event or the note first' };
61
+ if (body.bullet != null && !BULLETS.includes(body.bullet)) return { error: 'bullet is task, event or note' };
62
+ const bullet = body.bullet || e.bullet;
63
+ return { event: { event: 'added', id, day, bullet, text: e.text, first: !!(body.first || e.first), time: bullet === 'event' ? e.time : null } };
64
+ }
65
+
66
+ /** The line POST /api/today-log/mark appends. body: { key, act, day, until? (later), snap? { title, work, job } (done: what the row
67
+ * said, so its × still reads after the source has let it go) }. */
68
+ function markEvent(body, day) {
69
+ const b = body || {};
70
+ if (!DAY_RE.test(String(day || ''))) return { error: 'day is YYYY-MM-DD' };
71
+ if (!KEY_RE.test(String(b.key || ''))) return { error: 'key names the row' };
72
+ if (!ACTS.includes(b.act)) return { error: 'act is ' + ACTS.join(', ') };
73
+ const ev = { event: 'mark', key: String(b.key), act: b.act, day };
74
+ if (b.act === 'later') {
75
+ if (!DAY_RE.test(String(b.until || '')) || b.until <= day) return { error: 'until is a later day, YYYY-MM-DD' };
76
+ ev.until = b.until;
77
+ }
78
+ if (b.act === 'done' && b.snap && typeof b.snap === 'object') {
79
+ const s = {};
80
+ for (const k of SNAP) if (typeof b.snap[k] === 'string' && b.snap[k].trim()) s[k] = b.snap[k].replace(/\s+/g, ' ').trim().slice(0, MAX_TEXT);
81
+ if (Object.keys(s).length) ev.snap = s;
82
+ }
83
+ return { event: ev };
84
+ }
85
+
86
+ /** Fold the lines for one day. An own entry shows on its day and every day after until it is done or dropped (carried); a done
87
+ * entry shows only on the day it was done. A mark holds by key: the last done/undone wins, a later day hides the row until then,
88
+ * a drop hides it until an undrop, a keep is remembered with its day (PMOS suggests a drop again only a while after it). */
89
+ function fold(lines, day) {
90
+ const d = DAY_RE.test(String(day || '')) ? day : '9999-12-31';
91
+ const own = new Map(), marks = {};
92
+ const M = (k) => (marks[k] = marks[k] || {});
93
+ for (const ev of lines || []) {
94
+ if (!ev || typeof ev !== 'object' || !DAY_RE.test(String(ev.day || '')) || ev.day > d) continue;
95
+ if (ev.event === 'added' && ID_RE.test(String(ev.id || '')) && BULLETS.includes(ev.bullet)) {
96
+ own.set(ev.id, { id: ev.id, key: 'own:' + ev.id, bullet: ev.bullet, text: String(ev.text || ''), first: !!ev.first, time: ev.time || null, day: ev.day, at: ev.at || null });
97
+ continue;
98
+ }
99
+ if (ev.event !== 'mark' || !KEY_RE.test(String(ev.key || '')) || !ACTS.includes(ev.act)) continue;
100
+ const m = M(ev.key);
101
+ if (ev.act === 'done') { m.done = ev.day; if (ev.snap) m.snap = ev.snap; }
102
+ else if (ev.act === 'undone') { delete m.done; delete m.snap; }
103
+ else if (ev.act === 'later') { if (ev.until > d) m.until = ev.until; else delete m.until; }
104
+ else if (ev.act === 'now') delete m.until;
105
+ else if (ev.act === 'drop') m.dropped = ev.day;
106
+ else if (ev.act === 'undrop') delete m.dropped;
107
+ else if (ev.act === 'keep') m.kept = ev.day;
108
+ }
109
+ // a done mark of an earlier day is history: the row is gone from today's log (an own entry), or it is back as its source says
110
+ for (const k of Object.keys(marks)) { const m = marks[k]; if (m.done && m.done !== d) { m.doneBefore = m.done; delete m.done; delete m.snap; } if (!Object.keys(m).length) delete marks[k]; }
111
+ const entries = [];
112
+ for (const e of own.values()) {
113
+ const m = marks[e.key] || {};
114
+ if (m.dropped) continue;
115
+ if (m.doneBefore && !m.done) continue;
116
+ entries.push({ ...e, done: !!m.done });
117
+ }
118
+ return { entries, marks };
119
+ }
120
+
121
+ function readLines(file) {
122
+ let raw = '';
123
+ try { raw = fs.readFileSync(file, 'utf8'); } catch { return []; }
124
+ return raw.split('\n').filter(Boolean).map((l) => { try { return JSON.parse(l); } catch { return null; } }).filter(Boolean);
125
+ }
126
+ function appendLine(file, line, now = new Date()) {
127
+ fs.mkdirSync(path.dirname(file), { recursive: true });
128
+ fs.appendFileSync(file, JSON.stringify({ ...line, at: now.toISOString() }) + '\n');
129
+ }
130
+
131
+ module.exports = { DAY_RE, KEY_RE, BULLETS, ACTS, parseEntry, addEvent, markEvent, fold, readLines, appendLine };
@@ -10,6 +10,7 @@
10
10
  * F2 a phone: no fold · every page: no page error
11
11
  * PMOS_SHOTS=<dir> also saves the screenshots. */
12
12
  const path = require('path');
13
+ const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
13
14
  const fs = require('fs');
14
15
  const { spawn } = require('child_process');
15
16
  const { findBrowser } = require('./lib/find-browser');
@@ -46,7 +47,7 @@ const ASKS = () => RUNNING().concat([{ id: 'b', name: 'Redistribute plan items',
46
47
  try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
47
48
  srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
48
49
  await T.waitForServer(BASE);
49
- browser = await chromium.launch({ executablePath: exe });
50
+ browser = classicBoard(await chromium.launch({ executablePath: exe }));
50
51
  if (SHOTS) fs.mkdirSync(SHOTS, { recursive: true });
51
52
  const shot = async (page, name) => { if (SHOTS) { await sleep(300); await page.screenshot({ path: path.join(SHOTS, name + '.png') }); } };
52
53
 
@@ -70,10 +71,12 @@ const ASKS = () => RUNNING().concat([{ id: 'b', name: 'Redistribute plan items',
70
71
  const l = document.getElementById('czLive'), f = document.querySelector('#czMenu.ev-rail [data-cz-chat]') || document.getElementById('czFab'); if (!l || l.hidden) return null; // a desktop: the rail's chat icon (slice 1)
71
72
  const a = l.getBoundingClientRect(), b = f.getBoundingClientRect();
72
73
  return { text: l.textContent.trim(), w: Math.round(a.width), h: Math.round(a.height), round: getComputedStyle(l).borderRadius, marks: l.querySelectorAll('.lv-m').length,
73
- above: a.bottom <= b.top, centred: Math.abs((a.left + a.width / 2) - (b.left + b.width / 2)) <= 1, label: l.getAttribute('aria-label'), asks: l.classList.contains('asks') };
74
+ above: a.bottom <= b.top, centred: Math.abs((a.left + a.width / 2) - (b.left + b.width / 2)) <= 1, label: l.getAttribute('aria-label'), asks: l.classList.contains('asks'), chatpop: document.body.classList.contains('cz-chatpop') };
74
75
  }));
75
76
  ok('L2 the pill shows the number of live items and no marks', l2 && l2.text === '2' && l2.marks === 0 && !l2.asks, JSON.stringify(l2));
76
- ok('L2 it is a 44 px round button, stacked above the rail\'s chat icon on its centre line', l2 && l2.w === 44 && l2.h === 44 && l2.round === '50%' && l2.above && l2.centred, JSON.stringify(l2));
77
+ // with the popup's chat (cozy-popup.js sets window.czOpenChat) the rail's chat icon holds the sessions, so the round button gives way
78
+ // (cozy-ev.css cz-chatpop); it comes back only while a panel is put away (panels-test P3)
79
+ ok('L2 beside the rail\'s chat icon it gives way to the popup\'s chat; without it, a 44 px round button stacked above the chat icon on its centre line', l2 && (l2.chatpop ? l2.w === 0 && l2.h === 0 : l2.w === 44 && l2.h === 44 && l2.round === '50%' && l2.above && l2.centred), JSON.stringify(l2));
77
80
  ok('L2 its name still says what it holds and its key', l2 && /^What you work on now: 2 running\. Open \(Ctrl J\)$/.test(l2.label), l2 && l2.label);
78
81
  await shot(page, 'pill-running');
79
82
 
@@ -83,8 +86,8 @@ const ASKS = () => RUNNING().concat([{ id: 'b', name: 'Redistribute plan items',
83
86
  ok('L3 PMOS asks: the pill turns blue, with the count', l3 && l3.text === '3' && !/255, 255, 255/.test(l3.bg), JSON.stringify(l3));
84
87
  await shot(page, 'pill-asks');
85
88
 
86
- /* L4 */
87
- await page.click('#czLive');
89
+ /* L4 (beside the popup's chat icon the round button gives way, L2: Ctrl J still opens the list) */
90
+ if (l2 && l2.chatpop) await page.keyboard.press('Control+j'); else await page.click('#czLive');
88
91
  const rows = await until(() => page.evaluate(() => { const r = [...document.querySelectorAll('#czLiveList a[data-lv]')]; return r.length ? r.length : null; }));
89
92
  ok('L4 the list opens with its rows (the panels engine drags a[data-lv] to an edge)', rows === 3, String(rows));
90
93
  await shot(page, 'pill-list');
@@ -96,7 +99,7 @@ const ASKS = () => RUNNING().concat([{ id: 'b', name: 'Redistribute plan items',
96
99
  await page.evaluate(() => { delete window.czPanels; });
97
100
 
98
101
  /* L5 */
99
- ok('L5 a desktop has no menu to open (the rail is the menu, slice 1): the pill stays at the rail\'s foot', await page.evaluate(() => !document.getElementById('czLive').hidden && getComputedStyle(document.getElementById('czLive')).visibility === 'visible' && getComputedStyle(document.getElementById('czFab')).display === 'none'));
102
+ ok('L5 a desktop has no menu to open (the rail is the menu, slice 1): the pill stays at the rail\'s foot, or gives way to the popup\'s chat icon', await page.evaluate(() => { const l = document.getElementById('czLive'), cs = getComputedStyle(l); return !l.hidden && getComputedStyle(document.getElementById('czFab')).display === 'none' && (document.body.classList.contains('cz-chatpop') ? cs.display === 'none' : cs.visibility === 'visible'); }));
100
103
  await page.keyboard.press('Escape');
101
104
  await page.evaluate(() => { const m = document.getElementById('czMenu'); if (m && !m.hidden) document.getElementById('czFab').click(); });
102
105
 
@@ -145,7 +148,7 @@ const ASKS = () => RUNNING().concat([{ id: 'b', name: 'Redistribute plan items',
145
148
 
146
149
  /* L6 */
147
150
  await page.evaluate(() => { window.czPanels = { slideOver: () => false, list: () => [] }; });
148
- await page.click('#czLive');
151
+ if (l2 && l2.chatpop) await page.keyboard.press('Control+j'); else await page.click('#czLive');
149
152
  await until(() => page.$('#czLiveList a[data-lv="s:b"]'));
150
153
  await Promise.all([page.waitForURL(/premium\.html\?session=b/, { timeout: 15000 }).catch(() => null), page.click('#czLiveList a[data-lv="s:b"]')]);
151
154
  ok('L6 czPanels.slideOver(item) gives false (it did nothing): the row opens as today', /premium\.html\?session=b/.test(page.url()), page.url());
@@ -9,6 +9,8 @@
9
9
  * the stage card, Proves it worked, Early signal and Guardrail as Now → Target; ✓ keeps all; the folded "Success measure · Set before the
10
10
  * build · 3" with Undo · S the type scale only · H on a phone. PMOS_SHOTS=<dir> also saves the screenshots. */
11
11
  const path = require('path');
12
+ const { besidePage } = require('./lib/beside-page'); // these checks read the full page beside the page; in the popup work shows its three parts (nav slice 3)
13
+ const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
12
14
  const fs = require('fs');
13
15
  const { spawn } = require('child_process');
14
16
  const { findBrowser } = require('./lib/find-browser');
@@ -64,7 +66,7 @@ const INITIATIVE = () => ({
64
66
  try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
65
67
  srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
66
68
  await T.waitForServer(BASE);
67
- browser = await chromium.launch({ executablePath: exe });
69
+ browser = besidePage(classicBoard(await chromium.launch({ executablePath: exe })));
68
70
  if (SHOTS) fs.mkdirSync(SHOTS, { recursive: true });
69
71
  const shot = async (p, name) => { if (SHOTS) { await sleep(450); await p.screenshot({ path: path.join(SHOTS, name + '.png') }); } };
70
72
 
@@ -11,6 +11,7 @@
11
11
  * P the phone: the card is a bottom sheet
12
12
  * SHOTS_4B=<dir>: the card and the Filter, desktop and phone, into <dir>. */
13
13
  const path = require('path');
14
+ const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
14
15
  const { spawn } = require('child_process');
15
16
  const { findBrowser } = require('./lib/find-browser');
16
17
  const T = require('./test-run').configure({ name: 'milestone-pins' });
@@ -54,7 +55,7 @@ const ITEMS = [
54
55
  try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
55
56
  srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
56
57
  await T.waitForServer(BASE);
57
- browser = await chromium.launch({ executablePath: exe });
58
+ browser = classicBoard(await chromium.launch({ executablePath: exe }));
58
59
 
59
60
  /** The Board on the timeline. o: { w, h, phone, refuse, view } */
60
61
  const open = async (o = {}) => {
@@ -8,6 +8,8 @@
8
8
  * Save writes it and answers the suggestion; last checked and Check now · Z nothing to suggest, nothing shows · K the ◆ dates are reported once
9
9
  * · M Home's program card leads with its milestone changes · H on a phone. PMOS_SHOTS=<dir> also saves the screenshots the frames are compared with. */
10
10
  const path = require('path');
11
+ const { besidePage } = require('./lib/beside-page'); // these checks read the full page beside the page; in the popup work shows its three parts (nav slice 3)
12
+ const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
11
13
  const fs = require('fs');
12
14
  const { spawn } = require('child_process');
13
15
  const { findBrowser } = require('./lib/find-browser');
@@ -55,7 +57,7 @@ const withReview = (open, o = {}) => F.programs().map((p) => ({ ...p, ...(o.empt
55
57
  try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
56
58
  srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
57
59
  await T.waitForServer(BASE);
58
- browser = await chromium.launch({ executablePath: exe });
60
+ browser = besidePage(classicBoard(await chromium.launch({ executablePath: exe })));
59
61
  if (SHOTS) fs.mkdirSync(SHOTS, { recursive: true });
60
62
  const shot = async (p, name) => { if (SHOTS) await p.screenshot({ path: path.join(SHOTS, name + '.png') }); };
61
63
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.610.0",
3
+ "version": "0.612.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.610.0",
9
+ "version": "0.612.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.610.0",
3
+ "version": "0.612.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",
@@ -25,6 +25,7 @@
25
25
  * P13 the Live pill's list docks on the right by its grab bar, and a press moves it back (batch 26 item 4)
26
26
  * Screenshots go to PMOS_SHOTS when it is set. Every wait polls the page. */
27
27
  const fs = require('fs');
28
+ const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
28
29
  const path = require('path');
29
30
  const { spawn } = require('child_process');
30
31
  const { findBrowser } = require('./lib/find-browser');
@@ -61,7 +62,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
61
62
  try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed — the panels suite cannot run'); return finish(1); }
62
63
  srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
63
64
  await T.waitForServer(BASE);
64
- browser = besidePage(await chromium.launch({ executablePath: exe }));
65
+ browser = classicBoard(besidePage(await chromium.launch({ executablePath: exe })));
65
66
 
66
67
  const open = async ({ w = 1440, h = 900, dark = false, ctx = null, q = '', at = '/premium.html', ready = () => { document.querySelectorAll('#hmList .hv-fold[aria-expanded="false"]').forEach((b) => b.click()); return !!window.czPanels && document.querySelectorAll('#hmList .hv-r.ini .hm-rm').length > 2; } } = {}) => {
67
68
  // Home shows only the rows with a call (home-nav-rows-with-a-call): the default ready opens every folded group, so the rows this suite drags are there
@@ -7,6 +7,8 @@
7
7
  * T triage (accept, decline) · N New initiative · M move and Undo · L hold, resume, cancel, reopen, archive, restore · I the initiative page's bar
8
8
  * S the PMOS-self board (a model answer, since only the embedded checkout is self) · P the POST allow-list and the refusals · F floors */
9
9
  const fs = require('fs');
10
+ const { besidePage } = require('./lib/beside-page'); // these checks read the full page beside the page; in the popup work shows its three parts (nav slice 3)
11
+ const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
10
12
  const path = require('path');
11
13
  const { spawn } = require('child_process');
12
14
  const { findBrowser } = require('./lib/find-browser');
@@ -72,7 +74,7 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
72
74
  const a2 = await post('/api/boards/asks/add', { line: 'Can the portal get a dark mode', source: 'Support inbox' });
73
75
  ok('setup two asks are on the board', a1.status === 200 && a2.status === 200, JSON.stringify([a1, a2]));
74
76
 
75
- browser = await chromium.launch({ executablePath: exe });
77
+ browser = besidePage(classicBoard(await chromium.launch({ executablePath: exe })));
76
78
  const open = async (url, { w = 1280, h = 900 } = {}) => {
77
79
  const ctx = await openMission(await browser.newContext({ viewport: { width: w, height: h } }));
78
80
  await ctx.addInitScript(() => { try { localStorage.setItem('pmos.premium.openAs', 'popup'); } catch { /* none */ } });
@@ -10,6 +10,7 @@
10
10
  * T5 Pause, Resume, Stop · T6 a phone
11
11
  * Every wait polls the page; no fixed sleep stands in for a state. */
12
12
  const path = require('path');
13
+ const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
13
14
  const { spawn } = require('child_process');
14
15
  const { findBrowser } = require('./lib/find-browser');
15
16
  const T = require('./test-run').configure({ name: 'premium-rec-tab' });
@@ -64,7 +65,7 @@ async function context(o = {}) {
64
65
  try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
65
66
  srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
66
67
  await T.waitForServer(BASE);
67
- browser = await chromium.launch({ executablePath: exe });
68
+ browser = classicBoard(await chromium.launch({ executablePath: exe }));
68
69
  const W = F.world();
69
70
  const posted = (S, pth) => S.posts.filter((x) => x.path === pth);
70
71