create-pmos 0.827.0 → 0.829.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.
- package/package.json +217 -45
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/bin/pmos.js +19 -9
- package/workspace/board-deliveries-test.js +2 -2
- package/workspace/changelog.json +216 -12
- package/workspace/guide/cli.md +62 -0
- package/workspace/guide/home.md +1 -0
- package/workspace/guide/settings-and-switches.md +1 -0
- package/workspace/lib/board-cli.js +5 -1
- package/workspace/lib/board-premium.js +1 -0
- package/workspace/lib/critical-needs.js +162 -0
- package/workspace/lib/deps-cli.js +102 -0
- package/workspace/lib/engine/boards.js +13 -2
- package/workspace/lib/features.json +5 -0
- package/workspace/lib/five-action-cap.js +84 -0
- package/workspace/lib/needs-providers.js +1 -0
- package/workspace/lib/page-one-answer.js +86 -0
- package/workspace/lib/pages-cli.js +6 -2
- package/workspace/lib/people-cli.js +43 -2
- package/workspace/lib/pmos-verbs.js +15 -1
- package/workspace/lib/portfolio-cli.js +64 -0
- package/workspace/lib/portfolio.js +168 -0
- package/workspace/lib/prototype-cli.js +86 -0
- package/workspace/lib/report-cli.js +12 -2
- package/workspace/lib/report-readers.js +5 -3
- package/workspace/lib/review-pack.js +348 -0
- package/workspace/lib/review-reasons.js +357 -0
- package/workspace/lib/route-modules.js +6 -0
- package/workspace/lib/routes-boards.js +25 -2
- package/workspace/lib/routes-portfolio.js +50 -0
- package/workspace/lib/routes-review-pack.js +42 -0
- package/workspace/lib/routes-roadmap-ops.js +53 -1
- package/workspace/lib/routes-sim-users.js +66 -0
- package/workspace/lib/routes-stakeholders.js +42 -0
- package/workspace/lib/routes-strategy-card.js +29 -1
- package/workspace/lib/routes-team-waits.js +24 -0
- package/workspace/lib/routes-use-log.js +6 -1
- package/workspace/lib/sim-users.js +329 -0
- package/workspace/lib/stakeholder-map.js +232 -0
- package/workspace/lib/task-store.js +1 -1
- package/workspace/lib/team-waits.js +167 -0
- package/workspace/lib/tradeoff-cards.js +258 -0
- package/workspace/lib/tradeoff-cli.js +83 -0
- package/workspace/lib/voice-cli.js +7 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-vw-jira-test.js +6 -2
- package/workspace/public/pm/bd-backlog.js +44 -6
- package/workspace/public/pm/bd-principles.js +12 -1
- package/workspace/public/pm/cozy-library.css +5 -0
- package/workspace/public/pm/cozy-pick.css +1 -0
- package/workspace/public/pm/cozy-pop-work.js +8 -2
- package/workspace/public/pm/cozy-proto.css +5 -0
- package/workspace/public/pm/cozy-proto.js +11 -3
- package/workspace/public/pm/cozy-today-app.js +53 -3
- package/workspace/public/pm/cozy-today-view.js +12 -4
- package/workspace/public/pm/day-time.js +8 -0
- package/workspace/public/pm/five-action-cap.js +104 -0
- package/workspace/public/pm/home-ini.js +3 -2
- package/workspace/public/pm/ini-links.js +2 -1
- package/workspace/public/pm/ini-tasks.js +5 -2
- package/workspace/public/pm/ini-view-model.js +14 -6
- package/workspace/public/pm/ini-view.js +12 -2
- package/workspace/public/pm/library-model.js +1 -1
- package/workspace/public/pm/page-one-answer.css +18 -0
- package/workspace/public/pm/page-one-answer.js +134 -0
- package/workspace/public/pm/pop-work-model.js +8 -6
- package/workspace/public/pm/portfolio.js +67 -0
- package/workspace/public/pm/premium-board.js +19 -6
- package/workspace/public/pm/premium-library.js +27 -3
- package/workspace/public/pm/product-switcher.js +7 -1
- package/workspace/public/pm/range-pick.css +12 -0
- package/workspace/public/pm/range-pick.js +30 -6
- package/workspace/public/pm/review-pack.js +47 -0
- package/workspace/public/pm/review-reasons.js +75 -0
- package/workspace/public/pm/sim-users.js +34 -0
- package/workspace/public/pm/sort-order.js +3 -0
- package/workspace/public/pm/stakeholder-map.js +125 -0
- package/workspace/public/pm/task-card.js +10 -7
- package/workspace/public/pm/team-waits.js +56 -0
- package/workspace/public/pm/tradeoff-cards.css +27 -0
- package/workspace/public/pm/tradeoff-cards.js +183 -0
- package/workspace/public/premium-board.html +1 -0
- package/workspace/public/premium-portfolio.html +48 -0
- package/workspace/public/today.html +1 -0
- package/workspace/run-tests.js +9 -1
- package/workspace/server.js +1 -1
- package/workspace/stage-card-tasks-test.js +11 -5
- package/workspace/test-lists/critical-needs.json +9 -0
- package/workspace/test-lists/five-action-cap.json +9 -0
- package/workspace/test-lists/page-one-answer.json +9 -0
- package/workspace/test-lists/portfolio.json +9 -0
- package/workspace/test-lists/review-pack.json +9 -0
- package/workspace/test-lists/review-reasons.json +9 -0
- package/workspace/test-lists/sim-users.json +9 -0
- package/workspace/test-lists/stakeholder-map.json +9 -0
- package/workspace/test-lists/task-time-optional.json +9 -0
- package/workspace/test-lists/team-waits.json +9 -0
- package/workspace/test-lists/tradeoff-cards.json +9 -0
- package/workspace/test-timings.json +25 -0
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,217 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.829.0",
|
|
4
|
+
"at": "2026-11-25T13:25:22.949Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1948,
|
|
9
|
+
"t": "Work › Dependencies lists who waits on which team",
|
|
10
|
+
"s": "Work › Dependencies lists who waits on which team",
|
|
11
|
+
"k": "new",
|
|
12
|
+
"h": "Work › Dependencies lists who waits on which team",
|
|
13
|
+
"try": {
|
|
14
|
+
"steps": [
|
|
15
|
+
"Open Work",
|
|
16
|
+
"Press the Dependencies tab",
|
|
17
|
+
"On a row, press the person icon (Chase)"
|
|
18
|
+
],
|
|
19
|
+
"see": "Waiting on other teams: one row per wait, oldest first, each with the day it started; a wait of 14 days or more says how many days and shows the late mark; a wait in a sprint that is still running…",
|
|
20
|
+
"open": "/premium-board.html?work=deps"
|
|
21
|
+
},
|
|
22
|
+
"i": "team-waits"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"n": 2002,
|
|
26
|
+
"t": "A Today row when a critical-path task moves (A103)",
|
|
27
|
+
"s": "A Today row when a critical-path task moves (A103)",
|
|
28
|
+
"k": "new",
|
|
29
|
+
"h": "A Today row when a critical-path task moves (A103)",
|
|
30
|
+
"try": {
|
|
31
|
+
"steps": [
|
|
32
|
+
"Open Today: when a task on an initiative's critical path moved its start or due date in the last 7 days, a row names the task, the move…",
|
|
33
|
+
"Open Work, open that initiative and read its plan: the task the row named sits on the critical path.",
|
|
34
|
+
"Move the date of a task that is not on the critical path, then open Today again: no new row."
|
|
35
|
+
],
|
|
36
|
+
"see": "One row per critical-path move, for example: \"Design review\" moved its due from Dec 3 to Dec 6. It is on the critical path of Checkout revamp, so go-live forecasts Dec 12. No. Forecast Dec 12, 2…",
|
|
37
|
+
"open": "/today.html"
|
|
38
|
+
},
|
|
39
|
+
"i": "critical-moved"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"n": 1964,
|
|
43
|
+
"t": "Trade-off cards decide two close Roadmap neighbours and keep the reason (job #1918, A325)",
|
|
44
|
+
"s": "Trade-off cards decide two close Roadmap neighbours and keep the reason (job #1918, A325)",
|
|
45
|
+
"k": "new",
|
|
46
|
+
"h": "Trade-off cards decide two close Roadmap neighbours and keep the reason (job #1918, A325)",
|
|
47
|
+
"try": {
|
|
48
|
+
"steps": [
|
|
49
|
+
"Open Work and find the line These two are close. Compare them between two initiatives",
|
|
50
|
+
"Press it, read both sides and the ✦ line, write why in one line and press ✓"
|
|
51
|
+
],
|
|
52
|
+
"see": "The card shows the goal, evidence, cost, risk and what waits for each side, with not known where a record says nothing. After ✓ the reason shows once under the row that went first, and the toast has…",
|
|
53
|
+
"open": "/premium-board.html"
|
|
54
|
+
},
|
|
55
|
+
"i": "tradeoff-cards"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"n": 1965,
|
|
59
|
+
"t": "Simulated users try the prototype — Findings above the design (A20, #1909)",
|
|
60
|
+
"s": "Simulated users try the prototype — Findings above the design (A20, #1909)",
|
|
61
|
+
"k": "new",
|
|
62
|
+
"h": "Simulated users try the prototype",
|
|
63
|
+
"try": {
|
|
64
|
+
"steps": [
|
|
65
|
+
"Open Work and open an initiative that has a prototype",
|
|
66
|
+
"Press its prototype to open it in the Viewer",
|
|
67
|
+
"Read Findings above the design and press one finding"
|
|
68
|
+
],
|
|
69
|
+
"see": "Findings says how many simulated users (one per persona) got stuck on each key task and where, for example 2 of 4 personas stuck at Pay, with who they are; a task everyone finished is one line.…",
|
|
70
|
+
"open": "/premium-board.html"
|
|
71
|
+
},
|
|
72
|
+
"i": "sim-users"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"n": 1974,
|
|
76
|
+
"t": "Monthly product review pack in Library › Reports (job #1910, A343)",
|
|
77
|
+
"s": "Monthly product review pack in Library › Reports (job #1910, A343)",
|
|
78
|
+
"k": "new",
|
|
79
|
+
"h": "Monthly product review pack in Library › Reports (job #1910, A343)",
|
|
80
|
+
"try": {
|
|
81
|
+
"steps": [
|
|
82
|
+
"From Today, open Library in the rail and pick Reports in the Kind chip",
|
|
83
|
+
"Press this month's review pack: read Goals, Bets that failed, Next big decision and Asks, each line with its source",
|
|
84
|
+
"Open it with the arrow to edit it in the document view"
|
|
85
|
+
],
|
|
86
|
+
"see": "One pack for each product, drafted by PMOS in the last week of the month. Every line names the record it came from; a part with nothing to say is not shown. The pack changes only when you edit it.…",
|
|
87
|
+
"open": "/premium-library.html"
|
|
88
|
+
},
|
|
89
|
+
"i": "review-pack"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"n": 1962,
|
|
93
|
+
"t": "Every page opens with one answer (job #1889)",
|
|
94
|
+
"s": "Every page opens with one answer (job #1889)",
|
|
95
|
+
"k": "new",
|
|
96
|
+
"h": "Every page opens with one answer (job #1889)",
|
|
97
|
+
"try": {
|
|
98
|
+
"steps": [
|
|
99
|
+
"Open Today and read the first line: how many things need you, and how many are moving",
|
|
100
|
+
"Open Work and read the same line, then the Needs you rows under it",
|
|
101
|
+
"Open the fold under them and see the rest"
|
|
102
|
+
],
|
|
103
|
+
"see": "Each page opens with one sentence that counts what needs you, then the rest. Under it, only what needs you. The rest is folded until you open it. When nothing needs you the line says All moving and…",
|
|
104
|
+
"open": "/today.html"
|
|
105
|
+
},
|
|
106
|
+
"i": "page-one-answer"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"n": 1995,
|
|
110
|
+
"t": "An optional time on a task's start and due",
|
|
111
|
+
"s": "An optional time on a task's start and due",
|
|
112
|
+
"k": "new",
|
|
113
|
+
"i": "task-time-optional"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"n": 2007,
|
|
117
|
+
"t": "Portfolio's Not now draws the dismiss icon",
|
|
118
|
+
"s": "Portfolio's Not now draws the dismiss icon",
|
|
119
|
+
"k": "fix",
|
|
120
|
+
"i": "portfolio",
|
|
121
|
+
"try": {
|
|
122
|
+
"steps": [
|
|
123
|
+
"With two or more products, open Today or Work and press the Portfolio button at the end of the product tiles",
|
|
124
|
+
"Read one row per product: bets, odds, spend and outcome so far",
|
|
125
|
+
"Press a product's row to open it in Work"
|
|
126
|
+
],
|
|
127
|
+
"see": "One row per product with its open bets, the share of its checked outcomes that held, what its agent runs cost in 30 days and its latest outcome that held. At most one ✦ recommendation with its…",
|
|
128
|
+
"open": "/premium-portfolio.html"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"v": "0.828.0",
|
|
135
|
+
"at": "2026-11-25T12:42:22.052Z",
|
|
136
|
+
"f": 4,
|
|
137
|
+
"prs": [
|
|
138
|
+
{
|
|
139
|
+
"n": 1951,
|
|
140
|
+
"t": "Reviews grouped by reason — Customer voice on Work and pmos voice (job #1913, A427)",
|
|
141
|
+
"s": "Reviews grouped by reason — Customer voice on Work and pmos voice (job #1913, A427)",
|
|
142
|
+
"k": "new",
|
|
143
|
+
"i": "review-reasons",
|
|
144
|
+
"h": "Reviews grouped by reason — Customer voice on Work and pmos voice (job #1913, A427)",
|
|
145
|
+
"try": {
|
|
146
|
+
"steps": [
|
|
147
|
+
"Ask PMOS in the chat: add three reviews about checkout failing on old Android, score 1 of 5, reason Checkout fails on old Android",
|
|
148
|
+
"Open Work for that product and find Customer voice under the strategy",
|
|
149
|
+
"Press ✦ on the fastest-growing complaint, then Undo in the toast"
|
|
150
|
+
],
|
|
151
|
+
"see": "Customer voice lists each reason with its comments, how it moved in 30 days and the score in one line under the reasons. ✦ files the complaint as a triage item and the toast offers Undo, which takes…",
|
|
152
|
+
"open": "/premium-board.html"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"n": 1977,
|
|
157
|
+
"t": "Work and Today get the popup's five-action limit (job #1917, A529)",
|
|
158
|
+
"s": "Work and Today get the popup's five-action limit (job #1917, A529)",
|
|
159
|
+
"k": "new",
|
|
160
|
+
"i": "five-action-cap",
|
|
161
|
+
"h": "Work and Today get the popup's five-action limit (job #1917, A529)",
|
|
162
|
+
"try": {
|
|
163
|
+
"steps": [
|
|
164
|
+
"Open Today and point at a row in Today's log",
|
|
165
|
+
"See at most three buttons: Done, Put off a day and ⋯",
|
|
166
|
+
"Press ⋯ and find Set a date in the Change group"
|
|
167
|
+
],
|
|
168
|
+
"see": "Each Today row shows three buttons at most. ⋯ opens a short menu that starts with Change and holds every action the row does not show, so nothing is lost. Work's header keeps five actions and its ⋯.",
|
|
169
|
+
"open": "/today.html"
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"n": 1959,
|
|
174
|
+
"t": "The Portfolio puts every product side by side (job #1894, A56)",
|
|
175
|
+
"s": "The Portfolio puts every product side by side (job #1894, A56)",
|
|
176
|
+
"k": "new",
|
|
177
|
+
"i": "portfolio",
|
|
178
|
+
"h": "The Portfolio puts every product side by side (job #1894, A56)",
|
|
179
|
+
"try": {
|
|
180
|
+
"steps": [
|
|
181
|
+
"With two or more products, open Today or Work and press the Portfolio button at the end of the product tiles",
|
|
182
|
+
"Read one row per product: bets, odds, spend and outcome so far",
|
|
183
|
+
"Press a product's row to open it in Work"
|
|
184
|
+
],
|
|
185
|
+
"see": "One row per product with its open bets, the share of its checked outcomes that held, what its agent runs cost in 30 days and its latest outcome that held. At most one ✦ recommendation with its…",
|
|
186
|
+
"open": "/premium-portfolio.html"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"n": 1967,
|
|
191
|
+
"t": "Who decides, who must agree, who needs to know on each initiative (job #1896)",
|
|
192
|
+
"s": "Who decides, who must agree, who needs to know on each initiative (job #1896)",
|
|
193
|
+
"k": "new",
|
|
194
|
+
"i": "stakeholder-map",
|
|
195
|
+
"h": "Who decides, who must agree, who needs to know on each initiative (job #1896)",
|
|
196
|
+
"try": {
|
|
197
|
+
"steps": [
|
|
198
|
+
"Open Work and open an initiative that has people on it",
|
|
199
|
+
"Find the People block under the Overview: each name says decides, must agree or needs to know, and when they last heard from you",
|
|
200
|
+
"On a name over 3 weeks, press ✦ to read the draft update, copy it and send it yourself, then press I sent it"
|
|
201
|
+
],
|
|
202
|
+
"see": "One People block with the names PMOS found in Jira, meeting notes, mail and sign-offs, each a draft until you keep it. A name not updated in 3 weeks shows a warning and a ✦ draft update. PMOS sends…",
|
|
203
|
+
"open": "/premium-board.html"
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"n": 1887,
|
|
208
|
+
"t": "Day-run and stage-card-tasks hold under load, pmos uses the pinned port, Viewer phone floors wait for the pane",
|
|
209
|
+
"s": "Day-run and stage-card-tasks hold under load, pmos uses the pinned port, Viewer phone floors wait for the pane",
|
|
210
|
+
"k": "fix",
|
|
211
|
+
"i": "ci-main-unblock"
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
},
|
|
2
215
|
{
|
|
3
216
|
"v": "0.827.0",
|
|
4
217
|
"at": "2026-11-25T12:10:57.880Z",
|
|
@@ -9,6 +222,7 @@
|
|
|
9
222
|
"t": "Starter goals from your own product, under the fundamentals card (job #1916, A84)",
|
|
10
223
|
"s": "Starter goals from your own product, under the fundamentals card (job #1916, A84)",
|
|
11
224
|
"k": "new",
|
|
225
|
+
"i": "starter-goals",
|
|
12
226
|
"h": "Starter goals from your own product, under the fundamentals card (job #1916, A84)",
|
|
13
227
|
"try": {
|
|
14
228
|
"steps": [
|
|
@@ -18,24 +232,14 @@
|
|
|
18
232
|
],
|
|
19
233
|
"see": "Up to 3 drafts appear, each with 'from: <source>'. ✓ writes the goal to planning/okrs/okrs-starter.md and the row leaves the block; Undo puts the row back and takes the line out again. A product…",
|
|
20
234
|
"open": "/today.html"
|
|
21
|
-
}
|
|
22
|
-
"i": "starter-goals"
|
|
235
|
+
}
|
|
23
236
|
},
|
|
24
237
|
{
|
|
25
238
|
"n": 1984,
|
|
26
239
|
"t": "One warning when an initiative names risky code (A54)",
|
|
27
240
|
"s": "One warning when an initiative names risky code (A54)",
|
|
28
241
|
"k": "new",
|
|
29
|
-
"i": "arch-warns"
|
|
30
|
-
"try": {
|
|
31
|
-
"steps": [
|
|
32
|
-
"On Work, open an initiative of a product whose repository PMOS has read, whose record names a part the Code panel tints as risky",
|
|
33
|
-
"Read the ✦ line above the plan: it names the part and why it is risky",
|
|
34
|
-
"Press ✓ to add the test task, then Undo in the toast; press ✕ for Not now"
|
|
35
|
-
],
|
|
36
|
-
"see": "One ✦ line at most, naming the risky part and its reason in the code map's own words. ✓ adds the task 'Add tests for <part>' to the initiative and the toast's Undo removes it. ✕ hides the line for…",
|
|
37
|
-
"open": "/work.html"
|
|
38
|
-
}
|
|
242
|
+
"i": "arch-warns"
|
|
39
243
|
}
|
|
40
244
|
]
|
|
41
245
|
},
|
package/workspace/guide/cli.md
CHANGED
|
@@ -136,6 +136,8 @@ None of these briefs an agent or takes an item. Do that from the item's card on
|
|
|
136
136
|
- `pmos people record --file <sightings.json>` records the people a session saw. Agent sessions run it. It must name who recorded it: in a workspace session the session token does this; outside the workspace, add `--by <profile>`. A sighting already recorded is skipped and counted.
|
|
137
137
|
- `pmos people settings` prints `calendar names: on` or `calendar names: off`. The morning brief reads it before it records attendees.
|
|
138
138
|
- `pmos people help` prints the commands.
|
|
139
|
+
- `pmos people map <initiative>` lists who decides, who must agree and who needs to know on one initiative, and when each last heard from you. The names come from the record's `decider`, `owner` or `sponsor`, the initiative's sign-offs and objections, and the people whose Jira, meeting notes or mail name it. Each is a draft until you keep it. A name not updated in 3 weeks shows a ✦ draft update for you to send. Add `--json` for the rows. The People block of the initiative on Work shows the same map.
|
|
140
|
+
- `pmos people keep <initiative> <person> [--group decides|agree|know]` keeps a name on the map, in that group. `pmos people drop <initiative> <person>` takes it off for good. `pmos people told <initiative> <person>` records that you sent them an update today. `pmos people undo <initiative> <person>` takes back the last of these. PMOS never sends an update itself.
|
|
139
141
|
|
|
140
142
|
The sightings file holds `{ "sightings": [...], "merges": [...] }`. A sighting is `{ "source": "gather" | "calendar" | "live" | "jira" | "plan" | "notes", "handle": { "kind": "mail" | "slack" | "jira" | "confluence" | "speaker" | "name", "value": "…" }, "name": "…", "role"?, "org"?, "external"?: true, "interaction"?: { "date": "YYYY-MM-DD", "kind": "Mail", "text": "one line, at most 200 characters", "pointer": "where it came from, at most 200 characters", "tone"?: "warm", "initiative"?: "<id>" } }`. A merge is `{ "a": <handle>, "b": <handle>, "why": "one line" }`.
|
|
141
143
|
|
|
@@ -318,6 +320,17 @@ The idle lab run uses only the first three commands:
|
|
|
318
320
|
- `pmos lab critic checks [--root <dir>]`: the checks the critic uses for the product in that folder. No server is needed.
|
|
319
321
|
- `pmos lab critic label <run> <n> real|noise`: your word on finding `n` of a critic run. `pmos lab critic stats` counts the runs, the findings, and how many you called real or noise.
|
|
320
322
|
|
|
323
|
+
### pmos prototype: simulated users try the prototype
|
|
324
|
+
|
|
325
|
+
Before a prototype version shows in the Viewer, PMOS walks each key task of its flow once per persona: a simulated user for each. You see Findings above the design, not clicks: the screen where they got stuck, why, and how many, for example "2 of 4 personas stuck at "Pay": the Pay press cannot be reached with the keyboard". Press a finding to see that screen. A finding is a hint for your grilling. It never scores the prototype, never changes it and calls no model.
|
|
326
|
+
|
|
327
|
+
The walk checks each press that leads on to the next step: a keyboard user needs a button, link or field; a screen reader needs a name to hear; a new user needs words, not only a symbol, and a heading; a phone user needs a press of at least 44 px. Every persona gets stuck where a screen is missing or nothing leads on.
|
|
328
|
+
|
|
329
|
+
- `pmos prototype findings <initiative> [--ws <id>] [--json]`: the findings of the initiative's prototype now.
|
|
330
|
+
- `pmos prototype personas [--ws <id>]`: the personas that walk each prototype. With none recorded, four base personas walk: New user, Keyboard only, Screen reader and On a phone.
|
|
331
|
+
- `pmos prototype persona add --name "<who>" --needs <keyboard,reader,words,thumb> --from "<the record it comes from>" [--ws <id>]`: add one of your product's personas from your records. PMOS refuses a persona with no `--from`. Once one is recorded, only your personas walk.
|
|
332
|
+
- `pmos prototype persona remove <id> [--ws <id>]`: stop one walking. It prints the Undo, `pmos prototype persona restore <id>`.
|
|
333
|
+
|
|
321
334
|
### pmos away: away days and the handover note
|
|
322
335
|
|
|
323
336
|
- `pmos away set <YYYY-MM-DD> [--cover "<name>"]` sets you as away from today until that day. PMOS drafts a handover note as `planning/handovers/away-<from>.md` (kind Handover). The Library lists it once you commit it. PMOS runs no git command for it. The note has who covers, the open asks, and the dates that fall while you are away. It is a draft: read it, change it and share it yourself. PMOS sends nothing.
|
|
@@ -379,6 +392,17 @@ Write the press release before the build ("working backwards"). Run it in the pr
|
|
|
379
392
|
- The draft uses one agent run with no tools. `--no-ai`, `pmos ai off press-release` or `PMOS_AI=off` makes a draft from the record's own lines only. A failed run does the same and says why.
|
|
380
393
|
- `pmos press-release count [--days 7]` prints how many drafts were written in the last days. Its last line is the number.
|
|
381
394
|
|
|
395
|
+
### pmos tradeoff: decide two close items and keep the reason
|
|
396
|
+
|
|
397
|
+
Use it when two neighbours on the Roadmap score about the same. Run it in the product's repository, or pass `--root <dir>`, or ask the chat to "compare these two". Work shows the same cards: the line "These two are close. Compare them" between the two rows.
|
|
398
|
+
|
|
399
|
+
- `pmos tradeoff list` names each pair of Roadmap neighbours whose weighted sizes (`pmos` sized opportunities) are within 25 % of the larger one, and the reasons kept so far. A pair with a side that has no size is not compared. It writes nothing.
|
|
400
|
+
- `pmos tradeoff show <a> <b>` shows one card: for each side the goal it moves, the evidence, the cost, the risk and what waits if it goes first, read from the record (`parent_kr`, `evidence`, `cost` or `effort`, `risk`, `waits`). A missing one says "not known". ✦ suggests an order and one reason from the records. When the pair was decided before, the old reason comes first.
|
|
401
|
+
- `pmos tradeoff keep <a> <b> --first <id> --reason "<why>"` keeps the reason as a dated note beside the Roadmap's ledger (`tradeoffs.jsonl`). When the lower one goes first, PMOS also moves it directly above the other. The reason is one line, at most 200 characters. Work shows it once, under the row.
|
|
402
|
+
- `pmos tradeoff undo <note>` takes a reason back, and the rank it moved.
|
|
403
|
+
- `pmos tradeoff count [--days 14]` prints how many reasons were kept in the last days. Its last line is the number.
|
|
404
|
+
- The factor scores stay as they are. PMOS calls no model and sends nothing.
|
|
405
|
+
|
|
382
406
|
### pmos goals: starter goals from your own product
|
|
383
407
|
|
|
384
408
|
Right after setup, PMOS drafts up to three starter goals from the product's own files and shows them under the fundamentals card. `pmos goals` reads and changes the same drafts. Run it in the product's repository, or pass `--root <dir>`, or ask the chat.
|
|
@@ -400,6 +424,18 @@ Show where the team is short before you ask for headcount. Run it in the product
|
|
|
400
424
|
- PMOS never writes over a brief. It calls no model and sends nothing. Edit the brief and share it yourself.
|
|
401
425
|
- `pmos hire count [--days 7]` prints how many briefs were drafted in the last days. Its last line is the number.
|
|
402
426
|
|
|
427
|
+
### pmos voice: customer comments grouped by reason
|
|
428
|
+
|
|
429
|
+
Act on the reason behind a score, not on the score. Run it in the product's repository, or pass `--root <dir>`, or ask the chat to "import these reviews" or "group the survey comments". No running workspace is needed. Work shows the same reasons as Customer voice, under the strategy, on a Board that shows one product.
|
|
430
|
+
|
|
431
|
+
- `pmos voice import <file>` reads an export from a survey tool or an app store: a CSV with a header row, or a JSON list. The columns are `text`, `reason`, `score` (or `rating`), `scale` (5 for stars, 10 for an NPS survey), `source` (survey, review or other) and `at` (or `date`). A comment imported twice counts once.
|
|
432
|
+
- `pmos voice add --text "<comment>" [--reason "<reason>"] [--score 2] [--scale 5]` adds one comment.
|
|
433
|
+
- `pmos voice reason <comment id> "<reason>"` names the reason of a comment. A comment with no reason joins a reason it shares 2 words with; otherwise it stays unsorted, and `pmos voice list` shows its id.
|
|
434
|
+
- `pmos voice list [--json]` shows each reason of the last 90 days with its comments and how it moved in 30 days (up 3×, up, new, flat, down), most growth first, then the score line and the ✦.
|
|
435
|
+
- `pmos voice file "<reason>"` files a reason as a triage item, the same as ✦ on Work. `pmos voice undo <capture id>` takes it back, unless an initiative was already made from it.
|
|
436
|
+
- `pmos voice count` prints how many reasons had a comment in the last 30 days. Its last line is the number.
|
|
437
|
+
- PMOS calls no model and sends nothing. A reason is a complaint when most of its scored comments are low (3 or less of 5, 6 or less of 10).
|
|
438
|
+
|
|
403
439
|
### pmos why: why the work exists, in three lines
|
|
404
440
|
|
|
405
441
|
Anyone can run it, not only the PM: an engineer or a stakeholder who wants to know why an initiative or a task exists. Run it in the product's repository, or pass `--root <dir>`. It reads the records on disk, needs no running workspace and changes nothing.
|
|
@@ -531,6 +567,14 @@ An initiative on hold keeps why it is parked and what brings it back: a return d
|
|
|
531
567
|
- `pmos parked back <id>` brings it back to the Roadmap. To undo, park it again.
|
|
532
568
|
- `pmos parked coverage` shows how many parked initiatives say why and what brings them back, and the percent on the last line.
|
|
533
569
|
|
|
570
|
+
### pmos deps: what your work waits on outside the team
|
|
571
|
+
|
|
572
|
+
Work › Dependencies lists every wait on another team, oldest first, with the day it started. A wait comes from a Jira link, from the chat, from a parked initiative whose reason says "waiting on <team>", or from an initiative record with `waiting_on:` and `waiting_since:`. A wait of 14 days or more is late. A wait in a sprint that is still running names that sprint. Chase opens a draft in your own mail app; PMOS sends nothing.
|
|
573
|
+
|
|
574
|
+
- `pmos deps waits` lists the open waits, oldest first. `--json` gives the same rows the page reads.
|
|
575
|
+
- `pmos deps wait --team "<team>" --what "<what>" --ini <id> --since <YYYY-MM-DD>` adds a wait. `--who "<name>"` and `--email <address>` name the person Chase writes to. From a Jira link, pass `--key <KEY-1>`: one open wait per key. `--sprint "<name>" --sprint-end <YYYY-MM-DD>` names the sprint it holds up.
|
|
576
|
+
- `pmos deps done <wait id>` ends a wait. `pmos deps undo <wait id>` opens it again.
|
|
577
|
+
|
|
534
578
|
### pmos quiet: the weekly sweep of quiet work
|
|
535
579
|
|
|
536
580
|
Once a week Today shows how many initiatives had no change in 30 days or more. The chat answers the same list from a terminal.
|
|
@@ -619,6 +663,7 @@ A page that keeps breaking should get fixed before it gets a new feature. This c
|
|
|
619
663
|
- `pmos pages` (or `pmos pages show`): each page's fixes, reverts and restores in the last 14 days, and the share of fix commits among all page commits. A page at or over the limit (3) is marked ●. A page is its HTML file, its own sheets and the scripts it loads. A file that half the pages or more load is counted once, as shared code. It reads git only.
|
|
620
664
|
- `--json` gives the same numbers as JSON. `--count` prints only the number of pages over the limit.
|
|
621
665
|
- `pmos pages check --base <ref>`: when the change since `<ref>` has a `feat` commit and touches a page over the limit, it names that page. `--feature` treats the change as a feature without a `feat` commit. `--gate` exits 1 when it names a page.
|
|
666
|
+
- `pmos pages calls`: names each page (Today, Work, Board, an initiative) whose first view had more than one call to act. Each page opens with one sentence that counts what needs you, then the rest, and counts its calls to act once per open; the count is kept on this computer only. `--days N` sets the window (7 by default), `--json` gives the list and `--count` prints only the number of pages it names.
|
|
622
667
|
- The pages come from the `pages` globs in `design-drift.json`. A product sets `window_days` and `limit` in `page-health.json` in the same design-system folder, for example `{ "window_days": 14, "limit": 3 }`.
|
|
623
668
|
|
|
624
669
|
## Initiatives and Work
|
|
@@ -722,8 +767,11 @@ pmos board the Active filter
|
|
|
722
767
|
pmos board --mine your own items
|
|
723
768
|
pmos board --init <initiative> one initiative
|
|
724
769
|
pmos board --json the same answer as GET /api/board, for scripts
|
|
770
|
+
pmos board actions [--json] what Work and Today show, and what ⋯ holds
|
|
725
771
|
```
|
|
726
772
|
|
|
773
|
+
`pmos board actions` prints the five-action limit for each place: a page header shows five actions at most, and a row on Today shows three at most (two actions and ⋯). It names the actions shown, and the groups under ⋯, which start with Change. The shown actions are the ones you used most in the last 30 days, worked out at most once a week; before 30 days of use they are the defaults (Done and Put off a day on a Today row). It reads the local use log only.
|
|
774
|
+
|
|
727
775
|
The text form prints one column per block, then one line for each card: the initiative, the stage, the title and the owner, and what needs your notice. The command only reads. It writes no line to any ledger.
|
|
728
776
|
|
|
729
777
|
`pmos board` exits with 0 when it printed Work, 1 when the initiative is not on Work, and 2 when the command line is wrong.
|
|
@@ -746,6 +794,18 @@ pmos signal count [<checkout>]
|
|
|
746
794
|
|
|
747
795
|
`pmos signal` exits with 0 when it is done, 1 when it refused, and 2 when the command line is wrong.
|
|
748
796
|
|
|
797
|
+
### pmos portfolio
|
|
798
|
+
|
|
799
|
+
The Portfolio puts every product side by side, for a head of product. It is a page too: press the Portfolio button at the end of the product tiles on Today or Work. The page and the button show only when the workspace has two or more products.
|
|
800
|
+
|
|
801
|
+
- `pmos portfolio` prints one line per product: its open bets, its odds, its spend and its latest outcome that held. Then it prints PMOS's one recommendation, if there is one, with its reason. `--json` prints the rows.
|
|
802
|
+
- Bets are the product's work initiatives that are not stopped and whose outcome is not judged yet. Odds are the share of its judged outcome checks that held (validated of validated plus refuted). With fewer than 3 judged, the odds are not known and stay empty. Spend is what the product's agent runs cost in the last 30 days. Outcome is the evidence of its latest check that held.
|
|
803
|
+
- PMOS recommends one thing at most: the product with 2 or more outcome checks due needs help. When another product has more open bets and none due, PMOS says to move one person from it.
|
|
804
|
+
- `pmos portfolio keep <key>` keeps the recommendation: it stays hidden until its facts change. `pmos portfolio not-now <key>` hides it for 7 days. `pmos portfolio undo <key>` takes the last answer back. The page's Keep (✓) and Not now (✕) write the same store (`portfolio.jsonl` in the state folder).
|
|
805
|
+
- Reading the Portfolio changes no file of any product. A row on the page opens that product in Work.
|
|
806
|
+
|
|
807
|
+
`pmos portfolio` exits with 0 when it is done, 1 when it refused, and 2 when the command line is wrong.
|
|
808
|
+
|
|
749
809
|
### pmos program
|
|
750
810
|
|
|
751
811
|
`pmos program suggest` is the only write of the milestone review run. It files a suggestion for you to keep, change or drop.
|
|
@@ -1101,6 +1161,8 @@ pmos report issue biweekly 2026-10-16
|
|
|
1101
1161
|
|
|
1102
1162
|
`pmos report variants <cadence> [<slot>]` writes the draft again for three audiences: executives, engineers and customers. Each version sits beside the draft as `<slot>.for-<audience>.md`, says who it is for, and ends with the draft's sources. PMOS writes a version only when every number and name in it is in the draft. The newest draft is used when you give no slot. Add `--only executives,customers` to write some of them. A version of an unchanged draft is not written again. The draft does not change, and nothing is sent. `pmos ai off report-variants` stops it.
|
|
1103
1163
|
|
|
1164
|
+
`pmos report pack` drafts this month's review pack of the product: the goals with the state of their newest reading, the bets that failed in the last 30 days with what was learned, the next big decision and the asks. Every line names the record it came from. A line with no record is left out, and the command says how many. The pack is `<state>/reports/review-pack/<YYYY-MM>-01.md`, and it shows in Library under Reports. When you open Library in the last 7 days of the month, PMOS drafts the pack of each product that has none. To turn this off, set `PMOS_REVIEW_PACK=0`. A pack that exists is yours to edit: the command does not change it. To draft it again, add `--redraft`. Nothing is sent: to share the pack, press Share on it in Library, which issues it.
|
|
1165
|
+
|
|
1104
1166
|
`pmos report library` writes one page with every slide layout of the report library, filled with placeholder words. Open it in a browser to see the layouts a report can use. Add `--out <file>` to choose the file. `pmos report library --template <id>` draws one template with placeholder words.
|
|
1105
1167
|
|
|
1106
1168
|
Every command accepts `--root <dir>` to name the repository. `draft` and `list` also accept `--json`.
|
package/workspace/guide/home.md
CHANGED
|
@@ -132,6 +132,7 @@ Press an initiative's name in the list, or open `?ini=<id>`. The list stays as i
|
|
|
132
132
|
- **Change a task where it is.** In the List, press a task's name. The row opens in place: change the name (Enter saves), the status, and the dates. Only one row is open at a time. Esc closes it. The ⋯ after the dates has **Milestone** (or **Make it a plain task**), **Move to a stage**, **Open the task card** and **Delete task**. A milestone has one date: its due day. Each change shows **Undo**.
|
|
133
133
|
- In the List, a task's full name always shows: a long name wraps onto more lines. A short prefix such as "Bus shelter:" stays in the name, in grey. The dates show at the right. In a narrow panel or on a phone, the dates show under the name. On a computer, the Timeline's name column wraps a long name too, and its row grows; on a phone, each title stays on one line above its bar. On the Timeline, the blue Today line is your own day, from the clock of your device. Each bar starts on its start day and ends on its due day: a task that starts today starts at the Today line, and a bar, its grid line and its date at the top always meet on the same day. A task with no dates shows no date; open the row to set them.
|
|
134
134
|
- **Set the dates on one calendar.** Every date press of a task opens the same calendar: in the List, the Timeline, the task card and the work popup. Press the first day for the start and a second day for the due day, as you pick depart and return for a flight. The days between show as one band. A day before the start becomes the new start. Press **Start** or **Due** first to change only that end, or type a day such as "15 Oct" in it and press Enter. You can also type a day in words: "today", "tomorrow", "friday" (the next Friday after today), "+3d", "+2w", "in 2 weeks", "end of week" (Friday), "end of month" or "end of sprint". Before you press Enter, the field shows the day it read, such as "Reads as Friday 27 Nov 2026". "End of sprint" works where PMOS knows the task's sprint, as in the work popup; anywhere else the field says so and saves nothing. A milestone has one **Date**: one press sets it. **No date** clears the dates. Each press saves and shows **Undo**. The calendar opens with the focus on a day. The arrow keys move a day or a week, Home and End go to the start and end of the week, and Page Up and Page Down move a month. On a phone the calendar opens from the bottom of the screen.
|
|
135
|
+
- **Add a time if you need one.** A time is optional. Press the clock at the bottom right of the calendar, next to **No date**. **Start time** and **Due time** appear (a milestone has one **Time**). Type or pick a time, such as 09:30: it saves at once and shows **Undo**. The task's dates then show the time after the day, such as "Nov 28 17:00", and the next time you open the calendar the time row is already open. Clear a time field to remove that time. **No date** removes the days and their times. A task with no time looks and saves as before. A Jira ticket has no clock: Jira keeps its own fields.
|
|
135
136
|
- **Add a task to a stage.** Press **+** on an open stage. The field opens at the top of that stage, with one row of chips under it. **Stage** is the stage you pressed + on; press it to pick another stage of the workflow. **Task** can change to **Milestone**: the box becomes ◇ and **Date** takes one day. **Dates** and **Owner** are optional; with no owner, the task is yours. Enter adds the task and keeps the field open for the next one. Esc closes the field.
|
|
136
137
|
- **Move a task between stages.** On a computer, drag the grip at the left of a row. On a phone, press and hold the task's name, then drag. Drop it on a stage name to put it last in that stage, or between two rows to put it there. The status and the dates do not change. The message shows **Undo**.
|
|
137
138
|
- A linked Jira ticket opens in place too. Its name and status stay Jira's ("In Progress in Jira · read 4 min ago"). Its dates can change, and it can be a milestone. It has no **Delete**.
|
|
@@ -150,6 +150,7 @@ An "off" switch accepts `off`, `0`, `false` or `no` unless the row says a differ
|
|
|
150
150
|
| `PMOS_MS_REVIEW` | `off` stops the weekly milestone review of a [program](programs.md). | on | — |
|
|
151
151
|
| `PMOS_SCAN` | `off` stops the [horizon scan](intelligence-okr-goals.md). | on | — |
|
|
152
152
|
| `PMOS_REPORT_FIND` | `off` stops the report finder. | on | — |
|
|
153
|
+
| `PMOS_REVIEW_PACK` | `0` stops Library from drafting the month's review pack when it opens in the last 7 days of the month; `1` turns it on for a server with its own `PMOS_STATE_DIR`. | on (off with `PMOS_STATE_DIR` set) | `pmos report pack` drafts it by hand |
|
|
153
154
|
| `PMOS_CORE_DOCS` | `off` stops the scheduled [core document](programs.md) drafts. | on | — |
|
|
154
155
|
| `PMOS_FOCUS_AGENT` | `off` stops the meeting focus run during a recording. | on | — |
|
|
155
156
|
| `PMOS_FORECAST` | `off` stops the hourly forecast read. | on | — |
|
|
@@ -25,6 +25,7 @@ const USAGE = [
|
|
|
25
25
|
' pmos board --mine your own items',
|
|
26
26
|
' pmos board --init <initiative> one initiative',
|
|
27
27
|
' pmos board --json the answer of GET /api/board, for scripts',
|
|
28
|
+
' pmos board actions [--json] what Work and Today show (five in a header, three on a row) and what ⋯ holds',
|
|
28
29
|
'Done shows the last 14 days. Tasks and breakdown items both show; `pmos task list <initiative>` lists one initiative\'s tasks with their dates.',
|
|
29
30
|
];
|
|
30
31
|
const BOOL = new Set(['json', 'mine', 'help']);
|
|
@@ -93,8 +94,11 @@ function addTasks(out, root, now) {
|
|
|
93
94
|
out.counts = { todo: out.board.todo.length, doing: out.board.doing.length, review: out.board.review.length, done: out.board.done.length, doneOlder: out.board.doneOlder };
|
|
94
95
|
}
|
|
95
96
|
|
|
96
|
-
async function run(argv,
|
|
97
|
+
async function run(argv, io = {}) {
|
|
98
|
+
const { say = (s) => console.log(s), cwd = process.cwd(), now } = io;
|
|
97
99
|
const args = argv[0] === 'board' ? argv.slice(1) : argv.slice();
|
|
100
|
+
// five-action-cap (A529): what Work and Today show, and what ⋯ holds (lib/five-action-cap.js reads the local use log)
|
|
101
|
+
if (args[0] === 'actions') return require('./five-action-cap.js').run(args, { out: say, err: say, ...(io.dir !== undefined ? { dir: io.dir } : {}), ...(now ? { now } : {}) });
|
|
98
102
|
const { pos, flags } = parse(args);
|
|
99
103
|
if (flags.help) { for (const l of USAGE) say(l); return 0; }
|
|
100
104
|
for (const k of Object.keys(flags)) {
|
|
@@ -366,6 +366,7 @@ function build(f) {
|
|
|
366
366
|
taskBy.get(w.ini).push({ uid: w.uid, title: clip(w.title || '', 160), status: w.status || 'To do', owner: w.owner || '', start: w.start || '', end: w.end || '', ...(w.from ? { from: { stage: w.from.stage, finish: w.from.finish } } : {}),
|
|
367
367
|
// one view (feedback batch 6 item 1): its place in the breakdown, and a breakdown item's own stage and order
|
|
368
368
|
...(typeof w.section === 'string' ? { section: w.section } : {}), ...(w.itemStage ? { itemStage: w.itemStage } : {}), ...(Number.isFinite(w.order) ? { order: w.order } : {}), ...(Number.isFinite(w.rank) ? { rank: w.rank } : {}), ...(w.store === 'item' ? { item: true } : {}), ...(w.milestone ? { milestone: true } : {}), ...(w.since ? { since: w.since } : {}), ...(w.priority ? { priority: w.priority } : {}),
|
|
369
|
+
...(w.start_time ? { start_time: w.start_time } : {}), ...(w.due_time ? { due_time: w.due_time } : {}), // the optional times (task-time-optional)
|
|
369
370
|
// a subtask's parent (initiative work-subtasks), and the Jira ticket the task names as read: its key, link, epic, assignee and sub-tasks
|
|
370
371
|
...(w.parent ? { parent: w.parent } : {}), ...(w.tracker && w.tracker.key ? { jira: jiraOf(w.tracker) } : {}) });
|
|
371
372
|
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* critical-needs.js — a Today row when a task on an initiative's critical path moves (initiative critical-moved, bet A103;
|
|
3
|
+
* done test planning/done-tests/critical-moved.md).
|
|
4
|
+
*
|
|
5
|
+
* movesOf(lines, { today, days }) → Map uid → { field, from, to, at } each task's latest start or due move in the window
|
|
6
|
+
* rowsOf(ws, { today, snapshot, lines, days }) → rows the needs rows, pure (the tests call it)
|
|
7
|
+
* needs provider: kinds ['critical-move'] · rowsFor(w, { lead }) · sig(w)
|
|
8
|
+
* count(root, { days, today }) → number the health number: rows raised in the window
|
|
9
|
+
*
|
|
10
|
+
* THE RULE. kind-control.js works out each initiative's critical path: the tasks that hold go-live tight through their links. When one of
|
|
11
|
+
* those tasks moved its start or its due date in the last `days` days (7), the PM gets ONE row for it, naming the task, the old and the new
|
|
12
|
+
* date, the initiative and what go-live now forecasts. A move off the critical path says nothing. A task's first dates are not a move.
|
|
13
|
+
* An initiative with no links into go-live has no critical path, so it says nothing either.
|
|
14
|
+
*
|
|
15
|
+
* WHERE THE DATES COME FROM. The tasks and links come from lib/rehearse-read.js snapshotOf (the readers the pmos verbs use). The moves come
|
|
16
|
+
* from the three task ledgers lib/routes-kind-control.js reads for the baseline: the task store, the plan-items ledger and the Board's task
|
|
17
|
+
* lines. A line names a task (`task` or `item`) and a `start` or `due`, at the top or under `fields`. Never a typed status.
|
|
18
|
+
*/
|
|
19
|
+
const fs = require('fs');
|
|
20
|
+
const path = require('path');
|
|
21
|
+
const KC = require('./kind-control.js');
|
|
22
|
+
const TL = require('./task-links.js');
|
|
23
|
+
|
|
24
|
+
const NAME = 'critical-needs';
|
|
25
|
+
const KIND = 'critical-move';
|
|
26
|
+
const TAG = '[critical-moved]';
|
|
27
|
+
const DAYS = 7;
|
|
28
|
+
const clip = (s, n) => String(s == null ? '' : s).replace(/\s+/g, ' ').trim().slice(0, n);
|
|
29
|
+
const todayOf = (now = Date.now()) => new Date(now).toISOString().slice(0, 10);
|
|
30
|
+
const WORD = { start: 'start', due: 'due' };
|
|
31
|
+
|
|
32
|
+
function readJsonl(file) {
|
|
33
|
+
let text = '';
|
|
34
|
+
try { text = fs.readFileSync(file, 'utf8'); } catch { return []; }
|
|
35
|
+
const out = [];
|
|
36
|
+
for (const raw of text.split('\n')) { if (!raw.trim()) continue; try { out.push(JSON.parse(raw)); } catch { /* a torn line */ } }
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Each task's latest start or due move whose line is dated in the last `days` days. A line that sets a field for the first time is not a
|
|
41
|
+
* move; a line that repeats the same value is not a move. Lines are read oldest first. */
|
|
42
|
+
function movesOf(lines, { today = todayOf(), days = DAYS } = {}) {
|
|
43
|
+
const since = TL.dn(today) - days;
|
|
44
|
+
const last = new Map(), moves = new Map();
|
|
45
|
+
const sorted = (lines || []).filter((e) => e && typeof e === 'object').slice().sort((a, b) => String(a.at || '').localeCompare(String(b.at || '')));
|
|
46
|
+
for (const e of sorted) {
|
|
47
|
+
const id = typeof e.task === 'string' ? e.task : typeof e.item === 'string' ? e.item : null;
|
|
48
|
+
if (!id) continue;
|
|
49
|
+
const f = e.fields && typeof e.fields === 'object' ? e.fields : e;
|
|
50
|
+
const was = last.get(id) || {};
|
|
51
|
+
const now = { ...was };
|
|
52
|
+
for (const k of ['start', 'due']) {
|
|
53
|
+
const v = typeof f[k] === 'string' && TL.dn(f[k]) != null ? f[k].slice(0, 10) : undefined;
|
|
54
|
+
if (v === undefined) continue;
|
|
55
|
+
if (was[k] && was[k] !== v) {
|
|
56
|
+
const at = String(e.at || '');
|
|
57
|
+
const d = TL.dn(at.slice(0, 10));
|
|
58
|
+
if (d != null && d >= since && d <= TL.dn(today)) moves.set(id, { field: k, from: was[k], to: v, at });
|
|
59
|
+
}
|
|
60
|
+
now[k] = v;
|
|
61
|
+
}
|
|
62
|
+
last.set(id, now);
|
|
63
|
+
}
|
|
64
|
+
return moves;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** The needs rows for one workspace, from a snapshot (rehearse-read.js shape) and the task ledger lines. Pure. */
|
|
68
|
+
function rowsOf(ws, { today = todayOf(), snapshot, lines, days = DAYS } = {}) {
|
|
69
|
+
const snap = snapshot || {};
|
|
70
|
+
const moves = movesOf(lines, { today, days });
|
|
71
|
+
if (!moves.size) return [];
|
|
72
|
+
const out = [];
|
|
73
|
+
for (const row of snap.rows || []) {
|
|
74
|
+
if (!row || !row.id) continue;
|
|
75
|
+
const tasks = (snap.tasks || []).filter((x) => x && x.ini === row.id);
|
|
76
|
+
if (!tasks.some((x) => moves.has(x.uid || x.key))) continue;
|
|
77
|
+
const goal = (snap.goals || []).find((g) => (g.moves || []).includes(row.id)) || null;
|
|
78
|
+
const m = KC.project({ today, title: row.title || row.id, goal: goal ? { id: goal.id, title: goal.title, byAt: goal.byAt } : null, end: row.end || null,
|
|
79
|
+
record: {}, tasks, links: snap.links || [] });
|
|
80
|
+
for (const r of m.rows) {
|
|
81
|
+
if (!r.critical) continue;
|
|
82
|
+
const mv = moves.get(r.uid);
|
|
83
|
+
if (!mv) continue;
|
|
84
|
+
const title = clip(row.title || row.id, 80);
|
|
85
|
+
const goLive = m.goLive && m.goLive.due ? TL.md(TL.dn(m.goLive.due)) : '';
|
|
86
|
+
const effect = goLive ? `, so go-live forecasts ${goLive}` : '';
|
|
87
|
+
const track = m.ontrack && (m.ontrack.answer === 'yes' || m.ontrack.answer === 'no') ? ' ' + m.ontrack.words : '';
|
|
88
|
+
const cause = `"${clip(r.title, 80)}" moved its ${WORD[mv.field]} from ${TL.md(TL.dn(mv.from))} to ${TL.md(TL.dn(mv.to))}. It is on the critical path of ${title}${effect}.${track}`;
|
|
89
|
+
out.push({
|
|
90
|
+
run_id: `${NAME}:${ws}:${row.id}:${r.uid}:${mv.at}`, kind: KIND, initiative_id: row.id, question: cause, doc: null, ws,
|
|
91
|
+
today: { kind: 7, source: NAME, cause, evidence: `Task dates and links · moved ${mv.at.slice(0, 10)} · critical path ${m.critical.length} tasks`, act: { label: 'Open' } },
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return out;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** The task ledger lines of a repository (the three routes-kind-control.js reads for the baseline). */
|
|
99
|
+
function linesOf(root, stateDir) {
|
|
100
|
+
const lines = [];
|
|
101
|
+
try { const s = require('./task-store.js').storeFor(root); if (s) lines.push(...readJsonl(s.file)); } catch { /* none */ }
|
|
102
|
+
try { lines.push(...readJsonl(require('./plan-ledgers.js').ledgerPath(root, 'plan-items'))); } catch { /* none */ }
|
|
103
|
+
if (stateDir) {
|
|
104
|
+
try { const f = require('./routes-boards.js').ledgerFile({ stateDirFor: () => stateDir }, { root }); if (f) lines.push(...readJsonl(f).filter((e) => e && (e.kind === 'task' || e.kind === 'task-update'))); } catch { /* none */ }
|
|
105
|
+
}
|
|
106
|
+
return lines;
|
|
107
|
+
}
|
|
108
|
+
function stateDirOf(root) { try { return require('./driver.js').stateDirOf(root) || null; } catch { return null; } }
|
|
109
|
+
|
|
110
|
+
function read(root, { today = todayOf(), days = DAYS } = {}) {
|
|
111
|
+
const stateDir = stateDirOf(root);
|
|
112
|
+
const lines = linesOf(root, stateDir);
|
|
113
|
+
if (!movesOf(lines, { today, days }).size) return { lines, snapshot: null }; // no move in the window: the snapshot is not read
|
|
114
|
+
let snapshot;
|
|
115
|
+
try { snapshot = require('./rehearse-read.js').snapshotOf(root, { today, stateDir: stateDir || undefined }); } catch { snapshot = null; }
|
|
116
|
+
return { lines, snapshot };
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* ── the needs provider (lib/needs-providers.js) ─────────────────────────────────────────────────────────────────── */
|
|
120
|
+
const said = new Set(); // a row's id, logged once per process
|
|
121
|
+
function rowsFor(w, { lead } = {}) {
|
|
122
|
+
if (!lead || !w || !w.root) return [];
|
|
123
|
+
const today = todayOf();
|
|
124
|
+
const { lines, snapshot } = read(w.root, { today });
|
|
125
|
+
if (!snapshot) return [];
|
|
126
|
+
const rows = rowsOf(w.id, { today, snapshot, lines });
|
|
127
|
+
for (const r of rows) { if (said.has(r.run_id)) continue; said.add(r.run_id); console.info(`${TAG} ${r.initiative_id}: ${r.question}`); }
|
|
128
|
+
return rows;
|
|
129
|
+
}
|
|
130
|
+
// the date is in the signature: a move leaves the 7-day window at midnight with no change to a ledger
|
|
131
|
+
function sig(w) {
|
|
132
|
+
if (!w || !w.root) return '';
|
|
133
|
+
const files = [];
|
|
134
|
+
try { const s = require('./task-store.js').storeFor(w.root); if (s) files.push(s.file); } catch { /* none */ }
|
|
135
|
+
try { files.push(require('./plan-ledgers.js').ledgerPath(w.root, 'plan-items')); } catch { /* none */ }
|
|
136
|
+
const d = stateDirOf(w.root);
|
|
137
|
+
if (d) { files.push(path.join(d, 'boards.jsonl')); files.push(TL.ledgerFile(d)); }
|
|
138
|
+
return files.map((f) => { try { const st = fs.statSync(f); return st.size + ':' + st.mtimeMs; } catch { return '-'; } }).join('|') + '@' + todayOf();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** The health number: the rows the provider raises for `root` in the window. */
|
|
142
|
+
function count(root, { days = DAYS, today = todayOf() } = {}) {
|
|
143
|
+
const { lines, snapshot } = read(root, { today, days });
|
|
144
|
+
return snapshot ? rowsOf('count', { today, snapshot, lines, days }).length : 0;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** `node lib/critical-needs.js count <root> [--days N]`: the health number on the last line. → exit code */
|
|
148
|
+
function cli(argv, log = console.log) {
|
|
149
|
+
const [cmd, rootArg, ...rest] = argv;
|
|
150
|
+
if (cmd !== 'count') { log('usage: node lib/critical-needs.js count <root> [--days N]'); return 2; }
|
|
151
|
+
const root = path.resolve(rootArg || '.');
|
|
152
|
+
const i = rest.indexOf('--days');
|
|
153
|
+
const days = i >= 0 ? Math.max(1, parseInt(rest[i + 1], 10) || DAYS) : DAYS;
|
|
154
|
+
const n = count(root, { days });
|
|
155
|
+
log(`${TAG} ${n} critical-path date moves raised a Today row in the last ${days} days`);
|
|
156
|
+
log(String(n));
|
|
157
|
+
return 0;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
module.exports = { kinds: [KIND], rowsFor, sig, NAME, KIND, TAG, DAYS, movesOf, rowsOf, linesOf, count, cli };
|
|
161
|
+
|
|
162
|
+
if (require.main === module) process.exitCode = cli(process.argv.slice(2));
|