create-pmos 0.630.0 → 0.632.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.630.0",
3
+ "version": "0.632.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,32 @@
33
33
  "audit"
34
34
  ],
35
35
  "pmosChanges": [
36
+ {
37
+ "v": "0.632.0",
38
+ "at": "2026-11-19T11:23:46.354Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1414,
43
+ "t": "Set up the Meet panel from Settings › Connectors › Google Meet",
44
+ "s": "Set up the Meet panel from Settings › Connectors › Google Meet",
45
+ "k": "new"
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "v": "0.631.0",
51
+ "at": "2026-11-19T11:03:25.147Z",
52
+ "f": 4,
53
+ "prs": [
54
+ {
55
+ "n": 1412,
56
+ "t": "Keep a snapshot of every past sprint, with a sprint picker on the Backlog",
57
+ "s": "Keep a snapshot of every past sprint, with a sprint picker on the Backlog",
58
+ "k": "new"
59
+ }
60
+ ]
61
+ },
36
62
  {
37
63
  "v": "0.630.0",
38
64
  "at": "2026-11-19T08:05:45.827Z",
@@ -422,38 +448,6 @@
422
448
  "k": "new"
423
449
  }
424
450
  ]
425
- },
426
- {
427
- "v": "0.610.0",
428
- "at": "2026-11-18T19:58:43.558Z",
429
- "f": 4,
430
- "prs": [
431
- {
432
- "n": 1359,
433
- "t": "The navigation of six places, one thin rail on every page (slice 1)",
434
- "s": "The navigation of six places, one thin rail on every page (slice 1)",
435
- "k": "new"
436
- },
437
- {
438
- "n": 1360,
439
- "t": "One popup with the chat",
440
- "s": "One popup with the chat",
441
- "k": "new"
442
- }
443
- ]
444
- },
445
- {
446
- "v": "0.609.0",
447
- "at": "2026-11-18T14:50:56.888Z",
448
- "f": 4,
449
- "prs": [
450
- {
451
- "n": 1357,
452
- "t": "No Specimens line or prototype file once every version is deleted",
453
- "s": "No Specimens line or prototype file once every version is deleted",
454
- "k": "fix"
455
- }
456
- ]
457
451
  }
458
452
  ]
459
453
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@0ca33e7b
1
+ kernel-source: pmos@091ed81f
2
2
  assembled: 2026-11-19
3
3
  mode: vendor
@@ -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-19T08:05:42Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-19T11:23:43Z"}
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-19T08:05:42Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-19T11:23:43Z"}
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-19T08:05:42Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-19T11:23:43Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,30 @@
1
1
  [
2
+ {
3
+ "v": "0.632.0",
4
+ "at": "2026-11-19T11:23:46.354Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1414,
9
+ "t": "Set up the Meet panel from Settings › Connectors › Google Meet",
10
+ "s": "Set up the Meet panel from Settings › Connectors › Google Meet",
11
+ "k": "new"
12
+ }
13
+ ]
14
+ },
15
+ {
16
+ "v": "0.631.0",
17
+ "at": "2026-11-19T11:03:25.147Z",
18
+ "f": 4,
19
+ "prs": [
20
+ {
21
+ "n": 1412,
22
+ "t": "Keep a snapshot of every past sprint, with a sprint picker on the Backlog",
23
+ "s": "Keep a snapshot of every past sprint, with a sprint picker on the Backlog",
24
+ "k": "new"
25
+ }
26
+ ]
27
+ },
2
28
  {
3
29
  "v": "0.630.0",
4
30
  "at": "2026-11-19T08:05:45.827Z",
@@ -603,6 +603,8 @@ The benchmark needs a signed-in agent CLI. It never pushes and never opens a pul
603
603
  - `pmos jira sync <initiative> --from <file|-> [--query "<jql>"] [--dry-run]`
604
604
  - `pmos jira query --sprints`
605
605
  - `pmos jira sync --sprints --from <file|-> [--query "<jql>"] [--dry-run]`
606
+ - `pmos jira query --sprint "<name>"`
607
+ - `pmos jira sync --sprint "<name>" --from <file|-> [--dry-run]`
606
608
  - `pmos jira summary [--from <file|->] [--dry-run]`
607
609
  - `pmos jira which <KEY>`
608
610
  - `pmos jira moves`
@@ -165,6 +165,19 @@ pmos jira query --sprints
165
165
  pmos jira sync --sprints --from <file|-> [--query "<jql>"]
166
166
  ```
167
167
 
168
+ ## Past sprints keep every ticket
169
+
170
+ Each sprint read also goes to an append-only history, `<state>/tracker/jira/_sprint-history.jsonl`. It has one line for each sprint at each read, written only when something changed. A ticket that Jira carried from one sprint to the next stays in both sprints. When a sprint closes, the first read after the close freezes it: later reads add nothing to it. PMOS counts the close numbers itself from this record (done, total, carried in, carried to the next sprint, points). The agent does not count them.
171
+
172
+ The read also asks for the open sprints of the tickets' Jira projects, and for the closed sprints whose tickets changed in the last 21 days. Thus a sprint that opened and closed between two reads is still kept.
173
+
174
+ On Work › Backlog › This sprint, the sprint's name is a picker. Pick a past sprint to see its snapshot and its tickets as they were at close. To keep a sprint that PMOS never saw, press the read icon on it. PMOS then reads that sprint from Jira:
175
+
176
+ ```
177
+ pmos jira query --sprint "<name>"
178
+ pmos jira sync --sprint "<name>" --from <file|->
179
+ ```
180
+
168
181
  ## Each sprint's goal and summary
169
182
 
170
183
  The check then writes a goal and a short summary for each sprint, from the tickets it read. The Sprints tab shows them above the sprint's items, with one row for each group of related work.
@@ -476,9 +476,13 @@ The PMOS Chrome extension shows a small panel over a Google Meet call, so you do
476
476
 
477
477
  To add the extension:
478
478
 
479
- 1. Run `pmos extension`. It prints the folder of the extension and these steps.
480
- 2. In Chrome, open `chrome://extensions` and turn on **Developer mode**.
481
- 3. Press **Load unpacked** and pick the folder that `pmos extension` printed.
479
+ 1. In PMOS, open **Settings › Connectors**. Under **Google Meet**, press the set-up icon. PMOS copies the extension to the folder **PMOS Chrome extension** in your home folder, shows that folder in Finder, and opens Chrome's extensions page.
480
+ 2. In Chrome's extensions page, turn on **Developer mode** (top right).
481
+ 3. Press **Load unpacked** and pick the folder **PMOS Chrome extension**.
482
+
483
+ The steps also show under the Google Meet row, with the folder's path and a copy button. Chrome keeps these three presses for you: no page can add an extension. If **Load unpacked** is greyed out, your company's Chrome blocks extensions that are not in the Web Store.
484
+
485
+ After an update, PMOS copies the new version to the same folder when you open Settings › Connectors, and the row says so. Press the reload arrow on the PMOS card in Chrome's extensions page. When the panel has loaded in a call, the row says **Working** and the time it was seen. `pmos extension` in a terminal still prints the steps.
482
486
 
483
487
  PMOS must run while you use the panel. The extension looks for PMOS at `http://localhost:7433`. If `pmos` started on another port, open the extension's **Options**, type that address and press **Save**, then reload the Meet tab.
484
488
 
@@ -814,6 +814,22 @@ function sprintsOf(snapshots, onBoard = () => true, whole = null, notes = null,
814
814
  byName.set(n.name, { name: n.name, state: 'closed', start: n.start || null, end: n.end || null, issues, counts });
815
815
  }
816
816
  }
817
+ // The active sprint of the board's Jira projects, from the whole-sprint read, even when none of the board's initiatives holds a ticket
818
+ // in it (initiative sprint-snapshots: Sprint 118 was missing, the list came from the initiatives' reads only). opts.projects opts in.
819
+ if (Array.isArray(opts.projects) && opts.projects.length) {
820
+ const P = new Set(opts.projects.map((k) => String(k).toUpperCase()));
821
+ for (const t of wt) {
822
+ if (!t || !t.key || !t.sprint || !t.sprint.name || t.sprint.state !== 'active' || !P.has(String(t.key).split('-')[0].toUpperCase())) continue;
823
+ const name = String(t.sprint.name);
824
+ if (!byName.has(name)) { byName.set(name, { name, state: 'active', start: t.sprint.start || null, end: t.sprint.end || null, issues: [], counts: { todo: 0, doing: 0, done: 0 } }); any = true; }
825
+ const sp = byName.get(name);
826
+ if (sp.issues.some((i) => i.key === t.key)) continue;
827
+ const category = ['todo', 'doing', 'done'].includes(t.category) ? t.category : 'todo';
828
+ sp.issues.push({ key: t.key, summary: t.summary || '', status: t.status || '', category, initiative: null, flagged: !!t.flagged, reason: t.flagged && t.reason ? String(t.reason) : null, points: ptsOf(t), ...urlOf(t) });
829
+ sp.counts[category]++;
830
+ }
831
+ if (any && whole && whole.fetchedAt && (!readAt || whole.fetchedAt < readAt)) readAt = whole.fetchedAt;
832
+ }
817
833
  const jiraGoal = (sp) => {
818
834
  for (const t of wt) if (t && t.sprint && String(t.sprint.name) === sp.name && t.sprint.goal) return String(t.sprint.goal);
819
835
  for (const s of snapshots || []) for (const t of s && s.tickets instanceof Map ? s.tickets.values() : s && Array.isArray(s.tickets) ? s.tickets : []) if (t && t.sprint && String(t.sprint.name) === sp.name && t.sprint.goal) return String(t.sprint.goal);
@@ -16,7 +16,10 @@ const USAGE = ['usage: pmos extension — the Chrome extension: the meeting comp
16
16
  function lines(folder, exists = true) {
17
17
  const out = [];
18
18
  if (!exists) { out.push(`✗ the extension folder is not here: ${folder}`, ' Reinstall the workspace with `pmos upgrade`.'); return out; }
19
- out.push('PMOS for Chrome', '', ` folder ${folder}`, '',
19
+ out.push('PMOS for Chrome', '',
20
+ 'Easiest: in PMOS open Settings › Connectors › Google Meet and press Set up. It puts the extension in a folder you can see',
21
+ '("PMOS Chrome extension" in your home folder) and opens Chrome\'s extensions page.', '',
22
+ ` folder ${folder}`, '',
20
23
  'Load it in three steps:',
21
24
  ' 1. In Chrome, open chrome://extensions',
22
25
  ' 2. Turn on Developer mode (top right)',
@@ -0,0 +1,93 @@
1
+ 'use strict';
2
+ /* extension-setup.js — set up the PMOS Chrome extension from the workspace (initiative meeting-buddy, follow-up; Wawan 2026-11-19:
3
+ * "I can't find the file. Make it easy, make the setup can be done on the workspace").
4
+ *
5
+ * The extension ships inside the workspace package, which npm puts under a hidden folder (for example ~/.nvm/…/pmos-workspace/extension).
6
+ * Chrome's Load unpacked window does not show hidden folders. So one press copies the extension to a folder the PM can see,
7
+ * ~/PMOS Chrome extension, shows that folder in Finder, and opens Chrome's extensions page. Chrome keeps the last step for the
8
+ * person (Developer mode, Load unpacked, pick the folder): no page or program can load an extension for them.
9
+ *
10
+ * status({ home, seenAt }) -> { ok, folder, copied, version, shipped, current, seen } pure apart from reading the two manifests
11
+ * copyTo(src, dest) copies the extension folder (files only, no links), replacing what is there
12
+ * setup({ home, open, platform }) -> { ok, folder, opened } copy, then show the folder and open chrome://extensions (macOS; else the folder only)
13
+ * refresh({ home }) -> bool on start: when the copy exists and is older than the shipped one, copy again (Chrome still needs the reload arrow)
14
+ * markSeen(now) / seenAt() the buddy page reports itself when it loads inside the Meet panel (GET /api/extension/seen)
15
+ * Nothing here touches Chrome's own files or settings. */
16
+ const fs = require('fs');
17
+ const os = require('os');
18
+ const path = require('path');
19
+
20
+ const SHIPPED = path.resolve(__dirname, '..', 'extension');
21
+ const NAME = 'PMOS Chrome extension';
22
+ const folderOf = (home) => path.join(home || os.homedir(), NAME);
23
+
24
+ function versionOf(dir) {
25
+ try { return String(JSON.parse(fs.readFileSync(path.join(dir, 'manifest.json'), 'utf8')).version || ''); } catch { return ''; }
26
+ }
27
+ /** The extension's files as relative paths (plain files only; a link is skipped). */
28
+ function filesOf(dir, rel = '') {
29
+ const out = [];
30
+ let ents = [];
31
+ try { ents = fs.readdirSync(path.join(dir, rel), { withFileTypes: true }); } catch { return out; }
32
+ for (const e of ents) {
33
+ if (e.name.startsWith('.')) continue;
34
+ const r = path.join(rel, e.name);
35
+ if (e.isDirectory()) out.push(...filesOf(dir, r));
36
+ else if (e.isFile()) out.push(r);
37
+ }
38
+ return out;
39
+ }
40
+ /** Same content in both folders (every shipped file present and equal). */
41
+ function same(src, dest) {
42
+ for (const r of filesOf(src)) {
43
+ let a, b; try { a = fs.readFileSync(path.join(src, r)); b = fs.readFileSync(path.join(dest, r)); } catch { return false; }
44
+ if (!a.equals(b)) return false;
45
+ }
46
+ return true;
47
+ }
48
+
49
+ function copyTo(src, dest) {
50
+ const files = filesOf(src);
51
+ if (!files.includes('manifest.json')) throw new Error('the shipped extension has no manifest.json');
52
+ fs.mkdirSync(dest, { recursive: true });
53
+ // a file the new version dropped would stay and confuse Chrome: take out what the shipped folder no longer has
54
+ for (const r of filesOf(dest)) if (!files.includes(r)) { try { fs.unlinkSync(path.join(dest, r)); } catch {} }
55
+ for (const r of files) { fs.mkdirSync(path.dirname(path.join(dest, r)), { recursive: true }); fs.copyFileSync(path.join(src, r), path.join(dest, r)); }
56
+ }
57
+
58
+ let lastSeen = 0;
59
+ function markSeen(now = Date.now()) { lastSeen = now; }
60
+ function seenAt() { return lastSeen; }
61
+
62
+ function status({ home, src = SHIPPED, seenAt: seen = lastSeen } = {}) {
63
+ const folder = folderOf(home);
64
+ const copied = fs.existsSync(path.join(folder, 'manifest.json'));
65
+ const shipped = versionOf(src);
66
+ return { ok: true, folder, copied, version: copied ? versionOf(folder) : '', shipped, current: copied && same(src, folder), seen: seen ? new Date(seen).toISOString() : null };
67
+ }
68
+
69
+ function opener(platform) {
70
+ if (platform !== 'darwin') return null;
71
+ return (args) => { try { require('child_process').spawn('open', args, { detached: true, stdio: 'ignore' }).unref(); return true; } catch { return false; } };
72
+ }
73
+
74
+ function setup({ home, src = SHIPPED, platform = process.platform, open = opener(platform) } = {}) {
75
+ const folder = folderOf(home);
76
+ try { copyTo(src, folder); } catch (e) { return { ok: false, error: 'PMOS could not copy the extension: ' + String((e && e.message) || e).slice(0, 160) }; }
77
+ let opened = false;
78
+ if (open) {
79
+ // show the folder in Finder, then Chrome's extensions page (a page cannot open chrome:// links; this computer can)
80
+ opened = !!open(['-R', path.join(folder, 'manifest.json')]);
81
+ open(['-a', 'Google Chrome', 'chrome://extensions']);
82
+ }
83
+ return { ok: true, folder, opened };
84
+ }
85
+
86
+ function refresh({ home, src = SHIPPED } = {}) {
87
+ const folder = folderOf(home);
88
+ if (!fs.existsSync(path.join(folder, 'manifest.json'))) return false;
89
+ if (same(src, folder)) return false;
90
+ try { copyTo(src, folder); return true; } catch { return false; }
91
+ }
92
+
93
+ module.exports = { status, setup, refresh, copyTo, markSeen, seenAt, folderOf, SHIPPED, NAME };
@@ -12,6 +12,8 @@
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
14
14
  * pmos jira sync --sprints --from <file|-> [--query "<jql>"] a saved whole-sprint search → the Sprints tab (jira-sprint-scope)
15
+ * pmos jira query --sprint "<name>" the Jira search for every ticket one sprint held (a sprint PMOS never saw)
16
+ * pmos jira sync --sprint "<name>" --from <file|-> keep that read as the sprint's snapshot (initiative sprint-snapshots)
15
17
  * pmos jira summary [--from <file|->] [--dry-run] the sprints to summarise, or save their goal and summary (sprint-goal-summary)
16
18
  * pmos jira which <KEY> [<KEY> …] the initiative a Jira key belongs to
17
19
  * pmos jira moves the status moves the PM asked in PMOS, not answered yet (lib/jira-moves.js)
@@ -45,6 +47,8 @@ const USAGE = [
45
47
  ' pmos jira sync <initiative> --from <file|-|a,b> [--query "<jql>"] [--dry-run] save the status read from Jira (a,b: one file per page)',
46
48
  ' pmos jira query --sprints the Jira search for every issue in those tickets\' sprints',
47
49
  ' pmos jira sync --sprints --from <file|-> [--query "<jql>"] save every issue of the sprints, for the Sprints tab',
50
+ ' pmos jira query --sprint "<name>" the Jira search for every ticket one sprint held',
51
+ ' pmos jira sync --sprint "<name>" --from <file|-> keep that read as the sprint\'s snapshot',
48
52
  ' pmos jira summary the sprints that need a goal and summary written',
49
53
  ' pmos jira summary --from <file|-> [--dry-run] save each sprint\'s goal, summary and themes (a closed sprint is kept once written)',
50
54
  ' pmos jira which <KEY> [<KEY> …] the initiative a Jira key belongs to',
@@ -54,7 +58,7 @@ const USAGE = [
54
58
  'This command never calls Jira. Your agent reads and writes Jira with your own connection.',
55
59
  ];
56
60
  const BOOL = new Set(['json', 'dry-run', 'help', 'sprints']);
57
- const VALUE = new Set(['from', 'query', 'root', 'epic', 'updated', 'group', 'status', 'refused']);
61
+ const VALUE = new Set(['from', 'query', 'root', 'epic', 'updated', 'group', 'status', 'refused', 'sprint']);
58
62
  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' };
59
63
 
60
64
  function parse(argv) {
@@ -113,6 +117,21 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
113
117
 
114
118
  try {
115
119
  if (flags.sprints && verb !== 'query' && verb !== 'sync') return fail('--sprints goes with query or sync', 2);
120
+ if (flags.sprint != null && verb !== 'query' && verb !== 'sync') return fail('--sprint goes with query or sync', 2);
121
+ if (verb === 'query' && flags.sprint != null) {
122
+ const q = jiraStatus.sprintQueryOne(root, flags.sprint);
123
+ if (!q.ok) return fail(q.error);
124
+ return out(q, [q.query]);
125
+ }
126
+ if (verb === 'sync' && flags.sprint != null) {
127
+ if (!flags.from) return need('--sprint "<name>" --from <file|->');
128
+ let raw;
129
+ try { raw = readSearch(flags.from, cwd, stdin); }
130
+ catch (e) { return fail(`could not read ${flags.from} as JSON — ${String((e && e.message) || e).slice(0, 160)}`); }
131
+ const r = jiraStatus.syncSprints(root, raw, { query: flags.query || undefined, dryRun: !!flags['dry-run'], now, backfill: flags.sprint });
132
+ if (!r.ok) return fail(r.error);
133
+ return out(r, [`${r.backfill} · kept ${r.read} ${r.read === 1 ? 'ticket' : 'tickets'}${r.ignored ? ` · ${r.ignored} not in it, ignored` : ''}${r.dryRun ? ' · dry run, nothing written' : ''}`, ...(r.dryRun ? [] : [`history ${r.snapshot}`])]);
134
+ }
116
135
  if (verb === 'query' && flags.sprints) {
117
136
  const q = jiraStatus.sprintQuery(root);
118
137
  return out(q, [q.linked ? q.query : q.kept.length ? 'every sprint is closed and summarised once — nothing to read' : 'no Jira reading has a sprint yet — run the initiatives\' searches first']);
@@ -126,6 +145,7 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
126
145
  if (!r.ok) return fail(r.error);
127
146
  const lines = [`sprints · read ${r.read} ${r.read === 1 ? 'issue' : 'issues'}${r.ignored ? ` · ${r.ignored} in no sprint, ignored` : ''}${r.skipped ? ` · ${r.skipped} skipped (no key or summary)` : ''}${r.dryRun ? ' · dry run, nothing written' : ''}`];
128
147
  for (const [name, n] of Object.entries(r.sprints)) lines.push(` ${name} · ${n} ${n === 1 ? 'issue' : 'issues'}`);
148
+ for (const name of r.closedNow || []) lines.push(` ${name} closed since the last read: write its summary now (pmos jira summary)`);
129
149
  if (!r.dryRun) lines.push(`snapshot ${r.snapshot}`);
130
150
  return out(r, lines);
131
151
  }
@@ -133,7 +153,8 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
133
153
  if (!flags.from) {
134
154
  const r = jiraStatus.sprintsToSummarise(root);
135
155
  if (!r.read) return out(r, ['no whole-sprint read yet — run pmos jira query --sprints and sync --sprints first']);
136
- const lines = r.sprints.map((s) => `${s.name}\t${s.state}\t${s.tickets} ${s.tickets === 1 ? 'issue' : 'issues'}\t${s.jiraGoal ? `goal in Jira: ${s.jiraGoal}` : 'no goal in Jira'}`);
156
+ const lines = r.sprints.map((s) => `${s.name}\t${s.state}\t${s.tickets} ${s.tickets === 1 ? 'issue' : 'issues'}\t${s.jiraGoal ? `goal in Jira: ${s.jiraGoal}` : 'no goal in Jira'}`
157
+ + (s.closed ? `\tat close (PMOS's count): ${s.closed.done} of ${s.closed.total} done${s.closed.carriedIn ? `, ${s.closed.carriedIn} carried in` : ''}${s.closed.carried ? `, ${s.closed.carried} carried to ${s.closed.carriedTo || 'the next sprint'}` : ''}` : ''));
137
158
  if (!lines.length) lines.push('no sprint needs a summary');
138
159
  for (const k of r.kept) lines.push(`${k}\tclosed\tkept, summarised once`);
139
160
  return out(r, lines);
@@ -151,13 +151,21 @@ function sprintOf(v) {
151
151
  return all.find((s) => s.state === 'active') || all.find((s) => s.state === 'future') || all[all.length - 1] || null;
152
152
  }
153
153
  /** Jira Cloud keeps the sprint in a custom field: any array of objects that carry a sprint's name and state. */
154
- function sprintIn(fields) {
155
- if ('sprint' in fields) return sprintOf(fields.sprint);
154
+ function sprintField(fields) {
155
+ if ('sprint' in fields) return fields.sprint;
156
156
  for (const v of Object.values(fields)) {
157
- if (Array.isArray(v) && v.length && v.every((x) => x && typeof x === 'object' && 'name' in x && 'state' in x && ('boardId' in x || 'id' in x))) return sprintOf(v);
157
+ if (Array.isArray(v) && v.length && v.every((x) => x && typeof x === 'object' && 'name' in x && 'state' in x && ('boardId' in x || 'id' in x))) return v;
158
158
  }
159
159
  return null;
160
160
  }
161
+ function sprintIn(fields) { const v = sprintField(fields); return v == null ? null : sprintOf(v); }
162
+ /** Every sprint the ticket was in, oldest first, when Jira gave more than one (initiative sprint-snapshots): a ticket carried from Sprint 114
163
+ * to 115 keeps 114 in its list, so the old sprint keeps it (lib/sprint-history.js). {} when there is one or none. */
164
+ function sprintsAll(v) {
165
+ if (!Array.isArray(v) || v.length < 2) return {};
166
+ const all = v.map(sprintOne).filter(Boolean).map((s) => { const { goal, ...rest } = s; void goal; return rest; });
167
+ return all.length > 1 ? { sprints: all } : {};
168
+ }
161
169
  function subtasksOf(v) {
162
170
  if (Array.isArray(v)) {
163
171
  const done = v.filter((s) => {
@@ -211,7 +219,7 @@ function normalizeIssue(x) {
211
219
  const st = f.status || {};
212
220
  const status = nameOf(st) || 'Unknown';
213
221
  const flagged = flaggedIn(f) || /block|impediment|on hold/i.test(status);
214
- return { key, summary, status, category: categoryOf(status, st.statusCategory), sprint: sprintIn(f), subtasks: subtasksOf(f.subtasks), fixVersion: fixVersionsOf(f.fixVersions),
222
+ return { key, summary, status, category: categoryOf(status, st.statusCategory), sprint: sprintIn(f), ...sprintsAll(sprintField(f)), subtasks: subtasksOf(f.subtasks), fixVersion: fixVersionsOf(f.fixVersions),
215
223
  points: pointsIn(f), resolved: dayOf(f.resolutiondate || f.resolved),
216
224
  flagged, reason: flagged ? (flaggedIn(f) ? 'Flagged in Jira' : `Status: ${status}`) : null, url: urlOf(x, key),
217
225
  ...typeParent(f.issuetype, f.parent), ...whoWhen(f.assignee, f.updated) };
@@ -221,7 +229,7 @@ function normalizeIssue(x) {
221
229
  if (!summary) return null;
222
230
  const status = oneLine(x.status) || 'Unknown';
223
231
  const flagged = x.flagged === true || /block|impediment|on hold/i.test(status);
224
- return { key, summary, status, category: categoryOf(status, x.category), sprint: sprintOf(x.sprint), subtasks: subtasksOf(x.subtasks), fixVersion: fixVersionsOf(x.fixVersions != null ? x.fixVersions : x.fixVersion),
232
+ return { key, summary, status, category: categoryOf(status, x.category), sprint: sprintOf(x.sprint), ...sprintsAll(x.sprints != null ? x.sprints : x.sprint), subtasks: subtasksOf(x.subtasks), fixVersion: fixVersionsOf(x.fixVersions != null ? x.fixVersions : x.fixVersion),
225
233
  points: pointsIn(x), resolved: dayOf(x.resolved || x.resolutiondate),
226
234
  flagged, reason: flagged ? clip(oneLine(x.reason || x.flag_reason || (x.flagged === true ? 'Flagged in Jira' : `Status: ${status}`)), 160) : null,
227
235
  url: urlOf(x, key), ...typeParent(x.type != null ? x.type : x.issuetype, x.parent), ...whoWhen(x.assignee, x.updated) };
@@ -340,6 +348,7 @@ function sync(root, initiative, raw, { query, dryRun = false, now } = {}) {
340
348
  // not the sprint. This second read asks Jira for every issue in the sprints those tickets are in, whoever holds them.
341
349
  const SPRINTS_FILE = '_sprints';
342
350
  const jqlName = (n) => `"${String(n).replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`;
351
+ const CLOSED_DAYS = 21; // a closed sprint is read again while its tickets changed in the last three weeks (initiative sprint-snapshots)
343
352
  function sprintQuery(root) {
344
353
  const frozen = frozenNotes(root);
345
354
  const seen = new Map(); const kept = new Set(); const projectKeys = new Set();
@@ -356,23 +365,42 @@ function sprintQuery(root) {
356
365
  }
357
366
  }
358
367
  const sprints = [...seen.values()].sort((a, b) => a.name.localeCompare(b.name, undefined, { numeric: true }));
359
- if (!sprints.length) {
360
- // bug 2026-11-19: on a Jira site whose Sprint field is not the usual custom field, the initiatives' reads came back with no sprint,
361
- // so this said "no Jira reading has a sprint yet", the run skipped the sprint read, and the sprint band kept a 28 Oct read. When the
362
- // tickets carry no sprint, read the open sprints of their Jira projects instead.
363
- const projects = [...projectKeys].sort();
364
- if (projects.length && !kept.size) return { ok: true, linked: true, mode: 'open', projects, sprints, kept: [...kept], query: `project in (${projects.join(', ')}) AND sprint in openSprints() ORDER BY key` };
365
- return { ok: true, linked: false, sprints, kept: [...kept], query: null };
366
- }
367
- return { ok: true, linked: true, sprints, kept: [...kept], query: `sprint in (${sprints.map((s) => s.id || jqlName(s.name)).join(', ')}) ORDER BY key` };
368
+ const projects = [...projectKeys].sort();
369
+ // bug 2026-11-19: on a Jira site whose Sprint field is not the usual custom field, the initiatives' reads came back with no sprint, and
370
+ // the band kept a 28 Oct read; and a sprint that opened and closed between two reads was never read (116, 117). So the read always asks
371
+ // for the open sprints of the tickets' Jira projects, and for the closed ones whose tickets changed lately (initiative sprint-snapshots).
372
+ const proj = projects.length ? `project in (${projects.join(', ')}) AND (sprint in openSprints() OR (sprint in closedSprints() AND updated >= -${CLOSED_DAYS}d))` : null;
373
+ const ids = sprints.length ? `sprint in (${sprints.map((s) => s.id || jqlName(s.name)).join(', ')})` : null;
374
+ if (!proj && !ids) return { ok: true, linked: false, sprints, kept: [...kept], query: null };
375
+ const query = proj && ids ? `(${proj}) OR ${ids} ORDER BY key` : `${proj || ids} ORDER BY key`;
376
+ return { ok: true, linked: true, ...(ids ? {} : { mode: 'open' }), projects, sprints, kept: [...kept], query };
377
+ }
378
+ /** The search for one named sprint, every ticket it ever held (Jira's `sprint = X` matches a ticket carried out of it too): the
379
+ * "read it from Jira now" press of a sprint PMOS never saw (SpH3). → { ok, query } | { ok: false, error } */
380
+ function sprintQueryOne(root, name) {
381
+ const n = oneLine(name);
382
+ if (!n || n.length > 80) return { ok: false, error: 'name the sprint, as Jira names it (at most 80 characters)' };
383
+ const p = sprintQuery(root).projects || [];
384
+ return { ok: true, name: n, query: `${p.length ? `project in (${p.join(', ')}) AND ` : ''}sprint = ${jqlName(n)} ORDER BY key` };
368
385
  }
369
386
  /** Save a whole-sprint read. The read replaces the last one whole: an issue moved out of a sprint is gone from it. A closed
370
387
  * sprint that has its summary is not searched again, so its issues are kept from the last read. */
371
- function syncSprints(root, raw, { query, dryRun = false, now } = {}) {
388
+ function syncSprints(root, raw, { query, dryRun = false, now, backfill = null } = {}) {
372
389
  const n = normalize(raw);
373
390
  if (n.error) return { ok: false, error: n.error };
374
- const kept = n.issues.filter((i) => i.sprint && i.sprint.name);
375
391
  const fetchedAt = nowIso(now);
392
+ // every read also goes to the append-only sprint history, which keeps every ticket a sprint held (initiative sprint-snapshots)
393
+ const SH = require('./sprint-history.js');
394
+ if (backfill) {
395
+ // "read it from Jira now" for one closed sprint (SpH3): only the history takes it; the whole-sprint read stays as it was
396
+ const name = oneLine(backfill);
397
+ const mine = n.issues.map((i) => ({ ...i, sprints: (i.sprints && i.sprints.length ? i.sprints : i.sprint ? [i.sprint] : []).map((s) => (s.name === name ? { ...s, state: 'closed' } : s)) }))
398
+ .filter((i) => i.sprints.some((s) => s.name === name));
399
+ const h = SH.append(root, mine, { at: fetchedAt, backfill: name, dryRun });
400
+ return { ok: true, backfill: name, read: mine.length, ignored: n.issues.length - mine.length, skipped: n.skipped, sprints: { [name]: mine.length }, history: h, snapshot: jiraTickets.relOf(root, SH.fileOf(root)), dryRun: !!dryRun, fetchedAt };
401
+ }
402
+ const history = SH.append(root, n.issues, { at: fetchedAt, dryRun });
403
+ const kept = n.issues.filter((i) => i.sprint && i.sprint.name);
376
404
  const prev = readSprints(root);
377
405
  const frozen = frozenNotes(root);
378
406
  if (prev && frozen.length) {
@@ -382,7 +410,7 @@ function syncSprints(root, raw, { query, dryRun = false, now } = {}) {
382
410
  const bySprint = {};
383
411
  for (const i of kept) bySprint[i.sprint.name] = (bySprint[i.sprint.name] || 0) + 1;
384
412
  const result = { ok: true, read: kept.length, ignored: n.issues.length - kept.length, skipped: n.skipped, sprints: bySprint,
385
- was: prev ? prev.tickets.size : null, snapshot: snapshotRel(root, SPRINTS_FILE), dryRun: !!dryRun };
413
+ was: prev ? prev.tickets.size : null, snapshot: snapshotRel(root, SPRINTS_FILE), history, closedNow: history.closedNow, dryRun: !!dryRun };
386
414
  if (dryRun) return result;
387
415
  const file = snapshotPath(root, SPRINTS_FILE);
388
416
  fs.mkdirSync(path.dirname(file), { recursive: true });
@@ -468,7 +496,9 @@ function noteOne(x) {
468
496
  if (tickets == null) return { error: `${name}: theme "${title}" needs a ticket count` };
469
497
  const ini = t.initiative == null || t.initiative === '' ? null : String(t.initiative).trim();
470
498
  if (ini != null && !INI_RE.test(ini)) return { error: `${name}: theme "${title}" has a bad initiative id` };
471
- themes.push({ title, line: text(t.line, 200), tickets, done: Math.min(count(t.done) || 0, tickets), blocked: Math.min(count(t.blocked) || 0, tickets), people: text(t.people, 80), initiative: ini });
499
+ // the theme's ticket keys, when the agent gave them: a closed sprint's snapshot lists a theme's tickets on a press (SpH2)
500
+ const keys = Array.isArray(t.keys) ? [...new Set(t.keys.map((k) => oneLine(k).toUpperCase()).filter((k) => KEY_RE.test(k)))].slice(0, 300) : [];
501
+ themes.push({ title, line: text(t.line, 200), tickets, done: Math.min(count(t.done) || 0, tickets), blocked: Math.min(count(t.blocked) || 0, tickets), people: text(t.people, 80), initiative: ini, ...(keys.length ? { keys } : {}) });
472
502
  }
473
503
  const note = { name, state, goal, summary, themes };
474
504
  // The sprint brief (sprint-goal-summary, mockup-c3-sprint-brief): where the sprint stands, the issues to resolve with a proposed
@@ -505,9 +535,19 @@ function sprintsToSummarise(root) {
505
535
  o.tickets++;
506
536
  if (!o.jiraGoal && sp.goal) o.jiraGoal = sp.goal;
507
537
  }
538
+ // a sprint PMOS saw open and then closed is summarised at close from the kept record, carried-in tickets included, even when the
539
+ // whole-sprint read no longer holds it (initiative sprint-snapshots; Sprint 115's "21 of 23" left out the 56 carried in)
540
+ const SH = require('./sprint-history.js');
541
+ const H = SH.read(root);
542
+ for (const name of new Set(H.map((l) => l.sprint.name))) {
543
+ const c = SH.closeOf(H, name);
544
+ if (!c) continue;
545
+ if (!by.has(name)) by.set(name, { name, state: 'closed', tickets: c.total, jiraGoal: null });
546
+ const o = by.get(name); o.state = 'closed'; o.tickets = c.total; o.closed = c;
547
+ }
508
548
  const all = [...by.values()].sort((a, b) => a.name.localeCompare(b.name, undefined, { numeric: true }));
509
549
  const isKept = (s) => frozen.some((f) => sameSprint(f, s)); // the note was written when Jira said closed
510
- return { ok: true, read: !!whole, sprints: all.filter((s) => !isKept(s)), kept: all.filter(isKept).map((s) => s.name) };
550
+ return { ok: true, read: !!whole || H.length > 0, sprints: all.filter((s) => !isKept(s)), kept: all.filter(isKept).map((s) => s.name) };
511
551
  }
512
552
  /** Save the notes the agent wrote. A closed sprint already noted keeps its first note. A bad note refuses the whole file. */
513
553
  function saveSprintNotes(root, raw, { dryRun = false, now } = {}) {
@@ -521,7 +561,11 @@ function saveSprintNotes(root, raw, { dryRun = false, now } = {}) {
521
561
  const wt = whole ? [...whole.tickets.values()] : [];
522
562
  const writtenAt = nowIso(now);
523
563
  const saved = []; const kept = [];
564
+ let H = null; try { H = require('./sprint-history.js').read(root); } catch { H = []; }
524
565
  for (const n of got) {
566
+ // a closed sprint PMOS kept from open to close: the close numbers are PMOS's own count, never the agent's (initiative sprint-snapshots)
567
+ const own = n.state === 'closed' ? require('./sprint-history.js').closeOf(H, n.name) : null;
568
+ if (own) n.closed = { done: own.done, total: own.total, carried: own.carried, carriedTo: own.carriedTo || (n.closed && n.closed.carriedTo) || null, carriedIn: own.carriedIn, points: own.points || (n.closed && n.closed.points) || null };
525
569
  const i = notes.findIndex((o) => sameSprint(o, n));
526
570
  if (i >= 0 && notes[i].state === 'closed') { kept.push(n.name); continue; }
527
571
  const mine = wt.filter((t) => t.sprint && sameSprint(t.sprint, n));
@@ -562,5 +606,5 @@ function which(root, key) {
562
606
  return { ok: true, key: k, initiatives: hits };
563
607
  }
564
608
 
565
- module.exports = { queryFor, linkedInitiatives, normalize, sync, readSnapshot, findTicket, which, sprintLabel, snapshotPath, snapshotRel, sprintQuery, syncSprints, readSprints, SPRINTS_FILE,
609
+ module.exports = { queryFor, linkedInitiatives, normalize, sync, readSnapshot, findTicket, which, sprintLabel, snapshotPath, snapshotRel, sprintQuery, sprintQueryOne, syncSprints, readSprints, SPRINTS_FILE,
566
610
  sprintsToSummarise, saveSprintNotes, readSprintNotes, sameSprint, noteOne, NOTES_FILE };
@@ -69,6 +69,7 @@ const MODULES = Object.freeze([
69
69
  'routes-initiative-premium', // briefing-premium-initiative: the premium initiative page's model from the Initiatives sheet's own routes (read-only)
70
70
  'routes-initiative-layout', // premium-uncovered-features (Initiative): Moves on by itself, held stages, task groups and saved group sets (page press; file mode)
71
71
  'routes-board-publish', // board-publish slice 2 (D103): publish a board to the central host, republish, turn off (page press; the host is never given a way in)
72
+ 'routes-extension', // meeting-buddy: Settings › Connectors › Google Meet: copy the Chrome extension to a folder you can see, open Chrome's extensions page (page press)
72
73
  'routes-relay', // event-relay (D110): Settings › Connectors › Listening: set up, show steps, stop, pull now (page press; an event only starts a read)
73
74
  'routes-programs', // program-hierarchy: programs above initiatives across products, their members, tasks and milestones (page press; file mode)
74
75
  'routes-brief-page', // console3 Briefing as the brief: Today agenda, Needs you and Mentions (read-only; writes go through routes-pm-items)