create-pmos 0.781.0 → 0.782.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 +35 -62
- package/payload/KIT-VERSION +1 -1
- package/payload/design-system/ui/README.md +2 -2
- package/payload/design-system/ui/components/MainItem/README.md +4 -2
- package/payload/design-system/ui/components/MainItem/preview.html +2 -2
- package/payload/design-system/ui/components/MainSide/README.md +4 -2
- package/payload/design-system/ui/components/MainSide/preview.html +2 -2
- package/payload/design-system/ui/components/Popup/README.md +15 -0
- package/payload/design-system/ui/components/Popup/preview.html +8 -0
- package/payload/design-system/ui/components/Reading/README.md +19 -0
- package/payload/design-system/ui/components/Reading/preview.html +8 -0
- package/payload/design-system/ui/components/SingleColumn/README.md +4 -2
- package/payload/design-system/ui/components/SingleColumn/preview.html +2 -2
- package/payload/design-system/ui/components/bundle.css +29 -0
- package/payload/design-system/ui/pages.md +6 -6
- package/payload/design-system/ui/tokens.css +1 -1
- package/payload/design-system/ui/tokens.json +30 -0
- 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 +34 -10
- package/workspace/design-system/ui/README.md +2 -2
- package/workspace/design-system/ui/components/MainItem/README.md +4 -2
- package/workspace/design-system/ui/components/MainItem/preview.html +2 -2
- package/workspace/design-system/ui/components/MainSide/README.md +4 -2
- package/workspace/design-system/ui/components/MainSide/preview.html +2 -2
- package/workspace/design-system/ui/components/Popup/README.md +15 -0
- package/workspace/design-system/ui/components/Popup/preview.html +8 -0
- package/workspace/design-system/ui/components/Reading/README.md +19 -0
- package/workspace/design-system/ui/components/Reading/preview.html +8 -0
- package/workspace/design-system/ui/components/SingleColumn/README.md +4 -2
- package/workspace/design-system/ui/components/SingleColumn/preview.html +2 -2
- package/workspace/design-system/ui/components/bundle.css +29 -0
- package/workspace/design-system/ui/pages.md +6 -6
- package/workspace/design-system/ui/tokens.css +1 -1
- package/workspace/design-system/ui/tokens.json +30 -0
- package/workspace/guide/cli.md +9 -1
- package/workspace/guide/layout.md +14 -0
- package/workspace/lib/pmos-verbs.js +3 -0
- package/workspace/lib/sprint-cli.js +79 -0
- package/workspace/lib/sprint-retro.js +176 -0
- package/workspace/lib/task-cli.js +26 -12
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/komorebi.css +29 -1
- package/workspace/public/pm/premium-vw-doc.css +31 -0
- package/workspace/public/pm/premium-vw-doc.js +49 -3
- package/workspace/public/pm/reading-model.js +76 -0
- package/workspace/test-lists/reading-layouts.json +9 -0
- package/workspace/test-lists/sprint-retro-one-change.json +9 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Reference
|
|
3
|
+
title: "PMOS design system: Popup"
|
|
4
|
+
description: "Full popup: one item over the page."
|
|
5
|
+
timestamp: 2026-11-24
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Full popup: one item over the page, with Back, its path, the chat and ×. Then title and meta, Where it stands, and the breakdown or Detail. Used for: an initiative, a task, a milestone, a Jira ticket, a calendar event.
|
|
9
|
+
|
|
10
|
+
Class: `pm-layout-popup`. Slots: `pm-head` (Back, `pm-path`, icon actions, ×), then blocks in order.
|
|
11
|
+
|
|
12
|
+
## Interaction
|
|
13
|
+
|
|
14
|
+
- Back returns to the page it opened from; Esc closes. A task, milestone or artefact opened from an initiative replaces it, and Back returns to the initiative.
|
|
15
|
+
- On a phone it fills the screen with no corner or shadow.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<!-- @dsCard group="4 · Layouts" height=300 -->
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html>
|
|
4
|
+
<head><meta charset="utf-8"><title>preview</title></head>
|
|
5
|
+
<body>
|
|
6
|
+
<div class="pm"><div class="pm-layout-popup"><div class="pm-head"><button class="pm-btn" aria-label="Back">←</button><nav class="pm-path"><a href="#">Work</a> › Email OTP login</nav><button class="pm-btn" aria-label="Close">×</button></div><div class="pm-block flat" style="align-items:center;justify-content:center"><span class="pm-meta">Title and meta</span></div><div class="pm-block flat" style="align-items:center;justify-content:center"><span class="pm-meta">Where it stands</span></div><div class="pm-block flat" style="align-items:center;justify-content:center;min-height:72px"><span class="pm-meta">Breakdown or Detail</span></div></div></div>
|
|
7
|
+
</body>
|
|
8
|
+
</html>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Reference
|
|
3
|
+
title: "PMOS design system: Reading"
|
|
4
|
+
description: "Reading: one calm view for every document."
|
|
5
|
+
timestamp: 2026-11-24
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Reading: one calm view for every document PMOS writes or opens: docs, specs, briefs, reports, weekly updates, meeting notes, guides, notes, notepad, copies, shared links and text files. Slides, PDF and prototypes keep Stage; a task, ticket or event keeps the Full popup.
|
|
9
|
+
|
|
10
|
+
Class: `pm-layout-reading`. Slots: `pm-head` (Back, `pm-path`, comments count, chat, More, ×), `pm-contents` (left), `pm-main` (the column, `--doc-measure` = 640 px), `pm-margin` (right, comments).
|
|
11
|
+
|
|
12
|
+
- In `pm-main`: the title and meta strip (who drafted ✦, who checked, for whom), In short (Summary: the answer and the ask), then one section per heading. Body text uses the PMOS Documents reading sizes (16 px).
|
|
13
|
+
- With no comments there is no `pm-margin`, and the column moves over.
|
|
14
|
+
|
|
15
|
+
## Interaction
|
|
16
|
+
|
|
17
|
+
- Each section folds; the open state is kept per document. Contents follows the scroll and jumps to a section.
|
|
18
|
+
- A comment sits in the margin beside its line.
|
|
19
|
+
- Below 1100 px Contents folds away. On a phone it is one column with no Contents or margin: each section shows its comment count and opens its comments as a sheet.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<!-- @dsCard group="4 · Layouts" height=300 -->
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html>
|
|
4
|
+
<head><meta charset="utf-8"><title>preview</title></head>
|
|
5
|
+
<body>
|
|
6
|
+
<div class="pm"><div class="pm-layout-reading" style="--width-contents:20%;--width-margin:22%;--doc-measure:1fr"><div class="pm-head"><button class="pm-btn" aria-label="Back">←</button><nav class="pm-path"><a href="#">Library</a> › Weekly update</nav><button class="pm-btn" aria-label="Close">×</button></div><nav class="pm-contents"><a href="#" aria-current="true">In short</a><a href="#">Sign-up fell</a><a href="#">Rollout order</a></nav><div class="pm-main"><div class="pm-block flat" style="align-items:center;justify-content:center"><span class="pm-meta">Title · meta strip</span></div><div class="pm-block flat" style="align-items:center;justify-content:center"><span class="pm-meta">In short (Summary)</span></div><div class="pm-block flat" style="align-items:center;justify-content:center;min-height:72px"><span class="pm-meta">Sections, each folds</span></div></div><aside class="pm-margin"><div class="pm-block flat" style="align-items:center;justify-content:center;min-height:72px"><span class="pm-meta">A comment beside its line</span></div></aside></div></div>
|
|
7
|
+
</body>
|
|
8
|
+
</html>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "PMOS design system: SingleColumn"
|
|
4
|
-
description: "One centred column
|
|
5
|
-
|
|
4
|
+
description: "One centred column, no wider than `--page-measure`. Goals, Intelligence, Meeting recording and Welcome use it. On phones every layout becomes single column, Now first.
|
|
5
|
+
|
|
6
|
+
Class: `pm-layout-single`. Blocks go straight inside, in reading order."
|
|
7
|
+
timestamp: 2026-11-24
|
|
6
8
|
---
|
|
7
9
|
|
|
8
10
|
One centred column. Goals, Intelligence, Settings, Welcome use it. On phones every layout becomes single column, Now first.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<!-- @dsCard group="4 · Layouts" height=
|
|
1
|
+
<!-- @dsCard group="4 · Layouts" height=300 -->
|
|
2
2
|
<!doctype html>
|
|
3
3
|
<html>
|
|
4
4
|
<head><meta charset="utf-8"><title>preview</title></head>
|
|
5
5
|
<body>
|
|
6
|
-
<div class="pm"><div
|
|
6
|
+
<div class="pm"><div class="pm-layout-single"><div class="pm-block flat" style="align-items:center;justify-content:center"><span class="pm-meta">Summary</span></div><div class="pm-block flat" style="align-items:center;justify-content:center"><span class="pm-meta">Number · Number · Number</span></div><div class="pm-block flat" style="align-items:center;justify-content:center;min-height:96px"><span class="pm-meta">List or Table</span></div></div></div>
|
|
7
7
|
</body>
|
|
8
8
|
</html>
|
|
@@ -132,6 +132,35 @@ body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--font-s
|
|
|
132
132
|
.pm-rail .pm-count{position:absolute;top:3px;right:5px}
|
|
133
133
|
.pm-path{display:flex;align-items:center;gap:6px;font-size:var(--type-small)}
|
|
134
134
|
.pm-path a{color:var(--blue)}
|
|
135
|
+
/* Layouts (group 4, pages.md): a page picks one and fills its slots with blocks; gaps, widths and corners are tokens. The chat is the slide-over, never a slot. */
|
|
136
|
+
.pm-main,.pm-side,.pm-item,.pm-margin,.pm-contents{display:flex;flex-direction:column;gap:var(--space-16);min-width:0}
|
|
137
|
+
.pm-layout-single,.pm-layout-popup{display:flex;flex-direction:column;gap:var(--space-16);width:100%;max-width:var(--page-measure);margin:0 auto}
|
|
138
|
+
.pm-layout-side,.pm-layout-open,.pm-layout-reading{display:grid;gap:var(--space-16);align-items:start}
|
|
139
|
+
.pm-layout-side{grid-template-columns:minmax(0,1fr) var(--width-side)}
|
|
140
|
+
.pm-layout-side>.pm-side,.pm-layout-reading>.pm-contents{position:sticky;top:0}
|
|
141
|
+
.pm-layout-open{grid-template-columns:minmax(0,1fr)}
|
|
142
|
+
.pm-layout-open:has(>.pm-item){grid-template-columns:minmax(0,1fr) var(--width-item)}
|
|
143
|
+
.pm-layout-open>.pm-item,.pm-layout-popup{background:var(--card);border-radius:var(--radius-panel);box-shadow:var(--raise);padding:var(--space-24)}
|
|
144
|
+
.pm-layout-popup{box-shadow:var(--lift);padding:var(--space-24) var(--space-32)}
|
|
145
|
+
.pm-head{display:flex;align-items:center;gap:var(--space-8);min-width:0}
|
|
146
|
+
.pm-layout-reading{grid-template:"head head head" auto "contents main margin" 1fr/var(--width-contents) minmax(0,var(--doc-measure)) var(--width-margin);gap:var(--space-24) var(--space-32);justify-content:center}
|
|
147
|
+
.pm-layout-reading:not(:has(>.pm-margin)){grid-template:"head head" auto "contents main" 1fr/var(--width-contents) minmax(0,var(--doc-measure))}
|
|
148
|
+
.pm-layout-reading>.pm-head{grid-area:head}
|
|
149
|
+
.pm-layout-reading>.pm-contents{grid-area:contents;gap:var(--space-4);font-size:var(--type-small)}
|
|
150
|
+
.pm-layout-reading>.pm-main{grid-area:main;gap:var(--space-24)}
|
|
151
|
+
.pm-layout-reading>.pm-margin{grid-area:margin}
|
|
152
|
+
@media (max-width: 1100px){
|
|
153
|
+
.pm-layout-side{grid-template-columns:minmax(0,1fr)}
|
|
154
|
+
.pm-layout-reading{grid-template:"head head" auto "main margin" 1fr/minmax(0,var(--doc-measure)) var(--width-margin)}
|
|
155
|
+
.pm-layout-reading:not(:has(>.pm-margin)){grid-template:"head" auto "main" 1fr/minmax(0,var(--doc-measure))}
|
|
156
|
+
.pm-layout-reading>.pm-contents{display:none}
|
|
157
|
+
}
|
|
158
|
+
@media (max-width: 720px){
|
|
159
|
+
.pm-layout-open:has(>.pm-item){grid-template-columns:minmax(0,1fr)}
|
|
160
|
+
.pm-layout-open:has(>.pm-item)>.pm-main,.pm-layout-reading>.pm-margin{display:none}
|
|
161
|
+
.pm-layout-popup{padding:var(--space-16);border-radius:0;box-shadow:none}
|
|
162
|
+
.pm-layout-reading,.pm-layout-reading:not(:has(>.pm-margin)){grid-template:"head" auto "main" 1fr/minmax(0,1fr)}
|
|
163
|
+
}
|
|
135
164
|
/* States every block has (interactions.md, components/State): empty, loading, error. A state sits where the block's rows go. */
|
|
136
165
|
.pm-state{margin:0;padding:var(--space-8) 0;font-size:var(--type-small);line-height:var(--leading-small);color:var(--muted)}
|
|
137
166
|
.pm-state.empty{max-width:62ch}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "PMOS design system: pages and their blocks"
|
|
4
4
|
description: "Every workspace page with its layout and the blocks it is built from."
|
|
5
|
-
timestamp: 2026-11-
|
|
5
|
+
timestamp: 2026-11-24
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Pages and their blocks
|
|
9
9
|
|
|
10
|
-
Every workspace page, with its layout and the blocks it is built from.
|
|
10
|
+
Every workspace page, with its layout and the blocks it is built from. Each layout is one class (README, group 4): Single column `pm-layout-single`, Main + side `pm-layout-side`, Main + open item `pm-layout-open`, Full popup `pm-layout-popup`, Reading `pm-layout-reading`.
|
|
11
11
|
|
|
12
12
|
| Page | Layout | Blocks |
|
|
13
13
|
| --- | --- | --- |
|
|
@@ -16,7 +16,7 @@ Every workspace page, with its layout and the blocks it is built from.
|
|
|
16
16
|
| Work · Board | Main + open item | Table, List, Summary |
|
|
17
17
|
| Program | Main + open item | List, Number, Timeline |
|
|
18
18
|
| Backlog and sprint | Main + open item | Table, Number, Summary |
|
|
19
|
-
| Initiative
|
|
19
|
+
| Initiative · task · milestone · Jira ticket · event | Full popup | Detail, Summary, List, Timeline |
|
|
20
20
|
| Goals | Single column | Number, Summary, Conversation |
|
|
21
21
|
| Intelligence | Single column | Number, List, Summary |
|
|
22
22
|
| Library | Main + open item | List, Detail |
|
|
@@ -24,11 +24,11 @@ Every workspace page, with its layout and the blocks it is built from.
|
|
|
24
24
|
| Routine | Main + open item | Detail, List, Summary |
|
|
25
25
|
| Workflows | Main + open item | List, Detail |
|
|
26
26
|
| Viewer · item | Main + open item | Navigation, Detail, Summary, List |
|
|
27
|
-
| Viewer ·
|
|
28
|
-
| Viewer · slides, PDF, prototype |
|
|
27
|
+
| Viewer · docs, specs, briefs, reports, weekly updates, meeting notes, guides, notes, notepad, copies, text files | Reading | Document, Summary |
|
|
28
|
+
| Viewer · slides, PDF, prototype | Stage | Navigation, Stage |
|
|
29
29
|
| Meeting recording | Single column | Stage, Summary, List |
|
|
30
30
|
| Meeting buddy | Single column | Summary |
|
|
31
31
|
| Settings | Main + side | Navigation, Settings |
|
|
32
32
|
| Welcome | Single column | Settings, Summary |
|
|
33
33
|
| Search | slide-over | List |
|
|
34
|
-
| Shared link |
|
|
34
|
+
| Shared link | Reading (no comments, no chat) | Document, Table |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* PMOS Komorebi tokens. GENERATED from tokens.json by lib/design-system.js: do not edit; run `node lib/design-system.js --write`. */
|
|
2
2
|
:root, [data-theme="light"] {--raise:0 1px 2px rgba(42,46,53,.08), 0 4px 14px -6px rgba(70,80,50,.14);--lift:0 10px 28px -10px rgba(42,46,53,.28);--glow:0 0 0 2px #5F7A45, 0 0 0 5px rgba(95,122,69,.10)}
|
|
3
3
|
[data-theme="dark"] {--raise:0 1px 2px rgba(0,0,0,.4), 0 4px 14px -6px rgba(169,196,140,.08);--lift:0 10px 28px -10px rgba(0,0,0,.6);--glow:0 0 0 2px #A9C48C, 0 0 0 5px rgba(169,196,140,.12)}
|
|
4
|
-
:root:where(*) {--space-4:4px;--space-8:8px;--space-12:12px;--space-16:16px;--space-24:24px;--space-32:32px;--space-48:48px;--space-64:64px;--radius-sm:6px;--radius-md:10px;--radius-card:16px;--radius-panel:24px;--radius-pill:999px}
|
|
4
|
+
:root:where(*) {--space-4:4px;--space-8:8px;--space-12:12px;--space-16:16px;--space-24:24px;--space-32:32px;--space-48:48px;--space-64:64px;--doc-measure:640px;--page-measure:960px;--width-side:340px;--width-item:480px;--width-contents:200px;--width-margin:240px;--radius-sm:6px;--radius-md:10px;--radius-card:16px;--radius-panel:24px;--radius-pill:999px}
|
|
5
5
|
:root:where(*) {--type-title:26px;--leading-title:32px;--weight-title:600;--type-heading:18px;--leading-heading:24px;--weight-heading:600;--type-body:15px;--leading-body:24px;--weight-body:400;--type-small:13px;--leading-small:20px;--weight-small:400;--type-code:13px;--leading-code:20px;--weight-code:400}
|
|
6
6
|
.title{font-family:var(--font-sans);font-size:var(--type-title);line-height:var(--leading-title);font-weight:var(--weight-title)}
|
|
7
7
|
.heading{font-family:var(--font-sans);font-size:var(--type-heading);line-height:var(--leading-heading);font-weight:var(--weight-heading)}
|
|
@@ -96,6 +96,36 @@
|
|
|
96
96
|
"name": "space-64",
|
|
97
97
|
"value": "64px",
|
|
98
98
|
"usage": "Empty-state breathing room."
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"name": "doc-measure",
|
|
102
|
+
"value": "640px",
|
|
103
|
+
"usage": "The reading column: about 65 characters of 16 px body (the same value as PMOS Documents' doc-measure)."
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "page-measure",
|
|
107
|
+
"value": "960px",
|
|
108
|
+
"usage": "Widest Single column page and the Full popup."
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "width-side",
|
|
112
|
+
"value": "340px",
|
|
113
|
+
"usage": "The side column of Main + side (Timeline, a summary)."
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "width-item",
|
|
117
|
+
"value": "480px",
|
|
118
|
+
"usage": "The open item beside the list in Main + open item."
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"name": "width-contents",
|
|
122
|
+
"value": "200px",
|
|
123
|
+
"usage": "Contents at the left of the Reading layout."
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "width-margin",
|
|
127
|
+
"value": "240px",
|
|
128
|
+
"usage": "The comment margin at the right of the Reading layout."
|
|
99
129
|
}
|
|
100
130
|
]
|
|
101
131
|
},
|
package/workspace/guide/cli.md
CHANGED
|
@@ -408,6 +408,14 @@ The same five lines as the Strategy card on Work ([The strategy in five lines](i
|
|
|
408
408
|
- `pmos strategy set --line <key> --text "<line>"` writes your own line. `--text ""` blanks it.
|
|
409
409
|
- `pmos strategy undo` takes back every line PMOS drafted. `--line <key>` takes back one.
|
|
410
410
|
|
|
411
|
+
### pmos sprint: the retro of a closed sprint and one tracked change
|
|
412
|
+
|
|
413
|
+
The same block as One change in a past sprint on Work › Backlog. PMOS writes the retro from its own close numbers for every sprint it saw open and then closed: done of total, and why work was carried (never started, started, in review, carried two sprints in a row, added after the start). It tracks one change for the next sprint: the biggest reason with 2 or more tickets. At the next sprint's close, the retro says whether that change helped, with the number before and after. Run the commands in the product's repository, or pass `--root <dir>`. Your overrides are in `_sprint-retro.jsonl` beside the kept sprint history. Nothing is sent and Jira is not written.
|
|
414
|
+
|
|
415
|
+
- `pmos sprint retro` shows the retro of the newest closed sprint PMOS kept. `--sprint "<name>"` shows another one. `--json` prints the fields.
|
|
416
|
+
- `pmos sprint change --sprint "<name>" --pick <reason>` tracks another change. The reasons are `twice`, `never`, `review`, `started` and `added`.
|
|
417
|
+
- `pmos sprint change --sprint "<name>" --drop` tracks no change for that sprint. `--undo` goes back to PMOS's pick.
|
|
418
|
+
|
|
411
419
|
### pmos positioning: positioning and key messages from the strategy
|
|
412
420
|
|
|
413
421
|
Once a product's five strategy lines are written, PMOS drafts a positioning statement and key messages from them on Work's Strategy card ([Positioning](positioning.md)). Each line cites the strategy lines it comes from. Run the commands in the product's repository, or pass `--root <dir>`. The kept lines are in `positioning.jsonl` in the product's records folder, and Work shows what these commands write.
|
|
@@ -571,7 +579,7 @@ An agent adds and closes tasks when you ask, so you do not have to find the task
|
|
|
571
579
|
- `pmos task list <initiative>` lists the initiative's open tasks (To do and In progress) with their ids. `--all` adds the Done, Won't do and Archived tasks.
|
|
572
580
|
- `pmos task state <task> [<task> …] --to <state>` sets the state of one or more tasks: To do, In progress, Done, Won't do or Archived. `--why` adds the reason, and for Done it is the evidence you read. Each change writes the same line as the page's press, under the agent's name. Won't do on a breakdown item withdraws it, and it cannot come back.
|
|
573
581
|
- `pmos task set <task> [<task> …] --stage <stage>` puts one or more tasks under a stage of the initiative's workflow, by the stage's key or name. `--stage none` takes them out of every stage. The Tasks section groups the tasks by these stages. A task's stage is its place in the plan: it does not change the task's state, and it does not move the initiative. `set` also takes `--due`, `--start`, `--owner` and `--notes`; `--due none` and `--start none` clear a day.
|
|
574
|
-
- `pmos task set <task> [<task> …] --parent <task>` puts tasks under a parent task as subtasks; `--parent none` moves them back to the top level. A loop or a parent that does not exist is refused. The answer prints
|
|
582
|
+
- `pmos task set <task> [<task> …] --parent <task>` puts tasks under a parent task as subtasks; `--parent none` moves them back to the top level. A loop or a parent that does not exist is refused. The answer prints one `Undo:` command that puts every task back. When the tasks came from different parents, it uses `--parents <task>=<parent>|none,…`, which gives each task its own parent. `pmos task add … --parent <task>` adds a new task as a subtask.
|
|
575
583
|
- `pmos task remove <task> [<task> …]` deletes a task that was added by mistake, such as a placeholder or a duplicate. The task goes from every list, and the Undo on the page brings it back. For work that stopped, use Archived or Won't do instead. A breakdown item cannot be deleted: set it to Won't do.
|
|
576
584
|
- `pmos task describe <task>` prints the task's description and its sources. `pmos task describe <task> "<text>"` writes it: what the task is, why it matters, and when it is done. `none` clears it. The task page shows it at once, with Undo. When a task has no description, PMOS writes one by itself from the initiative's record, PRD and plan documents, and names its sources. A Jira ticket keeps its description in Jira.
|
|
577
585
|
- `pmos task comment <task>` lists the task's comments. `pmos task comment <task> "<text>"` adds one. The task page shows it at once, under Activity › Comments. Comments stay in PMOS: nothing is sent to Jira.
|
|
@@ -27,6 +27,8 @@ The workspace has one stylesheet for each part: `pm/brand.css`, `pm/charts.css`,
|
|
|
27
27
|
|
|
28
28
|
These pages are on the UI system: the meeting buddy, the recording tab, the audience tab, the extension's capture popup and the Welcome page. On a moved page, `pm/ds-bridge.css` points the old colour names at the system's colours, so the parts that other modules draw there follow the system too. While a screen is shared, the recording tab's stage uses the Dark theme.
|
|
29
29
|
|
|
30
|
+
**Five page layouts.** Every page is one of five layouts in `ui/`: Single column (`pm-layout-single`), Main + side (`pm-layout-side`), Main + open item (`pm-layout-open`), Full popup (`pm-layout-popup`) and Reading (`pm-layout-reading`). A page picks one and fills its slots with blocks. Gaps, widths and corners come from the system's tokens, so a change to a layout or a token reaches every page that uses it. The chat is always the slide-over, never a slot. On a phone every layout is one column. `ui/pages.md` says which page uses which layout; pages move onto them one at a time.
|
|
31
|
+
|
|
30
32
|
Every block has three states, and one part of the UI system draws all three (`State` in `ui/components/`). The Viewer uses it for every tab:
|
|
31
33
|
|
|
32
34
|
- **Empty**: one quiet line, and the next step when there is one.
|
|
@@ -130,6 +132,18 @@ The Viewer shows one item: an initiative, a program, a task, a document, a meeti
|
|
|
130
132
|
- On a page drawn from the PMOS design system (Today, Today, an item on its own page), the parts inside the Viewer card follow the system too: a meeting, the calendar and a report use its corners, its buttons and its switches. A word button has a small corner, a switch looks like tabs, and a chip or a tag stays round.
|
|
131
133
|
- One item shows in one Viewer only. If an item is already open, opening it again (a row, a ⌘-click, Open beside) shows it in the Viewer it is in. It never opens a second copy.
|
|
132
134
|
|
|
135
|
+
### A document reads one calm way
|
|
136
|
+
|
|
137
|
+
A document opened in the Viewer (a doc, spec, brief, report, weekly update, meeting notes, guide or note) reads top to bottom:
|
|
138
|
+
|
|
139
|
+
- The title, then one line that says who drafted it (✦ when PMOS did), who checked it, for whom, the version and how long it takes to read. **Properties** opens the document's other fields.
|
|
140
|
+
- **In short**: the answer and the ask, from the document's In short, Summary or TL;DR section.
|
|
141
|
+
- One section for each heading. Press a heading to fold it. Each document keeps the sections you folded, the next time you open it.
|
|
142
|
+
- **Contents** at the left lists the sections and marks the one you are reading as you scroll. Press one to go to it. Below 1100 px wide, and on a phone, there is no Contents.
|
|
143
|
+
- Edit, Markdown, Health, Links, Copies, the report's Present, Print and Download, the Edit log and Proposals are where they were. An agent's edit still opens with **Keep** and **Undo all**.
|
|
144
|
+
|
|
145
|
+
Other kinds move to this view one at a time. Slides, PDFs and prototypes keep the stage, and a task, ticket or event keeps the task detail.
|
|
146
|
+
|
|
133
147
|
### What you type is kept
|
|
134
148
|
|
|
135
149
|
Text you type in a PMOS box (a chat message, a Why, notes, a routine's instructions) is kept on this computer until you send it, save it or clear it.
|
|
@@ -169,6 +169,9 @@ const VERBS = Object.freeze({
|
|
|
169
169
|
// Not a pm-os-absorb verb (run: null): initiative strategy-draft (Wawan 2026-11-24) added it through the same table.
|
|
170
170
|
strategy: Object.freeze({ module: 'strategy-cli.js', run: null, guide: 'cli.md',
|
|
171
171
|
help: 'pmos strategy show|sources|draft|set|undo — the product\'s five-line strategy; PMOS drafts blank lines from the product\'s files, each citing them (pmos strategy help)' }),
|
|
172
|
+
// Not a pm-os-absorb verb (run: null): initiative sprint-retro-one-change (bet A76) added it through the same table.
|
|
173
|
+
sprint: Object.freeze({ module: 'sprint-cli.js', run: null, guide: 'cli.md',
|
|
174
|
+
help: 'pmos sprint retro|change — a closed sprint\'s retro from PMOS\'s own close numbers, and its one tracked change (pmos sprint help)' }),
|
|
172
175
|
// Not a pm-os-absorb verb (run: null): initiative parked-reason-way-back (bet A446) added it through the same table.
|
|
173
176
|
parked: Object.freeze({ module: 'parked-cli.js', run: null, guide: 'cli.md',
|
|
174
177
|
help: 'pmos parked list|hold|back|coverage — parked initiatives: why each is parked, what brings it back, and bringing it back (pmos parked help)' }),
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* sprint-cli.js — `pmos sprint`: the retro of a closed sprint and its one tracked change, the same block the past sprint view on Work ›
|
|
3
|
+
* Backlog shows (initiative sprint-retro-one-change). The store is lib/sprint-retro.js (_sprint-retro.jsonl beside the kept sprint history).
|
|
4
|
+
*
|
|
5
|
+
* pmos sprint retro [--sprint "<name>"] [--json] the retro (default: the newest closed sprint PMOS kept)
|
|
6
|
+
* pmos sprint change --sprint "<name>" --pick <reason> | --drop | --undo the PM's override of the tracked change (the chat writes it)
|
|
7
|
+
* every command: [--root <dir>] (default: this repository)
|
|
8
|
+
*
|
|
9
|
+
* Reasons: twice, never, review, started, added. Exit codes: 0 done, 1 refused, 2 usage. Nothing is sent and Jira is not written. */
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const { execFileSync } = require('child_process');
|
|
12
|
+
const SR = require('./sprint-retro.js');
|
|
13
|
+
const SH = require('./sprint-history.js');
|
|
14
|
+
|
|
15
|
+
const COMMANDS = { sprint: ['retro', 'change'] };
|
|
16
|
+
const REASONS = SR.REASONS.map((x) => x.reason);
|
|
17
|
+
const USAGE = [
|
|
18
|
+
'usage: pmos sprint retro|change — a closed sprint\'s retro, from PMOS\'s own close numbers, and its one tracked change',
|
|
19
|
+
' pmos sprint retro [--sprint "<name>"] [--json] the retro (default: the newest closed sprint PMOS kept)',
|
|
20
|
+
' pmos sprint change --sprint "<name>" --pick <reason> track another change (reasons: ' + REASONS.join(', ') + ')',
|
|
21
|
+
' pmos sprint change --sprint "<name>" --drop | --undo track no change, or go back to PMOS\'s pick',
|
|
22
|
+
'Run it in the product\'s repository, or pass --root <dir>.',
|
|
23
|
+
];
|
|
24
|
+
const ALLOWED = { retro: ['json', 'root', 'sprint'], change: ['json', 'root', 'sprint', 'pick', 'drop', 'undo'] };
|
|
25
|
+
const BOOL = new Set(['json', 'drop', 'undo']);
|
|
26
|
+
|
|
27
|
+
function parse(args) {
|
|
28
|
+
const pos = [], flags = {};
|
|
29
|
+
for (let i = 0; i < args.length; i++) {
|
|
30
|
+
const a = args[i];
|
|
31
|
+
if (!a.startsWith('--')) { pos.push(a); continue; }
|
|
32
|
+
const k = a.slice(2);
|
|
33
|
+
if (BOOL.has(k)) { flags[k] = true; continue; }
|
|
34
|
+
flags[k] = args[i + 1] !== undefined && !String(args[i + 1]).startsWith('--') ? args[++i] : '';
|
|
35
|
+
}
|
|
36
|
+
return { pos, flags };
|
|
37
|
+
}
|
|
38
|
+
function repoRoot(cwd) {
|
|
39
|
+
try { return execFileSync('git', ['rev-parse', '--show-toplevel'], { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim() || cwd; } catch { return cwd; }
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async function run(argv, { say = (s) => console.log(s), cwd = process.cwd() } = {}) {
|
|
43
|
+
const args = argv[0] === 'sprint' ? argv.slice(1) : argv.slice();
|
|
44
|
+
const sub = args[0];
|
|
45
|
+
if (!sub || ['help', '--help', '-h'].includes(sub)) { for (const l of USAGE) say(l); return sub ? 0 : 1; }
|
|
46
|
+
if (!COMMANDS.sprint.includes(sub)) { say(`unknown sprint command "${sub}". Use one of: ${COMMANDS.sprint.join(', ')}`); return 2; }
|
|
47
|
+
const { pos, flags } = parse(args.slice(1));
|
|
48
|
+
for (const k of Object.keys(flags)) if (!ALLOWED[sub].includes(k)) { say(`✗ --${k} is not an option of pmos sprint ${sub}`); return 2; }
|
|
49
|
+
if (pos.length) { say(`✗ pmos sprint ${sub} takes options, not an argument (pmos sprint help)`); return 2; }
|
|
50
|
+
const root = path.resolve(flags.root || repoRoot(cwd));
|
|
51
|
+
const fail = (error, code = 1) => { say(flags.json ? JSON.stringify({ ok: false, error }) : '✗ ' + error); return code; };
|
|
52
|
+
const lines = SH.read(root);
|
|
53
|
+
const kept = SR.keptOrder(lines);
|
|
54
|
+
|
|
55
|
+
if (sub === 'retro') {
|
|
56
|
+
const name = flags.sprint || kept[0];
|
|
57
|
+
if (!name) return fail('PMOS has kept no sprint it saw open and then closed. Read Jira while a sprint is open (pmos jira sync --sprints).');
|
|
58
|
+
const x = SR.retroOf(lines, name, { overrides: SR.readOverrides(root) });
|
|
59
|
+
if (!x) return fail(`PMOS did not see ${name} open and then closed, so it has no close numbers for it`);
|
|
60
|
+
if (flags.json) { say(JSON.stringify({ ok: true, retro: x })); return 0; }
|
|
61
|
+
for (const l of SR.linesOf(x)) say(l);
|
|
62
|
+
if (x.options.length > 1) say('Other changes: ' + x.options.filter((o) => !x.change || o.reason !== x.change.reason).map((o) => `${o.reason} (${o.count})`).join(', ') + ' · pmos sprint change --sprint "' + name + '" --pick <reason>');
|
|
63
|
+
return 0;
|
|
64
|
+
}
|
|
65
|
+
// change
|
|
66
|
+
if (!flags.sprint) return fail('name the sprint: --sprint "<name>"', 2);
|
|
67
|
+
const n = [flags.pick != null && flags.pick !== '', !!flags.drop, !!flags.undo].filter(Boolean).length;
|
|
68
|
+
if (n !== 1) return fail('give one of --pick <reason>, --drop, --undo', 2);
|
|
69
|
+
if (!kept.includes(flags.sprint)) return fail(`PMOS did not see ${flags.sprint} open and then closed, so it tracks no change for it`);
|
|
70
|
+
const ev = flags.drop ? 'drop' : flags.undo ? 'undo' : 'pick';
|
|
71
|
+
const r = SR.appendOverride(root, { sprint: flags.sprint, ev, reason: flags.pick || null, by: 'pm' });
|
|
72
|
+
if (!r.ok) return fail(r.error, 2);
|
|
73
|
+
const x = SR.retroOf(SH.read(root), flags.sprint, { overrides: SR.readOverrides(root) });
|
|
74
|
+
if (flags.json) { say(JSON.stringify({ ok: true, row: r.row, retro: x })); return 0; }
|
|
75
|
+
say(x && x.change ? `✓ ${flags.sprint}: tracking "${x.change.text}" (${x.change.number}, now ${x.change.count})` : `✓ ${flags.sprint}: no change tracked`);
|
|
76
|
+
return 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
module.exports = { run, COMMANDS, USAGE };
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* sprint-retro.js — the retro of a closed sprint, written from PMOS's own close numbers, with one change tracked into the next sprint
|
|
3
|
+
* (initiative sprint-retro-one-change, bet A76; done test planning/done-tests/sprint-retro-one-change.md).
|
|
4
|
+
*
|
|
5
|
+
* WHY. lib/sprint-history.js keeps every closed sprint with each ticket's state at close, but nothing turns those numbers into a retro, and
|
|
6
|
+
* nothing tracks whether what a team tried helped. This file reads only the kept snapshot (never the agent's count, never Jira):
|
|
7
|
+
* · the reasons work was carried: never started (to do at close), started (moving, not in review), in review (a review or test status),
|
|
8
|
+
* carried twice (carried in and carried on again), added after the start (not in the sprint's first read);
|
|
9
|
+
* · ONE change for the next sprint: the reason with the biggest count (at least MIN), ties in the order of REASONS, each with its number;
|
|
10
|
+
* · the check: at the next kept sprint's close, the previous sprint's change on its own number, helped (lower) / same / worse.
|
|
11
|
+
*
|
|
12
|
+
* THE FILE. <state>/tracker/jira/_sprint-retro.jsonl, append-only, the PM's overrides only (PMOS's own pick is worked out, never written):
|
|
13
|
+
* { at, sprint, ev: pick|drop|undo, reason?, by } pick: another listed reason · drop: no change tracked · undo: back to PMOS's pick
|
|
14
|
+
*
|
|
15
|
+
* reasonsOf(snapshot) → { done, total, carried, never, started, review, twice, added }
|
|
16
|
+
* optionsOf(reasons, sprintName) → [{ reason, count, text, number }] biggest first, only counts ≥ MIN
|
|
17
|
+
* retroOf(lines, name, { order, overrides }) → retro | null order: the closed sprints' names, newest first (the board's own picker)
|
|
18
|
+
* readOverrides(root) · appendOverride(root, { sprint, ev, reason, by }) · foldOverrides(rows) · countOf(root)
|
|
19
|
+
* CLI: node lib/sprint-retro.js count [--root <dir>] the health number on its last line
|
|
20
|
+
*
|
|
21
|
+
* BOUNDARY. No network, no child process, no Jira write. Writes only the overrides file. */
|
|
22
|
+
const fs = require('fs');
|
|
23
|
+
const path = require('path');
|
|
24
|
+
const SH = require('./sprint-history.js');
|
|
25
|
+
const jiraTickets = require('./jira-tickets.js');
|
|
26
|
+
|
|
27
|
+
const FILE = '_sprint-retro.jsonl';
|
|
28
|
+
const MIN = 2;
|
|
29
|
+
const LOG = '[sprint-retro]';
|
|
30
|
+
const REVIEW = /review|test|qa|verif|approv/i;
|
|
31
|
+
const t = (n) => n + (n === 1 ? ' ticket' : ' tickets');
|
|
32
|
+
const label = (name) => String(name || 'the sprint');
|
|
33
|
+
|
|
34
|
+
/** The reasons, in tie order, with the number each change moves and the words of the change. r: reasonsOf, s: the sprint's name. */
|
|
35
|
+
const REASONS = Object.freeze([
|
|
36
|
+
{ reason: 'twice', number: 'tickets carried two sprints in a row',
|
|
37
|
+
text: (r) => `Start with the ${t(r.twice)} carried two sprints in a row, or take them out of the next sprint` },
|
|
38
|
+
{ reason: 'never', number: 'tickets carried without being started',
|
|
39
|
+
text: (r, s) => `Plan about ${t(r.done)}, what ${label(s)} finished, not ${r.total}` },
|
|
40
|
+
{ reason: 'review', number: 'tickets carried while in review',
|
|
41
|
+
text: (r) => `Review before starting new work: ${t(r.review)} waited in review at the close` },
|
|
42
|
+
{ reason: 'started', number: 'started tickets carried unfinished',
|
|
43
|
+
text: (r) => `Finish started work before starting new: ${t(r.started)} were started and not finished` },
|
|
44
|
+
{ reason: 'added', number: 'tickets added after the sprint started',
|
|
45
|
+
text: (r) => `Keep new tickets for the next sprint unless they are urgent: ${t(r.added)} were added after the start` },
|
|
46
|
+
]);
|
|
47
|
+
const BY = new Map(REASONS.map((x, i) => [x.reason, { ...x, i }]));
|
|
48
|
+
|
|
49
|
+
/** Why the work was carried, from one kept snapshot (sprint-history.js snapshotOf). */
|
|
50
|
+
function reasonsOf(snap) {
|
|
51
|
+
const held = (snap && snap.rows ? snap.rows : []).filter((r) => !r.removed);
|
|
52
|
+
const carried = held.filter((r) => r.carried);
|
|
53
|
+
const review = carried.filter((r) => r.category === 'doing' && REVIEW.test(r.status || '')).length;
|
|
54
|
+
const started = carried.filter((r) => r.category === 'doing').length - review;
|
|
55
|
+
return { done: held.filter((r) => r.category === 'done').length, total: held.length, carried: carried.length,
|
|
56
|
+
never: carried.length - review - started, started, review, twice: carried.filter((r) => r.carriedIn).length, added: held.filter((r) => r.added).length };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** The changes PMOS could track, biggest first (ties in REASONS order); only a reason with MIN or more tickets. */
|
|
60
|
+
function optionsOf(r, name) {
|
|
61
|
+
return REASONS.map((x, i) => ({ x, i, count: r[x.reason] || 0 })).filter((o) => o.count >= MIN)
|
|
62
|
+
.sort((a, b) => b.count - a.count || a.i - b.i)
|
|
63
|
+
.map((o) => ({ reason: o.x.reason, count: o.count, number: o.x.number, text: o.x.text(r, name) }));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* ── the PM's overrides ──────────────────────────────────────────────────────────────────────────────────────── */
|
|
67
|
+
const fileOf = (root) => path.join(jiraTickets.jiraDir(root), FILE);
|
|
68
|
+
function readOverrides(root) {
|
|
69
|
+
let raw = ''; try { raw = fs.readFileSync(fileOf(root), 'utf8'); } catch { return []; }
|
|
70
|
+
const out = [];
|
|
71
|
+
for (const l of raw.split('\n')) { if (!l.trim()) continue; try { const o = JSON.parse(l); if (o && o.sprint && o.ev) out.push(o); } catch { /* a torn line has no effect */ } }
|
|
72
|
+
return out;
|
|
73
|
+
}
|
|
74
|
+
/** { [sprint]: { ev: pick|drop, reason?, at, by } }; undo removes the sprint's entry. */
|
|
75
|
+
function foldOverrides(rows) {
|
|
76
|
+
const out = {};
|
|
77
|
+
for (const o of rows || []) {
|
|
78
|
+
if (o.ev === 'undo') delete out[o.sprint];
|
|
79
|
+
else if (o.ev === 'drop') out[o.sprint] = { ev: 'drop', at: o.at, by: o.by || null };
|
|
80
|
+
else if (o.ev === 'pick' && BY.has(o.reason)) out[o.sprint] = { ev: 'pick', reason: o.reason, at: o.at, by: o.by || null };
|
|
81
|
+
}
|
|
82
|
+
return out;
|
|
83
|
+
}
|
|
84
|
+
/** One override, appended. → { ok, row } | { ok: false, error } */
|
|
85
|
+
function appendOverride(root, { sprint, ev, reason = null, by = 'pm', at = new Date().toISOString() } = {}) {
|
|
86
|
+
const name = String(sprint || '').trim().slice(0, 120);
|
|
87
|
+
if (!name) return { ok: false, error: 'name the sprint' };
|
|
88
|
+
if (!['pick', 'drop', 'undo'].includes(ev)) return { ok: false, error: 'ev is one of pick, drop, undo' };
|
|
89
|
+
if (ev === 'pick' && !BY.has(reason)) return { ok: false, error: 'pick one of: ' + REASONS.map((x) => x.reason).join(', ') };
|
|
90
|
+
const row = { at, sprint: name, ev, ...(ev === 'pick' ? { reason } : {}), by };
|
|
91
|
+
const file = fileOf(root);
|
|
92
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
93
|
+
fs.appendFileSync(file, JSON.stringify(row) + '\n');
|
|
94
|
+
console.log(`${LOG} ${ev}${ev === 'pick' ? ' ' + reason : ''} · ${name}`);
|
|
95
|
+
return { ok: true, row };
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* ── the retro ───────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
99
|
+
/** The closed sprints PMOS saw open, newest first (the order the picker uses, when none is given). */
|
|
100
|
+
function keptOrder(lines) {
|
|
101
|
+
const L = [];
|
|
102
|
+
for (const name of new Set((lines || []).map((l) => l.sprint.name))) {
|
|
103
|
+
const s = SH.snapshotOf(lines, name);
|
|
104
|
+
if (s && s.seenOpen && s.sprint.state === 'closed') L.push({ name, start: s.sprint.start || null });
|
|
105
|
+
}
|
|
106
|
+
const num = (n) => { const m = /(\d+)\s*$/.exec(n); return m ? Number(m[1]) : null; };
|
|
107
|
+
return L.sort((a, b) => ((a.start && b.start && a.start !== b.start) ? b.start.localeCompare(a.start)
|
|
108
|
+
: (num(a.name) != null && num(b.name) != null) ? num(b.name) - num(a.name) : b.name.localeCompare(a.name))).map((x) => x.name);
|
|
109
|
+
}
|
|
110
|
+
/** The change tracked for one sprint: PMOS's pick unless the PM picked another or dropped it. */
|
|
111
|
+
function changeOf(r, name, ov) {
|
|
112
|
+
const options = optionsOf(r, name);
|
|
113
|
+
const o = ov && ov[name];
|
|
114
|
+
if (o && o.ev === 'drop') return { change: null, options, by: 'dropped' };
|
|
115
|
+
if (o && o.ev === 'pick') {
|
|
116
|
+
const x = BY.get(o.reason);
|
|
117
|
+
const opt = options.find((y) => y.reason === o.reason) || { reason: o.reason, count: r[o.reason] || 0, number: x.number, text: x.text(r, name) };
|
|
118
|
+
return { change: opt, options, by: 'pm' };
|
|
119
|
+
}
|
|
120
|
+
return { change: options[0] || null, options, by: options.length ? 'pmos' : 'none' };
|
|
121
|
+
}
|
|
122
|
+
/** One sprint's retro. → null when PMOS did not see the sprint open and then closed. */
|
|
123
|
+
function retroOf(lines, name, { order = null, overrides = null } = {}) {
|
|
124
|
+
const snap = SH.snapshotOf(lines, name);
|
|
125
|
+
if (!snap || !snap.seenOpen || snap.sprint.state !== 'closed') return null;
|
|
126
|
+
const ov = overrides && !Array.isArray(overrides) ? overrides : foldOverrides(overrides || []);
|
|
127
|
+
const r = reasonsOf(snap);
|
|
128
|
+
const { change, options, by } = changeOf(r, name, ov);
|
|
129
|
+
const kept = keptOrder(lines);
|
|
130
|
+
const names = (order && order.length ? order : kept).filter((n) => kept.includes(n));
|
|
131
|
+
const i = names.indexOf(name);
|
|
132
|
+
const prev = i >= 0 ? names[i + 1] || null : null;
|
|
133
|
+
const next = i > 0 ? names[i - 1] : (snap.counts.carriedTo || null);
|
|
134
|
+
let check = null;
|
|
135
|
+
if (prev) {
|
|
136
|
+
const ps = SH.snapshotOf(lines, prev), pr = reasonsOf(ps), pc = changeOf(pr, prev, ov).change;
|
|
137
|
+
if (pc) {
|
|
138
|
+
const before = pc.count, after = r[pc.reason] || 0;
|
|
139
|
+
check = { sprint: prev, reason: pc.reason, text: pc.text, number: pc.number, before, after, result: after < before ? 'helped' : after === before ? 'same' : 'worse' };
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return { sprint: name, next, reasons: r, change, by, options, check };
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** The health number: closed kept sprints with a tracked change (PMOS's or the PM's pick, not dropped). */
|
|
146
|
+
function countOf(root) {
|
|
147
|
+
const lines = SH.read(root), ov = foldOverrides(readOverrides(root));
|
|
148
|
+
let n = 0;
|
|
149
|
+
for (const name of keptOrder(lines)) { const x = retroOf(lines, name, { overrides: ov }); if (x && x.change) n++; }
|
|
150
|
+
return n;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** The sentences a retro says, for the CLI and the chat (the page draws its own block from the same fields). */
|
|
154
|
+
function linesOf(x) {
|
|
155
|
+
if (!x) return [];
|
|
156
|
+
const r = x.reasons, out = [`${label(x.sprint)}: ${r.done} of ${r.total} done.`];
|
|
157
|
+
if (r.carried) {
|
|
158
|
+
const parts = [r.never && `${r.never} never started`, r.started && `${r.started} started`, r.review && `${r.review} in review`].filter(Boolean);
|
|
159
|
+
out.push(`${t(r.carried)} carried: ${parts.join(', ')}.` + (r.twice ? ` ${r.twice} of them carried two sprints in a row.` : ''));
|
|
160
|
+
}
|
|
161
|
+
if (r.added) out.push(`${t(r.added)} added after the start.`);
|
|
162
|
+
if (x.change) out.push(`One change for ${x.next ? label(x.next) : 'the next sprint'}: ${x.change.text}. Its number: ${x.change.number}, now ${x.change.count}.`);
|
|
163
|
+
else if (x.by === 'dropped') out.push('No change tracked: you dropped it.');
|
|
164
|
+
if (x.check) out.push(`Last sprint's change (${label(x.check.sprint)}): ${x.check.number} went from ${x.check.before} to ${x.check.after}. ${x.check.result === 'helped' ? 'It helped.' : x.check.result === 'same' ? 'No change.' : 'It got worse.'}`);
|
|
165
|
+
return out;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
module.exports = { FILE, MIN, LOG, REASONS, fileOf, reasonsOf, optionsOf, retroOf, keptOrder, readOverrides, foldOverrides, appendOverride, countOf, linesOf };
|
|
169
|
+
|
|
170
|
+
if (require.main === module) {
|
|
171
|
+
const a = process.argv.slice(2);
|
|
172
|
+
const ri = a.indexOf('--root');
|
|
173
|
+
const root = path.resolve(ri >= 0 && a[ri + 1] ? a[ri + 1] : process.cwd());
|
|
174
|
+
if (a[0] === 'count') { const n = countOf(root); console.log(`${LOG} count · ${n} closed ${n === 1 ? 'sprint carries' : 'sprints carry'} a tracked change`); console.log(String(n)); process.exit(0); }
|
|
175
|
+
console.log('usage: node lib/sprint-retro.js count [--root <dir>]'); process.exit(2);
|
|
176
|
+
}
|