create-pmos 0.781.0 → 0.783.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 +69 -80
- 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 +68 -6
- 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 +10 -1
- package/workspace/guide/jira.md +12 -0
- package/workspace/guide/layout.md +14 -0
- package/workspace/lib/{routes-card-catalog.js → card-catalog-route.js} +1 -1
- package/workspace/lib/card-catalog.js +1 -1
- package/workspace/lib/jira-cli.js +30 -3
- package/workspace/lib/pmos-verbs.js +3 -0
- package/workspace/lib/rollover-reasons.js +127 -0
- package/workspace/lib/routes-backlog.js +14 -2
- package/workspace/lib/routes-slash.js +2 -2
- package/workspace/lib/sprint-cli.js +79 -0
- package/workspace/lib/sprint-history.js +8 -2
- package/workspace/lib/sprint-retro.js +176 -0
- package/workspace/lib/{routes-star-drafts.js → star-drafts-route.js} +1 -1
- 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/bd-backlog.css +11 -0
- package/workspace/public/pm/bd-sprint.js +40 -7
- package/workspace/public/pm/bk-sprint.js +10 -0
- 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/rollover-reason.json +9 -0
- package/workspace/test-lists/sprint-retro-one-change.json +9 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "PMOS design system: MainItem"
|
|
4
|
-
description: "Main + open item: the list stays, the clicked item opens beside it. Work, Library and
|
|
5
|
-
|
|
4
|
+
description: "Main + open item: the list stays, the clicked item opens beside it (`--width-item`). Work, Backlog, Library, Routine and Workflows use it.
|
|
5
|
+
|
|
6
|
+
Class: `pm-layout-open`. Slots: `pm-main` (the list), then `pm-item` when a row is open; with no `pm-item` the list takes the width. At most 2 panels on a laptop, 3 at 1600 px and up, plus"
|
|
7
|
+
timestamp: 2026-11-24
|
|
6
8
|
---
|
|
7
9
|
|
|
8
10
|
Main + open item: the list stays, the clicked item opens beside it. Work, Library and the Viewer use it. At most 2 panels on a laptop, 3 at 1600 px and up, plus one slide-over; the first panel stays.
|
|
@@ -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-open" style="--width-item:45%"><div class="pm-main"><div class="pm-block flat" style="align-items:center;justify-content:center;min-height:200px"><span class="pm-meta">List or Table</span></div></div><div class="pm-item"><span class="pm-meta">Detail of the open row</span></div></div></div>
|
|
7
7
|
</body>
|
|
8
8
|
</html>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "PMOS design system: MainSide"
|
|
4
|
-
description: "Main + side: a main column with a narrow side column. Today
|
|
5
|
-
|
|
4
|
+
description: "Main + side: a main column with a narrow side column (`--width-side`). Today, Events and Settings use it. The side holds time (Timeline) or context.
|
|
5
|
+
|
|
6
|
+
Class: `pm-layout-side`. Slots: `pm-main`, then `pm-side`."
|
|
7
|
+
timestamp: 2026-11-24
|
|
6
8
|
---
|
|
7
9
|
|
|
8
10
|
Main + side: a main column with a narrow side column. Today uses it. The side holds time (Timeline) or context.
|
|
@@ -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-side" style="--width-side:30%"><div class="pm-main"><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;min-height:140px"><span class="pm-meta">List</span></div></div><div class="pm-side"><div class="pm-block flat" style="align-items:center;justify-content:center;min-height:96px"><span class="pm-meta">Timeline</span></div><div class="pm-block flat" style="align-items:center;justify-content:center"><span class="pm-meta">Summary</span></div></div></div></div>
|
|
7
7
|
</body>
|
|
8
8
|
</html>
|
|
@@ -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.
|
|
@@ -866,6 +874,7 @@ The benchmark needs a signed-in agent CLI. It never pushes and never opens a pul
|
|
|
866
874
|
- `pmos jira query --sprint "<name>"`
|
|
867
875
|
- `pmos jira sync --sprint "<name>" --from <file|-> [--dry-run]`
|
|
868
876
|
- `pmos jira summary [--from <file|->] [--dry-run]`
|
|
877
|
+
- `pmos jira why --sprint "<name>"`, `pmos jira why <KEY> <reason> --sprint "<name>"` or `pmos jira why <KEY> --clear --sprint "<name>"`: why a ticket rolled out of a closed sprint (blocked, bigger, pushed or waiting), the same as the one tap on Work › Backlog.
|
|
869
878
|
- `pmos jira which <KEY>`
|
|
870
879
|
- `pmos jira moves`
|
|
871
880
|
- `pmos jira moved <move id> --status "<Jira status>"` or `--refused "<why>"`
|
package/workspace/guide/jira.md
CHANGED
|
@@ -271,6 +271,18 @@ pmos jira summary
|
|
|
271
271
|
pmos jira summary --from <file|-> [--dry-run]
|
|
272
272
|
```
|
|
273
273
|
|
|
274
|
+
## Why work rolled to the next sprint
|
|
275
|
+
|
|
276
|
+
Pick a closed sprint in the sprint picker on Work › Backlog. Under **Carried to …**, each ticket that rolled to the next sprint shows four reasons: **Blocked**, **Bigger than thought**, **Pushed down** and **Waiting on someone**. Press one. The ticket then shows that reason and a button to take it back. The **Carried to** block above counts the reasons, largest first, and the tickets with no reason yet, so the sprint review sees why the plan slipped.
|
|
277
|
+
|
|
278
|
+
The reasons stay in PMOS, in `<state>/tracker/jira/_rollover-reasons.jsonl`. Nothing is written to Jira. The chat writes the same reason:
|
|
279
|
+
|
|
280
|
+
```
|
|
281
|
+
pmos jira why --sprint "<name>" the count per reason, and the tickets not said
|
|
282
|
+
pmos jira why <KEY> <reason> --sprint "<name>" reason: blocked, bigger, pushed or waiting
|
|
283
|
+
pmos jira why <KEY> --clear --sprint "<name>" take the reason back
|
|
284
|
+
```
|
|
285
|
+
|
|
274
286
|
## Link an initiative to its Jira epics
|
|
275
287
|
|
|
276
288
|
Your team may already plan in Jira, with an epic for each piece of work. Then link the initiative to its epics. You do not have to draft or push tickets.
|
|
@@ -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.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
/*
|
|
2
|
+
/* card-catalog-route.js — the card catalog for the page (star-buttons-act-directly).
|
|
3
3
|
*
|
|
4
4
|
* GET /api/card-catalog → { ok, catalog } the committed v2 catalog (lib/card-catalog.json), read only
|
|
5
5
|
*
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* button runs no command ("opens the task popup")
|
|
12
12
|
* commands() → [{ verb, sub, run, uses: [{ kind, label }] }], one per distinct "<verb> <sub>"
|
|
13
13
|
*
|
|
14
|
-
* The page reads the same file through GET /api/card-catalog (lib/
|
|
14
|
+
* The page reads the same file through GET /api/card-catalog (lib/card-catalog-route.js) and runs a button with
|
|
15
15
|
* public/pm/action-run.js. Pure apart from the one read. */
|
|
16
16
|
const fs = require('fs');
|
|
17
17
|
const path = require('path');
|
|
@@ -55,8 +55,9 @@ const jiraCriteria = require('./jira-criteria.js');
|
|
|
55
55
|
const pmName = (env) => { const e = String(((env || process.env).PMOS_PM_NAME) || '').trim(); if (e) return e; try { return require('./routes-board-publish.js').sharedBy() || ''; } catch { return ''; } };
|
|
56
56
|
const planItems = require('./plan-items.js');
|
|
57
57
|
const guard = require('./pm-guard.js');
|
|
58
|
+
const RR = require('./rollover-reasons.js');
|
|
58
59
|
|
|
59
|
-
const COMMANDS = { jira: ['draft', 'show', 'epic', 'approve', 'pending', 'record', 'query', 'sync', 'pin', 'summary', 'which', 'moves', 'moved', 'epic-asks', 'epic-done', 'guesses', 'answer', 'criteria', 'digest', 'criteria-propose', 'criteria-ask', 'criteria-asks', 'criteria-done', 'criteria-reach'] };
|
|
60
|
+
const COMMANDS = { jira: ['draft', 'show', 'epic', 'approve', 'pending', 'record', 'query', 'sync', 'pin', 'summary', 'which', 'moves', 'moved', 'epic-asks', 'epic-done', 'guesses', 'answer', 'criteria', 'digest', 'criteria-propose', 'criteria-ask', 'criteria-asks', 'criteria-done', 'criteria-reach', 'why'] };
|
|
60
61
|
const USAGE = [
|
|
61
62
|
'usage: pmos jira draft|show|epic|approve|pending|record|query|sync|summary|which — Jira tickets from the PRD, and their status',
|
|
62
63
|
' pmos jira draft <initiative> [--dry-run] draft one ticket per PRD item, in the ticket template',
|
|
@@ -82,6 +83,9 @@ const USAGE = [
|
|
|
82
83
|
' pmos jira sync --sprint "<name>" --from <file|-> keep that read as the sprint\'s snapshot',
|
|
83
84
|
' pmos jira summary the sprints that need a goal and summary written',
|
|
84
85
|
' pmos jira summary --from <file|-> [--dry-run] save each sprint\'s goal, summary and themes (a closed sprint is kept once written)',
|
|
86
|
+
' pmos jira why --sprint "<name>" why the tickets rolled out of a closed sprint: the count per reason, and the ones not said',
|
|
87
|
+
' pmos jira why <KEY> <reason> --sprint "<name>" save why a ticket rolled to the next sprint: blocked, bigger, pushed or waiting',
|
|
88
|
+
' pmos jira why <KEY> --clear --sprint "<name>" take that reason back',
|
|
85
89
|
' pmos jira which <KEY> [<KEY> …] the initiative a Jira key belongs to',
|
|
86
90
|
' pmos jira moves the status moves asked in PMOS that wait for Jira',
|
|
87
91
|
' pmos jira moved <move id> --status "<status>" | --refused "<why>" what Jira did with one move',
|
|
@@ -96,7 +100,7 @@ const USAGE = [
|
|
|
96
100
|
' every command: [--json] [--root <dir>]',
|
|
97
101
|
'This command never calls Jira. Your agent reads and writes Jira with your own connection.',
|
|
98
102
|
];
|
|
99
|
-
const BOOL = new Set(['json', 'dry-run', 'help', 'sprints', 'keep-default', 'direct', 'draft', 'changed', 'off', 'all', 'health', 'count']);
|
|
103
|
+
const BOOL = new Set(['json', 'dry-run', 'help', 'sprints', 'keep-default', 'direct', 'draft', 'changed', 'off', 'all', 'health', 'count', 'clear']);
|
|
100
104
|
const VALUE = new Set(['from', 'query', 'root', 'epic', 'updated', 'group', 'status', 'refused', 'sprint', 'text', 'since']);
|
|
101
105
|
const FLAG_TEXT = { 'prd-changed': 'PRD changed', removed: 'Removed from PRD', blocked: 'Blocked', incomplete: 'Missing text', pushing: 'Selected, waiting for the push', edited: 'Edited, not in Jira yet' };
|
|
102
106
|
|
|
@@ -156,7 +160,30 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
|
|
|
156
160
|
|
|
157
161
|
try {
|
|
158
162
|
if (flags.sprints && verb !== 'query' && verb !== 'sync') return fail('--sprints goes with query or sync', 2);
|
|
159
|
-
if (flags.sprint != null && verb !== 'query' && verb !== 'sync') return fail('--sprint goes with query or
|
|
163
|
+
if (flags.sprint != null && verb !== 'query' && verb !== 'sync' && verb !== 'why') return fail('--sprint goes with query, sync or why', 2);
|
|
164
|
+
if (flags.clear && verb !== 'why') return fail('--clear goes with why', 2);
|
|
165
|
+
// why a ticket rolled to the next sprint (initiative rollover-reason): the same write as the one tap on Work › Backlog
|
|
166
|
+
if (verb === 'why') {
|
|
167
|
+
if (flags.sprint == null) return need('--sprint "<name>" [<KEY> <reason> | <KEY> --clear]');
|
|
168
|
+
const sprint = String(flags.sprint);
|
|
169
|
+
const SH = require('./sprint-history.js');
|
|
170
|
+
const s = SH.snapshotOf(SH.read(root), sprint);
|
|
171
|
+
if (!s || s.sprint.state !== 'closed') return fail(`PMOS kept no closed sprint named "${sprint}"`);
|
|
172
|
+
const carried = s.rows.filter((r) => r.carried);
|
|
173
|
+
if (!pos.length) {
|
|
174
|
+
const fold = RR.foldOf(RR.read(root)), w = RR.whyOf(carried, fold, sprint);
|
|
175
|
+
if (!w) return out({ ok: true, sprint, why: null, unsaid: [] }, [`${sprint} carried nothing to the next sprint`]);
|
|
176
|
+
const unsaid = carried.filter((r) => !fold.has(sprint + '|' + r.key)).map((r) => r.key);
|
|
177
|
+
const parts = RR.REASONS.filter((k) => w[k]).map((k) => `${w[k]} ${RR.LABELS[k].toLowerCase()}`);
|
|
178
|
+
return out({ ok: true, sprint, why: w, unsaid }, [`${sprint} · ${carried.length} carried${parts.length ? ' · ' + parts.join(' · ') : ''}${w.unsaid ? ` · ${w.unsaid} not said yet` : ''}`,
|
|
179
|
+
...(unsaid.length ? [`not said: ${unsaid.join(' ')}`] : [])]);
|
|
180
|
+
}
|
|
181
|
+
const key = String(pos[0]).toUpperCase(), reason = flags.clear ? null : pos[1];
|
|
182
|
+
if (!flags.clear && !reason) return need('<KEY> <reason> --sprint "<name>" reason: ' + RR.REASONS.join(', '));
|
|
183
|
+
const r = RR.saveCarried(root, { sprint, key, reason, by: (isTTY ? 'pm' : 'agent') + ':cli' });
|
|
184
|
+
if (!r.ok) return fail(r.error);
|
|
185
|
+
return out({ ok: true, sprint, key, reason, was: r.was }, [reason ? `${key} · ${RR.LABELS[reason]} · rolled out of ${sprint}` : `${key} · reason taken back · ${sprint}`]);
|
|
186
|
+
}
|
|
160
187
|
if (flags.since != null && verb !== 'digest') return fail('--since goes with digest', 2);
|
|
161
188
|
if (flags.changed && verb !== 'query' && verb !== 'sync') return fail('--changed goes with query or sync', 2);
|
|
162
189
|
if (flags.off && verb !== 'pin') return fail('--off goes with pin', 2);
|
|
@@ -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,127 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* rollover-reasons.js — why a ticket rolled to the next sprint, one tap per ticket (initiative rollover-reason, bet A481, job #1759).
|
|
3
|
+
*
|
|
4
|
+
* WHY. Work rolls from one sprint to the next all the time (634 unfinished open-sprint items carried over on the test bed), and PMOS showed
|
|
5
|
+
* only THAT it slips (the carried-over line on Work › Backlog), not why. When a sprint closes, each ticket it carried takes one reason with
|
|
6
|
+
* one tap, and the sprint's "Carried to" block counts them, so a sprint review reads "3 blocked · 2 bigger than thought" instead of "5 carried".
|
|
7
|
+
*
|
|
8
|
+
* THE FILE. <state>/tracker/jira/_rollover-reasons.jsonl, next to _sprint-history.jsonl. Append-only, one line per tap:
|
|
9
|
+
* { at, sprint, key, reason: blocked|bigger|pushed|waiting|null, by }
|
|
10
|
+
* The latest line per sprint and ticket wins; reason null clears it (Undo, or the PM changed their mind). Nothing is written to Jira.
|
|
11
|
+
*
|
|
12
|
+
* REASONS, LABELS
|
|
13
|
+
* record(root, { sprint, key, reason, by, at }) → { ok, was } | { ok: false, error }
|
|
14
|
+
* saveCarried(root, { sprint, key, reason, by }, sin?) → the same, only for a ticket a kept closed sprint carried (the page and the chat)
|
|
15
|
+
* read(root) → [line]
|
|
16
|
+
* foldOf(lines) → Map 'sprint|KEY' → { reason, at, by }
|
|
17
|
+
* whyOf(rows, fold, sprint) → { blocked, bigger, pushed, waiting, unsaid } | null (null when no row was carried)
|
|
18
|
+
* count(root) → whole percent of the carried tickets of kept closed sprints that have a reason (0 when none was carried)
|
|
19
|
+
*
|
|
20
|
+
* BOUNDARY. No network, no child process. Writes only its own file. Every write logs one line starting [rollover-reason]. */
|
|
21
|
+
const fs = require('fs');
|
|
22
|
+
const path = require('path');
|
|
23
|
+
const jiraTickets = require('./jira-tickets.js');
|
|
24
|
+
|
|
25
|
+
const FILE = '_rollover-reasons.jsonl';
|
|
26
|
+
const REASONS = ['blocked', 'bigger', 'pushed', 'waiting'];
|
|
27
|
+
const LABELS = { blocked: 'Blocked', bigger: 'Bigger than thought', pushed: 'Pushed down', waiting: 'Waiting on someone' };
|
|
28
|
+
const KEY_RE = /^[A-Z][A-Z0-9_]*-\d+$/;
|
|
29
|
+
const fileOf = (root) => path.join(jiraTickets.jiraDir(root), FILE);
|
|
30
|
+
const idOf = (sprint, key) => sprint + '|' + key;
|
|
31
|
+
const say = (s) => { try { console.log('[rollover-reason] ' + s); } catch { /* no console */ } };
|
|
32
|
+
|
|
33
|
+
function read(root) {
|
|
34
|
+
let raw = '';
|
|
35
|
+
try { raw = fs.readFileSync(fileOf(root), 'utf8'); } catch { return []; }
|
|
36
|
+
const out = [];
|
|
37
|
+
for (const l of raw.split('\n')) {
|
|
38
|
+
if (!l.trim()) continue;
|
|
39
|
+
try {
|
|
40
|
+
const o = JSON.parse(l);
|
|
41
|
+
if (o && typeof o.sprint === 'string' && o.sprint && KEY_RE.test(String(o.key || '')) && (o.reason === null || REASONS.includes(o.reason))) out.push(o);
|
|
42
|
+
} catch { /* a torn line has no effect */ }
|
|
43
|
+
}
|
|
44
|
+
return out;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** The latest reason per sprint and ticket. A cleared one is left out. */
|
|
48
|
+
function foldOf(lines) {
|
|
49
|
+
const m = new Map();
|
|
50
|
+
for (const l of lines || []) {
|
|
51
|
+
const id = idOf(l.sprint, String(l.key).toUpperCase());
|
|
52
|
+
if (l.reason) m.set(id, { reason: l.reason, at: l.at || null, by: l.by || null }); else m.delete(id);
|
|
53
|
+
}
|
|
54
|
+
return m;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Check one tap: → { sprint, key, reason } | { error } */
|
|
58
|
+
function checkOf(inp) {
|
|
59
|
+
const sprint = typeof inp.sprint === 'string' ? inp.sprint.trim().slice(0, 120) : '';
|
|
60
|
+
const key = String(inp.key || '').trim().toUpperCase();
|
|
61
|
+
const reason = inp.reason == null || inp.reason === '' ? null : String(inp.reason);
|
|
62
|
+
if (!sprint) return { error: 'sprint names the closed sprint the ticket rolled out of' };
|
|
63
|
+
if (!KEY_RE.test(key)) return { error: 'key is a Jira key like ATL-12' };
|
|
64
|
+
if (reason !== null && !REASONS.includes(reason)) return { error: 'reason is one of ' + REASONS.join(', ') + ', or null to clear it' };
|
|
65
|
+
return { sprint, key, reason };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Save one tap. → { ok, was (the reason before, or null) } | { ok: false, error } */
|
|
69
|
+
function record(root, inp) {
|
|
70
|
+
const c = checkOf(inp || {});
|
|
71
|
+
if (c.error) return { ok: false, error: c.error };
|
|
72
|
+
const was = (foldOf(read(root)).get(idOf(c.sprint, c.key)) || {}).reason || null;
|
|
73
|
+
const line = { at: inp.at || new Date().toISOString(), sprint: c.sprint, key: c.key, reason: c.reason, by: String(inp.by || 'pm').slice(0, 120) };
|
|
74
|
+
const f = fileOf(root);
|
|
75
|
+
fs.mkdirSync(path.dirname(f), { recursive: true });
|
|
76
|
+
fs.appendFileSync(f, JSON.stringify(line) + '\n');
|
|
77
|
+
say(`${c.sprint} ${c.key} ${c.reason ? 'reason ' + c.reason : 'reason cleared'}${was && was !== c.reason ? ' (was ' + was + ')' : ''}`);
|
|
78
|
+
return { ok: true, was };
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** One tap from the page or the chat: only a ticket a kept closed sprint carried takes a reason. sin is what lib/sprint-history.js detailOf
|
|
82
|
+
* reads (the route passes the board's; the CLI passes { lines }). → { ok, was } | { ok: false, error } */
|
|
83
|
+
function saveCarried(root, inp, sin) {
|
|
84
|
+
const c = checkOf(inp || {});
|
|
85
|
+
if (c.error) return { ok: false, error: c.error };
|
|
86
|
+
const SH = require('./sprint-history.js');
|
|
87
|
+
const d = SH.detailOf(c.sprint, sin || { lines: SH.read(root) });
|
|
88
|
+
if (!d || d.state !== 'closed' || !d.rows) return { ok: false, error: `PMOS kept no closed sprint named "${c.sprint}"` };
|
|
89
|
+
if (!d.rows.some((r) => r.key === c.key && r.category !== 'done')) return { ok: false, error: `${c.key} did not roll out of ${c.sprint}` };
|
|
90
|
+
return record(root, { ...c, by: inp.by, at: inp.at });
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** The counts for one sprint's carried rows. Zero is silence for the caller: null when the sprint carried nothing. */
|
|
94
|
+
function whyOf(rows, fold, sprint) {
|
|
95
|
+
const carried = (rows || []).filter((r) => r && r.category !== 'done' && !r.removed);
|
|
96
|
+
if (!carried.length) return null;
|
|
97
|
+
const out = { blocked: 0, bigger: 0, pushed: 0, waiting: 0, unsaid: 0 };
|
|
98
|
+
for (const r of carried) {
|
|
99
|
+
const f = fold ? fold.get(idOf(sprint, String(r.key).toUpperCase())) : null;
|
|
100
|
+
if (f && REASONS.includes(f.reason)) out[f.reason]++; else out.unsaid++;
|
|
101
|
+
}
|
|
102
|
+
return out;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** The health number: the share (whole percent) of the tickets carried out of kept closed sprints that have a reason. */
|
|
106
|
+
function count(root) {
|
|
107
|
+
const SH = require('./sprint-history.js');
|
|
108
|
+
const lines = SH.read(root), fold = foldOf(read(root));
|
|
109
|
+
let all = 0, said = 0;
|
|
110
|
+
for (const name of new Set(lines.map((l) => l.sprint.name))) {
|
|
111
|
+
const s = SH.snapshotOf(lines, name);
|
|
112
|
+
if (!s || s.sprint.state !== 'closed') continue;
|
|
113
|
+
const w = whyOf(s.rows, fold, name);
|
|
114
|
+
if (!w) continue;
|
|
115
|
+
all += w.blocked + w.bigger + w.pushed + w.waiting + w.unsaid;
|
|
116
|
+
said += w.blocked + w.bigger + w.pushed + w.waiting;
|
|
117
|
+
}
|
|
118
|
+
return all ? Math.round((said / all) * 100) : 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
module.exports = { FILE, REASONS, LABELS, KEY_RE, fileOf, read, foldOf, checkOf, record, saveCarried, whyOf, count };
|
|
122
|
+
|
|
123
|
+
if (require.main === module) {
|
|
124
|
+
const [cmd, dir] = process.argv.slice(2);
|
|
125
|
+
if (cmd !== 'count') { console.error('usage: node workspace/lib/rollover-reasons.js count [<product checkout>] (percent of carried tickets with a reason)'); process.exit(2); }
|
|
126
|
+
console.log(String(count(path.resolve(dir || '.'))));
|
|
127
|
+
}
|