create-pmos 0.836.0 → 0.838.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 +124 -47
- 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/changelog.json +123 -2
- package/workspace/guide/cli.md +29 -0
- package/workspace/guide/home.md +1 -0
- package/workspace/guide/initiatives-and-next-steps.md +8 -0
- package/workspace/guide/layout.md +5 -1
- package/workspace/lib/built-vs-design-http.js +81 -0
- package/workspace/lib/built-vs-design.js +454 -0
- package/workspace/lib/deps-cli.js +47 -2
- package/workspace/lib/features.json +2 -0
- package/workspace/lib/hire-draft.js +4 -3
- package/workspace/lib/initiative-rows.js +3 -0
- package/workspace/lib/meeting-stance.js +199 -0
- package/workspace/lib/needs-providers.js +1 -0
- package/workspace/lib/people-cli.js +44 -1
- package/workspace/lib/pmos-verbs.js +7 -1
- package/workspace/lib/prefs-sync.js +1 -0
- package/workspace/lib/review-cli.js +6 -0
- package/workspace/lib/route-modules.js +3 -0
- package/workspace/lib/routes-meeting-stance.js +43 -0
- package/workspace/lib/routes-pop-work.js +4 -1
- package/workspace/lib/routes-segments.js +47 -0
- package/workspace/lib/routes-surface-moments.js +36 -0
- package/workspace/lib/routes-team-waits.js +39 -2
- package/workspace/lib/segments-cli.js +102 -0
- package/workspace/lib/segments.js +214 -0
- package/workspace/lib/surface-moments.js +185 -0
- package/workspace/lib/team-slips.js +160 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/ask-here-ctx.js +20 -2
- package/workspace/public/pm/ask-here.css +6 -1
- package/workspace/public/pm/ask-here.js +38 -25
- package/workspace/public/pm/bd-backlog.js +34 -5
- package/workspace/public/pm/built-vs-design.css +16 -0
- package/workspace/public/pm/built-vs-design.js +95 -0
- package/workspace/public/pm/cozy-board.css +11 -0
- package/workspace/public/pm/cozy-events-view.js +1 -1
- package/workspace/public/pm/cozy-home.css +10 -0
- package/workspace/public/pm/cozy-pop-work.js +11 -6
- package/workspace/public/pm/cozy-today-app.js +42 -1
- package/workspace/public/pm/cozy-today-model.js +70 -3
- package/workspace/public/pm/cozy-today-view.js +10 -1
- package/workspace/public/pm/goals-ds.js +3 -2
- package/workspace/public/pm/home-chat.js +19 -3
- package/workspace/public/pm/ini-tasks.js +2 -2
- package/workspace/public/pm/meeting-stance.js +113 -0
- package/workspace/public/pm/page-chat.js +2 -1
- package/workspace/public/pm/premium-board.js +2 -0
- package/workspace/public/pm/segments.js +113 -0
- package/workspace/public/pm/team-slips.js +48 -0
- package/workspace/public/premium-board.html +2 -0
- package/workspace/test-lists/built-vs-design.json +9 -0
- package/workspace/test-lists/meeting-stance.json +9 -0
- package/workspace/test-lists/segments.json +9 -0
- package/workspace/test-lists/surface-moments.json +9 -0
- package/workspace/test-lists/team-slips.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.838.0",
|
|
4
4
|
"description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -33,6 +33,127 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.838.0",
|
|
38
|
+
"at": "2026-11-25T16:26:34.847Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 2042,
|
|
43
|
+
"t": "Five features show by themselves in Your move (job #1985, LINE.md Rule 12)",
|
|
44
|
+
"s": "Five features show by themselves in Your move (job #1985, LINE.md Rule 12)",
|
|
45
|
+
"k": "new",
|
|
46
|
+
"i": "surface-moments",
|
|
47
|
+
"try": {
|
|
48
|
+
"steps": [
|
|
49
|
+
"Open Today and read Your move: when your data says it is time, a ✦ row shows by itself (a free gap: what fits it; leave on your calendar…",
|
|
50
|
+
"Press ✓ on the row, then Undo in the toast",
|
|
51
|
+
"Press Put off a day on another row"
|
|
52
|
+
],
|
|
53
|
+
"see": "Each moment shows only when its condition is true, with one ✓ and Put off a day; ✓ does the one step (drafts a file, sets you away, pauses one run kind) with Undo. With nothing true, Your move shows…",
|
|
54
|
+
"open": "/today.html"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"n": 2006,
|
|
59
|
+
"t": "Before the meeting, who agrees (job #1897, A333)",
|
|
60
|
+
"s": "Before the meeting, who agrees (job #1897, A333)",
|
|
61
|
+
"k": "new",
|
|
62
|
+
"h": "Before the meeting, who agrees (job #1897, A333)",
|
|
63
|
+
"try": {
|
|
64
|
+
"steps": [
|
|
65
|
+
"Open Work and open an initiative with a decision someone argued against",
|
|
66
|
+
"Under People, read the two questions PMOS drafted, press Copy and send them yourself, then press I sent them",
|
|
67
|
+
"Press each cell to record the answer you got, and read the ✦ line"
|
|
68
|
+
],
|
|
69
|
+
"see": "Two short questions for the contested decision, sent by you, never by PMOS. Then a grid of yes and no per person with the odd answers marked, and one ✦ line naming the point the meeting must settle",
|
|
70
|
+
"open": "/premium-board.html"
|
|
71
|
+
},
|
|
72
|
+
"i": "meeting-stance"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"n": 1960,
|
|
76
|
+
"t": "Segments on Work, each user group with the roadmap items that serve it (job #1893)",
|
|
77
|
+
"s": "Segments on Work, each user group with the roadmap items that serve it (job #1893)",
|
|
78
|
+
"k": "new",
|
|
79
|
+
"h": "Segments on Work, each user group with the roadmap items that serve it (job #1893)",
|
|
80
|
+
"try": {
|
|
81
|
+
"steps": [
|
|
82
|
+
"Open Work and pick one product with 3 or more live initiatives",
|
|
83
|
+
"Read the ✦ line in Segments under the strategy and press its draft button",
|
|
84
|
+
"Send the ask it puts in the chat"
|
|
85
|
+
],
|
|
86
|
+
"see": "Before any group, one ✦ line in Segments offers to draft groups, and its button fills the chat (LINE.md rule 12: it shows by itself). After the draft, under the strategy, a Segments table: each…",
|
|
87
|
+
"open": "/premium-board.html"
|
|
88
|
+
},
|
|
89
|
+
"i": "segments"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"n": 2045,
|
|
93
|
+
"t": "Declared domain anchors resolve, so pmos initiative anchors lists them",
|
|
94
|
+
"s": "Declared domain anchors resolve, so pmos initiative anchors lists them",
|
|
95
|
+
"k": "fix",
|
|
96
|
+
"i": "anchor-ids",
|
|
97
|
+
"try": {
|
|
98
|
+
"steps": [
|
|
99
|
+
"Open Work and note how many initiatives sit under one key result.",
|
|
100
|
+
"Open the chat (Ask PMOS): on a desk, the menu button at the bottom left, then the speech bubble. Ask it which anchor ids you can pick.",
|
|
101
|
+
"Ask it which anchors have text after the id (a dry run that changes nothing)."
|
|
102
|
+
],
|
|
103
|
+
"see": "Work shows the same counts per key result. The chat lists only ids the OKR files and health budgets declare. The dry run names each record, its id and the note that would move to anchor_note, and…",
|
|
104
|
+
"open": "/work.html"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"v": "0.837.0",
|
|
111
|
+
"at": "2026-11-25T16:11:10.474Z",
|
|
112
|
+
"f": 4,
|
|
113
|
+
"prs": [
|
|
114
|
+
{
|
|
115
|
+
"n": 2010,
|
|
116
|
+
"t": "Other teams' slips before they hit you (job #1912, A15)",
|
|
117
|
+
"s": "Other teams' slips before they hit you (job #1912, A15)",
|
|
118
|
+
"k": "new",
|
|
119
|
+
"i": "team-slips",
|
|
120
|
+
"h": "Other teams' slips before they hit you (job #1912, A15)",
|
|
121
|
+
"try": {
|
|
122
|
+
"steps": [
|
|
123
|
+
"Open Work",
|
|
124
|
+
"Press the Dependencies tab",
|
|
125
|
+
"In Upstream, press ✦ on a slip"
|
|
126
|
+
],
|
|
127
|
+
"see": "Upstream appears above Waiting on other teams only when a team your work waits on will likely slip: one row per slip with their likely new date and what of yours it hits, and 'Watching n boards your…",
|
|
128
|
+
"open": "/premium-board.html?work=deps"
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"n": 2004,
|
|
133
|
+
"t": "Ask card — done-test asserts, Wawan's feedback (hide ✦, smaller text, chat text size, drag)",
|
|
134
|
+
"s": "Ask card — done-test asserts, Wawan's feedback (hide ✦, smaller text, chat text size, drag)",
|
|
135
|
+
"k": "fix",
|
|
136
|
+
"i": "ask-anywhere"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"n": 1956,
|
|
140
|
+
"t": "The built screen beside its design, each difference circled (job #1903, A380)",
|
|
141
|
+
"s": "The built screen beside its design, each difference circled (job #1903, A380)",
|
|
142
|
+
"k": "new",
|
|
143
|
+
"i": "built-vs-design",
|
|
144
|
+
"h": "The built screen beside its design, each difference circled (job #1903, A380)",
|
|
145
|
+
"try": {
|
|
146
|
+
"steps": [
|
|
147
|
+
"Open Work and open an initiative whose product repository has a design and a screenshot of one screen in screens/<initiative id>/…",
|
|
148
|
+
"Read its Review block: PMOS compared them by itself, the design and the built screen side by side, each difference circled and numbered",
|
|
149
|
+
"Press ✓ to accept it, or press the send-back icon on a numbered difference to make it a fix task (the chat or pmos review list also shows…"
|
|
150
|
+
],
|
|
151
|
+
"see": "The built screen sits beside its design. Only the parts that differ are circled and numbered, with a short line for each under it. ✓ closes the review with Undo; sending a circle back adds a task…",
|
|
152
|
+
"open": "/premium-board.html"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
},
|
|
36
157
|
{
|
|
37
158
|
"v": "0.836.0",
|
|
38
159
|
"at": "2026-11-25T15:53:32.838Z",
|
|
@@ -56,6 +177,7 @@
|
|
|
56
177
|
"t": "First hour for a new engineer on Work (A55)",
|
|
57
178
|
"s": "First hour for a new engineer on Work (A55)",
|
|
58
179
|
"k": "new",
|
|
180
|
+
"i": "first-hour",
|
|
59
181
|
"h": "First hour for a new engineer on Work (A55)",
|
|
60
182
|
"try": {
|
|
61
183
|
"steps": [
|
|
@@ -65,8 +187,7 @@
|
|
|
65
187
|
],
|
|
66
188
|
"see": "Up to four steps from your own records: the product from its strategy lines, the current bets, a real first task in a tested part of the code map, and who changed those parts last. A step marks done…",
|
|
67
189
|
"open": "/premium-board.html"
|
|
68
|
-
}
|
|
69
|
-
"i": "first-hour"
|
|
190
|
+
}
|
|
70
191
|
}
|
|
71
192
|
]
|
|
72
193
|
},
|
|
@@ -966,50 +1087,6 @@
|
|
|
966
1087
|
}
|
|
967
1088
|
}
|
|
968
1089
|
]
|
|
969
|
-
},
|
|
970
|
-
{
|
|
971
|
-
"v": "0.812.0",
|
|
972
|
-
"at": "2026-11-25T06:24:25.632Z",
|
|
973
|
-
"f": 4,
|
|
974
|
-
"prs": [
|
|
975
|
-
{
|
|
976
|
-
"n": 1857,
|
|
977
|
-
"t": "Undo on a read line gives back every typed word (job #1845 fix round)",
|
|
978
|
-
"s": "Undo on a read line gives back every typed word (job #1845 fix round)",
|
|
979
|
-
"k": "fix",
|
|
980
|
-
"i": "capture-words-to-fields"
|
|
981
|
-
},
|
|
982
|
-
{
|
|
983
|
-
"n": 1864,
|
|
984
|
-
"t": "Pmos balance shows the mix of a list in one line",
|
|
985
|
-
"s": "Pmos balance shows the mix of a list in one line",
|
|
986
|
-
"k": "new",
|
|
987
|
-
"i": "balance-meter",
|
|
988
|
-
"h": "Pmos balance shows the mix of a list in one line",
|
|
989
|
-
"try": {
|
|
990
|
-
"steps": [
|
|
991
|
-
"In the chat on Today, ask: what is the mix of my roadmap?",
|
|
992
|
-
"Then ask: how many of them name an expected outcome?"
|
|
993
|
-
],
|
|
994
|
-
"see": "The chat names the counts by kind (Feature, Fix, Debt, Discovery) with one bar of the mix. A note shows only when one kind is over 60% of the list.",
|
|
995
|
-
"open": "/today.html"
|
|
996
|
-
}
|
|
997
|
-
}
|
|
998
|
-
]
|
|
999
|
-
},
|
|
1000
|
-
{
|
|
1001
|
-
"v": "0.810.0",
|
|
1002
|
-
"at": "2026-11-25T05:54:34.966Z",
|
|
1003
|
-
"f": 4,
|
|
1004
|
-
"prs": [
|
|
1005
|
-
{
|
|
1006
|
-
"n": 1853,
|
|
1007
|
-
"t": "Try-it answers count as outcome evidence (job #1837, A487)",
|
|
1008
|
-
"s": "Try-it answers count as outcome evidence (job #1837, A487)",
|
|
1009
|
-
"k": "new",
|
|
1010
|
-
"i": "try-answers-as-evidence"
|
|
1011
|
-
}
|
|
1012
|
-
]
|
|
1013
1090
|
}
|
|
1014
1091
|
]
|
|
1015
1092
|
}
|
package/payload/KIT-VERSION
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Eval calibration log"
|
|
4
4
|
description: "Append-only record of every PM override of an evaluator verdict."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-25T16:26:30Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Health budgets"
|
|
4
4
|
description: "Closed registry of health-budget anchors (D59), edited only by the PM."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-25T16:26:30Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Discoveries and friction log"
|
|
4
4
|
description: "Append-only record of what runs discovered and where the process rubbed."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-25T16:26:30Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,125 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.838.0",
|
|
4
|
+
"at": "2026-11-25T16:26:34.847Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 2042,
|
|
9
|
+
"t": "Five features show by themselves in Your move (job #1985, LINE.md Rule 12)",
|
|
10
|
+
"s": "Five features show by themselves in Your move (job #1985, LINE.md Rule 12)",
|
|
11
|
+
"k": "new",
|
|
12
|
+
"i": "surface-moments",
|
|
13
|
+
"try": {
|
|
14
|
+
"steps": [
|
|
15
|
+
"Open Today and read Your move: when your data says it is time, a ✦ row shows by itself (a free gap: what fits it; leave on your calendar…",
|
|
16
|
+
"Press ✓ on the row, then Undo in the toast",
|
|
17
|
+
"Press Put off a day on another row"
|
|
18
|
+
],
|
|
19
|
+
"see": "Each moment shows only when its condition is true, with one ✓ and Put off a day; ✓ does the one step (drafts a file, sets you away, pauses one run kind) with Undo. With nothing true, Your move shows…",
|
|
20
|
+
"open": "/today.html"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"n": 2006,
|
|
25
|
+
"t": "Before the meeting, who agrees (job #1897, A333)",
|
|
26
|
+
"s": "Before the meeting, who agrees (job #1897, A333)",
|
|
27
|
+
"k": "new",
|
|
28
|
+
"h": "Before the meeting, who agrees (job #1897, A333)",
|
|
29
|
+
"try": {
|
|
30
|
+
"steps": [
|
|
31
|
+
"Open Work and open an initiative with a decision someone argued against",
|
|
32
|
+
"Under People, read the two questions PMOS drafted, press Copy and send them yourself, then press I sent them",
|
|
33
|
+
"Press each cell to record the answer you got, and read the ✦ line"
|
|
34
|
+
],
|
|
35
|
+
"see": "Two short questions for the contested decision, sent by you, never by PMOS. Then a grid of yes and no per person with the odd answers marked, and one ✦ line naming the point the meeting must settle",
|
|
36
|
+
"open": "/premium-board.html"
|
|
37
|
+
},
|
|
38
|
+
"i": "meeting-stance"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"n": 1960,
|
|
42
|
+
"t": "Segments on Work, each user group with the roadmap items that serve it (job #1893)",
|
|
43
|
+
"s": "Segments on Work, each user group with the roadmap items that serve it (job #1893)",
|
|
44
|
+
"k": "new",
|
|
45
|
+
"h": "Segments on Work, each user group with the roadmap items that serve it (job #1893)",
|
|
46
|
+
"try": {
|
|
47
|
+
"steps": [
|
|
48
|
+
"Open Work and pick one product with 3 or more live initiatives",
|
|
49
|
+
"Read the ✦ line in Segments under the strategy and press its draft button",
|
|
50
|
+
"Send the ask it puts in the chat"
|
|
51
|
+
],
|
|
52
|
+
"see": "Before any group, one ✦ line in Segments offers to draft groups, and its button fills the chat (LINE.md rule 12: it shows by itself). After the draft, under the strategy, a Segments table: each…",
|
|
53
|
+
"open": "/premium-board.html"
|
|
54
|
+
},
|
|
55
|
+
"i": "segments"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"n": 2045,
|
|
59
|
+
"t": "Declared domain anchors resolve, so pmos initiative anchors lists them",
|
|
60
|
+
"s": "Declared domain anchors resolve, so pmos initiative anchors lists them",
|
|
61
|
+
"k": "fix",
|
|
62
|
+
"i": "anchor-ids",
|
|
63
|
+
"try": {
|
|
64
|
+
"steps": [
|
|
65
|
+
"Open Work and note how many initiatives sit under one key result.",
|
|
66
|
+
"Open the chat (Ask PMOS): on a desk, the menu button at the bottom left, then the speech bubble. Ask it which anchor ids you can pick.",
|
|
67
|
+
"Ask it which anchors have text after the id (a dry run that changes nothing)."
|
|
68
|
+
],
|
|
69
|
+
"see": "Work shows the same counts per key result. The chat lists only ids the OKR files and health budgets declare. The dry run names each record, its id and the note that would move to anchor_note, and…",
|
|
70
|
+
"open": "/work.html"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"v": "0.837.0",
|
|
77
|
+
"at": "2026-11-25T16:11:10.474Z",
|
|
78
|
+
"f": 4,
|
|
79
|
+
"prs": [
|
|
80
|
+
{
|
|
81
|
+
"n": 2010,
|
|
82
|
+
"t": "Other teams' slips before they hit you (job #1912, A15)",
|
|
83
|
+
"s": "Other teams' slips before they hit you (job #1912, A15)",
|
|
84
|
+
"k": "new",
|
|
85
|
+
"i": "team-slips",
|
|
86
|
+
"h": "Other teams' slips before they hit you (job #1912, A15)",
|
|
87
|
+
"try": {
|
|
88
|
+
"steps": [
|
|
89
|
+
"Open Work",
|
|
90
|
+
"Press the Dependencies tab",
|
|
91
|
+
"In Upstream, press ✦ on a slip"
|
|
92
|
+
],
|
|
93
|
+
"see": "Upstream appears above Waiting on other teams only when a team your work waits on will likely slip: one row per slip with their likely new date and what of yours it hits, and 'Watching n boards your…",
|
|
94
|
+
"open": "/premium-board.html?work=deps"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"n": 2004,
|
|
99
|
+
"t": "Ask card — done-test asserts, Wawan's feedback (hide ✦, smaller text, chat text size, drag)",
|
|
100
|
+
"s": "Ask card — done-test asserts, Wawan's feedback (hide ✦, smaller text, chat text size, drag)",
|
|
101
|
+
"k": "fix",
|
|
102
|
+
"i": "ask-anywhere"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"n": 1956,
|
|
106
|
+
"t": "The built screen beside its design, each difference circled (job #1903, A380)",
|
|
107
|
+
"s": "The built screen beside its design, each difference circled (job #1903, A380)",
|
|
108
|
+
"k": "new",
|
|
109
|
+
"i": "built-vs-design",
|
|
110
|
+
"h": "The built screen beside its design, each difference circled (job #1903, A380)",
|
|
111
|
+
"try": {
|
|
112
|
+
"steps": [
|
|
113
|
+
"Open Work and open an initiative whose product repository has a design and a screenshot of one screen in screens/<initiative id>/…",
|
|
114
|
+
"Read its Review block: PMOS compared them by itself, the design and the built screen side by side, each difference circled and numbered",
|
|
115
|
+
"Press ✓ to accept it, or press the send-back icon on a numbered difference to make it a fix task (the chat or pmos review list also shows…"
|
|
116
|
+
],
|
|
117
|
+
"see": "The built screen sits beside its design. Only the parts that differ are circled and numbered, with a short line for each under it. ✓ closes the review with Undo; sending a circle back adds a task…",
|
|
118
|
+
"open": "/premium-board.html"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
},
|
|
2
123
|
{
|
|
3
124
|
"v": "0.836.0",
|
|
4
125
|
"at": "2026-11-25T15:53:32.838Z",
|
|
@@ -22,6 +143,7 @@
|
|
|
22
143
|
"t": "First hour for a new engineer on Work (A55)",
|
|
23
144
|
"s": "First hour for a new engineer on Work (A55)",
|
|
24
145
|
"k": "new",
|
|
146
|
+
"i": "first-hour",
|
|
25
147
|
"h": "First hour for a new engineer on Work (A55)",
|
|
26
148
|
"try": {
|
|
27
149
|
"steps": [
|
|
@@ -31,8 +153,7 @@
|
|
|
31
153
|
],
|
|
32
154
|
"see": "Up to four steps from your own records: the product from its strategy lines, the current bets, a real first task in a tested part of the code map, and who changed those parts last. A step marks done…",
|
|
33
155
|
"open": "/premium-board.html"
|
|
34
|
-
}
|
|
35
|
-
"i": "first-hour"
|
|
156
|
+
}
|
|
36
157
|
}
|
|
37
158
|
]
|
|
38
159
|
},
|
package/workspace/guide/cli.md
CHANGED
|
@@ -139,6 +139,7 @@ None of these briefs an agent or takes an item. Do that from the item's card on
|
|
|
139
139
|
- `pmos people help` prints the commands.
|
|
140
140
|
- `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.
|
|
141
141
|
- `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.
|
|
142
|
+
- `pmos people stance <initiative>` shows, before the meeting, the two questions PMOS drafted for the initiative's contested decision: the newest live journal decision someone argued against. They go to the people who decide or must agree. After you send them, it shows each person's answers, with the odd ones marked and a ✦ line naming the point the meeting must settle. Add `--json` for the same view. `pmos people stance <initiative> sent` records that you sent the questions. `pmos people stance <initiative> answer <person> <1|2> <yes|no|clear>` records one answer. `pmos people stance <initiative> undo` takes back the last of these. The block under People on the initiative on Work shows the same. PMOS never sends the questions itself.
|
|
142
143
|
|
|
143
144
|
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" }`.
|
|
144
145
|
|
|
@@ -438,6 +439,18 @@ Show where the team is short before you ask for headcount. Run it in the product
|
|
|
438
439
|
- PMOS never writes over a brief. It calls no model and sends nothing. Edit the brief and share it yourself.
|
|
439
440
|
- `pmos hire count [--days 7]` prints how many briefs were drafted in the last days. Its last line is the number.
|
|
440
441
|
|
|
442
|
+
### pmos review: a built screen beside its design
|
|
443
|
+
|
|
444
|
+
Check a built screen against the design it came from by looking, not by flipping between two files. You do not need to run anything: put the design and a screenshot of the same screen in the product's repository as `screens/<initiative>/<screen>.design.png` and `<screen>.built.png` (a build or a design export can drop them there), and PMOS compares them by itself when the initiative opens on Work, and again when either file changes. The commands below do the same by hand. Run them in the product's repository, or pass `--root <dir>`. Both files must be PNG.
|
|
445
|
+
|
|
446
|
+
- `pmos review shots <initiative> --design <design.png> --built <built.png> [--screen <name>]` lays the two side by side and circles each part that differs, numbered top to bottom, with where it is and how big ("Differs near the top right, 200 × 60 px"). Parts that match get no mark. A design made at 2x compares with a 1x screen. Both files are copied into the product's state folder, so the review keeps showing what was compared. A newer compare of the same screen replaces the older one. The initiative's **Review** block on Work shows it.
|
|
447
|
+
- `pmos review list [<initiative>] [--all]` lists the open reviews and their numbered differences; `--all` adds the accepted ones. With an initiative, it first compares the screens in `screens/<initiative>/` that changed, as the Work popup does.
|
|
448
|
+
- `pmos review note <initiative> <n> "<words>"` names difference n better, for example "button 8px lower" or "empty state missing".
|
|
449
|
+
- `pmos review accept <initiative> [--undo]` accepts the built screen and closes the review; `--undo` opens it again.
|
|
450
|
+
- `pmos review fix <initiative> <n> [--undo]` sends difference n back: the task "Fix: <its words>" is added to the initiative, the same as Add a task on the page. `--undo` takes the task away and opens the circle again.
|
|
451
|
+
- `pmos review count [--days 7]` prints how many reviews were decided (accepted, or a difference sent back) in the last days. Its last line is the number.
|
|
452
|
+
- `--screen <name>` picks one screen when an initiative has several. Every command takes `--json`. PMOS calls no model and sends nothing.
|
|
453
|
+
|
|
441
454
|
### pmos layouts: three layouts for a new screen, pick one
|
|
442
455
|
|
|
443
456
|
When an initiative adds a new screen, page or view, its Work popup shows three layouts of the same parts under the stages: **A List first**, **B Summary first** and **C Action first**, drawn with grey bars in place of data. One ✦ line recommends one and says why. Press ✓ under the one you want. It is kept on the initiative as the layout to build, the other two stay beside it, and **Undo** takes it back. PMOS finds a new screen from the record's own words: a making word (new, add, build, design, create, introduce) and, within three words, a screen word (screen, page, view, dashboard, form, popup, panel, tab, layout), in the title or the first paragraph. A done or closed initiative shows none. Run the commands in the product's repository, or pass `--root <dir>`.
|
|
@@ -566,6 +579,16 @@ The same five lines as the Strategy card on Work ([The strategy in five lines](i
|
|
|
566
579
|
- `pmos strategy set --line <key> --text "<line>"` writes your own line. `--text ""` blanks it.
|
|
567
580
|
- `pmos strategy undo` takes back every line PMOS drafted. `--line <key>` takes back one.
|
|
568
581
|
|
|
582
|
+
### pmos segments: the product's user groups and the roadmap that serves them
|
|
583
|
+
|
|
584
|
+
The same groups as the Segments part on Work, under the strategy. A product has at most 6 groups. Each group has its users, a health from 0 to 100, what it uses and what it asks for. Roadmap items (the live initiatives) carry a group tag. Run the commands in the product's repository, or pass `--root <dir>`. The groups are in `segments.jsonl` in the product's records folder, and the page shows what these commands write. `<group>` is the group's name or its id (`sg_…`).
|
|
585
|
+
|
|
586
|
+
- `pmos segments list` shows the groups, most users first, with how many roadmap items serve each. ✦ marks a draft. When a group has 30% or more of the users and gets a third or less of its share of the tagged roadmap (3 or more tagged items), one ✦ line says so.
|
|
587
|
+
- `pmos segments draft --name "<group>" --users <n> --source "<connector · what>"` is PMOS's draft from a usage or revenue read. `--source` is necessary: a draft without it is refused. `--health`, `--uses` and `--asks` are optional. A draft for a group that exists updates its numbers.
|
|
588
|
+
- `pmos segments add --name "<group>" --users <n>` adds your own group, kept at once.
|
|
589
|
+
- `pmos segments keep <group>` keeps a draft. `pmos segments rename <group> --to "<name>"` renames a group and keeps it. `pmos segments drop <group>` hides it.
|
|
590
|
+
- `pmos segments tag <group> <initiative>` tags a live initiative with the group. `pmos segments untag <group> <initiative>` removes the tag.
|
|
591
|
+
- `pmos segments undo <group>` takes back the last change to that group.
|
|
569
592
|
### pmos code: the product's code map
|
|
570
593
|
|
|
571
594
|
The same map as the Code panel on Work: one line per main part of the product's code, with what it is, how it is tested and who changed it last. PMOS draws it from the default branch (origin/HEAD, then main, master, HEAD) when you first open the product on Work, and again after the branch moves. It reads git only and never writes to the repository. A part is risky when it has no test files, or when 5 or more of its commits in the last 30 days are fixes and they are at least half of its commits. Run the commands in the product's repository, or pass `--root <dir>`. The map is in `code-map.json` in the product's records folder, and your own words are in `code-map-notes.jsonl`.
|
|
@@ -618,6 +641,12 @@ Work › Dependencies lists every wait on another team, oldest first, with the d
|
|
|
618
641
|
- `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.
|
|
619
642
|
- `pmos deps done <wait id>` ends a wait. `pmos deps undo <wait id>` opens it again.
|
|
620
643
|
|
|
644
|
+
Upstream, above the waits, shows other teams' slips before they hit you. PMOS watches only the boards your open waits are on (the Jira keys of open waits). When a ticket's likely date moves past its due date, that is a slip: one row with their likely new date and what of yours it hits, and one row on Today. The ✦ move shifts your date (it opens the initiative, so its owner moves the date) when the slip lands on or past your date, else it chases them with a draft in your own mail app. The row goes once you act or wave it off; a later likely date warns again. No slip, no row.
|
|
645
|
+
|
|
646
|
+
- `pmos deps slips` lists the slips and how many boards PMOS watches. `--json` gives the same rows the page reads.
|
|
647
|
+
- `pmos deps slip --key <KEY-1> --theirs <YYYY-MM-DD> --likely <YYYY-MM-DD>` records one reading of a ticket your work waits on. `--yours <YYYY-MM-DD>` and `--yours-what "<what>"` name your date it hits; `--from "<board>"` names their board. The tracker read or the chat runs it.
|
|
648
|
+
- `pmos deps slip-done <KEY-1> --how shift|chase|skip` says you acted on the slip. `pmos deps slip-undo <KEY-1>` brings the row back.
|
|
649
|
+
|
|
621
650
|
### pmos quiet: the weekly sweep of quiet work
|
|
622
651
|
|
|
623
652
|
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.
|
package/workspace/guide/home.md
CHANGED
|
@@ -53,6 +53,7 @@ Today, Work, Insights and the Viewer use one typeface, Plus Jakarta Sans, with t
|
|
|
53
53
|
- **The dashed line.** Your move ends with one dashed line, for example "9 more move in the line by themselves · none stuck" (or "· 1 stuck"). It counts the live initiatives of your products that do not wait on you. Press it to open the Line on Work. With nothing on the line there is no dashed line.
|
|
54
54
|
- **The weekly digest.** On a Monday the Overview sentence ends with "Last week's digest is ready to read." Press it to read last week in the Viewer: one sentence on the line, What moved (each initiative that reached a new station, and what put it there), What PMOS did by itself (with what you undid and what the Checker sampled), Not sent (drafts that lapsed after 7 days) and Next week (initiatives that reach their station's limit). A section with nothing is left out. The digest is only to read: anything that needs you is already in Your move. The switch in its header, or **Weekly digest** in Settings › General, turns it off; off means PMOS does not make it.
|
|
55
55
|
- **Where your week went.** From Friday to Sunday, Your move shows one quiet row, for example "Where your week went: 9 h in 12 meetings, 3 decisions". Open it to see your week by kind, most first: meetings and their hours (from your calendar), decisions, reviews of what PMOS proposed, notes you typed and tasks you moved to Done. One line says what moved: the tasks done, the initiative with the most of them, and the dates or scope changes. It reads only what PMOS already holds. It calls no model, sends nothing and writes nothing. A week with nothing in it gives no row, and the row is gone once you open it that week.
|
|
56
|
+
- **Moments that show by themselves.** Your move shows a ✦ row only when your own data says it is time: a free gap of 15 to 90 minutes that starts within 10 minutes (✓ opens what fits it); leave on your calendar or a line like "off Friday" within 7 days (✓ sets your away days and drafts the handover note); an AI run kind that takes the most of this month's AI cost while you keep few of its ✦ (✓ pauses that kind); a role whose waiting work per person is highest, with no role brief in 14 days (✓ drafts the brief in the Library); a program steering meeting within 2 working days (✓ drafts the one-page pack in the Library). Each row has ✓ and Put off a day, and ✓ shows Undo. With nothing true, there is no row. PMOS sends nothing. The chat and the `pmos` commands still work as before.
|
|
56
57
|
- **A line filed to its initiative.** When a line you type on Today clearly names one open initiative (it shares at least 2 words with its title, and no other initiative shares as many), PMOS files it there. The line shows a chip with the initiative and its stage, for example "↳ Checkout redesign · Discovery", and a toast says where it went, with Undo. A task line also becomes a task on that initiative in Work, in the stage in progress. A note or an event keeps only the chip. Press the arrow beside the chip to file it to another initiative or to Not filed; the task follows. A line that is not clear is not filed. It calls no model and sends nothing.
|
|
57
58
|
- **When a product drifts from Jira.** When fewer than 95% of a product's tasks that name a Jira ticket match the last Jira read, the Overview says so in one ✦ row: "idpf differs from Jira on 7 of 128 tasks (94%). Take Jira's value on all 7". What differs is a value someone set by hand in PMOS: an owner, a done day or a state. Press ✓ to make PMOS say what Jira says for all of them, or press the arrow to see each difference and ✓ only the ones you want. The message that shows has Undo, which puts back what PMOS said. Press ✕ to keep what PMOS says; the row comes back only when the number changes. A product at 95% or more shows no row. PMOS changes nothing in Jira.
|
|
58
59
|
- **One press per initiative.** An initiative's proposals are one row, for example "Checkout: 6 changes to keep" with "3 dates, 2 names, 1 link" under it. Press it to see them grouped as Dates, Names, Done and Links. ✓ keeps all of them, with one Undo for the batch. ✕ drops them, then offers three reasons and **Say why**. A proposal that needs your own check keeps its own ✓ and ✕. **See every change** opens the full list on the initiative.
|
|
@@ -134,6 +134,14 @@ Below the strategy, a Work that shows one product has a **Principles** block. Wh
|
|
|
134
134
|
|
|
135
135
|
You can also ask the chat to keep, drop or add a principle (`pmos principles`). Work shows the change. When there are no principles and no drafts, the block is not shown.
|
|
136
136
|
|
|
137
|
+
### Segments: who the roadmap serves
|
|
138
|
+
|
|
139
|
+
Below the principles, a Work that shows one product has a **Segments** table when the product has user groups. Each row is one group: its users, a health bar, and how many roadmap items serve it. What the group uses and asks for shows under its name. A product has at most 6 groups.
|
|
140
|
+
|
|
141
|
+
When the product has no groups and 3 or more live roadmap items, Segments shows one ✦ line by itself: "None of your 3 roadmap items says which users it serves." Press its ✦ button to put the drafting ask in the chat, then send it. You can also ask the chat yourself to split your users into a few groups from usage and revenue. It drafts each group from a source it names, such as a connector or an export (`pmos segments draft`). A draft shows ✦ and stays a draft until you press ✓ to keep it or the pencil to rename it. A renamed draft is kept. Each press offers Undo. Ask the chat to tag each roadmap item with the group it serves (`pmos segments tag`).
|
|
142
|
+
|
|
143
|
+
When a group has 30% or more of the users and gets a third or less of its share of the tagged roadmap, one ✦ line under the table says so, for example "Small teams are 74% of users and get none of the 8 roadmap items." Only that row shows the alert colour. With fewer than 3 tagged items there is no line. When the product has no groups, the table is not shown. The ✦ offer does not show with fewer than 3 live roadmap items, or after any group was made, even if you dropped it.
|
|
144
|
+
|
|
137
145
|
### Issue a document PMOS drafted
|
|
138
146
|
|
|
139
147
|
When PMOS drafts a document for an initiative, for example a stage's plan that you asked the chat to update, the draft waits for you. You issue it in one of two places:
|
|
@@ -201,6 +201,7 @@ Under it, two blocks use the full width of the popup:
|
|
|
201
201
|
- **Stages.** Each stage of the workflow, with its dates under its name or "no dates yet", on a month scale with a red line for today. A stage's bar runs from the earliest start to the latest end of its tasks; a task with no start counts from its due date. Only a stage with no dated task uses the days the workflow moved through it. To change a stage's dates, change its tasks' dates. A stage has a bar only when it has real dates. A milestone is a diamond on its stage's row.
|
|
202
202
|
- **Layouts.** Only when the initiative adds a new screen, page or view: three layouts of the same parts side by side, **A List first**, **B Summary first** and **C Action first**, drawn with grey bars in place of data. One ✦ line recommends one and says why. Press ✓ under one to keep it as the layout to build; the other two stay, marked **Kept**, and **Undo** takes the pick back. The ✦ learns from your picks for this product. `pmos layouts` reads and writes the same picks.
|
|
203
203
|
- **Work breakdown.** **List** or **Gantt**; PMOS keeps your choice on this computer. **List** has one box on top: type a task and press Enter. Say its stage ("… in Plan"), or it goes to the stage in progress; start with ◇ to add a milestone. Each stage with tasks is one group that says how much is done, for example "1 of 3 done". Press the group to fold it, and press it again to open it. A stage whose tasks are all done is folded until you open it. In a stage, the tasks are in date order, a late task first. A done task stays in its place, in grey with a check. Stages with no tasks fold into one line at the end. Press the box before a task to mark it done, with **Undo**. Press its name to rename it: Enter saves and Escape cancels. When you point at the row, four icons show: **Who** (You, the people on this initiative, or **PMOS does it**, which gives the task to PMOS), **Due date**, **Stage** (moves the task to another stage) and ⋯ (**Status**, **Make it a milestone** and **Open the task**). Each change has **Undo**. A Jira ticket keeps its owner and stage from Jira. **Gantt** is the table described below, with its bars.
|
|
204
|
+
- **Review.** It shows only when a screen of the initiative was built and compared with its design. PMOS compares by itself: when the product's repository holds `screens/<initiative>/<screen>.design.png` beside `<screen>.built.png`, opening the initiative compares them, and again when either file changes (`pmos review shots` does it by hand). The design and the built screen sit side by side. On the built screen each difference is circled and numbered, and a short line under them says what differs, for example "1 · button 8px lower". Parts that match get no mark, and a screen that matches says **Matches its design.** ✓ accepts the built screen and closes the review, with **Undo**. The send-back icon on a line adds the task **Fix: …** to the initiative, with **Undo**; its circle turns grey, and pressing it again takes the task back. The block sits between Stages and the Work breakdown, and on a phone above **Ask PMOS**, with the two screens one above the other.
|
|
204
205
|
|
|
205
206
|
Press the rest of a row, or a milestone, to open it as a full popup in place of the work side. Its top line has ←, the path (**Work › product › initiative**), the chat button, ⋯ and ×. ← or the initiative's name goes back to the initiative, where you left it. The chat beside it is about the task or milestone itself: its own conversation, which starts with the item's status, dates, owner and notes, and the line under the chat's title reads **Task in** and the initiative. The chat button shows that chat. ← back to the initiative shows the initiative's chat again, and its sessions stay in the chat's session list. A file or a task that the chat opens itself does not change the chat. × closes the popup. A task shows its status, dates, owner, notes and what changed. A milestone also shows its date and how many days are left, the done test, **Kill if**, and the suggestion from PMOS about it when there is one.
|
|
206
207
|
|
|
@@ -324,9 +325,12 @@ Right-click any part of a page to ask PMOS about it. On a phone, press and hold
|
|
|
324
325
|
- The top line says what PMOS understood: the item, then the field or the place you pressed, for example **Instant payout to bank › Next milestone · Beta to 5% of users**. In a document it is the heading and the paragraph; on a slide it is the slide and the part, such as a chart bar.
|
|
325
326
|
- When the top line names the wrong thing, press **↑** to step out one level: the field, then the item, then the section, then the page.
|
|
326
327
|
- Under it is the item as Work holds it now, with its usual buttons. A task's date shows three later dates to move it to. Every change has Undo.
|
|
327
|
-
- Up to three questions show with ✦. Press one, or type your own question in the box.
|
|
328
|
+
- Up to three questions show with ✦. Press one, or type your own question in the box. The questions go away once you ask.
|
|
328
329
|
- **What PMOS can do** lists up to four features for that kind of item, such as **Why this work exists** for an initiative or **Strategy** for a product. One press asks it in the card, about that item, with nothing to type. A section, the page, or an item no feature acts on shows no such line.
|
|
329
330
|
- **⤢** opens the same conversation in the full chat. **×** or Escape closes the card.
|
|
331
|
+
- To move the card, hold its top line and drag it. It stays where you put it.
|
|
332
|
+
|
|
333
|
+
To change the text size of a chat, press **+** in the chat box and pick **A−**, **A** or **A+**. The size applies to every chat and follows you to your other computers.
|
|
330
334
|
|
|
331
335
|
Right-click keeps the browser's own menu in a text box, on a link, on selected text and in the terminal. Hold Shift to get the browser's menu anywhere.
|
|
332
336
|
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* built-vs-design-http.js — (not a routes-*.js module: lib/routes-pop-work.js hands it its paths) the built screen beside its design over HTTP (initiative built-vs-design, job #1903, idea A380). The store is
|
|
3
|
+
* lib/built-vs-design.js (built-vs-design.jsonl and the copied shots in the product's state folder); `pmos review` writes the same store.
|
|
4
|
+
*
|
|
5
|
+
* GET /api/built-vs-design?ws&ini → { ok, reviews: [{ id, ini, screen, at, w, h, diffs: [{ n, x, y, w, h, words, task }], more }] }
|
|
6
|
+
* the open reviews of the initiative (an accepted one is left out: zero is silence).
|
|
7
|
+
* First PMOS compares by itself each <repo>/screens/<ini>/<screen>.design.png beside
|
|
8
|
+
* <screen>.built.png whose files changed since its last review (BV.auto), so no ask is needed.
|
|
9
|
+
* GET /api/built-vs-design/shot?ws&pair&which=design|built → the stored PNG
|
|
10
|
+
* POST /api/built-vs-design { ws, ini, pair, act, n? } act ∈ accept · reopen · fix · unfix → { ok, … } | 4xx
|
|
11
|
+
* fix adds the task "Fix: <the difference>" to the initiative by the page's own Add a task (lib/routes-boards.js taskAdd); unfix takes
|
|
12
|
+
* it away again (taskDelete). A page press only (pm-guard requirePagePress). Nothing is sent anywhere. */
|
|
13
|
+
const fs = require('fs');
|
|
14
|
+
const guard = require('./pm-guard.js');
|
|
15
|
+
const BV = require('./built-vs-design.js');
|
|
16
|
+
|
|
17
|
+
const wsOf = (ctx, ws) => { try { return ctx && typeof ctx.getWs === 'function' ? ctx.getWs(ws || null) : null; } catch { return null; } };
|
|
18
|
+
const dirOf = (ctx, w, create) => { try { return w && ctx.stateDirFor ? ctx.stateDirFor(w, create ? { create: true } : undefined) : null; } catch { return null; } };
|
|
19
|
+
const pub = (p) => ({ id: p.id, ini: p.ini, screen: p.screen, at: p.at, w: p.w, h: p.h, diffs: p.diffs.map((d) => ({ n: d.n, x: d.x, y: d.y, w: d.w, h: d.h, words: d.words, task: d.task })), more: p.more || 0 });
|
|
20
|
+
|
|
21
|
+
/** The page's Add a task and Delete for one initiative, on this server. */
|
|
22
|
+
function adderFor(ctx, w, ini, g) {
|
|
23
|
+
const boards = require('./routes-boards.js');
|
|
24
|
+
const at = () => boards.initiativeWorkflow(ctx, w, ini);
|
|
25
|
+
return {
|
|
26
|
+
add: (title, notes) => {
|
|
27
|
+
const r = at(); if (!r.ok) return { ok: false, error: r.error };
|
|
28
|
+
const a = boards.taskAdd(ctx, { ws: w.id, board: r.board.id, initiative: ini, title, notes }, g);
|
|
29
|
+
return a.body && a.body.ok ? { ok: true, task: a.body.item.uid } : { ok: false, error: (a.body && a.body.error) || 'the task was not added' };
|
|
30
|
+
},
|
|
31
|
+
remove: (task) => {
|
|
32
|
+
const r = at(); if (!r.ok) return { ok: false, error: r.error };
|
|
33
|
+
const a = boards.taskDelete(ctx, { ws: w.id, board: r.board.id, task, why: 'the fix was taken back' }, g);
|
|
34
|
+
return a.body && a.body.ok ? { ok: true } : { ok: false, error: (a.body && a.body.error) || 'the task was not taken away' };
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async function handle(req, res, url, ctx) {
|
|
40
|
+
const p = url.pathname;
|
|
41
|
+
if (p !== '/api/built-vs-design' && p !== '/api/built-vs-design/shot') return false;
|
|
42
|
+
const send = (code, obj) => { ctx.json(res, obj, code); return true; };
|
|
43
|
+
if (p === '/api/built-vs-design/shot') {
|
|
44
|
+
if (req.method !== 'GET') return send(405, { ok: false, error: 'GET only' });
|
|
45
|
+
const w = wsOf(ctx, url.searchParams.get('ws')), dir = dirOf(ctx, w, false);
|
|
46
|
+
const f = dir ? BV.shotFile(dir, url.searchParams.get('pair'), url.searchParams.get('which')) : null;
|
|
47
|
+
if (!f) return send(404, { ok: false, error: 'no such shot' });
|
|
48
|
+
res.writeHead(200, { 'Content-Type': 'image/png', 'Cache-Control': 'private, max-age=3600' });
|
|
49
|
+
res.end(fs.readFileSync(f));
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
if (req.method === 'GET') {
|
|
53
|
+
const ini = String(url.searchParams.get('ini') || '');
|
|
54
|
+
const w = wsOf(ctx, url.searchParams.get('ws'));
|
|
55
|
+
// PMOS compares by itself: a screen in <repo>/screens/<ini>/ whose design or built file changed is compared on this read
|
|
56
|
+
const found = ini && w && w.root ? BV.discover(w.root, ini) : [];
|
|
57
|
+
const dir = dirOf(ctx, w, found.length > 0);
|
|
58
|
+
if (!ini || !dir) return send(200, { ok: true, reviews: [] });
|
|
59
|
+
if (found.length) BV.auto(dir, w.root, ini);
|
|
60
|
+
return send(200, { ok: true, reviews: BV.list(dir, ini).map(pub) });
|
|
61
|
+
}
|
|
62
|
+
if (req.method !== 'POST') return send(405, { ok: false, error: 'GET or POST' });
|
|
63
|
+
const rd = await ctx.readJson(req);
|
|
64
|
+
if (!rd.ok) return send(400, { ok: false, error: 'the body is not JSON' });
|
|
65
|
+
const body = rd.body || {};
|
|
66
|
+
const g = guard.requirePagePress(req, body);
|
|
67
|
+
if (!g.ok) return send(g.status, { ok: false, error: g.error });
|
|
68
|
+
const w = wsOf(ctx, body.ws), dir = dirOf(ctx, w, false), ini = String(body.ini || ''), pair = String(body.pair || '');
|
|
69
|
+
if (!dir || !ini || !BV.PAIR_RE.test(pair)) return send(400, { ok: false, error: 'name the product, the initiative and the review' });
|
|
70
|
+
const by = (g.actor && g.actor.by) || 'pm';
|
|
71
|
+
const act = String(body.act || '');
|
|
72
|
+
let r;
|
|
73
|
+
if (act === 'accept' || act === 'reopen') r = BV.accept(dir, ini, { by, pair, undo: act === 'reopen' });
|
|
74
|
+
else if (act === 'fix' || act === 'unfix') {
|
|
75
|
+
const A = ctx.builtVsDesignAdder ? ctx.builtVsDesignAdder(w, ini) : adderFor(ctx, w, ini, { ok: true, actor: g.actor });
|
|
76
|
+
r = await BV.fix(dir, ini, body.n, { add: A.add, remove: A.remove, by, pair, undo: act === 'unfix' });
|
|
77
|
+
} else return send(400, { ok: false, error: 'act is one of accept, reopen, fix, unfix' });
|
|
78
|
+
return send(r.ok ? 200 : 400, r);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
module.exports = { prefixes: ['/api/built-vs-design'], handle };
|