create-pmos 0.782.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 +39 -23
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/changelog.json +38 -0
- package/workspace/guide/cli.md +1 -0
- package/workspace/guide/jira.md +12 -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/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-history.js +8 -2
- package/workspace/lib/{routes-star-drafts.js → star-drafts-route.js} +1 -1
- 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/test-lists/rollover-reason.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.783.0",
|
|
4
4
|
"description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -33,6 +33,44 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.783.0",
|
|
38
|
+
"at": "2026-11-24T16:37:58.744Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1778,
|
|
43
|
+
"t": "Name the catalog and draft routes outside routes-*, so d86-seams check 7 passes",
|
|
44
|
+
"s": "Name the catalog and draft routes outside routes-*, so d86-seams check 7 passes",
|
|
45
|
+
"k": "fix",
|
|
46
|
+
"try": {
|
|
47
|
+
"steps": [
|
|
48
|
+
"On Work, open an initiative whose Overview says Goal: Not written yet, and press ✓ on its ✦",
|
|
49
|
+
"Wait for the line to say PMOS is drafting it, then read the goal it saved",
|
|
50
|
+
"Press Undo on the toast"
|
|
51
|
+
],
|
|
52
|
+
"see": "The goal line fills in by itself with no chat opening, and Undo puts it back to Not written yet",
|
|
53
|
+
"open": "/premium-board.html"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"n": 1780,
|
|
58
|
+
"t": "One-tap reason when work rolls to the next sprint",
|
|
59
|
+
"s": "One-tap reason when work rolls to the next sprint",
|
|
60
|
+
"k": "new",
|
|
61
|
+
"h": "One-tap reason when work rolls to the next sprint",
|
|
62
|
+
"try": {
|
|
63
|
+
"steps": [
|
|
64
|
+
"Open Work, then a product's Backlog, and press This sprint",
|
|
65
|
+
"Press the sprint name and pick the last closed sprint",
|
|
66
|
+
"Under Carried to, press one reason on a ticket, such as Blocked"
|
|
67
|
+
],
|
|
68
|
+
"see": "The ticket shows Blocked with a clear button, and the Carried to block above counts it: 1 blocked, and one fewer not said yet.",
|
|
69
|
+
"open": "/premium-board.html"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
},
|
|
36
74
|
{
|
|
37
75
|
"v": "0.782.0",
|
|
38
76
|
"at": "2026-11-24T16:18:37.421Z",
|
|
@@ -391,28 +429,6 @@
|
|
|
391
429
|
}
|
|
392
430
|
}
|
|
393
431
|
]
|
|
394
|
-
},
|
|
395
|
-
{
|
|
396
|
-
"v": "0.763.0",
|
|
397
|
-
"at": "2026-11-24T05:36:34.102Z",
|
|
398
|
-
"f": 4,
|
|
399
|
-
"prs": [
|
|
400
|
-
{
|
|
401
|
-
"n": 1719,
|
|
402
|
-
"t": "Tracker sync on Today below 95%, take Jira's value with Undo",
|
|
403
|
-
"s": "Tracker sync on Today below 95%, take Jira's value with Undo",
|
|
404
|
-
"k": "new",
|
|
405
|
-
"try": {
|
|
406
|
-
"steps": [
|
|
407
|
-
"Open Today on a product that differs from Jira on more than 5% of its tasks",
|
|
408
|
-
"Press the down arrow on the ✦ row that names the product, then ✓ on one row or ✓ on the ✦ row",
|
|
409
|
-
"Press Undo in the message that shows"
|
|
410
|
-
],
|
|
411
|
-
"see": "The ✦ row says how many tasks differ from Jira; ✓ makes PMOS say what Jira says and the row leaves; Undo puts back what PMOS said before. A product at 95% or more shows no row.",
|
|
412
|
-
"open": "/today.html"
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
]
|
|
416
432
|
}
|
|
417
433
|
]
|
|
418
434
|
}
|
package/payload/KIT-VERSION
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Eval calibration log"
|
|
4
4
|
description: "Append-only record of every PM override of an evaluator verdict."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-24T16:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-24T16:37:55Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Health budgets"
|
|
4
4
|
description: "Closed registry of health-budget anchors (D59), edited only by the PM."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-24T16:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-24T16:37:55Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Discoveries and friction log"
|
|
4
4
|
description: "Append-only record of what runs discovered and where the process rubbed."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-24T16:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-24T16:37:55Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,42 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.783.0",
|
|
4
|
+
"at": "2026-11-24T16:37:58.744Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1778,
|
|
9
|
+
"t": "Name the catalog and draft routes outside routes-*, so d86-seams check 7 passes",
|
|
10
|
+
"s": "Name the catalog and draft routes outside routes-*, so d86-seams check 7 passes",
|
|
11
|
+
"k": "fix",
|
|
12
|
+
"try": {
|
|
13
|
+
"steps": [
|
|
14
|
+
"On Work, open an initiative whose Overview says Goal: Not written yet, and press ✓ on its ✦",
|
|
15
|
+
"Wait for the line to say PMOS is drafting it, then read the goal it saved",
|
|
16
|
+
"Press Undo on the toast"
|
|
17
|
+
],
|
|
18
|
+
"see": "The goal line fills in by itself with no chat opening, and Undo puts it back to Not written yet",
|
|
19
|
+
"open": "/premium-board.html"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"n": 1780,
|
|
24
|
+
"t": "One-tap reason when work rolls to the next sprint",
|
|
25
|
+
"s": "One-tap reason when work rolls to the next sprint",
|
|
26
|
+
"k": "new",
|
|
27
|
+
"h": "One-tap reason when work rolls to the next sprint",
|
|
28
|
+
"try": {
|
|
29
|
+
"steps": [
|
|
30
|
+
"Open Work, then a product's Backlog, and press This sprint",
|
|
31
|
+
"Press the sprint name and pick the last closed sprint",
|
|
32
|
+
"Under Carried to, press one reason on a ticket, such as Blocked"
|
|
33
|
+
],
|
|
34
|
+
"see": "The ticket shows Blocked with a clear button, and the Carried to block above counts it: 1 blocked, and one fewer not said yet.",
|
|
35
|
+
"open": "/premium-board.html"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
2
40
|
{
|
|
3
41
|
"v": "0.782.0",
|
|
4
42
|
"at": "2026-11-24T16:18:37.421Z",
|
package/workspace/guide/cli.md
CHANGED
|
@@ -874,6 +874,7 @@ The benchmark needs a signed-in agent CLI. It never pushes and never opens a pul
|
|
|
874
874
|
- `pmos jira query --sprint "<name>"`
|
|
875
875
|
- `pmos jira sync --sprint "<name>" --from <file|-> [--dry-run]`
|
|
876
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.
|
|
877
878
|
- `pmos jira which <KEY>`
|
|
878
879
|
- `pmos jira moves`
|
|
879
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.
|
|
@@ -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);
|
|
@@ -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
|
+
}
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
* POST /api/backlog/place { ws, board, key, to } a No home Jira ticket into an initiative (a ticket-move line on the board
|
|
26
26
|
* ledger, as a split or merge writes it; Jira is not written to, D88). to '' takes it back out.
|
|
27
27
|
*
|
|
28
|
+
* POST /api/backlog/sprint-reason { ws, board, sprint, key, reason } why a ticket rolled out of a closed sprint: blocked, bigger, pushed,
|
|
29
|
+
* waiting, or null to clear it (initiative rollover-reason; lib/rollover-reasons.js)
|
|
28
30
|
* Every POST is a page press (lib/pm-guard.js requirePagePress). The gives ledger is <runtime>/backlog/gives.jsonl, append-only, and this file
|
|
29
31
|
* is its one writer. Nothing here sends anything: a message PMOS drafts goes out only after the PM's Approve, through the day run's own send.
|
|
30
32
|
* A task PMOS finished by itself is closed (Done) on the next read, by the same function `pmos task state` runs, written as the agent. */
|
|
@@ -38,6 +40,7 @@ const assigned = require('./work-assigned.js');
|
|
|
38
40
|
const WK = require('./work-kind.js');
|
|
39
41
|
const SO = require('./sprint-overview.js');
|
|
40
42
|
const SH = require('./sprint-history.js');
|
|
43
|
+
const RR = require('./rollover-reasons.js');
|
|
41
44
|
const SN = require('./sprint-now.js');
|
|
42
45
|
/** The PM's own name for Who (PMOS_PM_NAME, else git's user.name: the name Home greets them by); '' when neither is set. */
|
|
43
46
|
const pmNameOf = () => { try { return require('./routes-board-publish.js').sharedBy() || ''; } catch { return ''; } };
|
|
@@ -166,7 +169,8 @@ function sprintInputs(w, board, pmNotes, tasks, jiraStatus) {
|
|
|
166
169
|
for (const k of set) if (typeof k === 'string' && k) projects.add(k.toUpperCase());
|
|
167
170
|
if (!projects.size) for (const t of tasks || []) if (t.key) projects.add(String(t.key).split('-')[0].toUpperCase());
|
|
168
171
|
const notes = read(() => jiraStatus.readSprintNotes(w.root));
|
|
169
|
-
return { lines: read(() => SH.read(w.root)) || [], notes: notes ? notes.notes : [], whole: read(() => jiraStatus.readSprints(w.root)), pmNotes: pmNotes || {}, projects: [...projects]
|
|
172
|
+
return { lines: read(() => SH.read(w.root)) || [], notes: notes ? notes.notes : [], whole: read(() => jiraStatus.readSprints(w.root)), pmNotes: pmNotes || {}, projects: [...projects],
|
|
173
|
+
reasons: read(() => RR.foldOf(RR.read(w.root))) || new Map() };
|
|
170
174
|
}
|
|
171
175
|
|
|
172
176
|
/** A task PMOS finished by itself (or the PM approved) is closed in PMOS, once: the same write as `pmos task state --to Done`, as the agent. */
|
|
@@ -222,7 +226,7 @@ async function handle(req, res, url, ctx) {
|
|
|
222
226
|
if (!d) return send(bad(404, 'PMOS knows no sprint of that name on this board'));
|
|
223
227
|
return send({ status: 200, body: { ok: true, ws: L.ws, board: L.board, sprint: d } });
|
|
224
228
|
}
|
|
225
|
-
if (!['give', 'stop', 'decide', 'undo', 'decline', 'place', 'rank', 'sprint-draft', 'sprint-note'].includes(sub)) return send(bad(404, 'no such route'));
|
|
229
|
+
if (!['give', 'stop', 'decide', 'undo', 'decline', 'place', 'rank', 'sprint-draft', 'sprint-note', 'sprint-reason'].includes(sub)) return send(bad(404, 'no such route'));
|
|
226
230
|
if (req.method !== 'POST') return send(bad(405, 'POST only'));
|
|
227
231
|
const read = await ctx.readJson(req);
|
|
228
232
|
if (!read.ok || !read.body || typeof read.body !== 'object') return send(bad(400, 'the body must be a JSON object'));
|
|
@@ -237,6 +241,14 @@ async function handle(req, res, url, ctx) {
|
|
|
237
241
|
const gives = BL.foldGives(readGives(ctx));
|
|
238
242
|
const giveOf = (id) => (gives.get(BL.keyOf(ws, board, id)) || { give: null, declined: null, n: 0 });
|
|
239
243
|
|
|
244
|
+
// why a ticket rolled to the next sprint (initiative rollover-reason): one tap on a ticket the closed sprint carried; reason null clears it
|
|
245
|
+
if (sub === 'sprint-reason') {
|
|
246
|
+
const r = RR.saveCarried(L._w.root, { sprint: body.sprint, key: body.key, reason: body.reason, by: g.actor.by }, L._sin);
|
|
247
|
+
if (!r.ok) return send(bad(400, r.error));
|
|
248
|
+
const c = RR.checkOf(body);
|
|
249
|
+
return send({ status: 200, body: { ok: true, key: c.key, sprint: c.sprint, reason: c.reason, was: r.was } });
|
|
250
|
+
}
|
|
251
|
+
|
|
240
252
|
// the sprint overview (initiative sprint-overview): PMOS's written draft of one active sprint, and the PM's edits of it
|
|
241
253
|
if (sub === 'sprint-draft' || sub === 'sprint-note') {
|
|
242
254
|
const sprint = text(body.sprint).slice(0, 120);
|
|
@@ -81,9 +81,9 @@ function list(deps = {}) {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
// The commands a card's buttons run live beside the chat's commands (star-buttons-act-directly): GET /api/card-catalog
|
|
84
|
-
// (lib/
|
|
84
|
+
// (lib/card-catalog-route.js) and the ✦ drafts' background job, POST/GET /api/star-drafts (lib/star-drafts-route.js). They ride on this
|
|
85
85
|
// module's entry, so route-modules.js keeps its list.
|
|
86
|
-
const BESIDE = [require('./
|
|
86
|
+
const BESIDE = [require('./card-catalog-route.js'), require('./star-drafts-route.js')];
|
|
87
87
|
|
|
88
88
|
module.exports = {
|
|
89
89
|
prefixes: ['/api/slash-commands', '/api/card-catalog', '/api/star-drafts'],
|
|
@@ -22,13 +22,15 @@
|
|
|
22
22
|
* snapshotOf(lines, name) → the sprint as kept: its rows with their state at close and the counts (fold, pure)
|
|
23
23
|
* closeOf(lines, name) → { done, total, carried, carriedTo, carriedIn, points } | null PMOS's own close numbers (never the agent's)
|
|
24
24
|
* listOf({ lines, notes, whole, pmNotes, projects }) → the sprint picker (SpH1): every sprint PMOS knows of, newest first
|
|
25
|
-
* detailOf(name, same inputs) → one sprint for the frozen view (SpH2) or the never-seen view (SpH3)
|
|
25
|
+
* detailOf(name, same inputs) → one sprint for the frozen view (SpH2) or the never-seen view (SpH3); with inputs.reasons (the fold of
|
|
26
|
+
* lib/rollover-reasons.js) each carried row has its reason and the sprint its `why` counts (initiative rollover-reason)
|
|
26
27
|
* trendOf(list) → { line, bars } the carried-over work across the kept sprints; null when there is nothing to say
|
|
27
28
|
*
|
|
28
29
|
* BOUNDARY. No network, no child process. Reads Jira only through the files the read path saved; writes only the history file. */
|
|
29
30
|
const fs = require('fs');
|
|
30
31
|
const path = require('path');
|
|
31
32
|
const jiraTickets = require('./jira-tickets.js');
|
|
33
|
+
const RR = require('./rollover-reasons.js');
|
|
32
34
|
|
|
33
35
|
const FILE = '_sprint-history.jsonl';
|
|
34
36
|
const fileOf = (root) => path.join(jiraTickets.jiraDir(root), FILE);
|
|
@@ -277,6 +279,10 @@ function detailOf(name, inp) {
|
|
|
277
279
|
}
|
|
278
280
|
for (const t of g.whole) { const r = rows.get(t.key); if (r && !r.url && t.url) r.url = t.url; }
|
|
279
281
|
const R = [...rows.values()].sort((a, b) => a.key.localeCompare(b.key, undefined, { numeric: true }));
|
|
282
|
+
// why each carried ticket rolled on (initiative rollover-reason): one tap per ticket, kept in lib/rollover-reasons.js; done rows take none
|
|
283
|
+
const RF = inp.reasons instanceof Map ? inp.reasons : null;
|
|
284
|
+
for (const r of R) if (r.category !== 'done') r.reason = (RF && RF.get(name + '|' + String(r.key).toUpperCase()) || {}).reason || null;
|
|
285
|
+
const why = RR.whyOf(R, RF, name);
|
|
280
286
|
const removed = g.snap ? g.snap.rows.filter((x) => x.removed) : [];
|
|
281
287
|
// rows the snapshot cannot show (old data): the note counted more than PMOS kept, said once, on one quiet row
|
|
282
288
|
const gotDone = R.filter((r) => r.category === 'done').length, gotCarried = R.filter((r) => r.category !== 'done').length;
|
|
@@ -288,7 +294,7 @@ function detailOf(name, inp) {
|
|
|
288
294
|
const themes = n ? (n.themes || []).map((t) => ({ title: t.title, tickets: t.tickets || 0, done: t.done || 0, keys: Array.isArray(t.keys) ? t.keys.filter((x) => rows.has(x)) : [] })) : [];
|
|
289
295
|
return { ...base, ...k, hit: n && n.hit ? n.hit : null, got: n && n.got ? n.got : null, themes,
|
|
290
296
|
happened: n ? sentences(n.summary).slice(0, 5) : [], rows: R, removed: removed.map((r) => ({ key: r.key, title: r.title })), missing,
|
|
291
|
-
addedLater: g.snap && g.snap.seenOpen ? g.snap.counts.added : null };
|
|
297
|
+
addedLater: g.snap && g.snap.seenOpen ? g.snap.counts.added : null, ...(why ? { why } : {}) };
|
|
292
298
|
}
|
|
293
299
|
|
|
294
300
|
module.exports = { FILE, fileOf, read, append, snapshotOf, closeOf, listOf, detailOf, trendOf, WHY };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
/*
|
|
2
|
+
/* star-drafts-route.js — a ✦ "Draft …" answer as a PMOS background job (star-buttons-act-directly, done test A7; lib/star-draft.js).
|
|
3
3
|
*
|
|
4
4
|
* POST /api/star-drafts { ws, ask, again? } → { ok, state: 'pending' | 'ready' | 'failed', key, text?, why? } starts the job, or
|
|
5
5
|
* answers the kept draft at once
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.783.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.783.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -225,6 +225,17 @@ textarea.bk-rvl-ed, .bk-rvl textarea.bd { resize: vertical; min-height: 180px; }
|
|
|
225
225
|
.bk-past .bk-t { cursor: text; }
|
|
226
226
|
.bk-past a.bk-t { cursor: pointer; }
|
|
227
227
|
.bk-past .bk-more { box-sizing: border-box; width: 100%; }
|
|
228
|
+
/* why a carried ticket rolled on (initiative rollover-reason): one tap under its title */
|
|
229
|
+
.bk-past .bk-wy > .c-n { flex-wrap: wrap; row-gap: var(--space-4); padding: 6px 0; white-space: normal; }
|
|
230
|
+
.bk-past .bk-wy .bk-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
231
|
+
.bk-why { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-left: 24px; }
|
|
232
|
+
.bk-wb { all: unset; cursor: pointer; display: inline-flex; align-items: center; height: 24px; padding: 0 var(--space-8); border-radius: var(--radius-pill); font-size: var(--fs-meta); color: var(--cz-ink2); box-shadow: inset 0 0 0 1px var(--cz-hair); white-space: nowrap; }
|
|
233
|
+
.bk-wb.on { cursor: default; background: var(--cz-ink); color: var(--cz-card); box-shadow: none; }
|
|
234
|
+
.bk-why .bk-wx { width: 22px; height: 22px; }
|
|
235
|
+
.bk-wb:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
236
|
+
@media (hover: hover) { .bk-wb:not(.on):hover { background: var(--cz-well); } }
|
|
237
|
+
@media (pointer: coarse) { .bk-wb { height: 36px; } }
|
|
238
|
+
.sbo-b li.sbo-why span { color: var(--cz-ink2); font-size: var(--fs-meta); }
|
|
228
239
|
.sbo-pk:focus-visible, .sbo-mi:focus-visible, .sbo-mo:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
229
240
|
@media (hover: hover) { .sbo-mi:hover:not(.on) { background: var(--cz-well); } }
|
|
230
241
|
@media (max-width: 1100px) { .sbo-pl { grid-template-columns: 1fr 1fr; } }
|
|
@@ -205,8 +205,10 @@ function pastHtml(o, H, x, deps) {
|
|
|
205
205
|
+ `<div class="sbo-ed"><button type="button" class="bk-ib ok" data-sppsave="${k}" aria-label="Save ${title}" title="Save">${SV(I.ok)}</button><button type="button" class="bk-ib" data-spcancel aria-label="Cancel" title="Cancel">${SV(I.x)}</button></div></div>`;
|
|
206
206
|
return `<div class="sbo-b">${h}${L.length ? ulOf(L) : `<ul class="q"><li><span>${esc(empty)}</span></li></ul>`}</div>`;
|
|
207
207
|
};
|
|
208
|
+
const whyLine = d ? SK.whyLineOf(d.why) : ''; // why they rolled on (initiative rollover-reason): the one-tap reasons, counted
|
|
208
209
|
const carriedCol = x.carried ? `<div class="sbo-b"><h4>Carried to ${esc(to)}</h4><ul><li><span>${x.carried} open ${x.carried === 1 ? 'ticket' : 'tickets'}</span>`
|
|
209
|
-
+ (x.carriedTo && H.list.some((y) => y.name === x.carriedTo) ? `<button type="button" class="bk-lnk" data-spgo="${esc(x.carriedTo)}">open ${esc(to)}</button>` : '') + '</li
|
|
210
|
+
+ (x.carriedTo && H.list.some((y) => y.name === x.carriedTo) ? `<button type="button" class="bk-lnk" data-spgo="${esc(x.carriedTo)}">open ${esc(to)}</button>` : '') + '</li>'
|
|
211
|
+
+ (whyLine ? `<li class="sbo-why"><span>${esc(whyLine)}</span></li>` : '') + '</ul></div>' : '';
|
|
210
212
|
const pl = `<div class="sbo-pl">${pblock('happened', 'What happened', happened, !note.happened, 'PMOS writes this when the sprint closes.')}${carriedCol}${pblock('lessons', 'Lessons', lessons, false, 'Add what the team learned. Kept with the snapshot.')}</div>`;
|
|
211
213
|
return `<section class="sbo-band sbo-past" aria-label="${esc(SK.labelOf(x.name))}, snapshot"><div class="sbo-top">${sum}${th}</div>${pl}</section>`;
|
|
212
214
|
}
|
|
@@ -222,21 +224,31 @@ export function pastListHtml() {
|
|
|
222
224
|
const as = CURP.x.keptAt ? 'as read on ' + SK.dayOf(CURP.x.keptAt) : '';
|
|
223
225
|
const cols = 'style="--bk-cols: 40px minmax(240px, 1fr) 104px minmax(80px, 160px) minmax(140px, 220px) 72px"';
|
|
224
226
|
const head = '<div class="bk-r bk-h" role="row"><span class="c-ck"></span><span class="c-n">Task</span><span class="c-jira">Jira ticket</span><span class="c-epic">Epic</span><span class="c-state">State at close</span><span class="c-a"></span></div>';
|
|
225
|
-
const row = (r) => `<div class="bk-r bk-i" role="row"><span class="c-ck"></span><span class="c-n bk-n"><i class="bk-ic" title="Task">${SV('M5 5h14v14H5z')}</i>`
|
|
226
|
-
+ (r.url ? `<a class="bk-t" href="${esc(r.url)}" target="_blank" rel="noopener" title="${esc(r.title)}">${esc(r.title)}</a>` : `<span class="bk-t" title="${esc(r.title)}">${esc(r.title)}</span>`) + '</span>'
|
|
227
|
-
+ `<span class="c-jira"><span class="bk-jk" title="Jira ticket ${esc(r.key)}">${SV(I.jira)}${esc(r.key)}</span></span>`
|
|
228
|
-
+ `<span class="c-epic">${r.epicName || r.epic ? `<span title="${esc(r.epicName || r.epic)}">${esc(r.epicName || r.epic)}</span>` : '<span class="q">No epic</span>'}</span>`
|
|
229
|
-
+ `<span class="c-state bk-s"><i class="bk-dot ${r.category === 'done' ? 'green' : r.category === 'doing' ? 'blue' : ''}"></i>${esc(r.status || (r.category === 'done' ? 'Done' : 'Open'))}</span><span class="c-a"></span></div>`;
|
|
230
227
|
const body = G.map((g, i) => {
|
|
231
228
|
const cut = g.k === 'done' && !PMORE && !th && g.rows.length > 6;
|
|
232
229
|
const R = cut ? g.rows.slice(0, 6) : g.rows;
|
|
233
230
|
return `<div class="bk-r bk-g open" role="row"><span class="bk-gt"><b>${esc(g.n)}</b><span class="k">${g.rows.length} kept</span></span>${i === 0 && as ? `<span class="bk-gs">${esc(as)}</span>` : ''}${th ? `<button type="button" class="bk-lnk" data-spall>Show all</button>` : ''}</div>`
|
|
234
|
-
+ R.map(
|
|
231
|
+
+ R.map(pastRowHtml).join('') + (cut ? `<button type="button" class="bk-r bk-more" data-sppmore>${SV(I.chev)}${g.rows.length - 6} more done ${g.rows.length - 6 === 1 ? 'ticket' : 'tickets'}</button>` : '');
|
|
235
232
|
}).join('') || '<p class="bk-none">PMOS kept no row of this sprint\'s tickets.</p>';
|
|
236
233
|
const miss = SK.missingLineOf(d.missing);
|
|
237
234
|
return `<div class="bk bk-past" role="table" aria-label="${esc(SK.labelOf(d.name))} at close" ${cols}>${head}${body}${miss && !th ? `<p class="sbo-miss" role="row">${esc(miss)}</p>` : ''}</div>`;
|
|
238
235
|
}
|
|
239
236
|
|
|
237
|
+
/** One row of a past sprint's list: its state at close, and for a carried ticket why it rolled on (whyHtml). */
|
|
238
|
+
export const pastRowHtml = (r) => `<div class="bk-r bk-i${r.category !== 'done' ? ' bk-wy' : ''}" role="row"><span class="c-ck"></span><span class="c-n bk-n"><i class="bk-ic" title="Task">${SV('M5 5h14v14H5z')}</i>`
|
|
239
|
+
+ (r.url ? `<a class="bk-t" href="${esc(r.url)}" target="_blank" rel="noopener" title="${esc(r.title)}">${esc(r.title)}</a>` : `<span class="bk-t" title="${esc(r.title)}">${esc(r.title)}</span>`)
|
|
240
|
+
+ (r.category !== 'done' ? whyHtml(r) : '') + '</span>'
|
|
241
|
+
+ `<span class="c-jira"><span class="bk-jk" title="Jira ticket ${esc(r.key)}">${SV(I.jira)}${esc(r.key)}</span></span>`
|
|
242
|
+
+ `<span class="c-epic">${r.epicName || r.epic ? `<span title="${esc(r.epicName || r.epic)}">${esc(r.epicName || r.epic)}</span>` : '<span class="q">No epic</span>'}</span>`
|
|
243
|
+
+ `<span class="c-state bk-s"><i class="bk-dot ${r.category === 'done' ? 'green' : r.category === 'doing' ? 'blue' : ''}"></i>${esc(r.status || (r.category === 'done' ? 'Done' : 'Open'))}</span><span class="c-a"></span></div>`;
|
|
244
|
+
/** Why a carried ticket rolled on (initiative rollover-reason): the four reasons as one-tap buttons, or the one said and a button to take it
|
|
245
|
+
* back. Nothing is written to Jira. */
|
|
246
|
+
function whyHtml(r) {
|
|
247
|
+
if (r.reason) return `<span class="bk-why"><span class="bk-wb on">${esc(SK.whyLabelOf(r.reason))}</span>`
|
|
248
|
+
+ `<button type="button" class="bk-ib bk-wx" data-spwhyx="${esc(r.key)}" aria-label="${esc('Take back why ' + r.key + ' rolled on')}" title="Take back">${SV(I.x)}</button></span>`;
|
|
249
|
+
return `<span class="bk-why" role="group" aria-label="${esc('Why ' + r.key + ' rolled to the next sprint')}">`
|
|
250
|
+
+ SK.WHY.map(([k, l]) => `<button type="button" class="bk-wb" data-spwhy="${k}" data-spkey="${esc(r.key)}">${esc(l)}</button>`).join('') + '</span>';
|
|
251
|
+
}
|
|
240
252
|
/** The theme pressed, for the list below: { name, uids: Set, total } | null. */
|
|
241
253
|
export function themeOf() {
|
|
242
254
|
if (!THEME || !CUR || CURP) return null;
|
|
@@ -260,6 +272,7 @@ export async function press(e, deps) {
|
|
|
260
272
|
deps.draw(); const k = document.querySelector('[data-spmenu]'); if (k) k.focus(); return true;
|
|
261
273
|
}
|
|
262
274
|
if (hit('data-sppmore')) { PMORE = true; deps.draw(); return true; }
|
|
275
|
+
if (CURP && CURP.d && ((b = hit('data-spwhy')) || (b = hit('data-spwhyx')))) return why(b, deps);
|
|
263
276
|
if (hit('data-spcancel')) { EDIT = ''; deps.draw(); return true; }
|
|
264
277
|
if (CURP && hit('data-spfill')) {
|
|
265
278
|
const { H, x } = CURP, k = H.ws + '|' + H.board + '|' + x.name;
|
|
@@ -335,6 +348,26 @@ export async function press(e, deps) {
|
|
|
335
348
|
if ((b = hit('data-spok'))) { const p = CUR.props.find((x) => x.id === b.dataset.spok); return p ? accept(p, b, deps) : true; }
|
|
336
349
|
return false;
|
|
337
350
|
}
|
|
351
|
+
/** One tap on why a carried ticket rolled on, or its take-back; both with Undo. The kept detail is updated in place, then read again. */
|
|
352
|
+
async function why(b, deps) {
|
|
353
|
+
const { H, x, d } = CURP, key = b.dataset.spkey || b.dataset.spwhyx, reason = b.dataset.spwhy || null;
|
|
354
|
+
const row = (d.rows || []).find((r) => r.key === key);
|
|
355
|
+
if (!row) return true;
|
|
356
|
+
const set = async (to) => {
|
|
357
|
+
const r = await deps.post('/api/backlog/sprint-reason', { ws: H.ws, board: H.board, sprint: x.name, key, reason: to });
|
|
358
|
+
if (!r || r.ok === false) { deps.say((r && r.error) || 'The reason was not saved.'); return null; }
|
|
359
|
+
const was = row.reason || null;
|
|
360
|
+
row.reason = to;
|
|
361
|
+
if (d.why) { if (was) d.why[was]--; else d.why.unsaid--; if (to) d.why[to]++; else d.why.unsaid++; }
|
|
362
|
+
deps.draw();
|
|
363
|
+
return r;
|
|
364
|
+
};
|
|
365
|
+
const r = await set(reason);
|
|
366
|
+
if (!r) return true;
|
|
367
|
+
const was = r.was || null;
|
|
368
|
+
deps.say(reason ? `${key}: ${SK.whyLabelOf(reason).toLowerCase()}.` : `${key}: reason taken back.`, () => set(was));
|
|
369
|
+
return true;
|
|
370
|
+
}
|
|
338
371
|
/** No on a proposal: not now, with Undo. */
|
|
339
372
|
async function dismiss(p, at, deps) {
|
|
340
373
|
const r = await deps.post('/api/backlog/sprint-note', { ...at, ev: 'dismiss', id: p.id });
|
|
@@ -305,6 +305,16 @@ export function pastGroupsOf(d, keys) {
|
|
|
305
305
|
if (open.length) G.push({ k: 'carried', n: 'Carried to ' + to, rows: open });
|
|
306
306
|
return G;
|
|
307
307
|
}
|
|
308
|
+
/** Why work rolled to the next sprint (initiative rollover-reason): the four one-tap reasons, in the order the row shows them. */
|
|
309
|
+
export const WHY = [['blocked', 'Blocked'], ['bigger', 'Bigger than thought'], ['pushed', 'Pushed down'], ['waiting', 'Waiting on someone']];
|
|
310
|
+
export const whyLabelOf = (k) => (WHY.find(([x]) => x === k) || [, ''])[1];
|
|
311
|
+
/** The carried block's count line: each reason with tickets, largest first, then the ones not said. Zero is silence: '' with nothing carried. */
|
|
312
|
+
export function whyLineOf(w) {
|
|
313
|
+
if (!w) return '';
|
|
314
|
+
const said = WHY.filter(([k]) => w[k] > 0).sort((a, b) => w[b[0]] - w[a[0]]).map(([k, l]) => `${w[k]} ${l.toLowerCase()}`);
|
|
315
|
+
if (w.unsaid > 0) said.push(`${w.unsaid} not said yet`);
|
|
316
|
+
return said.join(' · ');
|
|
317
|
+
}
|
|
308
318
|
/** The one quiet row for rows the snapshot does not hold (old data): '' when none are missing. */
|
|
309
319
|
export function missingLineOf(m) {
|
|
310
320
|
if (!m || (!m.done && !m.carried)) return '';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "One-tap reason when work rolls to the next sprint (initiative rollover-reason, done test planning/done-tests/rollover-reason.md R1-R7). The store, the fold, the write the route and the chat share, the CLI and the rendered rows, in process. No connector, model or network.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"rollover-reason.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"rollover-reason.test.js": 2
|
|
8
|
+
}
|
|
9
|
+
}
|