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,204 +0,0 @@
1
- /* pm/keep-card.js — the Keep card, and the breakdown rows of Today's needs-you list (pm-os-absorb Run 1, PRD R21/R23).
2
- *
3
- * An agent's items arrive PROPOSED: they show in the Tree and on the Board but count in no progress until the PM keeps
4
- * them. One card per batch (everything one agent session proposed on one initiative) offers Keep or Withdraw all.
5
- * Tree "Agent · sess-3 proposed 9 items on 5 Oct." [Keep] [Withdraw all]
6
- * Today • <initiative> · 9 items · agent · sess-3 [Keep] [Withdraw all]
7
- * The batch is named by the session label the rows already show, so two batches on one initiative read apart.
8
- * Keep writes one `kept` line, and only from this page (the server refuses `kept` from anywhere else). Withdraw all goes
9
- * through the Undo hold and then writes one `withdrawn` per item in one request. The card reads the batch as the server
10
- * last sent it, so an item proposed after the read stays proposed and appears on the next refresh as a new count.
11
- *
12
- * Today's other two breakdown rows — an agent Done with no evidence, and a ledger line that has no effect (a forged Keep) —
13
- * render as plain cards that open the initiative. All three come from the existing GET /api/needs.
14
- */
15
-
16
- import { el } from './dom.js';
17
- import { button, toast, ensureComponentsCss } from './primitives.js';
18
- import { COPY, dayOf } from './breakdown-copy.js';
19
- import { postEvents, getNeeds } from './breakdown-api.js';
20
- import { hold, isHeld } from './undo-hold.js';
21
- import { wsOf } from './data.js';
22
- import { state, setState, FIXTURE } from './state.js';
23
- import { registerTodaySource } from './registry.js';
24
- import { records } from './board-read.js';
25
- import { COPY as TODAY } from './today-copy.js';
26
- import { todayCard, ensureFeed, onFeed } from './today-cards.js';
27
-
28
- export const keepKey = (ws, initiative, by) => 'batch:' + ws + ':' + initiative + ':' + by;
29
-
30
- /**
31
- * keepCard({ ws, initiative, initiativeTitle, batch, place: 'tree'|'today', onChanged(what), onHoldApply(layout) })
32
- * `onChanged` runs after Keep is written, when Withdraw all is held, undone or written. `onHoldApply` is the overlay the
33
- * hold applies to a fetched layout (the Tree passes one; Today hides the card while the hold runs).
34
- */
35
- export function keepCard({ ws, initiative, initiativeTitle, batch, place = 'tree', repo, cardId, onChanged, onHoldApply, onKeepApply }) {
36
- const n = batch.count || (batch.items || []).length;
37
- const key = keepKey(ws, initiative, batch.by);
38
- const doKeep = async (btn) => {
39
- btn.disabled = true;
40
- if (onKeepApply) onKeepApply();
41
- const out = await postEvents(ws, [{ ev: 'kept', initiative, batch: batch.by, items: batch.items }]);
42
- if (!out || out.ok === false) { toast({ text: (out && out.error) || 'nothing was saved', tone: 'error' }); btn.disabled = false; }
43
- else toast({ text: COPY.kept(n) });
44
- if (onChanged) onChanged({ kept: true, ok: !!(out && out.ok !== false) });
45
- };
46
- const doWithdrawAll = () => {
47
- hold({
48
- key, ws, text: COPY.withdrewN(n),
49
- events: (batch.items || []).map((id) => ({ ev: 'withdrawn', item: id })),
50
- apply: onHoldApply || null,
51
- onDone: () => { if (onChanged) onChanged({ withdrawn: true }); },
52
- onUndo: () => { if (onChanged) onChanged({ undone: true }); },
53
- });
54
- if (onChanged) onChanged({ held: true });
55
- };
56
- const attrs = { 'data-bd-keep-card': place, 'data-batch': batch.by, 'data-initiative': initiative, 'data-count': String(n) };
57
- if (place === 'today') {
58
- // R12: a Today card has ONE button. Keep is it; Withdraw all is in the ⋯ menu and is said on the card.
59
- return todayCard({
60
- kind: 5, id: cardId || key, repo, ws, initiative, cause: (initiativeTitle || initiative) + ' · ' + COPY.keepToday(n, batch.byLabel),
61
- evidence: TODAY.keepHint, act: { label: COPY.keep }, actAttrs: { 'data-bd-keep': '' },
62
- menuExtra: [{ label: TODAY.withdrawAll, onSelect: doWithdrawAll }], attrs: { ...attrs, 'data-today-row': 'keep' },
63
- onAct: (e) => doKeep(e.currentTarget),
64
- });
65
- }
66
- const keep = button({ label: COPY.keep, variant: 'outline', size: 'sm', attrs: { 'data-bd-keep': '' }, onClick: () => doKeep(keep) });
67
- const withdrawAll = button({ label: COPY.withdrawAll, variant: 'ghost', size: 'sm', attrs: { 'data-bd-withdraw-all': '' }, onClick: doWithdrawAll });
68
- const text = [el('span', null, COPY.keepTree(n, dayOf(batch.firstAt || batch.lastAt), batch.byLabel))];
69
- return el('div', { class: 'bd-keep', ...attrs }, el('div', { class: 'bd-keep__text' }, text), el('div', { class: 'bd-keep__actions' }, keep, withdrawAll));
70
- }
71
-
72
- /* ── Today ─────────────────────────────────────────────────────────────────────────────────────────────────────────── */
73
-
74
- const KINDS = ['keep', 'evidence', 'plan-flag'];
75
- const cache = new Map(); // ws -> { rows, loading, stale }
76
- let rerender = null;
77
- let hooked = false;
78
-
79
- function load(ws) {
80
- const c = cache.get(ws) || { rows: [], loading: false, stale: true };
81
- cache.set(ws, c);
82
- // A change that arrives while a read is in flight is not dropped: that read may have started before the change, so
83
- // it is read once more when the read ends.
84
- if (c.loading) { c.again = true; return; }
85
- c.loading = true; c.again = false;
86
- getNeeds(ws).then((out) => {
87
- c.loading = false; c.stale = false;
88
- c.rows = out && Array.isArray(out.needs) ? out.needs.filter((r) => r && KINDS.includes(r.kind) && r.run_id !== 'plan-items:unreadable') : [];
89
- if (c.again) load(ws);
90
- if (rerender) rerender(); else setState({});
91
- });
92
- }
93
-
94
- function hook() {
95
- if (hooked || typeof window === 'undefined') return;
96
- hooked = true;
97
- window.addEventListener('pmos:ledgers', (e) => {
98
- const changed = (e && e.detail && e.detail.changed) || [];
99
- let any = false;
100
- for (const ws of changed) { const c = cache.get(ws); if (c) { c.stale = true; any = true; load(ws); } }
101
- if (any && rerender) rerender();
102
- });
103
- }
104
-
105
- /**
106
- * Read the breakdown rows of every repository once, so the nav's Today count includes them before Today has rendered.
107
- * The nav calls it on each render. It starts a request only for a workspace that is not in the cache yet, and only after
108
- * the first sessions poll has answered (`state.sessions` is set), so the page's startup makes no extra request. After
109
- * that, a workspace is read again only on a `pmos:ledgers` change, as for Today. Fixture mode reads nothing.
110
- */
111
- export function primePlanNeeds(repos) {
112
- if (FIXTURE || !Array.isArray(state.sessions)) return;
113
- hook();
114
- for (const repo of repos || []) {
115
- const ws = wsOf(repo);
116
- if (ws && !cache.has(ws)) load(ws);
117
- }
118
- }
119
-
120
- /**
121
- * How many breakdown rows need the PM, over every workspace read so far (Keep batches not held for Undo, evidence and
122
- * check rows). The nav's Today count adds it, so the badge and Today's header count the same rows. Reads the cache that
123
- * primePlanNeeds() and Today fill; it fetches nothing itself. 0 in fixture mode.
124
- */
125
- function planCount(repos) {
126
- let n = 0;
127
- for (const repo of repos || []) {
128
- const ws = wsOf(repo);
129
- if (!ws) continue;
130
- primePlanNeeds([repo]);
131
- ensureFeed(ws);
132
- for (const row of (cache.get(ws) || { rows: [] }).rows) {
133
- if (row.kind === 'keep' && row.batch && isHeld(keepKey(ws, row.initiative_id, row.batch.by))) continue;
134
- n++;
135
- }
136
- }
137
- return n;
138
- }
139
-
140
- export function planNeedsCount() {
141
- let n = 0;
142
- for (const [ws, c] of cache) {
143
- for (const row of c.rows || []) {
144
- if (row.kind === 'keep' && row.batch && isHeld(keepKey(ws, row.initiative_id, row.batch.by))) continue;
145
- n++;
146
- }
147
- }
148
- return n;
149
- }
150
-
151
- /**
152
- * The breakdown cards for Today's needs-you column: Keep cards, then evidence and check cards, for the given
153
- * repositories. `open(repo, slug)` opens the initiative; `titleOf(slug)` names it; `onRender` is called when new rows
154
- * arrive. Reads /api/needs once per workspace and again when that workspace's ledger changes. Fixture mode reads nothing.
155
- * Every card is a Today card (today-cards.js): a cause, its evidence, one button and the ⋯ menu, with the id the server
156
- * ranks by (`<ws>|<run id>`).
157
- */
158
- export function planNeedsCards({ repos, fixture, onRender, open, titleOf }) {
159
- if (fixture) return [];
160
- rerender = onRender || rerender;
161
- hook();
162
- const out = [];
163
- for (const repo of repos || []) {
164
- const ws = wsOf(repo);
165
- if (!ws) continue;
166
- ensureFeed(ws);
167
- const c = cache.get(ws);
168
- if (!c || (c.stale && !c.loading)) load(ws);
169
- for (const row of (c && c.rows) || []) {
170
- const slug = row.initiative_id;
171
- const cardId = ws + '|' + row.run_id;
172
- if (row.kind === 'keep' && row.batch) {
173
- if (isHeld(keepKey(ws, slug, row.batch.by))) continue;
174
- out.push(keepCard({
175
- ws, repo, cardId, initiative: slug, initiativeTitle: titleOf ? titleOf(slug) : slug, batch: row.batch, place: 'today',
176
- onChanged: () => { const cc = cache.get(ws); if (cc) { cc.stale = true; load(ws); } if (rerender) rerender(); },
177
- }));
178
- } else {
179
- const evidence = row.kind === 'evidence';
180
- out.push(todayCard({
181
- kind: evidence ? 4 : 8, id: cardId, repo, ws, initiative: slug, cause: row.question,
182
- evidence: [titleOf ? titleOf(slug) : slug, evidence ? COPY.needs.evidence : COPY.needs.flag, COPY.derived].filter(Boolean).join(' · '),
183
- act: { label: COPY.needs.open }, onAct: () => { if (open) open(repo, slug); },
184
- attrs: { 'data-bd-need': row.kind, 'data-item': row.item || null, 'data-today-row': row.kind },
185
- }));
186
- }
187
- }
188
- }
189
- if (out.length) ensureComponentsCss();
190
- return out;
191
- }
192
-
193
- /* The Today source: the breakdown's rows as cards of kinds 4, 5 and 8, counted once with every other source. */
194
- if (!FIXTURE) {
195
- onFeed((ws) => { const c = cache.get(ws); if (c) { c.stale = true; load(ws); } });
196
- registerTodaySource({
197
- id: 'plan-rows', kind: null, rank: 30,
198
- count: (ctx) => planCount(ctx.repos),
199
- cards: (ctx) => planNeedsCards({
200
- repos: ctx.repos, fixture: false, onRender: () => (ctx.setState ? ctx.setState({}) : setState({})),
201
- open: (r, slug) => (ctx.open ? ctx.open(r, slug) : null), titleOf: (slug) => (records()[slug] && records()[slug].tag) || slug,
202
- }),
203
- });
204
- }
@@ -1,246 +0,0 @@
1
- /* pm/lifecycle-lens-model.js — the pure half of the Lifecycle lens (console3 wave B1). No DOM, so node can import it.
2
- *
3
- * Stage is DERIVED, never set. The lens reads each initiative's `nine_stages` (scripts/nine-stages.js: one of
4
- * done | current | pending | no-signal | skipped per stage). The roadmap payload does not carry `nine_stages` yet, so
5
- * `nineOf` falls back to a small MIRROR of scripts/nine-stages.js (STAGES, LANE_STAGES, SIGNALLED and the status rule),
6
- * fed by the rung the row's `stage.id` names. The mirror is approximate: the row's stage is the plan-tree group, not the
7
- * engine's raw rung, so an accepted initiative cannot be told apart from one in Evaluate. When the server sends
8
- * `nine_stages`, that wins and the mirror is not used.
9
- */
10
-
11
- // Six stages and two milestones (premium-agreed-design L1): Ideate folded into Discover, Strategize into Prioritize.
12
- export const STAGES = ['triage', 'discover', 'plan', 'prioritize', 'build', 'deliver', 'monitor', 'evaluate'];
13
- export const LABELS = { triage: 'Triage', discover: 'Discover', plan: 'Plan', prioritize: 'Prioritize', build: 'Build', deliver: 'Deliver', monitor: 'Monitor', evaluate: 'Evaluate' };
14
- /** Deliver and Evaluate are milestones (a diamond), not stages with duration. */
15
- export const MILESTONES = new Set(['deliver', 'evaluate']);
16
- /** A removed stage key read from anywhere (a stored payload, a URL) maps to its new key. Read-time only. */
17
- const LEGACY = { ideate: 'discover', strategize: 'prioritize' };
18
- export const stageKey = (k) => (k == null ? k : LEGACY[k] || k);
19
- // Mirror of scripts/nine-stages.js LANE_STAGES and SIGNALLED.
20
- const LANE_STAGES = {
21
- feature: STAGES,
22
- discovery: ['triage', 'discover', 'prioritize', 'evaluate'],
23
- chore: ['plan', 'build', 'deliver', 'evaluate'],
24
- incident: ['build', 'deliver', 'monitor', 'evaluate'],
25
- content: ['discover', 'plan', 'build', 'deliver'],
26
- prototype: ['triage', 'discover', 'evaluate'],
27
- };
28
- const SIGNALLED = new Set(['triage', 'discover', 'plan', 'build', 'evaluate']);
29
- // The plan-tree group id of a row's stage, as an engine rung rank (nine-stages.js RANK). Unknown groups read intake.
30
- const GROUP_RANK = { intake: 0, spec: 1, brief: 1, draft: 1, contract: 2, build: 3, evaluate: 4, handoff: 4 };
31
-
32
- /** The stage statuses of one row: its own `nine_stages` when the server sent them (an old payload's removed keys mapped, a repeated key
33
- * kept once), else the mirror. */
34
- export function nineOf(row) {
35
- if (row && Array.isArray(row.nine_stages) && row.nine_stages.length) {
36
- const seen = new Set(); const out = [];
37
- for (const s of row.nine_stages) {
38
- const key = stageKey(s && s.key);
39
- if (!key || seen.has(key)) continue;
40
- seen.add(key);
41
- out.push(key === (s && s.key) ? s : { ...s, key, label: LABELS[key] || s.label });
42
- }
43
- return out;
44
- }
45
- const lane = row && row.lane;
46
- const laneSet = new Set(LANE_STAGES[lane] || STAGES);
47
- const gid = row && row.stage && row.stage.id;
48
- const rank = GROUP_RANK[gid] ?? 0;
49
- const done = { triage: rank >= 1, discover: rank >= 1, plan: rank >= 2, build: rank >= 3, evaluate: rank >= 4 };
50
- let cur = false;
51
- return STAGES.map((key) => {
52
- let status;
53
- if (!laneSet.has(key)) status = 'skipped';
54
- else if (!SIGNALLED.has(key)) status = 'no-signal';
55
- else if (done[key]) status = 'done';
56
- else status = 'pending';
57
- if (status === 'pending' && !cur) { status = 'current'; cur = true; }
58
- return MILESTONES.has(key) ? { key, label: LABELS[key], status, milestone: true } : { key, label: LABELS[key], status };
59
- });
60
- }
61
-
62
- /** The stage an initiative sits in: the first `current`; else the last `done`; else null (nothing shows a stage yet). */
63
- export function stageBucket(nine) {
64
- const list = Array.isArray(nine) ? nine : [];
65
- const cur = list.find((s) => s.status === 'current');
66
- if (cur) return cur.key;
67
- let last = null;
68
- for (const s of list) if (s.status === 'done') last = s.key;
69
- return last;
70
- }
71
-
72
- /** Group rows by stage: { buckets: { discover: [row…], … }, unplaced: [row…] }. `scope` is an initiative id or null for all. */
73
- export function bucketRows(rows, scope) {
74
- const buckets = Object.fromEntries(STAGES.map((k) => [k, []]));
75
- const unplaced = [];
76
- for (const r of rows || []) {
77
- if (scope && r.id !== scope) continue;
78
- const k = stageBucket(nineOf(r));
79
- if (k && buckets[k]) buckets[k].push(r); else unplaced.push(r);
80
- }
81
- return { buckets, unplaced };
82
- }
83
-
84
- /** How one stage reads across the scoped rows: 'no-signal' when every row that uses it has no signal, 'skipped' when every row skips it. */
85
- export function stageNote(key, rows, scope) {
86
- const sts = (rows || []).filter((r) => !scope || r.id === scope).map((r) => (nineOf(r).find((s) => s.key === key) || {}).status);
87
- if (!sts.length) return null;
88
- if (sts.every((s) => s === 'skipped')) return 'skipped';
89
- if (sts.every((s) => s === 'skipped' || s === 'no-signal')) return 'no-signal';
90
- return null;
91
- }
92
-
93
- /* ── what each stage needs (console3.html C3.REQ, line 4687): the requirement rows of the lens, each with who does it ── */
94
- // Eight steps (premium-agreed-design L1). Ideate's options moved to Discover; Strategize's bet moved to Prioritize; the Commit gate is in Plan
95
- // (it pushes the tickets to Jira). Engineers build outside PMOS: Build reads the Jira tickets, never a PMOS builder.
96
- export const REQ = {
97
- triage: [['brief', 'BRD: the problem, who has it, the anchor', 'agent'], ['cont', 'Take it on or park it', 'pm']],
98
- discover: [['evidence', 'Evidence from 3 or more sources', 'agent'], ['opts', 'Two or more options, one recommended', 'agent'], ['prd', 'PRD with done criteria', 'agent']],
99
- plan: [['rub', 'Rubric and pre-run contract', 'agent'], ['plan', 'Scope, timeline and work breakdown reviewed', 'pm'], ['commit', 'Commit: the tickets go to Jira', 'pm']],
100
- prioritize: [['bet', 'Bet statement tied to the anchor', 'agent'], ['rank', 'Ranked on the roadmap', 'pm']],
101
- build: [['tix', 'Features delivered: the Jira tickets are done', 'jira'], ['rev', 'Review against the rubric', 'agent']],
102
- deliver: [['rel', 'Release shipped, your sign-off', 'pm']],
103
- monitor: [['out', 'Outcome report after 2 weeks', 'agent']],
104
- evaluate: [['verd', 'Verdict: keep, iterate or stop', 'pm']],
105
- };
106
- /** Who does a requirement: [icon, word]. Build work is the engineers', tracked in Jira. */
107
- export const reqWho = (w) => (w === 'pm' ? ['user', 'you'] : w === 'jira' || w === 'factory' ? ['branch', 'engineers (Jira)'] : ['spark', 'agent']);
108
- /** The agent's or factory's requirements of the same stage that are not done yet: a PM decision waits for them (c3prevPending). `isDone(key)` says what is done. */
109
- export const prevPending = (stage, key, isDone) => (REQ[stage] || []).filter((r) => r[2] !== 'pm' && r[0] !== key && !isDone(r[0]));
110
- /** What the agent is asked to draft, per requirement: [the offer, what it is]. */
111
- export const DRAFT_TEXT = {
112
- brief: ['Draft the BRD', 'A one-page business requirement with a stop rule'], evidence: ['Gather the evidence', 'Three or more sources, each cited'], opts: ['Draft the options', 'Two or more, one recommended, with the cost of each'],
113
- bet: ['Draft the bet statement', 'Tied to the anchor'], prd: ['Draft the PRD', 'Done criteria first'], rub: ['Draft the rubric and pre-run contract', 'The rubric is the spec; the contract is agreed before any build'],
114
- rev: ['Review the build against the rubric', 'Outcome only, weighted, against the threshold'], out: ['Run the outcome check', 'Two weeks after release, from the data'],
115
- };
116
- /** The PM's decision per requirement: [yes label, yes effect], [no label, no effect], the sentence. */
117
- export const DECIDE_TEXT = {
118
- cont: [['Take it on', 'It moves to Discover; the stop rule stays in force'], ['Park it, reason recorded', 'Frees the discovery slot'], 'The stop rule is the test. Read the BRD and decide: a close call is a reason to ask for more, not to guess.'],
119
- commit: [['Commit the plan', 'The tickets go to Jira'], ['Keep it in Plan', 'Nothing goes to Jira yet'], 'Commit pushes the work breakdown to Jira as tickets. Check scope and dates first.'],
120
- rank: [['Rank it on the roadmap', 'It takes its place in Now, Next or Later'], ['Keep it unranked', 'Waits for capacity'], 'Now has a limit. The least sure bet goes back if it fills.'],
121
- plan: [['Approve the plan', 'Breakdown, owners and dates are agreed'], ['Send the breakdown back', 'The agent revises it'], 'Check that every work item has an owner before you approve.'],
122
- rel: [['Sign off the release', 'The release is recorded as shipped by your slide'], ['Hold it', 'The date moves; promises are re-told'], 'Release needs its readiness checks and an outside change in Jira, which needs its own slide.'],
123
- verd: [['Record the verdict: iterate', 'The next bet is seeded from the lesson'], ['Record the verdict: stop', 'Frees the capacity'], 'Keep, iterate or stop is a human judgement; the agent only drafts the evidence.'],
124
- };
125
- /** The stages a lane uses, in order (the lane's own list). */
126
- export const laneStages = (lane) => LANE_STAGES[lane] || STAGES;
127
-
128
- /* ── the derived panels of the lens (console3 wave L1). Ports of scripts/trust/reader.js (the PM's sample), sections 11 to 16:
129
- * 11 PRIORITIZE score = impact x confidence / effort, capacity in bets
130
- * 12 DISCOVER hypothesis status from weighted evidence; evidence whose source is not a known file is untraced
131
- * 14 GATE LADDER the six gates in order, the next gate, order violations
132
- * 15 RUBRIC the weighted score against the threshold, the weakest dimension, the watermelon guard
133
- * 16 NORTH STAR corrections per agent run, lower is better
134
- * Pure: no DOM, no fetch. Real records feed them; nothing here invents a number. ── */
135
- const isNum = (v) => typeof v === 'number' && Number.isFinite(v);
136
-
137
- /** The score of an idea (reader.js section 11: impact x confidence / effort, two decimals). null when a figure is missing. */
138
- export function ideaScore(x) {
139
- if (!x || !isNum(x.imp) || !isNum(x.conf) || !isNum(x.eff) || x.eff <= 0) return null;
140
- return Math.round(x.imp * x.conf / x.eff * 100) / 100;
141
- }
142
- /** An ideas record (scripts/records: title, impact, effort, confidence; optional initiative, source, status, why) as the lens draws it. */
143
- export function normIdea(r) {
144
- const o = r || {};
145
- const st = ['new', 'short', 'committed', 'parked'].includes(o.status) ? o.status : o.status === 'shortlisted' ? 'short' : 'new';
146
- return { id: String(o.rid || o.id || ''), n: String(o.title || ''), init: String(o.initiative || ''), imp: Number(o.impact), eff: Number(o.effort), conf: Number(o.confidence),
147
- src: ['agent', 'customer', 'you'].includes(o.source) ? o.source : 'you', st, why: String(o.why || '') };
148
- }
149
- /** The ideas that are ranked: not parked, best score first (reader.js 11). */
150
- export const rankIdeas = (ideas) => (ideas || []).filter((x) => x.st !== 'parked' && ideaScore(x) != null).sort((a, b) => ideaScore(b) - ideaScore(a));
151
- /** Capacity: the effort the PM holds (shortlisted and committed) against the capacity figure. cap = null when none is recorded. */
152
- export function capacityUsed(ideas, cap) {
153
- const used = (ideas || []).filter((x) => x.st === 'short' || x.st === 'committed').reduce((a, x) => a + (isNum(x.eff) ? x.eff : 0), 0);
154
- return { used, cap: isNum(cap) ? cap : null, over: isNum(cap) ? Math.max(0, used - cap) : null };
155
- }
156
-
157
- /** A hypotheses record as the lens draws it. `evidence` is [{ src, dir: 'supports'|'refutes', w }]. */
158
- export function normHyp(r) {
159
- const o = r || {};
160
- const ev = (Array.isArray(o.evidence) ? o.evidence : []).filter((e) => e && typeof e === 'object').map((e) => ({ src: String(e.src || ''), dir: e.dir === 'refutes' ? 'refutes' : 'supports', w: isNum(Number(e.w)) ? Number(e.w) : 1, at: e.at ? String(e.at) : '' }));
161
- return { id: String(o.rid || o.id || ''), t: String(o.title || ''), init: String(o.initiative || ''), falsifier: String(o.falsifier || ''), review_by: String(o.review_by || ''), ev };
162
- }
163
- /** The status of a hypothesis, as reader.js section 12 derives it: net = sum of the weights (supports plus, refutes minus); net >= 3 is supported,
164
- * net <= -2 is refuted, anything between is open. `known` is a Set (or object) of the sources that exist; a source outside it is untraced.
165
- * The reader has three statuses. The page splits "open" for display only, so the PM can tell an empty hypothesis from a contested one:
166
- * `shown` is untested (no evidence), mixed (evidence both ways), or open (one-sided but below the bar). `status` stays the reader's. */
167
- export function hypStatus(h, known) {
168
- const ev = (h && h.ev) || [];
169
- const net = ev.reduce((a, e) => a + (e.dir === 'supports' ? e.w : -e.w), 0);
170
- const status = net >= 3 ? 'supported' : net <= -2 ? 'refuted' : 'open';
171
- const has = known instanceof Set ? (s) => known.has(s) : known ? (s) => !!known[s] : () => false;
172
- const untraced = ev.filter((e) => !has(e.src)).map((e) => e.src || '(no source)');
173
- const sup = ev.filter((e) => e.dir === 'supports').length; const ref = ev.length - sup;
174
- const shown = status !== 'open' ? status : !ev.length ? 'untested' : sup && ref ? 'mixed' : 'open';
175
- return { status, shown, net, untraced, supports: sup, refutes: ref };
176
- }
177
- export const HYP_LABEL = { supported: 'Supported', refuted: 'Refuted', mixed: 'Mixed', untested: 'Untested', open: 'Open' };
178
-
179
- /** The six gates the mockup draws, and the engine step each reads (scripts/workflow-state.js steps; the rule text of each step is its `basis.rule`):
180
- * Spec = spec, Rubric = contract (done criteria and test method agreed, D13), Build = build, Quality = quality, Review = review, Acceptance = accept. */
181
- export const GATES = [['Spec', 'spec'], ['Rubric', 'contract'], ['Build', 'build'], ['Quality', 'quality'], ['Review', 'review'], ['Acceptance', 'accept']];
182
- const dayOf = (v) => { const m = /^(\d{4}-\d{2}-\d{2})/.exec(String(v || '')); return m ? m[1] : ''; };
183
- /** The gate ladder from one initiative's ladder row (the steps of `GET /api/console?name=ladder`). Each gate: { name, key, state, evidence, rule, date }.
184
- * state is done | next (the first gate not done, the one in progress) | open (not yet) | na (cut by the PM or not required) | unknown (the engine does not claim it, e.g. CI decides).
185
- * A violation is a gate done before an earlier gate that is not done (reader.js 14 `viol`): "Build before Rubric"; with first-seen dates, also a gate done on an earlier day than the gate before it. */
186
- export function gateLadder(row) {
187
- const steps = (row && Array.isArray(row.steps)) ? row.steps : [];
188
- const by = Object.fromEntries(steps.map((s) => [s.key, s]));
189
- let nextAt = -1;
190
- const gates = GATES.map(([name, key], i) => {
191
- const s = by[key] || null;
192
- let state = !s ? 'unknown' : s.status === 'done' ? 'done' : s.status === 'na' ? 'na' : s.status === 'unknown' ? 'unknown' : 'open';
193
- if (state === 'open' && nextAt < 0) { nextAt = i; state = 'next'; }
194
- return { name, key, state, evidence: s ? String(s.evidence || '') : 'the engine returned no step for this gate', rule: s && s.basis ? String(s.basis.rule || '') : '', date: s && s.basis ? dayOf(s.basis.first_seen) : '', blocking: !!(s && s.blocking) };
195
- });
196
- const viol = [];
197
- gates.forEach((g, i) => {
198
- if (g.state !== 'done') return;
199
- gates.slice(0, i).forEach((p) => {
200
- if (p.state === 'na' || p.state === 'unknown') return;
201
- if (p.state !== 'done') viol.push(g.name + ' before ' + p.name);
202
- else if (g.date && p.date && g.date < p.date) viol.push(g.name + ' before ' + p.name + ' (' + g.date + ' against ' + p.date + ')');
203
- });
204
- });
205
- const next = gates.find((g) => g.state === 'next') || null;
206
- return { gates, next, violations: viol, done: gates.filter((g) => g.state === 'done').length, counted: gates.filter((g) => g.state !== 'na').length, nextAction: row && row.next ? row.next : null, blockers: (row && row.blockers) || [], failures: (row && row.gate_failures) || [] };
207
- }
208
- /** The cells of the mockup's `.gt` bar: 'd' done, 'h' next (half), '' open, 'na', 'u' (unknown). */
209
- export const gateCell = (g) => (g.state === 'done' ? 'd' : g.state === 'next' ? 'h' : g.state === 'na' ? 'na' : g.state === 'unknown' ? 'u' : '');
210
-
211
- /** An evaluation row (planning/runs/evals.jsonl: score, threshold or pass_threshold, dimensions as { name: score }, verdict, evaluator_model) as the scorecard.
212
- * The recorded score is shown as recorded. A weight is used only when a row carries one (`dims` as [{ dim, w, score }], the sample's form); otherwise the
213
- * dimensions are unweighted and the page says so. Dimensions that are not numbers are dropped. */
214
- export function normEval(e) {
215
- if (!e || typeof e !== 'object') return null;
216
- let dims = [];
217
- if (Array.isArray(e.dims)) dims = e.dims.filter((d) => d && isNum(d.score)).map((d) => ({ name: String(d.dim || d.name || ''), w: isNum(d.w) ? d.w : null, score: d.score }));
218
- else if (e.dimensions && typeof e.dimensions === 'object') dims = Object.entries(e.dimensions).filter(([, v]) => isNum(v)).map(([k, v]) => ({ name: k, w: null, score: v }));
219
- const weighted = dims.length && dims.every((d) => d.w != null);
220
- const computed = weighted ? dims.reduce((a, d) => a + d.w * d.score, 0) : dims.length ? dims.reduce((a, d) => a + d.score, 0) / dims.length : null;
221
- const score = isNum(e.score) ? e.score : computed;
222
- const thr = isNum(e.threshold) ? e.threshold : isNum(e.pass_threshold) ? e.pass_threshold : null;
223
- return { score, threshold: thr, dims, weighted: !!weighted, verdict: String(e.verdict || ''), model: String(e.evaluator_model || ''), at: String(e.recorded_at || e.at || ''), run: String(e.run_id || e.run || '') };
224
- }
225
- /** The verdict of a scorecard: passes (score at or over the threshold), the weakest dimension, and the watermelon guard (reader.js 15: a pass while a dimension scores under 0.6). */
226
- export function evalVerdict(ev) {
227
- if (!ev || ev.score == null) return null;
228
- const weakest = ev.dims.slice().sort((a, b) => a.score - b.score)[0] || null;
229
- const passes = ev.threshold != null ? ev.score >= ev.threshold : null;
230
- const watermelon = !!(passes && weakest && weakest.score < 0.6);
231
- return { passes, weakest, watermelon, below: ev.threshold != null && !passes };
232
- }
233
- /** The newest evaluation per initiative from a list of rows (recorded_at, then file order). */
234
- export function latestEvals(rows) {
235
- const out = {};
236
- (rows || []).forEach((r, i) => { const id = r && r.initiative_id; if (!id) return; const at = String(r.recorded_at || r.at || ''); const p = out[id]; if (!p || at >= p.at) out[id] = { at, i, row: r }; });
237
- return Object.fromEntries(Object.entries(out).map(([k, v]) => [k, v.row]));
238
- }
239
- /** Corrections per run (reader.js 16, lower is better), two decimals, for each bucket and the change from the first to the last. */
240
- export function correctionRate(series) {
241
- const s = (series || []).filter((x) => x && x.runs > 0);
242
- if (!s.length) return null;
243
- const rate = (x) => Math.round(x.corrections / x.runs * 100) / 100;
244
- const vals = s.map(rate);
245
- return { now: vals[vals.length - 1], from: vals[0], vals, improved: vals[vals.length - 1] < vals[0] };
246
- }