create-pmos 0.399.0 → 0.401.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 (425) hide show
  1. package/package.json +30 -25
  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-adddoc-test.js +2 -2
  7. package/workspace/briefing-premium-board-test.js +3 -3
  8. package/workspace/briefing-premium-doc-edit-test.js +2 -8
  9. package/workspace/briefing-premium-sources-test.js +2 -0
  10. package/workspace/briefing-premium-test.js +6 -2
  11. package/workspace/briefing-premium-work-test.js +9 -4
  12. package/workspace/c3-capture-test.js +0 -17
  13. package/workspace/changelog.json +29 -0
  14. package/workspace/guide/briefing-premium.md +2 -2
  15. package/workspace/guide/home.md +24 -3
  16. package/workspace/guide/layout.md +2 -2
  17. package/workspace/guide/notes.md +2 -2
  18. package/workspace/guide/phone-companion.md +1 -1
  19. package/workspace/lib/core-docs.js +2 -2
  20. package/workspace/lib/route-modules.js +1 -9
  21. package/workspace/lib/routes-phone-day.js +18 -9
  22. package/workspace/lib/routes-slash.js +95 -0
  23. package/workspace/package-lock.json +2 -2
  24. package/workspace/package.json +1 -2
  25. package/workspace/premium-chat-goal-view-test.js +1 -1
  26. package/workspace/premium-chat-term-test.js +0 -10
  27. package/workspace/premium-menu-rows-test.js +1 -1
  28. package/workspace/premium-phone-card-test.js +8 -3
  29. package/workspace/premium-vw-cal-test.js +4 -1
  30. package/workspace/premium-vw-doc-test.js +1 -8
  31. package/workspace/premium-work-depth-test.js +2 -3
  32. package/workspace/public/capture.html +23 -0
  33. package/workspace/public/pm/c3-base.js +47 -0
  34. package/workspace/public/pm/c3-capture.js +1 -1
  35. package/workspace/public/pm/c3-ini-ui.js +1 -1
  36. package/workspace/public/pm/c3-sheet.js +1 -1
  37. package/workspace/public/pm/c3-toast.js +1 -1
  38. package/workspace/public/pm/console3.css +3 -0
  39. package/workspace/public/pm/cozy-home.css +21 -6
  40. package/workspace/public/pm/cozy-today.css +4 -3
  41. package/workspace/public/pm/cozy-viewer.js +4 -2
  42. package/workspace/public/pm/cozy.css +9 -0
  43. package/workspace/public/pm/goal-chat.js +5 -1
  44. package/workspace/public/pm/home-app.js +65 -33
  45. package/workspace/public/pm/home-chat.js +34 -29
  46. package/workspace/public/pm/home-data.js +10 -2
  47. package/workspace/public/pm/home-dictate.js +7 -4
  48. package/workspace/public/pm/home-ini.js +13 -3
  49. package/workspace/public/pm/home-list.js +18 -10
  50. package/workspace/public/pm/home-more.js +2 -2
  51. package/workspace/public/pm/home-phone-card.js +9 -4
  52. package/workspace/public/pm/home-review.js +2 -3
  53. package/workspace/public/pm/home-today.js +11 -8
  54. package/workspace/public/pm/home-work.js +13 -8
  55. package/workspace/public/pm/note-dock.js +1 -2
  56. package/workspace/public/pm/notes-links.js +1 -2
  57. package/workspace/public/pm/notes-task.js +3 -4
  58. package/workspace/public/pm/premium-board.js +1 -1
  59. package/workspace/public/pm/premium-initiative-head.js +3 -3
  60. package/workspace/public/pm/premium-vw-doc.css +20 -2
  61. package/workspace/public/pm/premium-vw-doc.js +22 -7
  62. package/workspace/public/pm/premium-vw-item.css +6 -0
  63. package/workspace/public/pm/view-notes.js +2 -2
  64. package/workspace/replaced-tests.json +435 -0
  65. package/workspace/run-tests.js +323 -28
  66. package/workspace/server.js +15 -10
  67. package/workspace/test-files.json +4 -140
  68. package/workspace/test-lists/base.json +1 -2
  69. package/workspace/test-lists/c3-desktop-light-load.json +1 -2
  70. package/workspace/test-lists/c3-initiative-boards.json +1 -2
  71. package/workspace/test-lists/c3-meeting-focus.json +2 -12
  72. package/workspace/test-lists/c3-work-agent.json +1 -2
  73. package/workspace/test-lists/calendar-tidy-up.json +1 -2
  74. package/workspace/test-lists/console3-reports.json +1 -2
  75. package/workspace/test-lists/docs-three-way-sync.json +1 -2
  76. package/workspace/test-lists/extension-capture.json +5 -0
  77. package/workspace/test-lists/jira-wbs.json +1 -2
  78. package/workspace/test-lists/legacy-cleanup-a.json +9 -0
  79. package/workspace/test-lists/meeting-material.json +1 -2
  80. package/workspace/test-lists/meeting-notes.json +2 -36
  81. package/workspace/test-lists/meeting-replay.json +1 -2
  82. package/workspace/test-lists/mm-capture.json +2 -12
  83. package/workspace/test-lists/my-work.json +2 -10
  84. package/workspace/test-lists/onboarding-firstrun.json +2 -12
  85. package/workspace/test-lists/people-directory.json +1 -2
  86. package/workspace/test-lists/run2-a.json +1 -2
  87. package/workspace/test-lists/run2-d.json +2 -19
  88. package/workspace/test-lists/run3-b.json +1 -2
  89. package/workspace/test-lists/run3-c.json +2 -12
  90. package/workspace/test-lists/run4-b.json +1 -2
  91. package/workspace/test-lists/run4-d.json +1 -5
  92. package/workspace/test-lists/run5-c.json +1 -11
  93. package/workspace/test-lists/run6.json +1 -5
  94. package/workspace/test-lists/workspace-launch-flags.json +2 -12
  95. package/workspace/test-lists/workspace-profile-detection.json +2 -10
  96. package/workspace/test-timings.json +242 -123
  97. package/workspace/c3-briefing-test.js +0 -136
  98. package/workspace/c3-core-docs-test.js +0 -170
  99. package/workspace/c3-driver-fixture.js +0 -64
  100. package/workspace/c3-driver-test.js +0 -169
  101. package/workspace/c3-foundation-test.js +0 -163
  102. package/workspace/c3-ib-items-test.js +0 -114
  103. package/workspace/c3-ib-more-test.js +0 -146
  104. package/workspace/c3-ib-triage-backlog-test.js +0 -128
  105. package/workspace/c3-ini-harness.js +0 -66
  106. package/workspace/c3-ini-life-test.js +0 -167
  107. package/workspace/c3-initiatives-test.js +0 -186
  108. package/workspace/c3-light-load-test.js +0 -112
  109. package/workspace/c3-one-home-test.js +0 -149
  110. package/workspace/c3-phone-test.js +0 -289
  111. package/workspace/c3-quiet-test.js +0 -157
  112. package/workspace/c3-report-design-real-test.js +0 -264
  113. package/workspace/c3-report-design-test.js +0 -442
  114. package/workspace/c3-report-setup-test.js +0 -192
  115. package/workspace/c3-report-structure-real-test.js +0 -248
  116. package/workspace/c3-report-structure-test.js +0 -397
  117. package/workspace/c3-reports-test.js +0 -288
  118. package/workspace/c3-scan-test.js +0 -517
  119. package/workspace/c3-sessions-panel-test.js +0 -365
  120. package/workspace/c3-settings-test.js +0 -204
  121. package/workspace/c3-updates-test.js +0 -131
  122. package/workspace/c3-work-test.js +0 -260
  123. package/workspace/cut-stub.js +0 -40
  124. package/workspace/first-paint-audit.js +0 -160
  125. package/workspace/lib/c3-full-console.js +0 -15
  126. package/workspace/lib/engine/derived/trust.js +0 -3
  127. package/workspace/lib/engine/plan-forecast.js +0 -342
  128. package/workspace/lib/engine/report-families.js +0 -175
  129. package/workspace/lib/engine/truth-table.js +0 -57
  130. package/workspace/lib/routes-c3-init.js +0 -54
  131. package/workspace/lib/routes-c3-life.js +0 -120
  132. package/workspace/lib/routes-c3-timeline.js +0 -192
  133. package/workspace/lib/routes-forecast.js +0 -86
  134. package/workspace/lib/routes-releases.js +0 -130
  135. package/workspace/lib/routes-report-facts.js +0 -85
  136. package/workspace/lib/routes-report-families.js +0 -33
  137. package/workspace/lib/routes-signals.js +0 -51
  138. package/workspace/lib/routes-timeline.js +0 -197
  139. package/workspace/public/c3.html +0 -35
  140. package/workspace/public/index.html +0 -156
  141. package/workspace/public/pm/app.js +0 -831
  142. package/workspace/public/pm/bd-board.js +0 -159
  143. package/workspace/public/pm/bd-drag.js +0 -59
  144. package/workspace/public/pm/bd-model.js +0 -152
  145. package/workspace/public/pm/bd-timeline.js +0 -233
  146. package/workspace/public/pm/bd-tree.js +0 -244
  147. package/workspace/public/pm/board-copy.js +0 -59
  148. package/workspace/public/pm/board-read.js +0 -38
  149. package/workspace/public/pm/branches-sheet.js +0 -56
  150. package/workspace/public/pm/breakdown-api.js +0 -58
  151. package/workspace/public/pm/breakdown-copy.js +0 -138
  152. package/workspace/public/pm/briefing-deck.js +0 -441
  153. package/workspace/public/pm/briefing-model.js +0 -251
  154. package/workspace/public/pm/c3-ambient.js +0 -100
  155. package/workspace/public/pm/c3-audience-link.js +0 -21
  156. package/workspace/public/pm/c3-audience.js +0 -46
  157. package/workspace/public/pm/c3-boot.js +0 -13
  158. package/workspace/public/pm/c3-breakdown.js +0 -240
  159. package/workspace/public/pm/c3-brief-data.js +0 -11
  160. package/workspace/public/pm/c3-brief-mentions.js +0 -137
  161. package/workspace/public/pm/c3-brief-needs.js +0 -288
  162. package/workspace/public/pm/c3-brief-pulse.js +0 -112
  163. package/workspace/public/pm/c3-brief-summary.js +0 -139
  164. package/workspace/public/pm/c3-brief-today.js +0 -79
  165. package/workspace/public/pm/c3-brief.js +0 -279
  166. package/workspace/public/pm/c3-cal-strategy.js +0 -529
  167. package/workspace/public/pm/c3-calendar.js +0 -965
  168. package/workspace/public/pm/c3-calpop.js +0 -111
  169. package/workspace/public/pm/c3-case.js +0 -196
  170. package/workspace/public/pm/c3-core-docs.css +0 -18
  171. package/workspace/public/pm/c3-core-docs.js +0 -236
  172. package/workspace/public/pm/c3-daypart.js +0 -176
  173. package/workspace/public/pm/c3-demo-boards.js +0 -764
  174. package/workspace/public/pm/c3-demo-brief-ix.js +0 -350
  175. package/workspace/public/pm/c3-demo-brief-page.js +0 -70
  176. package/workspace/public/pm/c3-demo-cal-ix.js +0 -74
  177. package/workspace/public/pm/c3-demo-cal2.js +0 -66
  178. package/workspace/public/pm/c3-demo-cal3.js +0 -173
  179. package/workspace/public/pm/c3-demo-cal4.js +0 -169
  180. package/workspace/public/pm/c3-demo-cal5.js +0 -52
  181. package/workspace/public/pm/c3-demo-coredocs.js +0 -221
  182. package/workspace/public/pm/c3-demo-data.js +0 -552
  183. package/workspace/public/pm/c3-demo-focus.js +0 -181
  184. package/workspace/public/pm/c3-demo-init.js +0 -430
  185. package/workspace/public/pm/c3-demo-life.js +0 -77
  186. package/workspace/public/pm/c3-demo-material.js +0 -58
  187. package/workspace/public/pm/c3-demo-misc2.js +0 -34
  188. package/workspace/public/pm/c3-demo-phone.js +0 -48
  189. package/workspace/public/pm/c3-demo-plan2.js +0 -30
  190. package/workspace/public/pm/c3-demo-rd.js +0 -432
  191. package/workspace/public/pm/c3-demo-rep-ix.js +0 -126
  192. package/workspace/public/pm/c3-demo-rep2.js +0 -130
  193. package/workspace/public/pm/c3-demo-rep3.js +0 -138
  194. package/workspace/public/pm/c3-demo-rs.js +0 -287
  195. package/workspace/public/pm/c3-demo-term.js +0 -153
  196. package/workspace/public/pm/c3-demo-time.js +0 -49
  197. package/workspace/public/pm/c3-demo-work-ix.js +0 -32
  198. package/workspace/public/pm/c3-demo.js +0 -131
  199. package/workspace/public/pm/c3-design-studio.js +0 -369
  200. package/workspace/public/pm/c3-doc-formats.js +0 -153
  201. package/workspace/public/pm/c3-doc-sheet.js +0 -1230
  202. package/workspace/public/pm/c3-dock.js +0 -206
  203. package/workspace/public/pm/c3-docs.js +0 -291
  204. package/workspace/public/pm/c3-driver-work.js +0 -110
  205. package/workspace/public/pm/c3-driver.css +0 -18
  206. package/workspace/public/pm/c3-driver.js +0 -298
  207. package/workspace/public/pm/c3-focus.css +0 -304
  208. package/workspace/public/pm/c3-focus.js +0 -983
  209. package/workspace/public/pm/c3-ib-docs.js +0 -92
  210. package/workspace/public/pm/c3-ib-initiatives.js +0 -201
  211. package/workspace/public/pm/c3-ib-items.js +0 -210
  212. package/workspace/public/pm/c3-ib-releases.js +0 -48
  213. package/workspace/public/pm/c3-ib-sprints.js +0 -201
  214. package/workspace/public/pm/c3-ib-triage.js +0 -177
  215. package/workspace/public/pm/c3-ii-tabs.js +0 -252
  216. package/workspace/public/pm/c3-ini-life.css +0 -34
  217. package/workspace/public/pm/c3-ini-life.js +0 -379
  218. package/workspace/public/pm/c3-ini-records.js +0 -197
  219. package/workspace/public/pm/c3-ini-timeline.js +0 -278
  220. package/workspace/public/pm/c3-ini-work.js +0 -139
  221. package/workspace/public/pm/c3-init-extras.js +0 -170
  222. package/workspace/public/pm/c3-initiatives.js +0 -852
  223. package/workspace/public/pm/c3-lifecycle-panels.js +0 -479
  224. package/workspace/public/pm/c3-look.js +0 -27
  225. package/workspace/public/pm/c3-material.css +0 -22
  226. package/workspace/public/pm/c3-material.js +0 -321
  227. package/workspace/public/pm/c3-md.js +0 -3
  228. package/workspace/public/pm/c3-misc-panels.js +0 -89
  229. package/workspace/public/pm/c3-new-session.js +0 -110
  230. package/workspace/public/pm/c3-notes.js +0 -751
  231. package/workspace/public/pm/c3-phone-boot.js +0 -47
  232. package/workspace/public/pm/c3-phone-detail.js +0 -97
  233. package/workspace/public/pm/c3-phone-model.js +0 -3
  234. package/workspace/public/pm/c3-phone.css +0 -66
  235. package/workspace/public/pm/c3-phone.js +0 -444
  236. package/workspace/public/pm/c3-plan-panels.js +0 -163
  237. package/workspace/public/pm/c3-plan.js +0 -193
  238. package/workspace/public/pm/c3-quiet.css +0 -113
  239. package/workspace/public/pm/c3-quiet.js +0 -177
  240. package/workspace/public/pm/c3-replay.css +0 -133
  241. package/workspace/public/pm/c3-replay.js +0 -429
  242. package/workspace/public/pm/c3-report-deck.css +0 -163
  243. package/workspace/public/pm/c3-report-deck.js +0 -598
  244. package/workspace/public/pm/c3-report-frame.css +0 -20
  245. package/workspace/public/pm/c3-report-print.css +0 -20
  246. package/workspace/public/pm/c3-report-setup.css +0 -67
  247. package/workspace/public/pm/c3-report-setup.js +0 -298
  248. package/workspace/public/pm/c3-report-store.js +0 -244
  249. package/workspace/public/pm/c3-report-structure.css +0 -44
  250. package/workspace/public/pm/c3-report-structure.js +0 -473
  251. package/workspace/public/pm/c3-reports.css +0 -68
  252. package/workspace/public/pm/c3-reports.js +0 -377
  253. package/workspace/public/pm/c3-roadmap.js +0 -249
  254. package/workspace/public/pm/c3-scan-api.js +0 -167
  255. package/workspace/public/pm/c3-scan-next.js +0 -248
  256. package/workspace/public/pm/c3-scan-setup.js +0 -313
  257. package/workspace/public/pm/c3-scan-words.js +0 -41
  258. package/workspace/public/pm/c3-scan.css +0 -74
  259. package/workspace/public/pm/c3-scan.js +0 -93
  260. package/workspace/public/pm/c3-session-chat.js +0 -103
  261. package/workspace/public/pm/c3-session-conv.js +0 -165
  262. package/workspace/public/pm/c3-session-term.js +0 -216
  263. package/workspace/public/pm/c3-settings.css +0 -85
  264. package/workspace/public/pm/c3-settings.js +0 -1045
  265. package/workspace/public/pm/c3-shell.js +0 -628
  266. package/workspace/public/pm/c3-signals.js +0 -196
  267. package/workspace/public/pm/c3-strategy-panels.js +0 -45
  268. package/workspace/public/pm/c3-swipe.js +0 -230
  269. package/workspace/public/pm/c3-terminal-data.js +0 -48
  270. package/workspace/public/pm/c3-terminal-edge.js +0 -91
  271. package/workspace/public/pm/c3-terminal-icons.js +0 -40
  272. package/workspace/public/pm/c3-terminal-results.js +0 -141
  273. package/workspace/public/pm/c3-terminal.js +0 -52
  274. package/workspace/public/pm/c3-tickets.js +0 -163
  275. package/workspace/public/pm/c3-timeline.js +0 -201
  276. package/workspace/public/pm/calendar-views.js +0 -1049
  277. package/workspace/public/pm/console3-lift.md +0 -220
  278. package/workspace/public/pm/cozy-home.js +0 -172
  279. package/workspace/public/pm/cozy-initiative.css +0 -138
  280. package/workspace/public/pm/cycle-review.js +0 -125
  281. package/workspace/public/pm/data.js +0 -1577
  282. package/workspace/public/pm/dest-board.js +0 -444
  283. package/workspace/public/pm/dest-docs.js +0 -530
  284. package/workspace/public/pm/dest-initiatives.js +0 -162
  285. package/workspace/public/pm/dest-mywork.js +0 -307
  286. package/workspace/public/pm/dest-notes.js +0 -537
  287. package/workspace/public/pm/dest-people.js +0 -449
  288. package/workspace/public/pm/dest-reports.js +0 -383
  289. package/workspace/public/pm/dest-settings.js +0 -601
  290. package/workspace/public/pm/dest-today.js +0 -267
  291. package/workspace/public/pm/display-word.js +0 -56
  292. package/workspace/public/pm/doc-editor.js +0 -473
  293. package/workspace/public/pm/doc-graph.js +0 -272
  294. package/workspace/public/pm/doc-health-panel.js +0 -110
  295. package/workspace/public/pm/doc-rail.js +0 -167
  296. package/workspace/public/pm/doc-remote.js +0 -180
  297. package/workspace/public/pm/dock-sessions.js +0 -472
  298. package/workspace/public/pm/dock.js +0 -216
  299. package/workspace/public/pm/fixture.js +0 -821
  300. package/workspace/public/pm/flag-picker.js +0 -104
  301. package/workspace/public/pm/frame-copy.js +0 -278
  302. package/workspace/public/pm/freshness-line.js +0 -149
  303. package/workspace/public/pm/handoff-box.js +0 -82
  304. package/workspace/public/pm/initiative-list.js +0 -235
  305. package/workspace/public/pm/initiative-sheet.js +0 -331
  306. package/workspace/public/pm/initiatives-api.js +0 -95
  307. package/workspace/public/pm/initiatives-copy.js +0 -287
  308. package/workspace/public/pm/initiatives-timeline-copy.js +0 -59
  309. package/workspace/public/pm/initiatives-timeline.js +0 -410
  310. package/workspace/public/pm/initiatives-ui.js +0 -291
  311. package/workspace/public/pm/item-sheet.js +0 -268
  312. package/workspace/public/pm/keep-card.js +0 -204
  313. package/workspace/public/pm/lifecycle-lens-model.js +0 -246
  314. package/workspace/public/pm/lifecycle-lens.js +0 -276
  315. package/workspace/public/pm/lifecycle.js +0 -111
  316. package/workspace/public/pm/mobile.css +0 -366
  317. package/workspace/public/pm/mobile.js +0 -581
  318. package/workspace/public/pm/modes-live.js +0 -453
  319. package/workspace/public/pm/modes.js +0 -147
  320. package/workspace/public/pm/my-work-card.js +0 -51
  321. package/workspace/public/pm/my-work-data.js +0 -36
  322. package/workspace/public/pm/new-initiative-sheet.js +0 -169
  323. package/workspace/public/pm/next-step-ui.js +0 -190
  324. package/workspace/public/pm/outbox-panel.js +0 -125
  325. package/workspace/public/pm/palette-copy.js +0 -55
  326. package/workspace/public/pm/palette.js +0 -343
  327. package/workspace/public/pm/panel-breakdown.js +0 -702
  328. package/workspace/public/pm/panel-cockpit.js +0 -425
  329. package/workspace/public/pm/panel-detail.js +0 -1513
  330. package/workspace/public/pm/panel-initiatives.js +0 -929
  331. package/workspace/public/pm/panel-newsess.js +0 -709
  332. package/workspace/public/pm/panel-repos.js +0 -741
  333. package/workspace/public/pm/panel-tabs.js +0 -1506
  334. package/workspace/public/pm/panel-trees.js +0 -204
  335. package/workspace/public/pm/people-link.js +0 -106
  336. package/workspace/public/pm/phone-deck.js +0 -167
  337. package/workspace/public/pm/pm-work-view.js +0 -1533
  338. package/workspace/public/pm/portfolio-report.js +0 -61
  339. package/workspace/public/pm/premium-acts.js +0 -280
  340. package/workspace/public/pm/premium-brief.js +0 -111
  341. package/workspace/public/pm/premium-chat.js +0 -22
  342. package/workspace/public/pm/premium-doc-sheet.js +0 -312
  343. package/workspace/public/pm/premium-initiative.js +0 -324
  344. package/workspace/public/pm/premium-insights.css +0 -228
  345. package/workspace/public/pm/premium-metric-tiles.js +0 -68
  346. package/workspace/public/pm/premium-report-brief.js +0 -132
  347. package/workspace/public/pm/premium-vw-rec.js +0 -67
  348. package/workspace/public/pm/premium-wide.css +0 -30
  349. package/workspace/public/pm/print.css +0 -44
  350. package/workspace/public/pm/provider-cards.js +0 -136
  351. package/workspace/public/pm/registry.js +0 -203
  352. package/workspace/public/pm/release-card.js +0 -110
  353. package/workspace/public/pm/releases-view.js +0 -248
  354. package/workspace/public/pm/report-families-view.js +0 -505
  355. package/workspace/public/pm/report-slides.js +0 -438
  356. package/workspace/public/pm/report-tab.js +0 -33
  357. package/workspace/public/pm/report-view.js +0 -337
  358. package/workspace/public/pm/reports-copy.js +0 -134
  359. package/workspace/public/pm/roadmap.js +0 -294
  360. package/workspace/public/pm/run-card.js +0 -260
  361. package/workspace/public/pm/sessions-panel.js +0 -219
  362. package/workspace/public/pm/sheet-jira.js +0 -353
  363. package/workspace/public/pm/shell-bell.js +0 -163
  364. package/workspace/public/pm/shell-model.js +0 -83
  365. package/workspace/public/pm/shell-phone.js +0 -124
  366. package/workspace/public/pm/shell-readaloud.js +0 -53
  367. package/workspace/public/pm/shell-recording.js +0 -274
  368. package/workspace/public/pm/shell-ticker.js +0 -90
  369. package/workspace/public/pm/sig-watch.js +0 -41
  370. package/workspace/public/pm/slide-confirm.js +0 -163
  371. package/workspace/public/pm/slides-copy.js +0 -52
  372. package/workspace/public/pm/status-banner.js +0 -95
  373. package/workspace/public/pm/tab-doc.js +0 -859
  374. package/workspace/public/pm/tab-gone.js +0 -21
  375. package/workspace/public/pm/tab-term.js +0 -1210
  376. package/workspace/public/pm/tab-web.js +0 -90
  377. package/workspace/public/pm/timeline-copy.js +0 -48
  378. package/workspace/public/pm/timeline-forecast-view.js +0 -164
  379. package/workspace/public/pm/today-agenda.js +0 -331
  380. package/workspace/public/pm/today-cards.js +0 -244
  381. package/workspace/public/pm/today-copy.js +0 -506
  382. package/workspace/public/pm/today-day.js +0 -1371
  383. package/workspace/public/pm/today-goals.js +0 -297
  384. package/workspace/public/pm/today-jobs.js +0 -84
  385. package/workspace/public/pm/today-mentions.js +0 -50
  386. package/workspace/public/pm/topbar.js +0 -202
  387. package/workspace/public/pm/triage-card.js +0 -60
  388. package/workspace/public/pm/undo-hold.js +0 -103
  389. package/workspace/public/pm/view-addrepo.js +0 -208
  390. package/workspace/public/pm/view-files.js +0 -197
  391. package/workspace/public/pm/view-livenotes.js +0 -399
  392. package/workspace/public/pm/view-today.js +0 -13
  393. package/workspace/public/pm/view-validate.js +0 -171
  394. package/workspace/public/pm/welcome.js +0 -391
  395. package/workspace/public/pm/work-place.js +0 -68
  396. package/workspace/public/pm/xlsx-read.js +0 -117
  397. package/workspace/public/welcome.html +0 -22
  398. package/workspace/test-lists/browser-suites-green.json +0 -5
  399. package/workspace/test-lists/c3-core-docs.json +0 -9
  400. package/workspace/test-lists/c3-doc-sheet-rich.json +0 -6
  401. package/workspace/test-lists/c3-doc-sheet-size.json +0 -6
  402. package/workspace/test-lists/c3-doc-sheet-v2.json +0 -6
  403. package/workspace/test-lists/c3-ib-items.json +0 -9
  404. package/workspace/test-lists/c3-ib-more.json +0 -9
  405. package/workspace/test-lists/c3-ib-triage-backlog.json +0 -9
  406. package/workspace/test-lists/c3-ini-life.json +0 -9
  407. package/workspace/test-lists/c3-meeting-board.json +0 -5
  408. package/workspace/test-lists/c3-meeting-card.json +0 -5
  409. package/workspace/test-lists/c3-notes-place.json +0 -5
  410. package/workspace/test-lists/c3-notes-series.json +0 -5
  411. package/workspace/test-lists/calendar-time-page.json +0 -5
  412. package/workspace/test-lists/calpop.json +0 -4
  413. package/workspace/test-lists/console3-briefing.json +0 -9
  414. package/workspace/test-lists/console3-foundation.json +0 -9
  415. package/workspace/test-lists/console3-work-page.json +0 -9
  416. package/workspace/test-lists/premium-brief-parity.json +0 -9
  417. package/workspace/test-lists/report-design-studio-ui.json +0 -5
  418. package/workspace/test-lists/report-structure-ui.json +0 -11
  419. package/workspace/test-lists/report-workspace-ui.json +0 -5
  420. package/workspace/test-lists/run3-a.json +0 -5
  421. package/workspace/test-lists/run3-d.json +0 -6
  422. package/workspace/test-lists/run4-c.json +0 -13
  423. package/workspace/test-lists/today-goals-jobs-ui.json +0 -5
  424. package/workspace/test-lists/today-mentions-cards.json +0 -5
  425. package/workspace/test-lists/workspace-tabs-declutter.json +0 -13
@@ -1,170 +0,0 @@
1
- #!/usr/bin/env node
2
- /* PMOS workspace — the core documents of each level on the console3 Initiatives page (initiative core-documents; the approved mockup
3
- * 43-doc-levels.js), in demo mode (browser). c3-demo-coredocs.js answers GET /api/core-docs and the POSTs. It drives:
4
- * Portfolio > Documents (Overview | Documents), a board's Docs tab (core documents, then "Other documents") and an initiative's Docs tab
5
- * (categories that fold), the rows (state chips, Draft it, Review the draft), the draft panel of the document sheet (Issue it, Ask PMOS to
6
- * change it), the Briefing row core-doc-drafts, and no horizontal scroll at 400 px.
7
- *
8
- * The files it drives (named so `run-tests.js --changed` traces a change in any of them to this suite): public/pm/c3-core-docs.js,
9
- * c3-core-docs.css, c3-demo-coredocs.js, c3-demo.js, c3-ib-docs.js, c3-ii-tabs.js, c3-initiatives.js, c3-ini-ui.js, c3-doc-sheet.js,
10
- * c3-driver.js, c3-brief-needs.js and c3-ini-harness.js. At 400 px it keeps the desktop layout the way lib/c3-full-console.js does. Its list fragment is test-lists/c3-core-docs.json.
11
- */
12
- 'use strict';
13
- const { harness } = require('./c3-ini-harness');
14
-
15
- (async () => {
16
- const H = await harness('c3-core-docs');
17
- const { page, ok, until, st, open, toast, sleep } = H;
18
- const rows = (sel) => st((s) => [...document.querySelectorAll(s)].map((n) => n.dataset.cdRow).join(','), sel || '[data-cd-row]');
19
- const rowState = (k) => st((key) => { const n = document.querySelector('[data-cd-row="' + key + '"]'); return n ? n.dataset.cdSt : ''; }, k);
20
- const waitToast = (re) => until(async () => { const t = await toast(); return re.test(t) && t; });
21
- const noScroll = () => st(() => document.documentElement.scrollWidth <= window.innerWidth + 1 && [...document.querySelectorAll('.c3 .calwrap, .c3 .brief')].every((n) => n.scrollWidth <= n.clientWidth + 1));
22
- const sheetOpen = () => st(() => !!document.querySelector('[data-shell="sheet"] [role="dialog"]'));
23
- const settle = async (sel) => { await until(() => st((s) => !!document.querySelector(s), sel)); await sleep(120); };
24
-
25
- /* ── Portfolio > Documents ── */
26
- await open('docs');
27
- await settle('[data-cd="core"]');
28
- ok('P1 the Portfolio has an Overview | Documents control, Documents pressed', await st(() => { const b = [...document.querySelectorAll('[data-ini="pf-tabs"] [data-ini-tab]')]; return b.map((x) => x.dataset.iniTab + ':' + x.getAttribute('aria-pressed')).join(',') === 'overview:false,docs:true'; }));
29
- ok('P2 the Documents badge counts the drafts and the due documents', (await st(() => (document.querySelector('[data-cd="seg-badge"]') || {}).textContent)) === '3');
30
- const pf = await rows();
31
- ok('P3 the core set lists 11 documents, strategy first', pf.split(',').length === 11 && pf.startsWith('strategy,okrs,roadmap,invest'), pf);
32
- ok('P4 states: up to date, draft ready, due, comes later where it applies', (await rowState('strategy')) === 'ok' && (await rowState('roadmap')) === 'draft' && (await rowState('status')) === 'due');
33
- ok('P5 a row shows its question, cadence, reader and who writes it', await st(() => { const t = document.querySelector('[data-cd-row="strategy"]').textContent; return /Yearly, reviewed each quarter/.test(t) && /Leadership, every PM/.test(t) && /PMOS proposes/.test(t) && /new/.test(t) && /2 key results do not trace to it/.test(t); }));
34
- ok('P6 the right column says what the level is for, lists the drafts and how the levels connect', await st(() => { const l = document.querySelector('[data-cd="level"]'); return !!l && /Are we betting on the right things\?/.test(l.textContent) && document.querySelectorAll('[data-cd="drafts"] [data-cd-wait]').length === 2 && !!document.querySelector('[data-cd="connect"]'); }));
35
- ok('P7 the address holds the Documents view', await st(() => /init=docs/.test(location.search)));
36
- ok('P8 the summary line counts the drafts and what is due', await st(() => /2 drafts to review, 1 due/.test(document.querySelector('[data-cd="core"]').textContent)));
37
- await H.shot('portfolio-docs');
38
- await page.click('[data-ini="pf-tabs"] [data-ini-tab="overview"]');
39
- ok('P9 Overview brings the boards back', await until(() => st(() => !!document.querySelector('[data-ini="boards"]') && !document.querySelector('[data-cd="core"]'))));
40
- await page.click('[data-ini="pf-tabs"] [data-ini-tab="docs"]');
41
- ok('P10 Documents opens again', await until(() => st(() => !!document.querySelector('[data-cd="core"]'))));
42
-
43
- /* ── Review the draft, Issue it (Portfolio) ── */
44
- await page.click('[data-cd-review="invest"]');
45
- ok('R1 Review the draft opens the draft in the document sheet', await until(() => st(() => !!document.querySelector('[data-shell="sheet"] [data-cd="draft-panel"]'))));
46
- ok('R2 the sheet shows the draft, with Issue it and Ask PMOS to change it', await st(() => { const d = document.querySelector('[data-shell="sheet"]'); return /Investment mix/.test(d.textContent) && !!d.querySelector('[data-cd-issue="invest"]') && !!d.querySelector('[data-cd-redraft="invest"]'); }));
47
- await H.shot('portfolio-sheet');
48
- await page.click('[data-cd-issue="invest"]');
49
- ok('R3 Issue it says nothing was sent and closes the sheet', await until(async () => /Issued\. Nothing was sent/.test(await toast()) && !(await sheetOpen())));
50
- ok('R4 the row is up to date and the draft is gone from the waiting list', await until(async () => (await rowState('invest')) === 'ok' && (await st(() => document.querySelectorAll('[data-cd="drafts"] [data-cd-wait]').length)) === 1));
51
-
52
- /* ── a next step on every row (PRD amendment 2026-10-13): the OKRs, the scan and the status report not started ── */
53
- await st(() => Promise.all(['okrs', 'scan', 'status'].map((key) => fetch('/api/core-docs/drop', { method: 'POST', body: JSON.stringify({ scope: 'portfolio', key, slot: 'x' }) }))));
54
- await page.click('[data-ini="pf-tabs"] [data-ini-tab="overview"]');
55
- await until(() => st(() => !!document.querySelector('[data-ini="boards"]')));
56
- await page.click('[data-ini="pf-tabs"] [data-ini-tab="docs"]');
57
- await settle('[data-cd-row="okrs"][data-cd-st="missing"]');
58
- const btn = (sel) => st((x) => { const n = document.querySelector(x); return n ? n.textContent.trim() : ''; }, sel);
59
- ok('X1 the OKRs offer Propose them, the scan Run a scan, the status report Set it up', (await btn('[data-cd-draft="okrs"]')) === 'Propose them' && (await btn('[data-cd-go="scan"]')) === 'Run a scan' && (await btn('[data-cd-go="status"]')) === 'Set it up');
60
- await page.click('[data-cd-draft="okrs"]');
61
- ok('X2 Propose them starts a draft of the OKRs', await waitToast(/PMOS is drafting the okrs and health budgets/));
62
- ok('X3 the OKRs row shows "Agent drafting"', await until(async () => (await rowState('okrs')) === 'running'));
63
- await page.click('[data-cd-go="scan"]');
64
- ok('X4 Run a scan opens the Portfolio Overview, where Horizon scan lives', await until(() => st(() => !!document.querySelector('[data-ini="boards"]') && !document.querySelector('[data-cd="core"]'))));
65
- await page.click('[data-ini="pf-tabs"] [data-ini-tab="docs"]');
66
- await settle('[data-cd-go="status"]');
67
- await page.click('[data-cd-go="status"]');
68
- ok('X5 Set it up opens Reports', await until(() => st(() => { const t = document.querySelector('[data-c3-tab="rep"]'); return !!t && t.getAttribute('aria-selected') === 'true'; })));
69
-
70
- /* ── a board: IDPF ── */
71
- await open('board:idpf:docs');
72
- await settle('[data-cd="core"]');
73
- const bd = await rows();
74
- ok('B1 the board set lists 10 documents, the charter first', bd.split(',').length === 10 && bd.startsWith('charter,backlog,intake,bstatus,capacity'), bd);
75
- ok('B2 Core documents comes before "Other documents"', await st(() => { const c = document.querySelector('[data-cd="core"]'); const o = document.querySelector('[data-inb="docs-title"]'); return !!c && !!o && /Other documents/.test(o.textContent) && !!(c.compareDocumentPosition(o) & Node.DOCUMENT_POSITION_FOLLOWING); }));
76
- ok('B3 the existing documents list is still there, grouped by initiative', await until(() => st(() => document.querySelectorAll('[data-inb-docgrp]').length > 0)));
77
- ok('B4 the right column: what the level is for, and the initiative documents', await st(() => /Is this area moving, and what comes next\?/.test(document.querySelector('[data-cd="level"]').textContent) && /Build and deliver is on, so the set adds the sprint review and release notes from Jira IDPF/.test(document.querySelector('[data-cd="level"]').textContent) && /documents? across \d+ initiatives?/.test(document.querySelector('[data-cd="ini-docs"]').textContent)));
78
- ok('B5 a live row opens the tab it names', await (async () => { await page.click('[data-cd-open="intake"]'); return until(() => st(() => /board:idpf:triage/.test(decodeURIComponent(location.search)))); })());
79
- await open('board:idpf:docs');
80
- await settle('[data-cd="core"]');
81
- await H.shot('board-docs');
82
-
83
- /* Redraft from the sheet */
84
- await page.click('[data-cd-review="sprint"]');
85
- await until(() => st(() => !!document.querySelector('[data-shell="sheet"] [data-cd-redraft="sprint"]')));
86
- await page.click('[data-cd-redraft="sprint"]');
87
- ok('RD1 Ask PMOS to change it asks for a new draft and closes the sheet', await until(async () => /drafting it again/.test(await toast()) && !(await sheetOpen())));
88
- ok('RD2 the row shows the agent drafting', await until(async () => (await rowState('sprint')) === 'running' && (await st(() => /Agent drafting/.test(document.querySelector('[data-cd-row="sprint"]').textContent)))));
89
-
90
- /* ── a board with Build and deliver off ── */
91
- await open('board:office:docs');
92
- await settle('[data-cd="core"]');
93
- const off = await rows();
94
- ok('O1 Build and deliver off drops the sprint review and release notes (8 documents)', off.split(',').length === 8 && !/sprint|release/.test(off), off);
95
- ok('O2 the charter is not started and offers Draft it', (await rowState('charter')) === 'missing' && await st(() => !!document.querySelector('[data-cd-row="charter"] [data-cd-draft="charter"]')));
96
- ok('O3 the level card says there is no Jira', await st(() => /Build and deliver is off, so there is no sprint review or release notes/.test(document.querySelector('[data-cd="level"]').textContent)));
97
- await H.shot('board-off-docs');
98
- await page.click('[data-cd-draft="charter"]');
99
- ok('D1 Draft it says PMOS is drafting', await waitToast(/PMOS is drafting the board charter/));
100
- ok('D2 the row shows "Agent drafting" and no button', await until(async () => (await rowState('charter')) === 'running' && await st(() => !document.querySelector('[data-cd-row="charter"] [data-cd-draft]') && /Agent drafting/.test(document.querySelector('[data-cd-row="charter"]').textContent))));
101
- ok('D3 the draft arrives and offers Review the draft', await until(() => st(() => !!document.querySelector('[data-cd-row="charter"] [data-cd-review="charter"]')), 15000));
102
- await page.click('[data-cd-review="charter"]');
103
- await until(() => st(() => !!document.querySelector('[data-shell="sheet"] [data-cd="draft-panel"]')));
104
- ok('D4 the draft opens in the sheet with its own text', await st(() => /Jakarta office/.test(document.querySelector('[data-shell="sheet"]').textContent)));
105
- await page.click('[data-cd-issue="charter"]');
106
- ok('D5 Issue it turns the row up to date', await until(async () => (await rowState('charter')) === 'ok'));
107
-
108
- /* ── an initiative in Build: IDPF-12 ── */
109
- await open('ini:idpf:IDPF-12:docs');
110
- await settle('[data-cd-fold]');
111
- const folds = await st(() => [...document.querySelectorAll('[data-cd-cat]')].map((n) => n.dataset.cdCat + ':' + n.dataset.cdFold).join(','));
112
- ok('I1 Discover and Plan fold to one line, Do is the current one, Learn comes later', folds === 'Discover:done,Plan:done,Do:open,Learn:later', folds);
113
- ok('I2 the folded category says "All 3 up to date" and keeps its documents as chips', await st(() => { const s = document.querySelector('[data-cd-cat="Discover"]'); return /All 3 up to date/.test(s.textContent) && s.querySelectorAll('[data-cd-chip]').length === 3 && !s.querySelector('.nrow'); }));
114
- ok('I3 the current category is marked "now" and lists its rows', await st(() => { const s = document.querySelector('[data-cd-cat="Do"]'); return /Do · now/.test(s.textContent) && s.querySelectorAll('[data-cd-row]').length === 4 && /1 of 4 done/.test(s.textContent); }));
115
- ok('I4 the right column: level, order rules, other documents', await st(() => !!document.querySelector('[data-cd="level"]') && !!document.querySelector('[data-cd="order"]') && /Other documents/.test(document.body.textContent)));
116
- await H.shot('ini-docs');
117
- await page.click('[data-cd-chip="prd"]');
118
- ok('I5 a chip of a folded category opens the document in the sheet', await until(() => sheetOpen()));
119
- await page.keyboard.press('Escape');
120
- await until(async () => !(await sheetOpen()));
121
- await page.click('[data-cd-row="risks"] [data-cd-open="risks"]');
122
- ok('I6 a row with a stage tool opens the initiative Overview on that tool', await until(() => st(() => /ini:idpf:IDPF-12:overview:risks/.test(decodeURIComponent(location.search)))));
123
-
124
- /* ── an initiative on research only, early: IDPF-21 ── */
125
- await open('ini:idpf:IDPF-21:docs');
126
- await settle('[data-cd-fold]');
127
- const early = await st(() => [...document.querySelectorAll('[data-cd-cat]')].map((n) => n.dataset.cdCat + ':' + n.dataset.cdFold).join(','));
128
- ok('E1 Discover is open, the later categories wait', early === 'Discover:open,Plan:later,Do:later,Learn:later', early);
129
- ok('E2 the set has no PRD, rubric, design or launch checklist', await st(() => !document.querySelector('[data-cd-open="prd"], [data-cd-open="rubric"], [data-cd-open="design"], [data-cd-open="launch"]') && /Research only: nothing gets built/.test(document.querySelector('[data-cd="level"]').textContent)));
130
- ok('E3 a draft problem statement offers Review the draft; research notes are due', await st(() => !!document.querySelector('[data-cd-row="problem"] [data-cd-review]')) && (await rowState('research')) === 'due');
131
- await H.shot('ini-early-docs');
132
-
133
- /* ── an initiative in Evaluate with an outcome review draft ── */
134
- await open('ini:idpf:IDPF-62:docs');
135
- await settle('[data-cd-fold]');
136
- ok('V1 the outcome review is a draft to review', await st(() => !!document.querySelector('[data-cd-row="outcome"] [data-cd-review="outcome"]')));
137
- await page.click('[data-cd-review="outcome"]');
138
- await until(() => st(() => !!document.querySelector('[data-shell="sheet"] [data-cd-issue="outcome"]')));
139
- ok('V2 the sheet shows the review and Issue it', await st(() => /Did it move the key result/.test(document.querySelector('[data-shell="sheet"]').textContent)));
140
- await H.shot('outcome-sheet');
141
- await page.click('[data-shell="sheet"] button[aria-label="Close"]');
142
- await until(async () => !(await sheetOpen()));
143
-
144
- /* ── the Briefing row opens the Docs view ── */
145
- await page.route('**/api/needs*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, needs: [{ run_id: 'core-docs:drafts:board:idpf', kind: 'core-doc-drafts', provider: 'core-docs', derived: true, scope: 'board:idpf', question: '1 IDPF draft to review', initiative_id: null }] }) }));
146
- await page.goto(H.BASE + '/console.html?demo=1&tab=brief', { waitUntil: 'load' });
147
- await until(() => st(() => !!document.querySelector('[data-drv-need="core-doc-drafts"]')));
148
- ok('N1 the Briefing shows the core-doc-drafts row', await st(() => /1 IDPF draft to review/.test(document.querySelector('[data-drv-need="core-doc-drafts"]').textContent)));
149
- await page.click('[data-drv-need="core-doc-drafts"] .tt');
150
- ok('N2 a press opens that board\'s Docs view', await until(() => st(() => !!document.querySelector('[data-ini-board-page="idpf"] [data-cd="core"]'))));
151
- await page.unroute('**/api/needs*');
152
-
153
- /* ── 400 px: no horizontal scroll ── */
154
- await page.evaluate(() => { try { localStorage.setItem('pmos.c3.testDesk', 'desk'); } catch { /* no storage */ } }); // at 400 px the phone companion shows; the suites that test the desktop layout keep it (lib/c3-full-console.js)
155
- await page.setViewportSize({ width: 400, height: 900 });
156
- for (const [loc, label] of [['docs', 'Portfolio'], ['board:idpf:docs', 'board'], ['board:office:docs', 'board with Build and deliver off'], ['ini:idpf:IDPF-12:docs', 'initiative'], ['ini:idpf:IDPF-21:docs', 'early initiative']]) {
157
- await open(loc);
158
- await settle('[data-cd-row], [data-cd-fold]');
159
- ok('W ' + label + ' Docs has no horizontal scroll at 400 px', await noScroll(), await st(() => document.documentElement.scrollWidth + ' > ' + window.innerWidth));
160
- await H.shot('w400-' + label.replace(/\W+/g, '-'));
161
- }
162
- await open('board:idpf:docs');
163
- await settle('[data-cd="core"]');
164
- await page.click('[data-cd-review="bstatus"]');
165
- await until(() => st(() => !!document.querySelector('[data-shell="sheet"] [data-cd="draft-panel"]')));
166
- ok('W the draft sheet has no horizontal scroll at 400 px', await noScroll());
167
- await H.shot('w400-sheet');
168
-
169
- await H.finish();
170
- })();
@@ -1,64 +0,0 @@
1
- 'use strict';
2
- /* c3-driver-fixture.js — a real server, a scratch repository and a seeded driver ledger for the console3 Initiative Driver suite
3
- * (c3-driver-test.js). Not a suite: it asserts nothing. The server runs with PMOS_DRIVER=off, so no headless run starts: every
4
- * proposal, run and blocker the page shows is a line this file wrote with lib/driver.js, the single writer.
5
- *
6
- * const F = await start({ name }) -> { BASE, ws, board, team, ledger, ids, item, itemDue, post, get, stop }
7
- * ids: { problem, evidence, sizing, move, follow, step } proposal ids; item: the Work task with a follow-up; itemDue: the one with a due date
8
- */
9
- const fs = require('fs');
10
- const path = require('path');
11
- const { spawn } = require('child_process');
12
- const T = require('./test-run').configure({ name: 'c3-driver' });
13
- const { makeRepos, codeRepo, write, git } = require('./plan-test-repos');
14
- const D = require('./lib/driver.js');
15
-
16
- const HOUR = 3600000;
17
- async function call(base, method, p, body, headers) {
18
- const r = await fetch(base + p, { method, headers: headers || {}, body: body === undefined ? undefined : JSON.stringify(body) });
19
- const raw = await r.text(); let j = null; try { j = JSON.parse(raw); } catch { /* not JSON */ }
20
- return { status: r.status, body: j, raw };
21
- }
22
-
23
- async function start({ name = 'c3-driver' } = {}) {
24
- const R = makeRepos(name);
25
- const team = codeRepo(path.join(R.base, 'team'));
26
- fs.mkdirSync(path.join(team, 'pmos', 'state'), { recursive: true });
27
- write(team, 'pmos/state/.keep', '');
28
- git(team, ['add', '-A']); git(team, ['commit', '-q', '-m', 'state']);
29
- const ledger = path.join(team, 'pmos', 'state', 'driver.jsonl');
30
- const BASE = T.BASE;
31
- const srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore',
32
- env: T.env({ PMOS_WS_PORT: String(T.PORT), PMOS_SELF_ROOT: team, PMOS_NO_OPEN: '1', PMOS_DRIVER: 'off' }) });
33
- await T.waitForServer(BASE);
34
- const press = await T.pressHeaders(BASE);
35
- const post = (p, body) => call(BASE, 'POST', p, body, press);
36
- const get = (p) => call(BASE, 'GET', p);
37
- const reg = await post('/api/workspaces', { root: team, focus: true });
38
- const ws = reg.body.workspace.id;
39
- const made = await post('/api/initiatives', { ws, title: 'Partner API onboarding', lane: 'feature', anchor: 'health:tech', id: 'drv-ui' });
40
- if (made.status !== 200) throw new Error('could not create the initiative: ' + made.raw);
41
- const a = (await post('/api/pm-items/add', { line: 'Get the sandbox access date from Dana waiting on Dana Hartono' })).body.item;
42
- const b = (await post('/api/pm-items/add', { line: 'Send the partner onboarding list to Lina' })).body.item;
43
- const tI = { kind: 'initiative', ws, id: 'drv-ui' };
44
- const now = Date.now();
45
- // Today's run must fall on today: a run 5 hours back is yesterday's between midnight and 05:00, and the strip then reads
46
- // "0 runs today". So the same-day timeline is squeezed into the time since midnight when that is shorter.
47
- const H = Math.min(HOUR, Math.floor((now - new Date(now).setHours(0, 0, 0, 0)) / 6));
48
- const w = (line, at) => D.append(ledger, line, { now: at });
49
- const prop = (id, target, what, data, why, sources, at, run) => { w({ ev: 'proposal', id, target, what, data, why, sources: sources || [], run, by: 'agent:sess-4.0a1b2c3d' }, at); return id; };
50
- const ids = { problem: 'p-aaaaaaaa01', evidence: 'p-aaaaaaaa02', sizing: 'p-aaaaaaaa03', move: 'p-aaaaaaaa04', follow: 'p-aaaaaaaa05', step: 'p-aaaaaaaa06' };
51
- w({ ev: 'epoch' }, now - 3 * 24 * HOUR);
52
- w({ ev: 'run-start', run: 'run-aaaaaaaa01', target: tI, board: ws, wakes: [], session: 'sess-4.0a1b2c3d' }, now - 5 * H);
53
- prop(ids.problem, tI, 'problem', { text: 'New partners wait 9 days on average from signed contract to first live API call. Support handles 23 onboarding tickets a month.' }, 'first draft from the Jira and Slack threads', [{ label: 'Jira', ref: 'IDPF-1204' }, { label: 'Slack', ref: '#partner-support, 6 Oct' }], now - 4 * H, 'run-aaaaaaaa01');
54
- prop(ids.evidence, tI, 'evidence', { text: 'Six sources back the problem statement. Four name sandbox access as the main delay.', items: [{ text: 'Partner X waited 9 days for sandbox access', ref: 'IDPF-1204' }, { text: 'Two partners paused go-live this quarter', ref: 'https://example.invalid/partner-council/1-oct' }] }, 'evidence for the problem', [{ label: 'Meeting note', ref: 'IDPF DSU, 8 Oct' }], now - 4 * H + H / 6, 'run-aaaaaaaa01');
55
- prop(ids.sizing, tI, 'sizing', { text: '14 partners are in the pipeline this half. Cutting the wait from 9 days to 3 moves about 5 go-lives into Q4.' }, 'low confidence: two data points', [{ label: 'Slack', ref: '#sales-asks, 7 Oct' }], now - 3 * H, 'run-aaaaaaaa01');
56
- prop(ids.move, tI, 'move', { to: 'Plan' }, 'the problem, evidence and sizing are in', [], now - 50 * HOUR, 'run-aaaaaaaa01');
57
- w({ ev: 'run-end', run: 'run-aaaaaaaa01', ok: true, agent_run: null }, now - 3 * H + H / 60);
58
- w({ ev: 'blocker', key: `initiative:${ws}:drv-ui:pm-open`, day: D.localDay(now), target: tI, board: ws, code: 'pm-open', owner: 'pm', text: "The agent's drafts have waited on you since " + new Date(now - 50 * HOUR).toISOString().slice(0, 10) }, now - H);
59
- prop(ids.follow, { kind: 'work', ws, id: a.id }, 'follow-up', { text: 'Hi Dana,\n\nQuick follow-up on the sandbox access for Nusa Pay. Can you tell me which day your engineers can use the sandbox?\n\nThanks,\nWawan', to: 'Dana' }, 'waiting 4 days, no reply', [{ label: 'Slack', ref: '#partner-support' }], now - 2 * H, null);
60
- prop(ids.step, { kind: 'work', ws, id: b.id }, 'next-step', { text: 'Send the list to Lina', due: '2026-10-15' }, 'overdue with no next step', [], now - H, null);
61
- const stop = () => { try { srv.kill('SIGKILL'); } catch { /* gone */ } T.killTmux(); R.cleanup(); };
62
- return { BASE, ws, board: ws, team, ledger, ids, item: a, itemDue: b, post, get, stop, T, D, tI };
63
- }
64
- module.exports = { start };
@@ -1,169 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
- /* c3-driver-test.js — the Initiative Driver on console3 (initiative initiative-driver; PRD section 5 and done-criterion 9).
4
- * LIVE mode: a real server and a scratch repository whose driver.jsonl this suite seeds (c3-driver-fixture.js; PMOS_DRIVER=off, so no
5
- * run starts and every line the page shows is one the fixture wrote). A real Chromium drives /console.html.
6
- *
7
- * strip Initiative · Overview shows the Agent strip: the count, Pause, "1 run today", the status, the last action, the
8
- * blocker line, one row per open proposal; a row opens to its text and sources (a URL source is a link)
9
- * runs the runs chip opens a sheet that lists today's run
10
- * decide Keep on a problem proposal posts /api/driver/keep and the row turns "Kept by you"; Send back asks for a note and posts it;
11
- * Drop posts and the row leaves
12
- * pause Pause posts /api/driver/pause and the strip says Paused; Resume brings it back
13
- * work a Work task with a follow-up shows the agent line; Review opens the sheet with the draft and "the agent sent nothing";
14
- * Keep records the keep; a task with a next-step shows Keep and Drop in the line
15
- * setting Board settings has the Agent setting; pressing Shadow posts /api/driver/mode and the ledger holds it
16
- * briefing Needs you shows the agent's two kinds of row, a long title wraps inside the row, and a press opens the initiative
17
- * phone at 400 wide the strip has no horizontal scroll
18
- * Every wait polls the page. The page must raise no script error.
19
- */
20
- const path = require('path');
21
- const { findBrowser } = require('./lib/find-browser');
22
- const F = require('./c3-driver-fixture');
23
-
24
- const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
25
- const until = async (fn, ms = 20000, step = 120) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
26
- const results = [];
27
- const ok = (n, cond, extra = '') => { results.push({ n, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${n}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 400) : ''}`); };
28
- let fx = null; let browser = null;
29
- const finish = async (code) => {
30
- if (browser) await browser.close().catch(() => {});
31
- if (fx) fx.stop();
32
- const bad = results.filter((x) => !x.cond).length;
33
- console.log(`\n${results.length - bad}/${results.length} c3-driver assertions passed`);
34
- process.exit(code !== undefined ? code : (bad ? 1 : 0));
35
- };
36
- process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
37
-
38
- (async () => {
39
- const exe = findBrowser();
40
- if (!exe) { console.log('· no Chrome/Chromium on this machine — c3-driver suite skipped'); process.exit(0); }
41
- let chromium;
42
- try { ({ chromium } = require('playwright-core')); } catch { console.log('· playwright-core not installed — c3-driver suite skipped'); process.exit(0); }
43
- fx = await F.start({ name: 'c3-driver' });
44
- const { BASE, ws, ids, D, ledger } = fx;
45
- const state = () => D.fold(D.readLines(ledger));
46
- browser = await chromium.launch({ executablePath: exe });
47
- const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } });
48
- const page = await ctx.newPage();
49
- const errors = []; page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
50
- const posts = []; page.on('request', (r) => { if (r.method() === 'POST' && r.url().includes('/api/driver/')) posts.push({ path: new URL(r.url()).pathname, body: JSON.parse(r.postData() || '{}') }); });
51
- const st = (f, a) => page.evaluate(f, a);
52
- const sel = (s) => until(() => page.$(s));
53
- const INI = `/console.html?tab=init&init=ini:${ws}:drv-ui:overview`;
54
-
55
- /* ── strip ── */
56
- await page.goto(BASE + INI, { waitUntil: 'load' });
57
- await sel('[data-drv-row]');
58
- const rows = await st(() => [...document.querySelectorAll('[data-drv-row]')].map((r) => r.dataset.drvRow));
59
- ok('S1 the Agent strip draws one row per open proposal, in the order the agent filed them', rows.join() === [ids.problem, ids.evidence, ids.sizing, ids.move].join(), rows.join());
60
- const head = await st(() => document.querySelector('[data-drv="strip"] .sh2').textContent);
61
- ok('S2 the header says AGENT 4, has Pause and "1 run today", with no limit', /Agent\s*4/i.test(head) && /Pause/.test(head) && /1 run today/.test(head) && !/ of \d+ runs/.test(head), head);
62
- const body = await st(() => document.querySelector('[data-drv="strip"]').textContent);
63
- ok('S3 the status line says the agent is idle and waiting on you, with the last action', /Agent is idle · waiting on you/.test(body) && /The oldest proposal is 2 days old/.test(body) && /Last: filed 4 proposals/.test(body), body.slice(0, 300));
64
- ok('S4 the blocker line names who stopped the agent', /Stopped by: you\./.test(await st(() => document.querySelector('[data-drv="blocker"]').textContent)));
65
- ok('S5 the old proposal says how long it waited', /waiting 2 days/.test(await st(() => document.querySelector(`[data-drv-row="${'p-aaaaaaaa04'}"]`).textContent)));
66
- await page.click(`[data-drv-title="${ids.evidence}"]`);
67
- await until(() => st((id) => document.querySelector(`[data-drv-row="${id}"] .xp.open`), ids.evidence));
68
- const ev = await st((id) => { const r = document.querySelector(`[data-drv-row="${id}"]`); return { text: r.textContent, link: (r.querySelector('a[href^="https://example.invalid"]') || {}).href || '', n: r.querySelectorAll('[data-drv-src]').length }; }, ids.evidence);
69
- ok('S6 a row opens to its text and its sources (label and ref); a URL ref is a link', /Six sources back the problem statement/.test(ev.text) && /IDPF DSU, 8 Oct/.test(ev.text) && ev.n === 3 && /partner-council/.test(ev.link), JSON.stringify(ev));
70
- await page.click('[data-drv="runs"]');
71
- await sel('[data-drv="runs-sheet"]');
72
- const runs = await st(() => document.querySelector('[data-shell="sheet"]').textContent);
73
- ok('S7 the runs chip opens a sheet with today\'s run', /Agent runs today/.test(runs) && /1 run today/.test(runs) && /no daily limit/.test(runs) && /Filed 4 proposals/.test(runs), runs.slice(0, 300));
74
- await page.keyboard.press('Escape');
75
-
76
- /* ── decide ── */
77
- await page.click(`[data-drv-row="${ids.problem}"] [data-drv-act=keep]`);
78
- await until(() => posts.some((p) => p.path === '/api/driver/keep'));
79
- ok('D1 Keep posts /api/driver/keep with the proposal id and no writer field', posts.some((p) => p.path === '/api/driver/keep' && p.body.proposal === ids.problem && !('by' in p.body)), JSON.stringify(posts));
80
- await until(() => st((id) => { const r = document.querySelector(`[data-drv-row="${id}"]`); return r && r.dataset.drvState === 'kept'; }, ids.problem));
81
- ok('D2 the row turns "Kept by you" and loses its buttons; the ledger holds the keep by the PM', await st((id) => { const r = document.querySelector(`[data-drv-row="${id}"]`); return /Kept by you/.test(r.textContent) && !r.querySelector('[data-drv-act]'); }, ids.problem)
82
- && state().proposals.get(ids.problem).state === 'kept' && state().proposals.get(ids.problem).decided_by === 'pm:wawan');
83
- await until(() => st(() => /Kept: Problem statement|Kept/.test(document.querySelector('[data-c3-toast]') ? document.querySelector('[data-c3-toast]').textContent : '')));
84
- await page.click(`[data-drv-row="${ids.sizing}"] [data-drv-act=back]`);
85
- await sel('[data-drv="send-back"]');
86
- await page.click('[data-drv="send-back"]');
87
- ok('D3 Send back with an empty note is refused in plain words and posts nothing', !!(await until(() => page.$('[data-drv="note-error"]:not([hidden])'))) && !posts.some((p) => p.path === '/api/driver/return'));
88
- await page.fill('[data-drv="note"]', 'Use active partners, not signed ones');
89
- await page.click('[data-drv="send-back"]');
90
- await until(() => posts.some((p) => p.path === '/api/driver/return'));
91
- ok('D4 Send back posts the note; the row says it was sent back; the ledger holds it', posts.some((p) => p.path === '/api/driver/return' && p.body.note === 'Use active partners, not signed ones')
92
- && !!(await until(() => st((id) => { const r = document.querySelector(`[data-drv-row="${id}"]`); return r && r.dataset.drvState === 'back'; }, ids.sizing))) && state().proposals.get(ids.sizing).state === 'returned');
93
- await page.click(`[data-drv-row="${ids.evidence}"] [data-drv-act=drop]`);
94
- await until(() => st((id) => !document.querySelector(`[data-drv-row="${id}"]`), ids.evidence));
95
- ok('D5 Drop posts /api/driver/drop and the row leaves', posts.some((p) => p.path === '/api/driver/drop' && p.body.proposal === ids.evidence) && state().proposals.get(ids.evidence).state === 'dropped');
96
-
97
- /* ── pause ── */
98
- await page.click('[data-drv-act=pause]');
99
- await until(() => st(() => /Agent is paused/.test(document.querySelector('[data-drv="status"]').textContent)));
100
- ok('P1 Pause posts /api/driver/pause for the initiative and the strip says Paused with a Resume button', posts.some((p) => p.path === '/api/driver/pause' && p.body.target_kind === 'initiative' && p.body.id === 'drv-ui')
101
- && !!(await page.$('[data-drv-act=resume]')) && D.isPaused(state(), fx.tI));
102
- await page.click('[data-drv-act=resume]');
103
- await until(() => st(() => !!document.querySelector('[data-drv-act=pause]')));
104
- ok('P2 Resume lifts it', !D.isPaused(state(), fx.tI));
105
-
106
- /* ── setting ── */
107
- await page.goto(BASE + `/console.html?tab=init&init=board:${ws}:summary`, { waitUntil: 'load' });
108
- await (await sel('[data-ini=board-settings]')).click();
109
- await sel('[data-drv="setting"] [data-drv-mode]');
110
- ok('T1 Board settings shows the Agent setting at Approve, with the one-line explanations', await st(() => { const s = document.querySelector('[data-drv="setting"]'); return s.querySelector('[data-drv-mode=approve]').getAttribute('aria-pressed') === 'true' && /The agent drafts and asks you/.test(s.textContent) && /The agent does nothing on this board/.test(s.textContent); }));
111
- await page.click('[data-drv-mode=shadow]');
112
- await until(() => posts.some((p) => p.path === '/api/driver/mode'));
113
- await until(() => st(() => document.querySelector('[data-drv-mode=shadow]').getAttribute('aria-pressed') === 'true'));
114
- ok('T2 pressing Shadow posts /api/driver/mode for the board and the ledger holds it', posts.some((p) => p.path === '/api/driver/mode' && p.body.mode === 'shadow' && p.body.board === ws) && D.modeOf(state(), ws) === 'shadow');
115
- await page.goto(BASE + INI, { waitUntil: 'load' });
116
- await sel('[data-drv="shadow"]');
117
- ok('T3 in Shadow the strip says so and offers no Keep', !(await page.$('[data-drv-act=keep]')) && /Shadow mode/.test(await st(() => document.querySelector('[data-drv="shadow"]').textContent)));
118
- await page.goto(BASE + `/console.html?tab=init&init=board:${ws}:summary`, { waitUntil: 'load' });
119
- await (await sel('[data-ini=board-settings]')).click();
120
- await sel('[data-drv-mode=approve]');
121
- await page.click('[data-drv-mode=approve]');
122
- await until(() => D.modeOf(state(), ws) === 'approve');
123
- ok('T4 pressing Approve puts it back', D.modeOf(state(), ws) === 'approve');
124
-
125
- /* ── work ── */
126
- await page.goto(BASE + '/console.html?tab=work', { waitUntil: 'load' });
127
- await sel('[data-pm-lenses]');
128
- await page.click('[data-pm-lenses] [data-lens=waiting]');
129
- const line = await sel(`[data-drv-line="${fx.item.id}"]`);
130
- ok('W1 a Waiting task with a follow-up shows "Agent drafted a follow-up to Dana. Nothing is sent." and Review', /Agent drafted a follow-up to Dana\. Nothing is sent\./.test(await line.textContent()) && !!(await page.$('[data-drv-wnote-act=review]')));
131
- await page.click('[data-drv-wnote-act=review]');
132
- await sel('[data-drv="work-sheet"]');
133
- const sheet = await st(() => document.querySelector('[data-drv="work-sheet"]').textContent);
134
- ok('W2 Review opens a sheet with the draft and the line that the agent sent nothing', /Quick follow-up on the sandbox access/.test(sheet) && /The agent sent nothing and cannot send/.test(sheet) && !!(await page.$('[data-drv=sheet-keep]')) && !!(await page.$('[data-drv=sheet-back]')) && !!(await page.$('[data-drv=sheet-drop]')));
135
- await ctx.grantPermissions(['clipboard-read', 'clipboard-write'], { origin: BASE }).catch(() => {});
136
- await page.click('[data-drv=sheet-keep]');
137
- await until(() => state().proposals.get(ids.follow).state === 'kept');
138
- ok('W3 Keep records the keep (by the PM) and the sheet closes', state().proposals.get(ids.follow).decided_by === 'pm:wawan' && !!(await until(async () => !(await page.$('[data-drv="work-sheet"]')))));
139
- const clip = await page.evaluate(() => navigator.clipboard.readText().catch(() => null));
140
- ok('W4 the draft text was copied to the clipboard (or the browser refused, and the text was selected)', (clip && /Quick follow-up on the sandbox access/.test(clip)) || clip === null, String(clip));
141
- await page.click('[data-pm-lenses] [data-lens=inbox]');
142
- await sel(`[data-drv-line="${fx.itemDue.id}"]`);
143
- ok('W5 a task with a next-step shows the suggestion with Keep and Drop in the line', /Agent suggests a next step: Send the list to Lina, due Thu 15 Oct/.test(await st((id) => document.querySelector(`[data-drv-line="${id}"]`).textContent, fx.itemDue.id)) && !!(await page.$('[data-drv-wnote-act=keep]')) && !!(await page.$('[data-drv-wnote-act=drop]')));
144
- await page.click('[data-drv-wnote-act=drop]');
145
- await until(() => state().proposals.get(ids.step).state === 'dropped');
146
- ok('W6 Drop in the line drops the proposal and the line goes', !!(await until(async () => !(await page.$(`[data-drv-line="${fx.itemDue.id}"]`)))));
147
-
148
- /* ── briefing ── */
149
- await page.goto(BASE + '/console.html?tab=brief', { waitUntil: 'load' });
150
- await sel('[data-drv-need]');
151
- const needs = await st(() => [...document.querySelectorAll('[data-drv-need]')].map((r) => r.dataset.drvNeed + ':' + r.textContent.replace(/\s+/g, ' ')));
152
- ok('B1 Needs you shows the agent\'s rows: the drafts left on the initiative, and the initiative waiting on you', needs.some((t) => /^driver-drafts:Agent has 1 draft on Partner API onboarding/.test(t)) && needs.some((t) => /^driver-blocked:.*Partner API onboarding is waiting on you/.test(t)), needs.join(' | '));
153
- const fit = await st(() => { const r = [...document.querySelectorAll('[data-drv-need="driver-drafts"]')].find((x) => x.offsetParent); const t = r.querySelector('.tt'); const was = t.textContent;
154
- t.textContent = 'Agent has 2 drafts on I need to create recommendations for Scarlet product strategy, including whether to change it with something else entirely or keep it';
155
- const nb = r.querySelector('.nb'); const out = { ws: getComputedStyle(t).whiteSpace, over: nb.scrollWidth - nb.clientWidth, right: t.getBoundingClientRect().right - r.getBoundingClientRect().right };
156
- t.textContent = was; return out; });
157
- ok('B3 a long title wraps inside the row: the title button is not nowrap and nothing runs past the card', fit.ws !== 'nowrap' && fit.over <= 1 && fit.right <= 1, JSON.stringify(fit));
158
- await page.click('[data-drv-need="driver-drafts"] .tt');
159
- await until(() => page.$('[data-drv="strip"]'));
160
- ok('B2 a press on the row opens the initiative with its Agent strip', !!(await page.$('[data-drv="strip"]')));
161
-
162
- /* ── phone ── */
163
- await page.setViewportSize({ width: 400, height: 900 });
164
- await page.goto(BASE + INI, { waitUntil: 'load' });
165
- await sel('[data-drv-row]');
166
- ok('M1 at 400 wide the page has no horizontal scroll', await st(() => document.documentElement.scrollWidth <= window.innerWidth + 1), await st(() => document.documentElement.scrollWidth));
167
- ok('N1 no page error was thrown', errors.length === 0, errors.join(' | '));
168
- await finish();
169
- })().catch((e) => { console.error(e); finish(1); });
@@ -1,163 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
- /* c3-foundation-test.js — the console3 shell foundation (initiative console3-foundation; planning/prd/console3-foundation-prd.md R1 to R7).
4
- * Loads /console.html?demo=1 (demo mode answers every /api call, so nothing reaches the server) and holds:
5
- * R1 the page is white: no day-part wash on the page, no radial on the Briefing; data-daypart stays
6
- * R2 one ambient canvas (.c3amb) sits behind the grid; reduced motion draws one still frame; dark theme draws; no canvas, no error
7
- * R3 the build-fix rules: a primary button label is the page background colour; .sect > .sh2 is a flex row outside .brief
8
- * R4 the card front shows number tiles and the kind label; the flipped back holds its options and the confirm control; a decision
9
- * adds .ok and a toast with Undo, and Undo takes it back
10
- * R5 the Briefing and Initiatives tabs carry count badges beside Work's
11
- * R6 the Sessions pill and the dock button draw the bolt, with the mockup's tooltip copy
12
- * R7 the Record control shows when idle in demo mode, starts the simulated recorder and returns to idle on stop
13
- * The page must raise no script error. Every wait polls the page; no fixed sleep stands in for a state.
14
- */
15
- const path = require('path');
16
- const { spawn } = require('child_process');
17
- const { findBrowser } = require('./lib/find-browser');
18
- const T = require('./test-run').configure({ name: 'c3-foundation' });
19
-
20
- const BASE = T.BASE;
21
- const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
22
- const until = async (fn, ms = 10000, step = 120) => {
23
- const t0 = Date.now();
24
- for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); }
25
- };
26
- const results = [];
27
- const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
28
- let srv = null; let browser = null;
29
- const finish = async (code) => {
30
- if (browser) await browser.close().catch(() => {});
31
- if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
32
- T.killTmux();
33
- const bad = results.filter((x) => !x.cond).length;
34
- console.log(`\n${results.length - bad}/${results.length} c3-foundation assertions passed`);
35
- process.exit(code !== undefined ? code : (bad ? 1 : 0));
36
- };
37
- process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
38
-
39
- (async () => {
40
- const exe = findBrowser();
41
- if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the c3-foundation suite cannot run'); return finish(1); }
42
- let chromium;
43
- try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed — the c3-foundation suite cannot run'); return finish(1); }
44
-
45
- srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
46
- await T.waitForServer(BASE);
47
- browser = await chromium.launch({ executablePath: exe });
48
-
49
- const open = async (ctxOpts, url, init) => {
50
- const ctx = await browser.newContext({ viewport: { width: 1440, height: 1000 }, ...(ctxOpts || {}) });
51
- const page = await ctx.newPage();
52
- const errors = [];
53
- page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
54
- if (init) await page.addInitScript(init);
55
- await page.goto(BASE + (url || '/console.html?demo=1'));
56
- const up = await until(() => page.evaluate(() => !!document.querySelector('[data-c3-demo="1"]') && document.querySelectorAll('#c3-root .deck .fc').length > 0), 45000, 250);
57
- return { ctx, page, errors, up };
58
- };
59
- /* the largest alpha on the ambient canvas: 0 means nothing was drawn */
60
- const maxAlpha = (page) => page.evaluate(() => { const c = document.querySelector('#c3-root > canvas.c3amb'); if (!c) return -1; const d = c.getContext('2d').getImageData(0, 0, c.width, c.height).data; let m = 0; for (let i = 3; i < d.length; i += 4) if (d[i] > m) m = d[i]; return m; });
61
-
62
- const A = await open();
63
- ok('0 the demo page draws the Briefing deck', A.up);
64
- if (!A.up) return finish(1);
65
- const p = A.page;
66
-
67
- /* R1 */
68
- ok('R1 the page has no day-part wash and keeps data-daypart', await p.evaluate(() => { const r = document.getElementById('c3-root'); return !!r.getAttribute('data-daypart') && getComputedStyle(r).backgroundImage === 'none'; }));
69
- ok('R1 the Briefing has no blue radial', await p.evaluate(() => { const b = document.querySelector('.c3 .brief'); const s = getComputedStyle(b, '::before'); return !b || s.content === 'none' || s.display === 'none'; }));
70
- ok('R1 the daylight strip still has its warm token', await p.evaluate(() => getComputedStyle(document.getElementById('c3-root')).getPropertyValue('--dp-warm').trim() !== ''));
71
-
72
- /* R2 */
73
- ok('R2 exactly one ambient canvas, fixed and behind the grid', await p.evaluate(() => { const l = document.querySelectorAll('#c3-root canvas.c3amb'); if (l.length !== 1) return false; const s = getComputedStyle(l[0]); return s.position === 'fixed' && s.pointerEvents === 'none' && s.zIndex === '0' && getComputedStyle(document.querySelector('.c3grid')).zIndex === '1'; }));
74
- ok('R2 the canvas gets a frame drawn (light theme)', await until(async () => (await maxAlpha(p)) > 0, 6000));
75
- ok('R2 mounted once even after tab changes', await p.evaluate(async () => { document.querySelector('[data-c3-tab="work"]').click(); await new Promise((r) => setTimeout(r, 200)); document.querySelector('[data-c3-tab="brief"]').click(); return document.querySelectorAll('canvas.c3amb').length === 1; }));
76
-
77
- /* R3 */
78
- ok('R3 a primary button label takes the page background colour', await p.evaluate(() => {
79
- const r = document.getElementById('c3-root'); const b = document.createElement('button'); b.className = 'pmc-btn pmc-btn--primary'; const probe = document.createElement('div'); probe.style.color = 'var(--background)';
80
- r.append(b, probe); const same = getComputedStyle(b).color === getComputedStyle(probe).color; b.remove(); probe.remove(); return same;
81
- }));
82
- ok('R3 .sect > .sh2 is a flex row outside .brief', await p.evaluate(() => {
83
- const r = document.getElementById('c3-root'); const s = document.createElement('section'); s.className = 'sect'; s.innerHTML = '<div class="sh2"><h2>Title</h2></div>'; r.append(s);
84
- const d = getComputedStyle(s.firstChild).display; const tt = getComputedStyle(s.firstChild.firstChild).textTransform; s.remove(); return d === 'flex' && tt === 'uppercase';
85
- }));
86
-
87
- /* R4 */
88
- ok('R4 the front shows number tiles and a kind label', await p.evaluate(() => { const c = document.querySelector('#c3-root .deck .fc'); return c.querySelectorAll('.ff .cfh .kp').length >= 1 && !!c.querySelector('.ff .tag.pov') && !c.querySelector('.ff .cfk'); }));
89
- ok('R4 the kind label sits beside the tag', await p.evaluate(() => { const c = document.querySelector('#c3-root .deck .fc .ff'); const t = c.querySelector('.tg'); const k = c.querySelector('.tag.pov'); return !!t && !!k && t.parentNode === k.parentNode; }));
90
- const key = await p.evaluate(() => document.querySelector('#c3-root .deck .fc').getAttribute('data-bf-card'));
91
- const card = `#c3-root .deck .fc[data-bf-card="${key}"]`;
92
- const h0 = await p.evaluate((s) => document.querySelector(s).offsetHeight, card);
93
- await p.evaluate((s) => document.querySelector(s).click(), card);
94
- ok('R4 the card flips', await until(() => p.evaluate((s) => document.querySelector(s).classList.contains('back'), card), 4000));
95
- /* The back grows over a transition; a slow runner is still mid-grow after a fixed wait, so poll until it settles. */
96
- const measure = () => p.evaluate((s) => {
97
- const c = document.querySelector(s); const cb = c.getBoundingClientRect(); const fb = c.querySelector('.fb');
98
- const inside = (e) => !e || e.getBoundingClientRect().bottom <= cb.bottom + 1;
99
- return { grew: c.offsetHeight, noClip: fb.scrollHeight <= fb.clientHeight + 1, opts: inside(c.querySelector('.opts')), conf: inside(c.querySelector('.c3slide, .c3hold')), foot: inside(c.querySelector('.cft')), hasOpts: !!c.querySelector('.opt') };
100
- }, card);
101
- await sleep(500);
102
- let fit = await measure();
103
- await until(async () => { fit = await measure(); return fit.grew >= h0 && fit.noClip && fit.opts && fit.conf && fit.foot && fit.hasOpts; }, 4000);
104
- ok('R4 the flipped back grows to fit its content', fit.grew >= h0 && fit.noClip && fit.opts && fit.conf && fit.foot && fit.hasOpts, JSON.stringify({ h0, fit }));
105
- /* decide: a hold button (fine pointer) or a click; the slide where the pointer is coarse */
106
- const act = await p.evaluate((s) => { const c = document.querySelector(s); const hb = c.querySelector('.c3hold .hb'); if (hb) { const r = hb.getBoundingClientRect(); return { x: r.left + r.width / 2, y: r.top + r.height / 2, mode: hb.getAttribute('data-hold') }; } return null; }, card);
107
- if (act) {
108
- await p.mouse.move(act.x, act.y); await p.mouse.down();
109
- if (act.mode === 'hold') await sleep(750);
110
- await p.mouse.up();
111
- }
112
- ok('R4 deciding adds .ok to the card', !!act && await until(() => p.evaluate((s) => document.querySelector(s).classList.contains('ok'), card), 5000), JSON.stringify(act));
113
- const undo = await until(() => p.evaluate(() => !!document.querySelector('.toast button, [data-c3-toast-action]')), 4000);
114
- ok('R4 the decision shows a toast with Undo', undo);
115
- if (undo) await p.evaluate(() => (document.querySelector('[data-c3-toast-action]') || document.querySelector('.toast button')).click());
116
- ok('R4 Undo takes .ok off', undo && await until(() => p.evaluate((s) => !document.querySelector(s).classList.contains('ok'), card), 4000));
117
- await p.keyboard.press('Escape');
118
-
119
- /* R5 */
120
- ok('R5 Briefing, Work and Initiatives carry count badges', await until(() => p.evaluate(() => ['brief-count', 'work-count', 'init-count'].every((k) => { const b = document.querySelector(`[data-c3pg="${k}"]`); return !!b && !b.hidden && /^\d+$/.test(b.textContent) && Number(b.textContent) > 0; })), 8000));
121
- ok('R5 the badge titles say what they count', await p.evaluate(() => document.querySelector('[data-c3pg="brief-count"]').title === 'Needs you' && document.querySelector('[data-c3pg="init-count"]').title === 'New asks to triage'));
122
- ok('R5 the Briefing badge matches the Needs you count', await until(() => p.evaluate(() => { const n = document.querySelector('[data-c3pg="needs"] .sh2 .bdg'); return !!n && n.textContent === document.querySelector('[data-c3pg="brief-count"]').textContent; }), 5000));
123
-
124
- /* R6 */
125
- ok('R6 the Sessions pill draws the bolt, with the Agent surfaces tooltip', await p.evaluate(() => { const b = document.querySelector('[data-c3pg="agent-button"]'); const u = b.querySelector('use'); return !!u && /#c3i-bolt$/.test(u.getAttribute('href')) && /^Agent surfaces: /.test(b.title); }));
126
- ok('R6 the dock button draws the bolt, with the mockup tooltip', await p.evaluate(() => { const b = document.querySelector('[data-c3pg="dock-agent"]'); const u = b && b.querySelector('use'); return !!u && /#c3i-bolt$/.test(u.getAttribute('href')) && b.title === 'Agent surfaces: the full page of sessions that need you'; }));
127
-
128
- /* R7 */
129
- ok('R7 the idle Record control shows in demo mode', await p.evaluate(() => { const g = document.querySelector('.c3rec .recg.idle'); if (!g) return false; const r = g.getBoundingClientRect(); return r.width > 0 && !!g.querySelector('[data-fr-rec-new]') && !!g.querySelector('[data-fr-rec-upcoming]'); }));
130
- await p.evaluate(() => document.querySelector('[data-fr-rec-new]').click());
131
- ok('R7 Record starts the simulated recorder', await until(() => p.evaluate(() => !!document.querySelector('[data-shell-rec-stop]') && !!document.querySelector('[data-shell-rec-clock]')), 4000));
132
- await p.evaluate(() => document.querySelector('[data-shell-rec-stop]').click());
133
- ok('R7 Stop returns to the idle control', await until(() => p.evaluate(() => !!document.querySelector('.c3rec .recg.idle [data-fr-rec-new]') && !document.querySelector('[data-shell-rec-stop]')), 4000));
134
- ok('0 no page error', A.errors.length === 0, A.errors.join(' | '));
135
- await A.ctx.close();
136
-
137
- /* R2: reduced motion draws one still frame, dark theme draws, no canvas means no error */
138
- const R = await open({ reducedMotion: 'reduce' });
139
- ok('R2 reduced motion: one still frame is drawn', R.up && await until(async () => (await maxAlpha(R.page)) > 0, 6000));
140
- /* a still frame redraws only when the layout moves (content arriving); once the page is quiet it holds the same picture */
141
- const snap = () => R.page.evaluate(() => document.querySelector('canvas.c3amb').toDataURL());
142
- let prev = await snap();
143
- ok('R2 reduced motion: the frame does not change once the page is quiet', await until(async () => { await sleep(700); const now = await snap(); const same = now === prev; prev = now; return same; }, 12000, 0));
144
- ok('0 no page error (reduced motion)', R.errors.length === 0, R.errors.join(' | '));
145
- await R.ctx.close();
146
-
147
- const D = await open({}, '/console.html?demo=1&theme=dark');
148
- ok('R2 dark theme: the canvas draws', D.up && await until(async () => (await maxAlpha(D.page)) > 0, 6000));
149
- ok('0 no page error (dark)', D.errors.length === 0, D.errors.join(' | '));
150
- await D.ctx.close();
151
-
152
- const N = await open({}, '/console.html?demo=1', () => { HTMLCanvasElement.prototype.getContext = function () { return null; }; });
153
- ok('R2 where canvas is unavailable the page still draws and raises no error', N.up && N.errors.length === 0 && await N.page.evaluate(() => document.querySelectorAll('canvas.c3amb').length === 0), N.errors.join(' | '));
154
- await N.ctx.close();
155
-
156
- /* phone width: no horizontal scroll. A phone shows the companion (c3-phone-test.js); this holds the desktop layout at that width
157
- * (lib/c3-full-console.js). */
158
- const M = await open({ viewport: { width: 400, height: 900 } }, null, () => { try { localStorage.setItem('pmos.c3.testDesk', 'desk'); } catch { /* no storage */ } });
159
- ok('0 at 400 wide the page does not scroll sideways', M.up && await M.page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1), 'scrollWidth');
160
- ok('0 no page error (400 wide)', M.errors.length === 0, M.errors.join(' | '));
161
- await M.ctx.close();
162
- return finish();
163
- })().catch((e) => { console.error(e); finish(1); });