create-pmos 0.396.0 → 0.398.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 (177) hide show
  1. package/package.json +25 -25
  2. package/payload/KIT-VERSION +2 -2
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/scripts/nine-stages.js +49 -20
  6. package/payload/state/discoveries.md +1 -1
  7. package/payload/state/log.md +1 -1
  8. package/workspace/briefing-premium-adddoc-test.js +103 -74
  9. package/workspace/briefing-premium-board-test.js +316 -154
  10. package/workspace/briefing-premium-calendar-2-test.js +135 -195
  11. package/workspace/briefing-premium-calendar-3-test.js +143 -413
  12. package/workspace/briefing-premium-calendar-test.js +86 -185
  13. package/workspace/briefing-premium-doc-edit-test.js +95 -83
  14. package/workspace/briefing-premium-initiative-test.js +166 -294
  15. package/workspace/briefing-premium-insights-test.js +351 -214
  16. package/workspace/briefing-premium-metrics-test.js +53 -118
  17. package/workspace/briefing-premium-products-test.js +40 -27
  18. package/workspace/briefing-premium-sources-test.js +91 -52
  19. package/workspace/briefing-premium-test.js +150 -633
  20. package/workspace/briefing-premium-work-test.js +88 -269
  21. package/workspace/changelog.json +24 -0
  22. package/workspace/fixtures/board-premium-facts.js +2 -1
  23. package/workspace/fixtures/board-premium-jira.js +28 -0
  24. package/workspace/fixtures/board-premium-trail.js +32 -0
  25. package/workspace/fixtures/initiative-premium-facts.js +2 -1
  26. package/workspace/fixtures/initiatives-api/list.json +30 -42
  27. package/workspace/fixtures/initiatives-api/roadmap.json +40 -56
  28. package/workspace/fixtures/initiatives-api/sheet.json +10 -14
  29. package/workspace/fixtures/insights-premium-facts.js +11 -2
  30. package/workspace/fixtures/premium-viewer-fixtures.js +182 -0
  31. package/workspace/guide/briefing-premium.md +3 -1
  32. package/workspace/guide/home.md +47 -0
  33. package/workspace/guide/index.md +2 -0
  34. package/workspace/guide/lifecycle.md +51 -0
  35. package/workspace/home-shot.js +38 -0
  36. package/workspace/lib/agent-roles.js +71 -0
  37. package/workspace/lib/board-premium.js +160 -3
  38. package/workspace/lib/board-trail.js +223 -0
  39. package/workspace/lib/engine/boards.js +15 -14
  40. package/workspace/lib/engine/nine-stages.js +49 -20
  41. package/workspace/lib/engine/signals/detectors.js +13 -11
  42. package/workspace/lib/home-work-item.js +58 -0
  43. package/workspace/lib/insights-goals.js +196 -0
  44. package/workspace/lib/insights-premium.js +126 -1
  45. package/workspace/lib/insights-records.js +101 -0
  46. package/workspace/lib/jira-tickets.js +1 -1
  47. package/workspace/lib/route-modules.js +4 -0
  48. package/workspace/lib/routes-board-premium.js +3 -2
  49. package/workspace/lib/routes-board-trail.js +33 -0
  50. package/workspace/lib/routes-home-desk.js +176 -0
  51. package/workspace/lib/routes-initiatives.js +1 -1
  52. package/workspace/lib/routes-insights-premium.js +19 -3
  53. package/workspace/lib/routes-insights-records.js +129 -0
  54. package/workspace/lib/routes-notes.js +1 -0
  55. package/workspace/lib/routes-viewer.js +108 -0
  56. package/workspace/lib/transcript-steps.js +123 -0
  57. package/workspace/lib/vendor/scripts/nine-stages.js +49 -20
  58. package/workspace/lib/viewer-meeting.js +205 -0
  59. package/workspace/lib/viewer-report.js +89 -0
  60. package/workspace/package-lock.json +2 -2
  61. package/workspace/package.json +1 -1
  62. package/workspace/premium-agreed-viewer-shots.js +76 -0
  63. package/workspace/premium-board-actions-test.js +85 -73
  64. package/workspace/premium-briefing-depth-test.js +66 -53
  65. package/workspace/premium-chat-attach-test.js +54 -63
  66. package/workspace/premium-chat-chart-tab-test.js +35 -36
  67. package/workspace/premium-chat-context-test.js +22 -19
  68. package/workspace/premium-chat-goal-view-test.js +28 -26
  69. package/workspace/premium-chat-notes-test.js +29 -33
  70. package/workspace/premium-chat-report-tab-test.js +35 -25
  71. package/workspace/premium-chat-term-test.js +16 -14
  72. package/workspace/premium-chat-viewer-test.js +60 -53
  73. package/workspace/premium-core-doc-issue-test.js +50 -41
  74. package/workspace/premium-html-viewer-test.js +17 -18
  75. package/workspace/premium-phone-card-test.js +8 -2
  76. package/workspace/premium-phone-room-test.js +42 -31
  77. package/workspace/premium-report-read-test.js +115 -197
  78. package/workspace/premium-viewer-download-test.js +19 -22
  79. package/workspace/premium-viewer-flicker-test.js +11 -16
  80. package/workspace/premium-viewer-share-test.js +6 -9
  81. package/workspace/premium-viewer-test.js +41 -60
  82. package/workspace/premium-vw-backlog-test.js +53 -31
  83. package/workspace/premium-vw-cal-test.js +82 -123
  84. package/workspace/premium-vw-copy-test.js +17 -33
  85. package/workspace/premium-vw-doc-test.js +12 -11
  86. package/workspace/premium-vw-item-test.js +50 -48
  87. package/workspace/premium-vw-jira-test.js +55 -26
  88. package/workspace/premium-vw-meet-test.js +118 -187
  89. package/workspace/premium-vw-notes-test.js +85 -107
  90. package/workspace/premium-vw-rec-test.js +72 -193
  91. package/workspace/premium-vw-slides-test.js +46 -50
  92. package/workspace/premium-welcome-test.js +3 -2
  93. package/workspace/premium-work-depth-test.js +63 -51
  94. package/workspace/public/pm/bd-acts.js +305 -0
  95. package/workspace/public/pm/bd-span.js +224 -0
  96. package/workspace/public/pm/bd-stages.js +47 -0
  97. package/workspace/public/pm/c3-doc-sheet.js +1 -1
  98. package/workspace/public/pm/c3-md.js +3 -395
  99. package/workspace/public/pm/c3-phone-detail.js +1 -1
  100. package/workspace/public/pm/c3-phone-model.js +3 -68
  101. package/workspace/public/pm/chat-term.js +3 -3
  102. package/workspace/public/pm/cozy-board.css +640 -0
  103. package/workspace/public/pm/cozy-home.css +580 -0
  104. package/workspace/public/pm/cozy-home.js +172 -0
  105. package/workspace/public/pm/cozy-initiative.css +138 -0
  106. package/workspace/public/pm/cozy-insights.css +421 -0
  107. package/workspace/public/pm/cozy-md.js +396 -0
  108. package/workspace/public/pm/cozy-nav.js +65 -0
  109. package/workspace/public/pm/cozy-placeholder.js +26 -0
  110. package/workspace/public/pm/cozy-viewer.css +143 -0
  111. package/workspace/public/pm/cozy-viewer.js +144 -0
  112. package/workspace/public/pm/cozy-vw.css +485 -0
  113. package/workspace/public/pm/cozy.css +254 -0
  114. package/workspace/public/pm/home-adddoc.js +48 -0
  115. package/workspace/public/pm/home-app.js +905 -0
  116. package/workspace/public/pm/home-around.js +515 -0
  117. package/workspace/public/pm/home-chat.js +459 -0
  118. package/workspace/public/pm/home-data.js +312 -0
  119. package/workspace/public/pm/home-draft.js +68 -0
  120. package/workspace/public/pm/home-more.js +249 -0
  121. package/workspace/public/pm/home-phone-card.js +109 -0
  122. package/workspace/public/pm/home-work.js +519 -0
  123. package/workspace/public/pm/lifecycle-lens-model.js +45 -27
  124. package/workspace/public/pm/lifecycle-lens.js +22 -11
  125. package/workspace/public/pm/phone-moment.js +69 -0
  126. package/workspace/public/pm/pm-work-view.js +1 -1
  127. package/workspace/public/pm/premium-attach.js +4 -0
  128. package/workspace/public/pm/premium-board.js +544 -253
  129. package/workspace/public/pm/premium-brief.js +1 -1
  130. package/workspace/public/pm/premium-chart-tab.js +110 -62
  131. package/workspace/public/pm/premium-chat.js +17 -10
  132. package/workspace/public/pm/premium-deck.js +3 -3
  133. package/workspace/public/pm/premium-first.js +25 -21
  134. package/workspace/public/pm/premium-initiative-head.js +138 -0
  135. package/workspace/public/pm/premium-initiative.js +28 -4
  136. package/workspace/public/pm/premium-insights.js +950 -440
  137. package/workspace/public/pm/premium-meeting.js +61 -549
  138. package/workspace/public/pm/premium-notes.js +1 -1
  139. package/workspace/public/pm/premium-report-frame.css +20 -0
  140. package/workspace/public/pm/premium-report-read.js +509 -480
  141. package/workspace/public/pm/premium-report-tab.js +87 -63
  142. package/workspace/public/pm/premium-shell.js +107 -124
  143. package/workspace/public/pm/premium-viewer.js +27 -1
  144. package/workspace/public/pm/premium-vw-cal.js +187 -48
  145. package/workspace/public/pm/premium-vw-doc.css +6 -0
  146. package/workspace/public/pm/premium-vw-doc.js +40 -2
  147. package/workspace/public/pm/premium-vw-file.js +2 -2
  148. package/workspace/public/pm/premium-vw-jira-model.js +22 -5
  149. package/workspace/public/pm/premium-vw-jira.css +11 -0
  150. package/workspace/public/pm/premium-vw-jira.js +11 -4
  151. package/workspace/public/pm/premium-vw-meet.js +6 -83
  152. package/workspace/public/pm/premium-vw-mtg.js +731 -0
  153. package/workspace/public/pm/premium-vw-notes.js +56 -69
  154. package/workspace/public/pm/premium-vw-open.js +35 -0
  155. package/workspace/public/pm/premium-vw-page.js +16 -0
  156. package/workspace/public/pm/premium-vw-rec.js +11 -215
  157. package/workspace/public/pm/premium-vw-slides.css +5 -0
  158. package/workspace/public/pm/premium-vw-slides.js +44 -8
  159. package/workspace/public/pm/term-view.js +22 -0
  160. package/workspace/public/premium-board.html +57 -64
  161. package/workspace/public/premium-chat.html +7 -33
  162. package/workspace/public/premium-initiative.html +8 -41
  163. package/workspace/public/premium-insights.html +63 -62
  164. package/workspace/public/premium-viewer.html +20 -0
  165. package/workspace/public/premium-work.html +6 -72
  166. package/workspace/public/premium.html +21 -66
  167. package/workspace/public/vendor/nunito-var.woff2 +0 -0
  168. package/workspace/server.js +25 -3
  169. package/workspace/test-files.json +1 -0
  170. package/workspace/test-lists/home-libs.json +9 -0
  171. package/workspace/test-lists/premium-agreed-viewer.json +9 -0
  172. package/workspace/test-lists/premium-report-read.json +1 -1
  173. package/workspace/test-lists/premium-vw-agreed.json +9 -0
  174. package/workspace/test-lists/premium-vw-notes.json +1 -1
  175. package/workspace/third-party/README.md +1 -0
  176. package/workspace/public/pm/premium-work.js +0 -719
  177. package/workspace/public/pm/premium.js +0 -1133
@@ -8,29 +8,45 @@
8
8
  * `nine_stages`, that wins and the mirror is not used.
9
9
  */
10
10
 
11
- export const STAGES = ['discover', 'ideate', 'strategize', 'prioritize', 'plan', 'build', 'deliver', 'monitor', 'evaluate'];
12
- export const LABELS = { discover: 'Discover', ideate: 'Ideate', strategize: 'Strategize', prioritize: 'Prioritize', plan: 'Plan', build: 'Build', deliver: 'Deliver', monitor: 'Monitor', evaluate: 'Evaluate' };
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);
13
19
  // Mirror of scripts/nine-stages.js LANE_STAGES and SIGNALLED.
14
20
  const LANE_STAGES = {
15
21
  feature: STAGES,
16
- discovery: ['discover', 'ideate', 'strategize', 'prioritize', 'evaluate'],
17
- chore: ['plan', 'build', 'evaluate'],
22
+ discovery: ['triage', 'discover', 'prioritize', 'evaluate'],
23
+ chore: ['plan', 'build', 'deliver', 'evaluate'],
18
24
  incident: ['build', 'deliver', 'monitor', 'evaluate'],
19
- content: ['ideate', 'plan', 'build', 'deliver'],
20
- prototype: ['discover', 'ideate', 'evaluate'],
25
+ content: ['discover', 'plan', 'build', 'deliver'],
26
+ prototype: ['triage', 'discover', 'evaluate'],
21
27
  };
22
- const SIGNALLED = new Set(['discover', 'plan', 'build', 'evaluate']);
28
+ const SIGNALLED = new Set(['triage', 'discover', 'plan', 'build', 'evaluate']);
23
29
  // The plan-tree group id of a row's stage, as an engine rung rank (nine-stages.js RANK). Unknown groups read intake.
24
30
  const GROUP_RANK = { intake: 0, spec: 1, brief: 1, draft: 1, contract: 2, build: 3, evaluate: 4, handoff: 4 };
25
31
 
26
- /** The nine statuses of one row: its own `nine_stages` when the server sent them, else the mirror. */
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. */
27
34
  export function nineOf(row) {
28
- if (row && Array.isArray(row.nine_stages) && row.nine_stages.length) return row.nine_stages;
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
+ }
29
45
  const lane = row && row.lane;
30
46
  const laneSet = new Set(LANE_STAGES[lane] || STAGES);
31
47
  const gid = row && row.stage && row.stage.id;
32
48
  const rank = GROUP_RANK[gid] ?? 0;
33
- const done = { discover: rank >= 1, plan: rank >= 2, build: rank >= 3, evaluate: rank >= 4 };
49
+ const done = { triage: rank >= 1, discover: rank >= 1, plan: rank >= 2, build: rank >= 3, evaluate: rank >= 4 };
34
50
  let cur = false;
35
51
  return STAGES.map((key) => {
36
52
  let status;
@@ -39,7 +55,7 @@ export function nineOf(row) {
39
55
  else if (done[key]) status = 'done';
40
56
  else status = 'pending';
41
57
  if (status === 'pending' && !cur) { status = 'current'; cur = true; }
42
- return { key, label: LABELS[key], status };
58
+ return MILESTONES.has(key) ? { key, label: LABELS[key], status, milestone: true } : { key, label: LABELS[key], status };
43
59
  });
44
60
  }
45
61
 
@@ -75,34 +91,36 @@ export function stageNote(key, rows, scope) {
75
91
  }
76
92
 
77
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.
78
96
  export const REQ = {
79
- discover: [['brief', 'Discovery brief with a stop rule', 'agent'], ['evidence', 'Evidence from 3 or more sources', 'agent'], ['cont', 'Continue or park', 'pm']],
80
- ideate: [['opts', 'Two or more options, one recommended', 'agent']],
81
- strategize: [['bet', 'Bet statement tied to the anchor', 'agent']],
82
- prioritize: [['commit', 'Commit: it fits Now capacity', 'pm']],
83
- plan: [['prd', 'PRD with done criteria', 'agent'], ['rub', 'Rubric and pre-run contract', 'agent'], ['plan', 'Breakdown reviewed', 'pm']],
84
- build: [['tix', 'Build tickets merged, required CI green', 'factory'], ['rev', 'Review against the rubric', 'agent']],
85
- deliver: [['rel', 'Release shipped', 'pm']],
86
- monitor: [['out', 'Outcome check after 2 weeks', 'agent']],
87
- evaluate: [['verd', 'Verdict: what we learned, next bet seeded', 'pm']],
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']],
88
105
  };
89
- /** Who does a requirement: [icon, word]. */
90
- export const reqWho = (w) => (w === 'pm' ? ['user', 'you'] : w === 'factory' ? ['branch', 'factory'] : ['spark', 'agent']);
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']);
91
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. */
92
109
  export const prevPending = (stage, key, isDone) => (REQ[stage] || []).filter((r) => r[2] !== 'pm' && r[0] !== key && !isDone(r[0]));
93
110
  /** What the agent is asked to draft, per requirement: [the offer, what it is]. */
94
111
  export const DRAFT_TEXT = {
95
- brief: ['Draft the discovery brief', 'A one-page brief 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'],
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'],
96
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'],
97
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'],
98
115
  };
99
116
  /** The PM's decision per requirement: [yes label, yes effect], [no label, no effect], the sentence. */
100
117
  export const DECIDE_TEXT = {
101
- cont: [['Continue to the next stage', 'The stop rule stays in force'], ['Park it, reason recorded', 'Frees the discovery slot'], 'The stop rule is the test. Read the evidence and decide: a close call is a reason to ask for more, not to guess.'],
102
- commit: [['Commit it to Now', 'It fits Now capacity'], ['Keep it in Prioritize', 'Waits for capacity'], 'Now has a limit. The least sure bet goes back if it fills.'],
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.'],
103
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.'],
104
- rel: [['Release it', '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.'],
105
- verd: [['Record the verdict: iterate', 'The next bet is seeded from the lesson'], ['Record the verdict: stop', 'Frees the capacity'], 'The verdict is a human judgement; the agent only drafts the evidence.'],
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.'],
106
124
  };
107
125
  /** The stages a lane uses, in order (the lane's own list). */
108
126
  export const laneStages = (lane) => LANE_STAGES[lane] || STAGES;
@@ -1,13 +1,13 @@
1
1
  /* pm/lifecycle-lens.js — the Lifecycle lens of Initiatives (console3 wave B1; R4b: on the console3 mockup's own markup and CSS).
2
2
  *
3
- * The mockup (prototype/pmos-console-handoff/mockups/console3.html) is the UI. Lifted: the view bar `.calbar` with the nine stages
3
+ * The mockup (prototype/pmos-console-handoff/mockups/console3.html) is the UI. Lifted: the view bar `.calbar` with the eight steps (six stages, two milestones)
4
4
  * as `.seg` buttons (icon, label, `.bdg.g` count) and the scope as `.chips2` pills (iniHead, line 3576); the lens header `.lh`
5
5
  * (iniLensHead, line 3579); `.calwrap > .calbody > .brief.sbb > .bcols > .bcol.l/.r` (vIni, line 3600); the card deck `.cdeck >
6
6
  * .deck > .fc` with the dots `.dk .dkd` (iniDeck, line 3580); the lifecycle line `.lc` for one initiative (lifecycle, line 3487;
7
- * the mockup's seven columns are nine here, as the mockup's own override at c3:20 makes them); and the stage's list as
7
+ * the mockup's seven columns are eight here: six stages and two milestones, premium-agreed-design L1); and the stage's list as
8
8
  * `section.card.sect > .sh2 + ul.list > li.nrow` with a case file in `.xp > .xi` (c3needs, line 4714). Styles: pm/console3.css.
9
9
  *
10
- * What is real: the rows of the Initiatives view ctx (the roadmap horizons rows) and the nine stages derived from them
10
+ * What is real: the rows of the Initiatives view ctx (the roadmap horizons rows) and the eight steps derived from them
11
11
  * (lifecycle-lens-model.js). Stage is derived, never set; a stage with no signal reads "no signal yet", never done or pending;
12
12
  * a stage the lane skips reads skipped. Park (on hold) and Kill (cancelled) go through setLifecycle with a reason, as the sheet's
13
13
  * lifecycle menu does. `nine_stages` is not in that payload yet, so the model mirrors scripts/nine-stages.js; the page says so.
@@ -22,7 +22,7 @@
22
22
  * Self-registers as the 'lifecycle' Initiatives view, like Timeline and Releases.
23
23
  */
24
24
  import { el } from './dom.js';
25
- import { ensureComponentsCss } from './primitives.js';
25
+ import { ensureComponentsCss, button } from './primitives.js';
26
26
  import { registerInitiativesView } from './registry.js';
27
27
  import { setLifecycle } from './initiatives-api.js';
28
28
  import { STAGES, LABELS, bucketRows, stageNote, nineOf, REQ, reqWho, prevPending, DRAFT_TEXT, DECIDE_TEXT } from './lifecycle-lens-model.js';
@@ -35,7 +35,7 @@ import { ensureC3Css, c3ic, c3ring, c3Phone } from './pm-work-view.js';
35
35
  const views = new WeakMap();
36
36
  const PILLS = 7; // the mockup's scope row has five initiatives; a repository has hundreds, so the row shows the first few and says so
37
37
  const LIST_MAX = 20; // a stage's list shows this many rows, then "Show all"
38
- const ICON = { discover: 'search', ideate: 'spark', strategize: 'flag', prioritize: 'scale', plan: 'tree', build: 'branch', deliver: 'out', monitor: 'report', evaluate: 'check' }; // ILI, lines 3437 and 4686
38
+ const ICON = { triage: 'spark', discover: 'search', prioritize: 'scale', plan: 'tree', build: 'branch', deliver: 'out', monitor: 'report', evaluate: 'check' }; // ILI, lines 3437 and 4686
39
39
  const short = (t, n) => { t = String(t || ''); return t.length > n ? t.slice(0, n - 1) + '…' : t; };
40
40
 
41
41
  /* ── the mockup's Strategize lens (console3.html nsChart line 2833, sigCard 2883, matCard 2894), drawn only when ctx.strategy is given. The
@@ -86,7 +86,7 @@ function deckCard(V, row, i, n) {
86
86
 
87
87
  /* ── what a stage needs: one row per requirement, each with a case file (console3.html c3needs, line 4713; C3.cases.rq line 4719) ── */
88
88
  const isDemo = () => !!window.__c3demo;
89
- /** Is a requirement done for an initiative at this stage? The nine-stage rule says a stage that is done has all its requirements; at the current stage nothing is
89
+ /** Is a requirement done for an initiative at this stage? The lifecycle rule says a stage that is done has all its requirements; at the current stage nothing is
90
90
  * recorded per requirement, so none is shown done unless the PM's slide has just recorded it (the demo also carries the mockup's own table). */
91
91
  function reqDone(V, row, L, key) {
92
92
  const st = (nineOf(row).find((x) => x.key === L) || {}).status;
@@ -162,9 +162,12 @@ function render(V) {
162
162
  const scope = V.scope;
163
163
  const { buckets, unplaced } = bucketRows(rows, scope);
164
164
  const ST = V.ctx.strategy || null; // optional (demo): the mockup's Strategize lens content; the lens opens on it
165
- if (!V.lens) V.lens = ST ? 'strategize' : STAGES.find((k) => buckets[k].length) || 'discover';
165
+ // Strategize folded into Prioritize (premium-agreed-design L1): its strategy panels are the Prioritize lens's second view, opened by its toggle.
166
+ if (V.lens === 'strategize') { V.lens = 'prioritize'; V.strat = true; }
167
+ if (V.lens === 'ideate') { V.lens = 'discover'; V.ideas = true; }
168
+ if (!V.lens) { V.lens = ST ? 'prioritize' : STAGES.find((k) => buckets[k].length) || 'triage'; if (ST) V.strat = true; }
166
169
  const lens = V.lens;
167
- const stratOn = lens === 'strategize'; // the Calendar's strategy panels (c3-strategy-panels.js), as the mockup draws them under Strategize (iniLeft 3586, iniRight 3595)
170
+ const stratOn = lens === 'prioritize' && !!V.strat; // the Calendar's strategy panels (c3-strategy-panels.js), as the mockup draws them under Strategize (iniLeft 3586, iniRight 3595)
168
171
  const list = buckets[lens];
169
172
  const note = stageNote(lens, rows, scope);
170
173
 
@@ -178,8 +181,16 @@ function render(V) {
178
181
  ...rows.slice(0, PILLS).map((r) => el('button', { type: 'button', class: 'pill', 'aria-pressed': String(scope === r.id), 'data-lc-pill': r.id, title: r.title, onClick: () => { V.scope = r.id; V.lens = null; render(V); } }, short(r.title, 14))),
179
182
  rows.length > PILLS ? el('span', { class: 'dim mono', style: 'font-size:var(--fs-2)', 'data-lc-more': '' }, '+' + (rows.length - PILLS) + ' more in the list') : null);
180
183
 
184
+ // Ideate folded into Discover: its ideas panels are Discover's second view, as the strategy panels are Prioritize's.
185
+ const ideasOn = lens === 'discover' && !!V.ideas;
186
+ const subBar = lens === 'prioritize' ? el('div', { class: 'seg', role: 'group', 'aria-label': 'Prioritize view', 'data-lc-prio': '' },
187
+ button({ label: 'Ranking', variant: 'ghost', size: 'sm', attrs: { 'aria-pressed': String(!stratOn), 'data-lc-prio-view': 'rank' }, onClick: () => { V.strat = false; render(V); } }),
188
+ button({ label: 'Strategy', variant: 'ghost', size: 'sm', attrs: { 'aria-pressed': String(stratOn), 'data-lc-prio-view': 'strategy' }, onClick: () => { V.strat = true; render(V); } }))
189
+ : lens === 'discover' ? el('div', { class: 'seg', role: 'group', 'aria-label': 'Discover view', 'data-lc-disc': '' },
190
+ button({ label: 'Evidence', variant: 'ghost', size: 'sm', attrs: { 'aria-pressed': String(!ideasOn), 'data-lc-disc-view': 'evidence' }, onClick: () => { V.ideas = false; render(V); } }),
191
+ button({ label: 'Ideas', variant: 'ghost', size: 'sm', attrs: { 'aria-pressed': String(ideasOn), 'data-lc-disc-view': 'ideas' }, onClick: () => { V.ideas = true; render(V); } })) : null;
181
192
  const placed = STAGES.reduce((n, k) => n + buckets[k].length, 0);
182
- const PN = stratOn ? null : lensPanels(V, lens, scope); // the panels the mockup draws for this stage (c3-lifecycle-panels.js)
193
+ const PN = stratOn ? null : lensPanels(V, ideasOn ? 'ideate' : lens, scope); // the panels the mockup draws for this stage (c3-lifecycle-panels.js)
183
194
  const HD = PN && PN.head;
184
195
  const head = stratOn && ST ? el('div', { class: 'lh', 'data-lc-derived': '' }, el('span', { class: 'ki' }, c3ic('flag')), el('div', { style: 'min-width:0' }, el('b', null, ST.head.h), el('div', { class: 'dim' }, ST.head.s)), c3ring(ST.head.ring[0], ST.head.ring[1], 44, ST.head.ring[0] + '/' + ST.head.ring[1]))
185
196
  : HD ? el('div', { class: 'lh', 'data-lc-derived': '', 'data-lc-head': lens }, el('span', { class: 'ki' }, c3ic(HD.icon)), el('div', { style: 'min-width:0' }, el('b', null, HD.h), el('div', { class: 'dim' }, HD.s)), c3ring(HD.ring[0], Math.max(1, HD.ring[1]), 44, HD.ring[0] + '/' + HD.ring[1]))
@@ -221,7 +232,7 @@ function render(V) {
221
232
  const right = [
222
233
  ...(PN && PN.right.length ? [...PN.right, ...(lens === 'monitor' && ST && ST.signals ? [signalsCard(ST.signals.slice(0, 3))] : [])] : lens === 'monitor' && ST && ST.signals ? [signalsCard(ST.signals.slice(0, 3))] : [el('section', { class: 'card' }, el('h3', null, c3ic('info'), 'How the stage is derived'),
223
234
  el('ul', { class: 'chgl' },
224
- el('li', null, c3ic('check', 'sm'), el('span', null, 'Discover, Plan, Build and Evaluate read from the records.')),
235
+ el('li', null, c3ic('check', 'sm'), el('span', null, 'Triage, Discover, Plan, Build and Evaluate read from the records. Deliver and Evaluate are milestones.')),
225
236
  el('li', null, c3ic('clock', 'sm'), el('span', null, 'The other stages have no signal yet, so none is shown done or pending.')),
226
237
  el('li', null, c3ic('moon', 'sm'), el('span', null, 'A stage the lane skips reads skipped.'))))]),
227
238
  unplaced.length ? el('section', { class: 'card', 'data-lc-unplaced': '' }, el('h3', null, c3ic('alert'), 'No stage shown yet'),
@@ -230,7 +241,7 @@ function render(V) {
230
241
 
231
242
  V.root.replaceChildren(el('div', { class: 'calwrap' },
232
243
  el('div', { class: 'calbar' }, pills),
233
- el('div', { class: 'calbar', style: 'flex-wrap:wrap;gap:8px' }, seg),
244
+ el('div', { class: 'calbar' }, seg, subBar),
234
245
  el('div', { class: 'calbody' },
235
246
  head, V.ctx.links || null,
236
247
  V.notice ? el('div', { class: 'fold w', role: 'alert' }, c3ic('alert', 'sm'), V.notice) : null,
@@ -0,0 +1,69 @@
1
+ /* pm/phone-moment.js — which moment of the day the phone companion is in, and what it brings (initiative c3-phone-companion).
2
+ * Pure: it reads today's meetings and the PM's own open items (GET /api/brief-page) and a clock, and returns one moment. No DOM, no fetch.
3
+ * Moved here from pm/c3-phone-model.js (premium-agreed-design), so premium pages load no c3-* module; c3-phone-model.js re-exports it.
4
+ *
5
+ * momentOf({ today, needs, now }) → { kind, meeting?, next?, minutes?, fits?, later }
6
+ * kind 'meeting' a meeting is under way (start ≤ now < end) meeting = that one
7
+ * 'before' the next meeting starts within BEFORE_MIN minutes meeting = the next one, minutes = until it starts
8
+ * 'after' a meeting ended less than AFTER_MIN minutes ago, nothing under way meeting = the one that ended
9
+ * 'gap' a free stretch of GAP_MIN minutes or more before the next meeting minutes = free minutes, fits = items that fit
10
+ * 'morning' before noon with no meeting under way or near next = the next meeting, or null
11
+ * 'work' working hours after noon with no meeting near next = the next meeting, or null
12
+ * 'recap' from WRAP_HOUR on: the evening recap of the day next = null
13
+ * 'night' from NIGHT_HOUR on, or before EARLY_HOUR: tomorrow at a glance next = null
14
+ * later the meetings still to come after the one the moment is about (time order), for "I'll bring up later".
15
+ * part the part of the day the moment belongs to (PART_OF), drawn as one icon in the header:
16
+ * morning · work (gap, work) · meeting (before, meeting, after) · evening (recap) · night
17
+ * fitsIn(needs, minutes) the own items worth doing in a free stretch: overdue first (most late first), then due today; at most two.
18
+ * The meeting rows are the brief page's today[] rows: { id, title, start, end, people, initiative, prepared, before }. */
19
+
20
+ export const BEFORE_MIN = 30;
21
+ export const AFTER_MIN = 20;
22
+ export const GAP_MIN = 15;
23
+ export const WRAP_HOUR = 17;
24
+ export const NIGHT_HOUR = 20;
25
+ export const EARLY_HOUR = 5;
26
+ export const PART_OF = Object.freeze({ morning: 'morning', gap: 'work', work: 'work', before: 'meeting', meeting: 'meeting', after: 'meeting', recap: 'evening', night: 'night' });
27
+
28
+ const ms = (iso) => Date.parse(iso);
29
+ const ok = (m) => m && m.id && !Number.isNaN(ms(m.start)) && !Number.isNaN(ms(m.end || m.start));
30
+
31
+ export function fitsIn(needs, minutes) {
32
+ if (!(minutes >= GAP_MIN)) return [];
33
+ const own = (needs || []).filter((n) => n && (n.kind === 'overdue' || n.kind === 'due-today'));
34
+ own.sort((a, b) => (a.kind === b.kind ? (b.days_late || 0) - (a.days_late || 0) : a.kind === 'overdue' ? -1 : 1));
35
+ return own.slice(0, 2);
36
+ }
37
+
38
+ export function momentOf(args = {}) {
39
+ const mo = kindOf(args);
40
+ return { ...mo, part: PART_OF[mo.kind] };
41
+ }
42
+
43
+ function kindOf({ today, needs, now } = {}) {
44
+ const t = (now instanceof Date ? now : new Date(now || Date.now())).getTime();
45
+ const hour = new Date(t).getHours();
46
+ const rows = (today || []).filter(ok).slice().sort((a, b) => ms(a.start) - ms(b.start));
47
+ const end = (m) => ms(m.end || m.start);
48
+ const cur = rows.find((m) => ms(m.start) <= t && t < end(m));
49
+ const upcoming = rows.filter((m) => ms(m.start) > t);
50
+ const next = upcoming[0] || null;
51
+ const laterThan = (m) => upcoming.filter((x) => x !== m);
52
+ if (cur) return { kind: 'meeting', meeting: cur, minutes: Math.round((end(cur) - t) / 60000), later: upcoming };
53
+ const until = next ? Math.round((ms(next.start) - t) / 60000) : null;
54
+ if (next && until <= BEFORE_MIN) return { kind: 'before', meeting: next, minutes: until, later: laterThan(next) };
55
+ const ended = rows.filter((m) => end(m) <= t && t - end(m) < AFTER_MIN * 60000).pop();
56
+ if (ended) return { kind: 'after', meeting: ended, later: upcoming };
57
+ if (hour >= NIGHT_HOUR || hour < EARLY_HOUR) return { kind: 'night', next: null, later: upcoming };
58
+ if (hour >= WRAP_HOUR) return { kind: 'recap', next: null, later: upcoming };
59
+ if (next && until >= GAP_MIN && rows.some((m) => end(m) <= t)) return { kind: 'gap', next, minutes: until, fits: fitsIn(needs, until), later: upcoming };
60
+ if (hour < 12) return { kind: 'morning', next, later: upcoming };
61
+ return { kind: 'work', next, minutes: until, fits: fitsIn(needs, until === null ? 120 : until), later: upcoming };
62
+ }
63
+
64
+ /** "in 25 min", "in 1 h 5 min" */
65
+ export function inText(minutes) {
66
+ const m = Math.max(0, Math.round(minutes || 0));
67
+ if (m < 60) return 'in ' + m + ' min';
68
+ return 'in ' + Math.floor(m / 60) + ' h' + (m % 60 ? ' ' + (m % 60) + ' min' : '');
69
+ }
@@ -30,7 +30,7 @@ import { el } from './dom.js';
30
30
  import { button } from './primitives.js';
31
31
  import { pmGet, pmPost } from './http.js';
32
32
  import { renderCase } from './c3-case.js';
33
- import { parseMd, toDom } from './c3-md.js';
33
+ import { parseMd, toDom } from './cozy-md.js';
34
34
  import { makeXp, attachExpand } from './c3-expand.js';
35
35
  import { attachSwipe } from './c3-swipe.js';
36
36
  import { toast } from './c3-toast.js';
@@ -129,7 +129,11 @@ export function mountAttach({ getKey, input, note, onSlash, onPad }) {
129
129
  me.add = add;
130
130
  }
131
131
  /** A note already saved (Share with Claude): a chip like a saved file; × takes it off the message and keeps the note. */
132
+ let SINK = null;
133
+ /** A page with its own message box (Home, premium-agreed-design) takes saved files here instead of the dialog's chip row. */
134
+ export function setAttachSink(fn) { SINK = typeof fn === 'function' ? fn : null; }
132
135
  export function attachSaved(f) {
136
+ if (!A && SINK && f && f.saved) { SINK(f); return; }
133
137
  if (!A || !f || !f.saved) return;
134
138
  if (A.files.some((x) => x.saved === f.saved)) return;
135
139
  if (A.files.length >= MAX_FILES) { if (A.say) A.say('A message takes ' + MAX_FILES + ' files at most.'); return; }