create-pmos 0.402.0 → 0.403.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 +13 -13
- 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/board-programs-test.js +6 -5
- package/workspace/briefing-premium-adddoc-test.js +28 -22
- package/workspace/briefing-premium-board-test.js +91 -73
- package/workspace/briefing-premium-calendar-2-test.js +23 -10
- package/workspace/briefing-premium-calendar-3-test.js +23 -19
- package/workspace/briefing-premium-calendar-test.js +19 -17
- package/workspace/briefing-premium-initiative-test.js +25 -12
- package/workspace/briefing-premium-insights-test.js +31 -18
- package/workspace/briefing-premium-metrics-test.js +8 -8
- package/workspace/briefing-premium-test.js +4 -3
- package/workspace/changelog.json +12 -0
- package/workspace/fixtures/premium-viewer-fixtures.js +24 -2
- package/workspace/guide/jira.md +38 -6
- package/workspace/home-rows-test.js +184 -0
- package/workspace/lib/calendar-layers.js +8 -4
- package/workspace/lib/initiative-layout.js +4 -3
- package/workspace/lib/jira-cli.js +17 -12
- package/workspace/lib/jira-status.js +1 -1
- package/workspace/lib/jira-tickets.js +126 -24
- package/workspace/lib/meeting-files.js +58 -0
- package/workspace/lib/meeting-learn.js +139 -0
- package/workspace/lib/meeting-material.js +12 -5
- package/workspace/lib/notes.js +3 -0
- package/workspace/lib/routes-brief-page.js +8 -1
- package/workspace/lib/routes-calendar-views.js +24 -3
- package/workspace/lib/routes-meeting-material.js +38 -0
- package/workspace/lib/routes-meeting-points.js +23 -3
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +30 -24
- package/workspace/premium-chat-context-test.js +1 -1
- package/workspace/premium-chat-goal-view-test.js +1 -1
- package/workspace/premium-chat-viewer-test.js +1 -1
- package/workspace/premium-core-doc-issue-test.js +13 -7
- package/workspace/premium-discuss-landing-test.js +83 -0
- package/workspace/premium-link-suggest-test.js +103 -0
- package/workspace/premium-report-read-test.js +86 -82
- package/workspace/premium-vw-backlog-test.js +6 -5
- package/workspace/premium-vw-cal-test.js +46 -23
- package/workspace/premium-vw-item-test.js +8 -6
- package/workspace/premium-vw-jira-test.js +3 -2
- package/workspace/premium-vw-meet-test.js +122 -66
- package/workspace/premium-vw-notes-test.js +7 -6
- package/workspace/premium-vw-rec-test.js +14 -13
- package/workspace/premium-vw-slides-test.js +11 -5
- package/workspace/program-panel-test.js +64 -55
- package/workspace/public/pm/bd-acts.js +1 -1
- package/workspace/public/pm/bd-asks.js +22 -7
- package/workspace/public/pm/bd-ini-panel.js +229 -0
- package/workspace/public/pm/bd-pop.js +2 -2
- package/workspace/public/pm/bd-prog-panel.js +176 -191
- package/workspace/public/pm/cozy-board.css +5 -28
- package/workspace/public/pm/cozy-evui.js +4 -2
- package/workspace/public/pm/cozy-home-rows.css +54 -0
- package/workspace/public/pm/cozy-home.css +9 -0
- package/workspace/public/pm/cozy-insights.css +1 -2
- package/workspace/public/pm/cozy-mtg-present.css +160 -0
- package/workspace/public/pm/cozy-panel.css +11 -34
- package/workspace/public/pm/cozy-rec-pill.css +12 -0
- package/workspace/public/pm/cozy-rec-pill.js +46 -0
- package/workspace/public/pm/cozy-viewer.js +307 -43
- package/workspace/public/pm/cozy-vw-mtg.css +96 -94
- package/workspace/public/pm/cozy-vw-rp.css +40 -25
- package/workspace/public/pm/cozy-vw-shell.css +127 -0
- package/workspace/public/pm/cozy-xv.css +51 -0
- package/workspace/public/pm/cozy-xv.js +34 -0
- package/workspace/public/pm/home-app.js +122 -58
- package/workspace/public/pm/home-chat.js +11 -2
- package/workspace/public/pm/home-day.js +64 -0
- package/workspace/public/pm/home-ini-model.js +1 -1
- package/workspace/public/pm/home-ini.js +197 -54
- package/workspace/public/pm/home-list.js +6 -14
- package/workspace/public/pm/home-mentions.js +187 -0
- package/workspace/public/pm/home-rec-row.js +67 -0
- package/workspace/public/pm/home-review.js +20 -10
- package/workspace/public/pm/home-task.js +19 -18
- package/workspace/public/pm/home-today.js +3 -3
- package/workspace/public/pm/premium-board.js +73 -235
- package/workspace/public/pm/premium-insights.js +118 -82
- package/workspace/public/pm/premium-mtg-present.js +408 -100
- package/workspace/public/pm/premium-mtg-replay.js +70 -10
- package/workspace/public/pm/premium-report-read.js +118 -63
- package/workspace/public/pm/premium-vw-cal.js +62 -34
- package/workspace/public/pm/premium-vw-mtg.js +348 -192
- package/workspace/public/pm/rec-state.js +63 -0
- package/workspace/public/pm/rp-parts.js +33 -8
- package/workspace/public/pm/tk-draft.js +107 -0
- package/workspace/public/pm/tk-model.js +134 -0
- package/workspace/public/pm/tk-send.js +124 -0
- package/workspace/public/pm/tk-tasks.css +120 -0
- package/workspace/public/premium-board.html +0 -1
- package/workspace/server.js +4 -2
- package/workspace/skills/jira-push.skill +3 -3
- package/workspace/test-lists/prd-to-jira.json +6 -0
- package/workspace/test-lists/viewer-home-rows.json +9 -0
- package/workspace/test-lists/viewer-meetings.json +9 -0
- package/workspace/test-lists/viewer-shell-a.json +15 -0
- package/workspace/tk-tasks-test.js +199 -0
package/workspace/guide/jira.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "Jira: tickets drafted from the PRD, and their status"
|
|
4
4
|
description: "How to draft Jira tickets from a PRD in your ticket template, push the ones that are ready, and see their status, sprint and progress on the initiative's Jira tickets tab."
|
|
5
|
-
timestamp: 2026-10-
|
|
5
|
+
timestamp: 2026-10-24
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Jira: tickets drafted from the PRD, and their status
|
|
@@ -20,6 +20,8 @@ PMOS owns the text of a ticket. Jira owns its status. PMOS holds no Jira passwor
|
|
|
20
20
|
|
|
21
21
|
Open an initiative. Its sheet has four tabs: Breakdown, Files, History and **Jira tickets**.
|
|
22
22
|
|
|
23
|
+
On Home, open the initiative's **Tasks**. When the PRD has ticket items, the Tasks are grouped by **Epic**: one group for each epic, in the order of the PRD. Each drafted ticket is a row. Press a row to open the ticket. To group the Tasks in another way, open **⋯ › Group tasks by**. On a phone, the Tasks, Documents and Stage switch is at the top.
|
|
24
|
+
|
|
23
25
|
In a document repository whose lane has a Handoff stage, the Jira tickets tab opens when the handoff is done. Mark the Handoff item done in the Breakdown, or record `handed_off:` in the initiative. In other repositories the tab is open as soon as the PRD has ticket items.
|
|
24
26
|
|
|
25
27
|
## Write the ticket items in the PRD
|
|
@@ -50,6 +52,26 @@ As a PM, I want every GA4 event to carry the runtime version, so that I can comp
|
|
|
50
52
|
- Text before the first subsection is the User Story when it starts "As a …".
|
|
51
53
|
- A bullet such as `- **S1 · Pay with a saved card.** As a …` also works.
|
|
52
54
|
|
|
55
|
+
### Several epics
|
|
56
|
+
|
|
57
|
+
To send the tickets of one initiative into more than one epic, put each group of tickets under a subheading with no ID. The subheading is the epic's name. A prefix `Epic:` is optional:
|
|
58
|
+
|
|
59
|
+
```markdown
|
|
60
|
+
## User stories
|
|
61
|
+
|
|
62
|
+
### Sign-in and sign-up
|
|
63
|
+
|
|
64
|
+
#### S1 · Sign-in parity
|
|
65
|
+
…
|
|
66
|
+
|
|
67
|
+
### Epic: Sessions and SSO
|
|
68
|
+
|
|
69
|
+
#### S4 · Session and SSO parity
|
|
70
|
+
…
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
A ticket that is not under such a subheading goes into the initiative's epic. A PRD with no such subheadings has one epic, as before.
|
|
74
|
+
|
|
53
75
|
## Draft, read and edit
|
|
54
76
|
|
|
55
77
|
Press **Draft tickets**, or run:
|
|
@@ -70,16 +92,26 @@ pmos jira show <initiative>
|
|
|
70
92
|
|
|
71
93
|
## Choose the epic
|
|
72
94
|
|
|
73
|
-
|
|
95
|
+
The **Send to Jira** sheet shows the epic of each group. Press **Change** to choose **Create a new epic** (named after the group, or after the initiative for the tickets in no group) or to paste the link or key of an existing epic. After the first push the epic of a group is fixed. In the terminal:
|
|
74
96
|
|
|
75
97
|
```
|
|
76
98
|
pmos jira epic <initiative> new
|
|
77
99
|
pmos jira epic <initiative> ATL-482
|
|
100
|
+
pmos jira epic <initiative> ATL-482 --group sign-in-and-sign-up
|
|
78
101
|
```
|
|
79
102
|
|
|
103
|
+
The group is the epic's name in lowercase, with hyphens for spaces (`pmos jira show <initiative>` lists the groups).
|
|
104
|
+
|
|
80
105
|
## Push the tickets that are ready
|
|
81
106
|
|
|
82
|
-
|
|
107
|
+
All the ways to send open the same **Send to Jira** sheet:
|
|
108
|
+
|
|
109
|
+
- the send icon of an epic group in the Tasks,
|
|
110
|
+
- the send icon of a drafted ticket,
|
|
111
|
+
- **Send to Jira** at the top of the Tasks on a desktop,
|
|
112
|
+
- **Commit** on the Board, when the initiative is yours to commit.
|
|
113
|
+
|
|
114
|
+
The sheet shows the Jira project, the epic of each group and the tickets with a tick each. A ticket that lacks text is shown with what it lacks, and you cannot tick it. Press **Send N**. Nothing goes to Jira before you press it. Only ticked tickets are sent. An agent session starts and creates the epics and the tickets. A ticket you edit after you sent it must be sent again.
|
|
83
115
|
|
|
84
116
|
In your own terminal, the same selection is:
|
|
85
117
|
|
|
@@ -89,7 +121,7 @@ pmos jira approve <initiative> TD-01 TD-02
|
|
|
89
121
|
|
|
90
122
|
It asks you to type the initiative's id. An agent session cannot select tickets.
|
|
91
123
|
|
|
92
|
-
The agent runs the **Push to Jira** skill. It reads what to send with `pmos jira pending <initiative>`, and records each key with `pmos jira record <initiative> TD-01=ATL-491`. It never moves, assigns, comments on, closes or deletes a Jira issue.
|
|
124
|
+
The agent runs the **Push to Jira** skill. It reads what to send with `pmos jira pending <initiative>`, and records each key with `pmos jira record <initiative> TD-01=ATL-491`. It records the epic it creates for a group with `pmos jira record <initiative> --epic ATL-490 --group <group>`. It never moves, assigns, comments on, closes or deletes a Jira issue.
|
|
93
125
|
|
|
94
126
|
## Status, sprint and progress
|
|
95
127
|
|
|
@@ -183,10 +215,10 @@ The morning brief, the day check and requirement gathering use it to tie a Jira
|
|
|
183
215
|
|
|
184
216
|
- `pmos jira draft <initiative> [--dry-run]`
|
|
185
217
|
- `pmos jira show <initiative>`
|
|
186
|
-
- `pmos jira epic <initiative> new|<KEY or link
|
|
218
|
+
- `pmos jira epic <initiative> new|<KEY or link> [--group <group>]`
|
|
187
219
|
- `pmos jira approve <initiative> <ID> …`
|
|
188
220
|
- `pmos jira pending <initiative>`
|
|
189
|
-
- `pmos jira record <initiative> [ID=KEY …] [--epic KEY] [--updated ID,ID]`
|
|
221
|
+
- `pmos jira record <initiative> [ID=KEY …] [--epic KEY [--group <group>]] [--updated ID,ID]`
|
|
190
222
|
- `pmos jira query [<initiative>]`
|
|
191
223
|
- `pmos jira sync <initiative> --from <file|-> [--query "<jql>"] [--dry-run]`
|
|
192
224
|
- `pmos jira query --sprints`
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* home-rows-test.js — the two rows at the top of Home and the Mentions Viewer (Viewer kit; canvas XvANew, XvAMention, XvAMentionJira,
|
|
4
|
+
* XvAMentionDoc, XvAMentionMail, XvARecHome; public/pm/home-mentions.js, home-rec-row.js).
|
|
5
|
+
* Serves the real page from the real server. GET /api/briefing-premium answers the fixture model (as briefing-premium-test.js does),
|
|
6
|
+
* GET /api/brief-page is the server's own answer with today's mentions put in, and GET /api/notes says whether a meeting records.
|
|
7
|
+
* M1 @Mentions is the first row of the list with "N new"; with none new the row stays, quiet, with no count
|
|
8
|
+
* M2 no mention is a row under an initiative or under Not in an initiative any more (say it once)
|
|
9
|
+
* M3 the row opens the Mentions Viewer: the summary (N new, ONE primary Reply to <first>), New open, Earlier folded with its count
|
|
10
|
+
* M4 a mention drills in: ← returns to Mentions; the summary, the excerpt with the mention outlined, What I checked only when checked,
|
|
11
|
+
* Open in <source> and the initiative; ⋯ holds Make it a task and Mark read, and Mark read posts the mark
|
|
12
|
+
* R1 a recording pins a row above @Mentions with its title and a ticking clock; paused is quieter and still; none: no row
|
|
13
|
+
* F a phone (390 px): the rows, and the Viewer full screen; no page error anywhere
|
|
14
|
+
* Screenshots (1440x900, 390x844) go to PMOS_SHOTS when it is set. Every wait polls the page. */
|
|
15
|
+
const fs = require('fs');
|
|
16
|
+
const path = require('path');
|
|
17
|
+
const { spawn } = require('child_process');
|
|
18
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
19
|
+
const T = require('./test-run').configure({ name: 'home-rows' });
|
|
20
|
+
const B = require('./lib/briefing-premium.js');
|
|
21
|
+
const F = require('./fixtures/briefing-premium-facts.js');
|
|
22
|
+
|
|
23
|
+
const BASE = T.BASE;
|
|
24
|
+
const SHOTS = process.env.PMOS_SHOTS || '';
|
|
25
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
26
|
+
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { let v; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
27
|
+
const results = [];
|
|
28
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 600) : ''}`); };
|
|
29
|
+
let srv = null; let browser = null;
|
|
30
|
+
const finish = async (code) => {
|
|
31
|
+
if (browser) await browser.close().catch(() => {});
|
|
32
|
+
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
33
|
+
T.killTmux();
|
|
34
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
35
|
+
console.log(`\n${results.length - bad}/${results.length} home-rows assertions passed`);
|
|
36
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
37
|
+
};
|
|
38
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
39
|
+
const MODEL = B.build(F.facts());
|
|
40
|
+
|
|
41
|
+
const ago = (min) => new Date(Date.now() - min * 60000).toISOString();
|
|
42
|
+
const MENTIONS = (ini) => [
|
|
43
|
+
{ id: 'aaaaaaaaaaa1', source: 'slack', who: 'Dita', where: '#product', text: '@wawan can we cut search from v2.4 and ship it in v2.5?', reply: true, in_needs: false, read: false, at: ago(120),
|
|
44
|
+
link: 'https://slack.example/1', initiative: ini, checks: ['Search is 3 of 8 tickets in v2.4. Moving it keeps Nov 4.'],
|
|
45
|
+
thread: [{ who: 'Bima', at: ago(132), text: 'QA found 2 more search bugs.' }, { who: 'Dita', at: ago(120), text: '@wawan can we cut search from v2.4 and ship it in v2.5?' }, { who: 'Rudi', at: ago(114), text: 'The bugs are in ranking.' }] },
|
|
46
|
+
{ id: 'aaaaaaaaaaa2', source: 'confluence', who: 'Ana', where: 'PRD v3', text: 'Is the calendar in or out of this scope?', reply: true, in_needs: false, read: false, at: ago(40) },
|
|
47
|
+
{ id: 'aaaaaaaaaaa3', source: 'mail', who: 'Bima', where: 'Partners in the v2.4 beta?', text: 'Can we add two partners to the beta?', reply: false, in_needs: false, read: true, at: ago(300) },
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
(async () => {
|
|
51
|
+
const exe = findBrowser();
|
|
52
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the home-rows suite cannot run'); return finish(1); }
|
|
53
|
+
let chromium;
|
|
54
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed — the home-rows suite cannot run'); return finish(1); }
|
|
55
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
56
|
+
await T.waitForServer(BASE);
|
|
57
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
58
|
+
|
|
59
|
+
// the fixture's first initiative, so a mention names one Home shows
|
|
60
|
+
const board = await until(async () => { const r = await fetch(BASE + '/api/board-premium').then((x) => x.json()).catch(() => null); return r && r.ok && r.model ? r.model : null; }, 20000, 500);
|
|
61
|
+
const INI = (((board && board.initiatives && board.initiatives.list && board.initiatives.list.rows) || []).find((r) => r && r.id) || {}).id || '';
|
|
62
|
+
ok('0 the board has an initiative for a mention to name', !!INI);
|
|
63
|
+
|
|
64
|
+
const open = async ({ w = 1440, h = 900, mentions = MENTIONS(INI), rec = null } = {}) => {
|
|
65
|
+
const ctx = await browser.newContext({ viewport: { width: w, height: h }, hasTouch: w < 500 });
|
|
66
|
+
const page = await ctx.newPage();
|
|
67
|
+
const errors = [], posts = [];
|
|
68
|
+
page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
|
|
69
|
+
page.on('request', (r) => { if (r.method() === 'POST' && r.url().startsWith(BASE)) posts.push({ path: new URL(r.url()).pathname, body: (() => { try { return JSON.parse(r.postData() || 'null'); } catch { return null; } })() }); });
|
|
70
|
+
const json = (body, status = 200) => (r) => r.fulfill({ status, contentType: 'application/json', body: JSON.stringify(body) });
|
|
71
|
+
await page.route(/\/api\/briefing-premium(\?.*)?$/, json({ ok: true, state: 'ready', model: MODEL, as_of: Date.now() }));
|
|
72
|
+
await page.route(/\/api\/brief-page(\?.*)?$/, async (r) => {
|
|
73
|
+
try { // a read still in flight when the context closes is dropped, not a failure of the suite
|
|
74
|
+
const res = await r.fetch(); let b = {}; try { b = await res.json(); } catch { /* none */ }
|
|
75
|
+
await r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ ...b, ok: true, mentions: JSON.parse(JSON.stringify(mentions)) }) });
|
|
76
|
+
} catch { /* the context closed */ }
|
|
77
|
+
});
|
|
78
|
+
const notes = { cur: rec };
|
|
79
|
+
await page.route(/\/api\/notes(\?.*)?$/, (r) => r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ ok: true, notes: notes.cur ? [notes.cur] : [] }) }));
|
|
80
|
+
await page.route('**/api/mentions/read', json({ ok: true }));
|
|
81
|
+
await page.route('**/api/pm-items/add', json({ ok: true, id: 'x' }));
|
|
82
|
+
await page.goto(BASE + '/premium.html');
|
|
83
|
+
const up = await until(() => page.evaluate(() => !!document.querySelector('#hmList [data-hr-mentions]')), 20000);
|
|
84
|
+
const close = async () => { await ctx.unrouteAll({ behavior: 'ignoreErrors' }).catch(() => {}); await ctx.close().catch(() => {}); };
|
|
85
|
+
return { ctx, page, errors, posts, up, notes, close };
|
|
86
|
+
};
|
|
87
|
+
const shot = async (page, name) => { if (!SHOTS) return; fs.mkdirSync(SHOTS, { recursive: true }); await page.screenshot({ path: path.join(SHOTS, name + '.png') }); };
|
|
88
|
+
const vw = (page) => page.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); return v ? { title: (v.querySelector('#czVwTitle') || {}).textContent || '', text: v.textContent, back: !!v.querySelector('[data-cz-vw="back"]') } : null; });
|
|
89
|
+
|
|
90
|
+
/* M1, M2 */
|
|
91
|
+
const A = await open();
|
|
92
|
+
ok('0 the page draws the list with the Mentions row', !!A.up);
|
|
93
|
+
if (!A.up) return finish(1);
|
|
94
|
+
const p = A.page;
|
|
95
|
+
const top = await p.evaluate(() => { const b = document.querySelector('#hmList .hv-body'); const f = b && b.firstElementChild; return { first: f ? f.className : '', text: f ? f.textContent.replace(/\s+/g, ' ').trim() : '' }; });
|
|
96
|
+
ok('M1 @Mentions is the first row of the list, with "2 new"', /hr-men-card/.test(top.first) && /^@ ?Mentions ?2 new$/.test(top.text), JSON.stringify(top));
|
|
97
|
+
ok('M2 no mention is a row under an initiative or under Not in an initiative', await p.evaluate(() => !document.querySelector('#hmList [data-id^="men:"]')));
|
|
98
|
+
await shot(p, 'home-1440');
|
|
99
|
+
|
|
100
|
+
/* M3 */
|
|
101
|
+
await p.click('#hmList [data-hr-mentions]');
|
|
102
|
+
const L1 = await until(() => vw(p).then((v) => (v && v.title === 'Mentions' ? v : null)));
|
|
103
|
+
ok('M3 the row opens the Mentions Viewer', !!L1, JSON.stringify(L1));
|
|
104
|
+
const sum = await p.evaluate(() => { const v = document.querySelector('#czViewer'); const s = v.querySelector('.czs-sum'); return { line: (s.querySelector('.czs-line') || {}).textContent || '', pri: [...s.querySelectorAll('.czs-pri')].map((b) => b.textContent), secs: [...v.querySelectorAll('.czs-sec')].map((x) => [x.querySelector('.czs-row b').textContent, (x.querySelector('.czs-n') || {}).textContent || '', x.querySelector('.czs-row').getAttribute('aria-expanded')]), items: v.querySelectorAll('.czs-body:not([hidden]) [data-hr-mi]').length, sel: !!document.querySelector('#hmList .hr-men.sel') }; });
|
|
105
|
+
ok('M3 the summary says 2 new and has ONE primary, Reply to Dita', /2 new since this morning/.test(sum.line) && sum.pri.length === 1 && sum.pri[0] === 'Reply to Dita', JSON.stringify(sum));
|
|
106
|
+
ok('M3 New is open with 2 mentions; Earlier is folded with its count', JSON.stringify(sum.secs) === JSON.stringify([['New', '2', 'true'], ['Earlier', '1', 'false']]) && sum.items === 2, JSON.stringify(sum));
|
|
107
|
+
ok('M3 the Mentions row is the selected row', sum.sel);
|
|
108
|
+
await shot(p, 'mentions-1440');
|
|
109
|
+
|
|
110
|
+
/* M4 */
|
|
111
|
+
await p.click('#czViewer [data-hr-mi="aaaaaaaaaaa1"]');
|
|
112
|
+
const D1 = await until(() => vw(p).then((v) => (v && /^Dita/.test(v.title) ? v : null)));
|
|
113
|
+
ok('M4 the Slack mention\'s tile is the @ icon', await p.evaluate(() => /M12 8a4 4/.test((document.querySelector('#czViewer .cz-vw-tile path') || { getAttribute: () => '' }).getAttribute('d'))));
|
|
114
|
+
ok('M4 a mention drills in, titled who and where, with ←', !!D1 && D1.title === 'Dita · Slack #product' && D1.back, JSON.stringify(D1));
|
|
115
|
+
const one = await p.evaluate(() => { const v = document.querySelector('#czViewer'); return { line: (v.querySelector('.czs-line') || {}).textContent || '', warn: !!v.querySelector('.czs-line.warn'), pri: [...v.querySelectorAll('.czs-pri')].map((b) => b.textContent), me: [...v.querySelectorAll('.hr-msg.me')].map((x) => x.textContent), msgs: v.querySelectorAll('.hr-msg').length, chk: !!v.querySelector('.hr-chk'), rows: [...v.querySelectorAll('.czs-row b')].map((b) => b.textContent) }; });
|
|
116
|
+
ok('M4 the summary waits on the PM (amber) with ONE primary, Draft a reply', /^Waiting on you · 2 h/.test(one.line) && one.warn && one.pri.join() === 'Draft a reply', JSON.stringify(one));
|
|
117
|
+
ok('M4 the thread shows with the mention outlined, once', one.msgs === 3 && one.me.length === 1 && /cut search/.test(one.me[0]), JSON.stringify(one));
|
|
118
|
+
ok('M4 What I checked shows the brief\'s check; Open in Slack and the initiative are rows', one.chk && one.rows[0] === 'Open in Slack' && one.rows.length === (INI ? 2 : 1), JSON.stringify(one));
|
|
119
|
+
await shot(p, 'mention-slack-1440');
|
|
120
|
+
await p.click('#czViewer [data-cz-vw="more"]');
|
|
121
|
+
const menu = await until(() => p.evaluate(() => [...document.querySelectorAll('.cz-vw-menu button')].map((b) => b.textContent)));
|
|
122
|
+
ok('M4 ⋯ holds Make it a task and Mark read', JSON.stringify(menu) === JSON.stringify(['Make it a task', 'Mark read']), JSON.stringify(menu));
|
|
123
|
+
await p.click('.cz-vw-menu button:has-text("Mark read")');
|
|
124
|
+
const mark = await until(() => A.posts.find((x) => x.path === '/api/mentions/read'));
|
|
125
|
+
ok('M4 Mark read posts the mark for that mention', !!mark && mark.body.id === 'aaaaaaaaaaa1' && mark.body.read === true, JSON.stringify(mark));
|
|
126
|
+
const still = await until(() => vw(p).then((v) => (v && /^Dita/.test(v.title) && v.back ? v : null)));
|
|
127
|
+
ok('M4 after Mark read the mention stays shown, and ← still goes back', !!still);
|
|
128
|
+
await p.click('#czViewer [data-cz-vw="back"]');
|
|
129
|
+
const L2 = await until(() => vw(p).then((v) => (v && v.title === 'Mentions' ? v : null)));
|
|
130
|
+
ok('M4 ← returns to the Mentions list', !!L2);
|
|
131
|
+
await p.click('#czViewer [data-hr-mi="aaaaaaaaaaa2"]');
|
|
132
|
+
const D2 = await until(() => p.evaluate(() => { const v = document.querySelector('#czViewer'); const t = (v.querySelector('#czVwTitle') || {}).textContent; return /^Ana/.test(t) ? { t, chk: !!v.querySelector('.hr-chk'), me: v.querySelectorAll('.hr-msg.me').length, rows: [...v.querySelectorAll('.czs-row b')].map((b) => b.textContent) } : null; }));
|
|
133
|
+
ok('M4 a mention with no check claims none (honest state); a document comment shows its words outlined', !!D2 && D2.t === 'Ana · comment on PRD v3' && !D2.chk && D2.me === 1 && D2.rows.length === 0, JSON.stringify(D2));
|
|
134
|
+
await shot(p, 'mention-doc-1440');
|
|
135
|
+
ok('M no page error', !A.errors.length, A.errors.join(' | '));
|
|
136
|
+
await A.close();
|
|
137
|
+
|
|
138
|
+
/* M1 at zero */
|
|
139
|
+
const Z = await open({ mentions: MENTIONS(INI).map((m) => ({ ...m, read: true })) });
|
|
140
|
+
const z = await Z.page.evaluate(() => { const r = document.querySelector('#hmList [data-hr-mentions]'); return r ? { t: r.textContent.replace(/\s+/g, ' ').trim(), n: !!r.querySelector('.hr-new') } : null; });
|
|
141
|
+
ok('M1 with none new the row stays, quiet, with no count', !!z && /^@ ?Mentions$/.test(z.t) && !z.n, JSON.stringify(z));
|
|
142
|
+
await Z.close();
|
|
143
|
+
|
|
144
|
+
/* R1 */
|
|
145
|
+
const note = { id: 'n-rec-1', state: 'recording', title: 'Viewer sync', meeting_ms: (12 * 60 + 40) * 1000 };
|
|
146
|
+
const R = await open({ rec: note });
|
|
147
|
+
const r1 = await until(() => R.page.evaluate(() => { const b = document.querySelector('#hmList .hv-body'); const f = b && b.firstElementChild; return f && /hr-rec-card/.test(f.className) ? { t: f.textContent.replace(/\s+/g, ' ').trim(), next: (f.nextElementSibling || {}).className || '', paused: f.classList.contains('paused') } : null; }), 15000);
|
|
148
|
+
ok('R1 a recording pins a row above @Mentions: its title and Recording · 12:4x', !!r1 && /^Viewer sync ?Recording · 12:4\d$/.test(r1.t) && /hr-men-card/.test(r1.next) && !r1.paused, JSON.stringify(r1));
|
|
149
|
+
ok('R1 the Today card does not say the recording again (say it once)', await R.page.evaluate(() => !/not on the calendar/.test((document.querySelector('#hmList') || {}).textContent || '')));
|
|
150
|
+
const c0 = await R.page.textContent('#hmList [data-hr-clock]');
|
|
151
|
+
const c1 = await until(async () => { const t = await R.page.textContent('#hmList [data-hr-clock]'); return t !== c0 ? t : null; }, 4000);
|
|
152
|
+
ok('R1 the clock ticks', !!c1, c0 + ' → ' + c1);
|
|
153
|
+
await shot(R.page, 'rec-1440');
|
|
154
|
+
await R.page.click('#hmList [data-hr-mentions]');
|
|
155
|
+
await until(() => vw(R.page));
|
|
156
|
+
ok('R1 the row stays while another item is open', await R.page.evaluate(() => !!document.querySelector('#hmList .hr-rec-card')));
|
|
157
|
+
R.notes.cur = { ...note, state: 'paused' };
|
|
158
|
+
// the page reads the notes again within 10 s (rec-state.js, or Home's own notes while that is not on the page)
|
|
159
|
+
const r2 = await until(() => R.page.evaluate(() => { const f = document.querySelector('#hmList .hr-rec-card'); return f && f.classList.contains('paused') ? f.textContent.replace(/\s+/g, ' ').trim() : null; }), 16000, 500);
|
|
160
|
+
ok('R1 paused: "Paused · 12:40", quieter', !!r2 && /Paused · 12:40$/.test(r2), String(r2));
|
|
161
|
+
const s0 = await R.page.textContent('#hmList [data-hr-clock]'); await sleep(1300);
|
|
162
|
+
ok('R1 a paused clock stands still', s0 === await R.page.textContent('#hmList [data-hr-clock]'));
|
|
163
|
+
await shot(R.page, 'rec-paused-1440');
|
|
164
|
+
ok('R no page error', !R.errors.length, R.errors.join(' | '));
|
|
165
|
+
await R.close();
|
|
166
|
+
|
|
167
|
+
/* F */
|
|
168
|
+
const P = await open({ w: 390, h: 844, rec: note });
|
|
169
|
+
const ph = await until(() => P.page.evaluate(() => !!document.querySelector('#hmList .hr-rec-card') && !!document.querySelector('#hmList [data-hr-mentions]')), 15000);
|
|
170
|
+
ok('F on a phone both rows show', !!ph);
|
|
171
|
+
await shot(P.page, 'home-390');
|
|
172
|
+
await P.page.click('#hmList [data-hr-mentions]');
|
|
173
|
+
const pv = await until(() => P.page.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); if (!v) return null; const r = v.getBoundingClientRect(); return { w: Math.round(r.width), back: !!v.querySelector('[data-cz-vw="back"]') }; }));
|
|
174
|
+
ok('F the Mentions Viewer is full screen on a phone, with ←', !!pv && pv.w >= 380 && pv.back, JSON.stringify(pv));
|
|
175
|
+
await shot(P.page, 'mentions-390');
|
|
176
|
+
await P.page.click('#czViewer [data-hr-mi="aaaaaaaaaaa1"]');
|
|
177
|
+
await until(() => vw(P.page).then((v) => (v && /^Dita/.test(v.title) ? v : null)));
|
|
178
|
+
await shot(P.page, 'mention-slack-390');
|
|
179
|
+
const sx = await P.page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1);
|
|
180
|
+
ok('F no sideways scroll at 390 px', sx);
|
|
181
|
+
ok('F no page error', !P.errors.length, P.errors.join(' | '));
|
|
182
|
+
await P.close();
|
|
183
|
+
return finish();
|
|
184
|
+
})();
|
|
@@ -361,11 +361,12 @@ function contextFrom(events, range, src, opts = {}) {
|
|
|
361
361
|
if (past) {
|
|
362
362
|
for (const n of notes) {
|
|
363
363
|
if (n.private) continue; // a private note shows its title and nothing of its content
|
|
364
|
-
|
|
364
|
+
// a point the PM has not confirmed is not a fact: it is kept, marked confirmed: false, so a reader can say "to confirm"
|
|
365
|
+
for (const d of n.decisions || []) if (str(d && d.text)) items.push({ kind: 'decision', text: str(d.text), ref: { type: 'note', id: n.id }, ...(d.confirmed === false ? { confirmed: false } : {}) });
|
|
365
366
|
for (const a of n.actions || []) {
|
|
366
367
|
if (!str(a && a.text)) continue;
|
|
367
368
|
const tail = [a.owner && `owner: ${a.owner}`, a.due && `due: ${a.due}`].filter(Boolean).join(', ');
|
|
368
|
-
items.push({ kind: 'action', text: str(a.text) + (tail ? ` (${tail})` : ''), ref: { type: 'note', id: n.id } });
|
|
369
|
+
items.push({ kind: 'action', text: str(a.text) + (tail ? ` (${tail})` : ''), ref: { type: 'note', id: n.id }, ...(a.confirmed === false ? { confirmed: false } : {}) });
|
|
369
370
|
}
|
|
370
371
|
}
|
|
371
372
|
const moved = movedBy({ ...e, initiative: e.initiative || (notes.find((n) => n.initiative) || {}).initiative || null }, endMs, s);
|
|
@@ -464,8 +465,11 @@ function briefOf(e, current, s, { today, inis, links: meetingLinks, boards } = {
|
|
|
464
465
|
last = { id: lastNote.id, title: str(lastNote.title) || str(lastNote.meeting.title), at: lastNote.meeting.start, private: !!lastNote.private };
|
|
465
466
|
if (!lastNote.private) {
|
|
466
467
|
last.overview = str(lastNote.overview) || null;
|
|
467
|
-
|
|
468
|
-
last.
|
|
468
|
+
// only what the PM confirmed counts as decided; the rest is counted as to confirm (Viewer kit: unconfirmed captures are never facts)
|
|
469
|
+
last.decisions = (lastNote.decisions || []).filter((d) => d && d.confirmed !== false).map((d) => str(d && d.text)).filter(Boolean).slice(0, 4);
|
|
470
|
+
last.actions = (lastNote.actions || []).filter((a) => str(a && a.text)).slice(0, 5).map((a) => ({ text: str(a.text), owner: str(a.owner) || null, due: str(a.due) || null, ...(a.confirmed === false ? { confirmed: false } : {}) }));
|
|
471
|
+
const toConfirm = (lastNote.decisions || []).filter((d) => d && d.confirmed === false && str(d.text)).length;
|
|
472
|
+
if (toConfirm) last.to_confirm = toConfirm;
|
|
469
473
|
}
|
|
470
474
|
}
|
|
471
475
|
const links = (Array.isArray(e.links) ? e.links : []).filter((l) => l && str(l.url) && /^https?:\/\//.test(l.url)).slice(0, 5).map((l) => ({ label: str(l.label) || str(l.url), url: str(l.url) }));
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
* What it holds:
|
|
10
10
|
* auto "Moves on by itself": true unless the PM turned it off (default on)
|
|
11
11
|
* held the stages the PM undid a move by itself out of: the page does not move out of them by itself again
|
|
12
|
-
* by how the Tasks card groups: 'stage' | 'mine' (the groups the PM names) | 'owner' | 'status' | 'none'
|
|
12
|
+
* by how the Tasks card groups: 'stage' | 'epic' (the Jira epics of the drafted tickets) | 'mine' (the groups the PM names) | 'owner' | 'status' | 'none'
|
|
13
|
+
* picked true once the PM chose `by`; until then the page may default to 'epic' when tickets are drafted
|
|
13
14
|
* names the PM's group names, in order
|
|
14
15
|
* of task key → the PM's group name
|
|
15
16
|
* stage task key → the stage the task belongs to (a task records none of its own)
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
|
|
18
19
|
const ID_RE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,80}$/;
|
|
19
20
|
const TASK_RE = /^(task|req):[A-Za-z0-9][A-Za-z0-9._:#/-]{0,120}$/;
|
|
20
|
-
const BY = ['stage', 'mine', 'owner', 'status', 'none'];
|
|
21
|
+
const BY = ['stage', 'epic', 'mine', 'owner', 'status', 'none']; // epic: the Jira epics of the drafted tickets (T1)
|
|
21
22
|
const KINDS = ['auto', 'hold', 'by', 'groups', 'rename', 'place', 'stage', 'set', 'unset'];
|
|
22
23
|
const name = (v, n = 40) => String(v == null ? '' : v).replace(/[\u0000-\u001f]+/g, ' ').replace(/\s+/g, ' ').trim().slice(0, n);
|
|
23
24
|
const names = (v) => { const out = []; for (const x of Array.isArray(v) ? v : []) { const s = name(x); if (s && !out.some((y) => y.toLowerCase() === s.toLowerCase())) out.push(s); } return out.slice(0, 12); };
|
|
@@ -30,7 +31,7 @@ function fold(lines, initiative) {
|
|
|
30
31
|
if (!l || l.initiative !== initiative) continue;
|
|
31
32
|
if (l.kind === 'auto') { o.auto = l.on !== false; if (o.auto) o.held = []; }
|
|
32
33
|
else if (l.kind === 'hold' && l.stage && !o.held.includes(l.stage)) o.held.push(l.stage);
|
|
33
|
-
else if (l.kind === 'by' && BY.includes(l.by)) o.by = l.by;
|
|
34
|
+
else if (l.kind === 'by' && BY.includes(l.by)) { o.by = l.by; o.picked = true; } // picked: the PM chose it, so no default replaces it
|
|
34
35
|
else if (l.kind === 'groups') {
|
|
35
36
|
o.names = names(l.names);
|
|
36
37
|
for (const k of Object.keys(o.of)) if (!o.names.includes(o.of[k])) delete o.of[k]; // a deleted group lets its tasks go
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*
|
|
5
5
|
* pmos jira draft <initiative> [--dry-run] the PRD's items → the ticket draft (lib/jira-tickets.js)
|
|
6
6
|
* pmos jira show <initiative> every ticket, its flags and its status in Jira
|
|
7
|
-
* pmos jira epic <initiative> new|<KEY or link>
|
|
7
|
+
* pmos jira epic <initiative> new|<KEY or link> [--group <g>] create a new epic, or use an existing one (of one epic group)
|
|
8
8
|
* pmos jira approve <initiative> <ID> … the PM selects tickets to push, in their own terminal
|
|
9
9
|
* pmos jira pending <initiative> what the agent creates or updates in Jira (approved only)
|
|
10
|
-
* pmos jira record <initiative> [ID=KEY …] [--epic KEY] [--updated ID,ID] the keys the agent created
|
|
10
|
+
* pmos jira record <initiative> [ID=KEY …] [--epic KEY [--group <g>]] [--updated ID,ID] the keys the agent created
|
|
11
11
|
* pmos jira query [<initiative>] the Jira search for the tickets an initiative pushed
|
|
12
12
|
* pmos jira sync <initiative> --from <file|-> [--query "<jql>"] [--dry-run] a saved search → the status snapshot
|
|
13
13
|
* pmos jira query --sprints the Jira search for every issue in the sprints the tickets are in
|
|
@@ -33,10 +33,10 @@ const USAGE = [
|
|
|
33
33
|
'usage: pmos jira draft|show|epic|approve|pending|record|query|sync|summary|which — Jira tickets from the PRD, and their status',
|
|
34
34
|
' pmos jira draft <initiative> [--dry-run] draft one ticket per PRD item, in the ticket template',
|
|
35
35
|
' pmos jira show <initiative> every ticket, what needs you, and its status in Jira',
|
|
36
|
-
' pmos jira epic <initiative> new|<KEY or link>
|
|
36
|
+
' pmos jira epic <initiative> new|<KEY or link> [--group <g>] create a new epic at the first push, or use an existing one',
|
|
37
37
|
' pmos jira approve <initiative> <ID> … select tickets to push (you, in your own terminal)',
|
|
38
38
|
' pmos jira pending <initiative> what the push creates or updates in Jira',
|
|
39
|
-
' pmos jira record <initiative> [ID=KEY …] [--epic KEY] [--updated ID,ID] the keys created in Jira',
|
|
39
|
+
' pmos jira record <initiative> [ID=KEY …] [--epic KEY [--group <g>]] [--updated ID,ID] the keys created in Jira',
|
|
40
40
|
' pmos jira query [<initiative>] the Jira search for the pushed tickets',
|
|
41
41
|
' pmos jira sync <initiative> --from <file|-> [--query "<jql>"] [--dry-run] save the status read from Jira',
|
|
42
42
|
' pmos jira query --sprints the Jira search for every issue in those tickets\' sprints',
|
|
@@ -48,7 +48,7 @@ const USAGE = [
|
|
|
48
48
|
'This command never calls Jira. Your agent reads and writes Jira with your own connection.',
|
|
49
49
|
];
|
|
50
50
|
const BOOL = new Set(['json', 'dry-run', 'help', 'sprints']);
|
|
51
|
-
const VALUE = new Set(['from', 'query', 'root', 'epic', 'updated']);
|
|
51
|
+
const VALUE = new Set(['from', 'query', 'root', 'epic', 'updated', 'group']);
|
|
52
52
|
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' };
|
|
53
53
|
|
|
54
54
|
function parse(argv) {
|
|
@@ -166,7 +166,9 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
|
|
|
166
166
|
if (verb === 'show') {
|
|
167
167
|
const r = jiraTickets.view(root, initiative, { snapshot: jiraStatus.readSnapshot(root, initiative) });
|
|
168
168
|
if (!r.ok) return fail(r.error);
|
|
169
|
-
const
|
|
169
|
+
const epicWord = (e) => e.key || (e.mode === 'new' ? 'new, created at the first push' : 'not chosen');
|
|
170
|
+
const lines = [`${initiative} · ${r.inJira} of ${r.tickets.length} in Jira · ${r.checkedAt ? `checked ${r.checkedAt}` : 'not checked yet'} · ${r.groups.length ? `${r.groups.length} epics` : `epic ${epicWord(r.epic)}`}`];
|
|
171
|
+
for (const g of r.groups) lines.push(` epic ${g.id} · ${g.name} · ${epicWord(g)}`);
|
|
170
172
|
if (!r.gate.open) lines.push(` The Jira tickets tab opens when the handoff is done (${r.gate.why}).`);
|
|
171
173
|
for (const t of r.tickets) {
|
|
172
174
|
lines.push(` ${t.id} · ${t.summary} · ${[t.type, t.priority, t.estimate].filter(Boolean).join(' · ')}`);
|
|
@@ -179,9 +181,11 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
|
|
|
179
181
|
if (verb === 'epic') {
|
|
180
182
|
const v = pos[1];
|
|
181
183
|
if (!v) return need('<initiative> new|<KEY or link>');
|
|
182
|
-
const r = jiraTickets.setEpic(root, initiative, v === 'new' ? { mode: 'new' } : { mode: 'existing', key: v }, { now });
|
|
184
|
+
const r = jiraTickets.setEpic(root, initiative, { ...(v === 'new' ? { mode: 'new' } : { mode: 'existing', key: v }), group: flags.group || null }, { now });
|
|
183
185
|
if (!r.ok) return fail(r.error);
|
|
184
|
-
|
|
186
|
+
const e = r.group || r.epic;
|
|
187
|
+
const who = r.group ? `${initiative} · ${r.group.name}` : initiative;
|
|
188
|
+
return out(r, [e.mode === 'new' ? `${who} · a new epic is created at the first push` : `${who} · tickets go under ${e.key}`]);
|
|
185
189
|
}
|
|
186
190
|
if (verb === 'approve') {
|
|
187
191
|
const ids = pos.slice(1);
|
|
@@ -197,7 +201,8 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
|
|
|
197
201
|
const r = jiraTickets.pushPlan(root, initiative);
|
|
198
202
|
if (!r.ok) return fail(r.error);
|
|
199
203
|
const lines = [`${initiative} · ${r.create.length} to create · ${r.update.length} to update · ${r.unchanged} unchanged · ${r.notApproved} not selected`];
|
|
200
|
-
lines.push(r.epic.key ? ` epic ${r.epic.key}` : ` epic create "${r.epic.create.summary}"`);
|
|
204
|
+
if (r.epic) lines.push(r.epic.key ? ` epic ${r.epic.key}` : ` epic create "${r.epic.create.summary}"`);
|
|
205
|
+
for (const e of r.epics) lines.push(e.key ? ` epic ${e.group} · ${e.key}` : ` epic ${e.group} · create "${e.create.summary}"`);
|
|
201
206
|
for (const t of r.create) lines.push(` create ${t.ticket} · ${t.summary} · ${t.issuetype} · ${t.priority}`);
|
|
202
207
|
for (const t of r.update) lines.push(` update ${t.ticket} ${t.key} · ${t.summary}`);
|
|
203
208
|
return out(r, lines);
|
|
@@ -210,10 +215,10 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
|
|
|
210
215
|
tickets[m[1]] = m[2];
|
|
211
216
|
}
|
|
212
217
|
const updated = flags.updated ? String(flags.updated).split(',').map((s) => s.trim()).filter(Boolean) : [];
|
|
213
|
-
if (!Object.keys(tickets).length && !updated.length && !flags.epic) return need('<initiative> [ID=KEY …] [--epic KEY] [--updated ID,ID]');
|
|
214
|
-
const r = jiraTickets.record(root, initiative, { epic: flags.epic || null, tickets, pushed: updated }, { now });
|
|
218
|
+
if (!Object.keys(tickets).length && !updated.length && !flags.epic) return need('<initiative> [ID=KEY …] [--epic KEY [--group <g>]] [--updated ID,ID]');
|
|
219
|
+
const r = jiraTickets.record(root, initiative, { epic: flags.epic || null, group: flags.group || null, tickets, pushed: updated }, { now });
|
|
215
220
|
if (!r.ok) return fail(r.error);
|
|
216
|
-
return out(r, [`${initiative}${r.epic ? ` · epic ${r.epic}` : ''} · recorded ${r.recorded.length}`, ...r.recorded.map((x) => ` ${x.what} ${x.ticket} ${x.key}`)]);
|
|
221
|
+
return out(r, [`${initiative}${r.epic ? ` · epic ${r.group ? r.group + ' ' : ''}${r.epic}` : ''} · recorded ${r.recorded.length}`, ...r.recorded.map((x) => ` ${x.what} ${x.ticket} ${x.key}`)]);
|
|
217
222
|
}
|
|
218
223
|
if (verb === 'sync') {
|
|
219
224
|
if (!flags.from) return need('<initiative> --from <file|->');
|
|
@@ -522,7 +522,7 @@ function which(root, key) {
|
|
|
522
522
|
const hits = [];
|
|
523
523
|
for (const id of jiraTickets.draftedInitiatives(root)) {
|
|
524
524
|
const p = jiraTickets.pushedTickets(root, id);
|
|
525
|
-
if (p.epic === k) hits.push({ initiative: id, role: 'epic' });
|
|
525
|
+
if (p.epic === k || (p.epics || []).includes(k)) hits.push({ initiative: id, role: 'epic' });
|
|
526
526
|
else if (p.tickets.has(k)) hits.push({ initiative: id, role: 'ticket', ticket: p.tickets.get(k).id, summary: p.tickets.get(k).summary });
|
|
527
527
|
}
|
|
528
528
|
return { ok: true, key: k, initiatives: hits };
|