create-pmos 0.732.0 → 0.733.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.
Files changed (38) hide show
  1. package/package.json +32 -14
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/okf/core/concepts/frontmatter-format.md +2 -1
  4. package/payload/planning/evals/eval-calibration.md +1 -1
  5. package/payload/planning/okrs/health-budgets.md +1 -1
  6. package/payload/state/discoveries.md +1 -1
  7. package/workspace/board-columns-test.js +6 -5
  8. package/workspace/board-deliveries-test.js +8 -7
  9. package/workspace/board-programs-test.js +6 -12
  10. package/workspace/briefing-premium-board-test.js +3 -3
  11. package/workspace/calm-timeline-test.js +5 -10
  12. package/workspace/changelog.json +31 -0
  13. package/workspace/guide/agent-capabilities.md +1 -0
  14. package/workspace/guide/cli.md +10 -1
  15. package/workspace/guide/layout.md +4 -4
  16. package/workspace/lib/pmos-verbs.js +3 -0
  17. package/workspace/lib/press-release-cli.js +108 -0
  18. package/workspace/lib/press-release.js +186 -0
  19. package/workspace/milestone-pins-test.js +4 -7
  20. package/workspace/package-lock.json +2 -2
  21. package/workspace/package.json +1 -1
  22. package/workspace/product-lane-test.js +5 -11
  23. package/workspace/program-leave-test.js +1 -1
  24. package/workspace/public/pm/bd-deliveries.js +7 -0
  25. package/workspace/public/pm/bd-phone-line.js +29 -0
  26. package/workspace/public/pm/bd-views.js +6 -3
  27. package/workspace/public/pm/bd-work-ds.css +16 -0
  28. package/workspace/public/pm/cozy-goals.css +3 -10
  29. package/workspace/public/pm/cozy-pop-work.js +1 -1
  30. package/workspace/public/pm/goals-ds.js +1 -1
  31. package/workspace/public/pm/premium-board.js +4 -3
  32. package/workspace/public/pm/premium-goals.js +14 -34
  33. package/workspace/public/premium-goals.html +0 -1
  34. package/workspace/task-delete-test.js +1 -1
  35. package/workspace/task-milestones-test.js +4 -8
  36. package/workspace/test-lists/phone-initiative-lines.json +6 -0
  37. package/workspace/test-lists/press-release.json +9 -0
  38. package/workspace/timeline-holds-test.js +5 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.732.0",
3
+ "version": "0.733.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,37 @@
33
33
  "audit"
34
34
  ],
35
35
  "pmosChanges": [
36
+ {
37
+ "v": "0.733.0",
38
+ "at": "2026-11-23T06:21:18.047Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1634,
43
+ "t": "Approve icon in the Work popup; one jira pin line in cli.md",
44
+ "s": "Approve icon in the Work popup; one jira pin line in cli.md",
45
+ "k": "fix"
46
+ },
47
+ {
48
+ "n": 1635,
49
+ "t": "Goals uses the full width and opens Ask PMOS on the right",
50
+ "s": "Goals uses the full width and opens Ask PMOS on the right",
51
+ "k": "fix"
52
+ },
53
+ {
54
+ "n": 1612,
55
+ "t": "Phone initiatives as a list with their own small line, no Gantt",
56
+ "s": "Phone initiatives as a list with their own small line, no Gantt",
57
+ "k": "new"
58
+ },
59
+ {
60
+ "n": 1624,
61
+ "t": "Pmos press-release, a press release and FAQ draft for a bet (A362)",
62
+ "s": "Pmos press-release, a press release and FAQ draft for a bet (A362)",
63
+ "k": "new"
64
+ }
65
+ ]
66
+ },
36
67
  {
37
68
  "v": "0.732.0",
38
69
  "at": "2026-11-23T06:02:19.112Z",
@@ -441,19 +472,6 @@
441
472
  "k": "fix"
442
473
  }
443
474
  ]
444
- },
445
- {
446
- "v": "0.709.0",
447
- "at": "2026-11-22T12:36:24.052Z",
448
- "f": 4,
449
- "prs": [
450
- {
451
- "n": 1539,
452
- "t": "A local use log of page opens and controls pressed, cleared in Settings (A466)",
453
- "s": "A local use log of page opens and controls pressed, cleared in Settings (A466)",
454
- "k": "new"
455
- }
456
- ]
457
475
  }
458
476
  ]
459
477
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@d59de16d
1
+ kernel-source: pmos@f91d7908
2
2
  assembled: 2026-11-23
3
3
  mode: vendor
@@ -46,11 +46,12 @@ OKF's reserved filenames carry **no** frontmatter and are skipped by both the mi
46
46
  The enforced list lives in [`scripts/frontmatter_registry.txt`](/scripts/frontmatter_registry.txt) — the single source `frontmatter_lint.py` reads. A `type:` value not in it fails CI (this catches typos).
47
47
 
48
48
  - **OKF core:** `Concept`, `ADR`, `Template`, `Playbook`, `Reference`
49
- - **Planning:** `Initiative`, `PRD`, `Story`, `Rubric`, `OKR`, `Radar`, `Checklist`, `Calibration`, `Research`, `Design`, `Prototype`, `Handover`, `Review`
49
+ - **Planning:** `Initiative`, `PRD`, `Story`, `Rubric`, `OKR`, `Radar`, `Checklist`, `Calibration`, `Research`, `Design`, `Prototype`, `Handover`, `Review`, `PressRelease`
50
50
  - `Initiative` is the repo-native initiative record in [`planning/initiatives/`](/planning/initiatives/), read by the [Initiative Gate](/.github/scripts/initiative-gate.sh). Its D56 **work-type lane** rides a separate `lane:` key — not `type:` — so the lane vocabulary and this registry never collide.
51
51
  - `Story` is a **user-story document** — the decomposition of a spec into the units of work handed to whoever builds them. It is the one type in this registry that is also **checked positionally** (see below), and it may carry an optional `jira:` / `confluence:` / `google_doc:` key naming the tracker record it corresponds to. That key is a *declaration* the workspace displays, never a lookup: PMOS holds no credential and makes no outbound request.
52
52
  - `Handover` is the note the cockpit mod's `/pmos-handover` writes (`planning/handovers/<id>.md`, or `pmos/state/handovers/<id>.md` in a kit): one per initiative, replaced on each handover, with checked fields (`id`, `head_sha`, `branch`, `stage`, `next`, `commits`, `files`, `handover_at`) read back by the resume summary ([D81](/okf/products/pmos/adr/d81-cockpit-mod-and-grants.md)).
53
53
  - `Review` is an initiative's **outcome review**, a core document the workspace drafts and the PM issues (`<state>/core-docs/initiative-<id>/outcome/<slot>.md`, initiative core-documents): did the work move its key result, and what was learned. The other core documents are `Reference`.
54
+ - `PressRelease` is a bet's one-page press release and FAQ, drafted by `pmos press-release <id>` from the initiative record (`planning/press-releases/<id>.md`, or `pmos/state/press-releases/<id>.md` in a kit) for the PM to edit; PMOS never writes over it (initiative press-release-faq).
54
55
  - **Root governance:** `Decision`, `Principle`, `Debt`, `Discovery`, `Guide`
55
56
 
56
57
  ### When the path decides the type
@@ -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-23T06:02:15Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-23T06:21:14Z"}
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-23T06:02:15Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-23T06:21:14Z"}
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-23T06:02:15Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-23T06:21:14Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -72,7 +72,7 @@ const ITEMS = [
72
72
  if (o.cols) ls['pmos.board.tlcols'] = o.cols;
73
73
  await page.addInitScript(([s]) => { try { if (!sessionStorage.getItem('set')) { sessionStorage.setItem('set', '1'); for (const [k, v] of Object.entries(s)) localStorage.setItem(k, v); } } catch { /* none */ } }, [ls]);
74
74
  await page.goto(BASE + '/premium-board.html?ws=idpf&board=idpf');
75
- await page.waitForSelector('#ibBody [data-row]', { timeout: 15000 });
75
+ await page.waitForSelector('#ibBody [data-row], #ibBody .bd-lrow[data-key]', { timeout: 15000 });
76
76
  await page.waitForTimeout(500);
77
77
  return { ctx, page, errors };
78
78
  };
@@ -131,7 +131,7 @@ const ITEMS = [
131
131
  ok('P the menu stays open while you choose', await p.evaluate(() => !document.querySelector('#bdViewMenu').hidden && !!document.querySelector('#bdViewMenu #bdColsMenu')));
132
132
  await p.keyboard.press('Escape'); await p.waitForTimeout(150);
133
133
  ok('P Escape closes the menu and gives the focus back to the View chip', await p.evaluate(() => document.querySelector('#bdViewMenu').hidden && document.activeElement && document.activeElement.id === 'bdView'));
134
- await p.reload(); await p.waitForSelector('#ibBody [data-row]'); await p.waitForTimeout(400);
134
+ await p.reload(); await p.waitForSelector('#ibBody [data-row], #ibBody .bd-lrow[data-key]'); await p.waitForTimeout(400);
135
135
  ok('P the choice is remembered after a reload', (await heads(p)).join() === 'Initiative,Stage,Status,Start,Owner', JSON.stringify(await heads(p)));
136
136
  await p.evaluate(() => document.querySelector('#bdViewMenu [data-pv="track"]').click()); await p.waitForTimeout(200);
137
137
  ok('P the Columns are the timeline\'s only', await p.evaluate(() => !document.querySelector('#bdColsMenu')));
@@ -159,11 +159,12 @@ const ITEMS = [
159
159
  ok('N no page error', errors.length === 0, errors.join(' | '));
160
160
  await ctx.close();
161
161
  }
162
+ /* N — the phone has no Gantt (board PhIniB, initiative phone-initiative-lines): a stored Timeline opens the List, each row with its own line */
162
163
  {
163
164
  const { ctx, page: p, errors } = await open({ w: 390, h: 844, phone: true });
164
- const ph = await p.evaluate(() => ({ heads: document.querySelectorAll('#ibBody .tg-chd, #ibBody .tg-c').length, btn: !document.querySelector('#bdColsMenu'), bars: [...document.querySelectorAll('#ibBody .tg-bar')].map((b) => Math.round(b.getBoundingClientRect().height)), scroll: document.documentElement.scrollWidth <= innerWidth + 1 }));
165
- ok('N the phone has no columns and no Columns button; its bars are 20 px; no sideways page scroll', ph.heads === 0 && ph.btn && ph.bars.length && ph.bars.every((x) => x === 20) && ph.scroll, JSON.stringify(ph));
166
- ok('N no page error on the phone', errors.length === 0, errors.join(' | '));
165
+ const ph = await p.evaluate(() => ({ tg: document.querySelectorAll('#ibBody .tg, #ibBody .tgq-r').length, rows: document.querySelectorAll('#ibBody .bd-lrow.ini2').length, scroll: document.documentElement.scrollWidth <= innerWidth + 1 }));
166
+ ok('N the phone draws no timeline: the List, with no sideways page scroll', ph.tg === 0 && ph.rows >= 1 && ph.scroll, JSON.stringify(ph));
167
+ ok('the phone threw nothing', !errors.length, errors.join('\n'));
167
168
  await ctx.close();
168
169
  }
169
170
  finish();
@@ -75,7 +75,7 @@ const model = () => {
75
75
  await page.addInitScript(([s]) => { try { if (!sessionStorage.getItem('set')) { sessionStorage.setItem('set', '1'); for (const [k, v] of Object.entries(s)) localStorage.setItem(k, v); } } catch { /* none */ } },
76
76
  [{ 'pmos.board.view': 'time', 'pmos.board.pview': 'time', 'pmos.board.span': o.span || 'year', ...(o.store || {}) }]);
77
77
  await page.goto(BASE + '/premium-board.html?ws=w1&board=w1');
78
- await page.waitForSelector('#ibBody [data-row]', { timeout: 15000 });
78
+ await page.waitForSelector('#ibBody [data-row], #ibBody .bd-lrow[data-key]', { timeout: 15000 });
79
79
  await page.waitForTimeout(400);
80
80
  return { ctx, page, errors };
81
81
  };
@@ -124,7 +124,7 @@ const model = () => {
124
124
  ok('F folded: one line "Next · Today Deliver · 2 more this year · 1 missed"', a && a.cols === 0 && /^Next\s*Today Deliver\s*· 2 more this year · 1 missed$/.test(a.fold.trim()), JSON.stringify(a && a.fold));
125
125
  ok('F the fold button says it opens the lane', await p.evaluate(() => document.querySelector('#ibBody [data-dl-fold]').getAttribute('aria-expanded') === 'false'));
126
126
  await shot(p, 'deliveries-folded-1440');
127
- await p.reload(); await p.waitForSelector('#ibBody [data-row]'); await p.waitForTimeout(300);
127
+ await p.reload(); await p.waitForSelector('#ibBody [data-row], #ibBody .bd-lrow[data-key]'); await p.waitForTimeout(300);
128
128
  const b = await lane(p);
129
129
  ok('F the fold is remembered after a reload', b && b.cols === 0 && !!b.fold, JSON.stringify(b));
130
130
  await ctx.close();
@@ -137,16 +137,17 @@ const model = () => {
137
137
  await ctx.close();
138
138
  }
139
139
 
140
- /* Q — the phone */
140
+ /* Q — the phone has no Gantt (board PhIniB, initiative phone-initiative-lines): a stored Timeline opens the List, each row with its own line */
141
141
  {
142
142
  const { ctx, page: p, errors } = await open({ w: 390, h: 844, phone: true });
143
- const c = await p.evaluate(() => { const s = document.querySelector('#ibBody .dl-ph'); return s ? { head: s.querySelector('.dl-phh').textContent, lines: [...s.querySelectorAll('.dl-pl')].map((x) => x.textContent), first: !!(s.nextElementSibling && s.nextElementSibling.classList.contains('tg')) } : null; });
144
- ok('Q "Next deliveries · 1 missed" above the rows, with All', c && c.first && c.head === 'Next deliveries· 1 missedAll', JSON.stringify(c));
145
- ok('Q the next 3, missed first', c && c.lines.join('|') === 'Oct 14MAGW dry run|TodayDeliver|Nov 2MAGW on auth-service', JSON.stringify(c && c.lines));
143
+ const ph = await p.evaluate(() => ({ tg: document.querySelectorAll('#ibBody .tg, #ibBody .tgq-r').length, rows: document.querySelectorAll('#ibBody .bd-lrow.ini2').length, scroll: document.documentElement.scrollWidth <= innerWidth + 1 }));
144
+ ok('Q the phone draws no timeline: the List, with no sideways page scroll', ph.tg === 0 && ph.rows >= 1 && ph.scroll, JSON.stringify(ph));
145
+ const c = await p.evaluate(() => { const s = document.querySelector('#ibBody .dl-ph'); return s ? { head: s.querySelector('.dl-phh').textContent, lines: s.querySelectorAll('.dl-pl').length, first: s === document.querySelector('#ibBody').firstElementChild, box: getComputedStyle(s).borderTopWidth + ' ' + getComputedStyle(s).backgroundColor } : null; });
146
+ ok('Q "Next deliveries · 1 missed" leads the List, flat (no card), with All and the next 3', c && c.first && c.head === 'Next deliveries· 1 missedAll' && c.lines === 3 && /^0px rgba\(0, 0, 0, 0\)$/.test(c.box), JSON.stringify(c));
146
147
  await shot(p, 'deliveries-phone-390');
147
148
  await p.click('#ibBody .dl-all'); await p.waitForTimeout(200);
148
149
  const sh = await p.evaluate(() => { const m = document.querySelector('.tg-msp.sh'); return m ? { h: (m.querySelector('.h') || {}).textContent, n: m.querySelectorAll('[data-ms-ini]').length } : null; });
149
- ok('Q All opens the sheet with every delivery not done', sh && sh.h === 'Deliveries' && sh.n === 6, JSON.stringify(sh));
150
+ ok('Q All opens the sheet with every delivery not done', sh && sh.h === 'Deliveries' && sh.n >= 3, JSON.stringify(sh));
150
151
  ok('the phone threw nothing', !errors.length, errors.join('\n'));
151
152
  await ctx.close();
152
153
  }
@@ -339,19 +339,12 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
339
339
  ok('S the scroll threw nothing', !errors.length, errors.join('\n'));
340
340
  await ctx.close();
341
341
  }
342
+ /* S — the phone has no Gantt (board PhIniB, initiative phone-initiative-lines): a stored Timeline opens the List, each row with its own line */
342
343
  {
343
- // the phone (TsCPhone, TsCPhoneSpan; batch 28 item 3, BhA): the timeline is a view; the spans sit in the view button's menu
344
344
  const { ctx, page: p, errors } = await open({ view: 'time', w: 390, h: 844, store: { 'pmos.board.pview': 'time', 'pmos.board.span': 'quarter' } });
345
- await p.click('#bdView');
346
- const ph = await p.evaluate(() => ({ spans: !!document.querySelector('#bdSpans'), pick: (document.querySelector('#bdViewMenu [data-spick][aria-checked="true"]') || {}).textContent || '', rows: [...document.querySelectorAll('#ibBody .tgq-r .tgq-n b')].map((b) => b.textContent), names: document.querySelectorAll('#ibBody .tgq-r[data-row] .tgq-n').length }));
347
- ok('S phone: the spans in the view button, no span row; each row carries its name above its bar, Monitor and Evaluate rows too (batch 8 item 2), and the undated one as a "No dates" row (batch 26 item 8)', !ph.spans && ph.pick === 'Quarter' && ph.names === 4 && ph.rows.includes('Usage-based billing') && ph.rows.includes('Legacy IdP sunset') && ph.rows.includes('Inline login for eShop checkout'), JSON.stringify(ph));
348
- await p.click('#bdViewMenu [data-spick="year"]'); await p.waitForTimeout(200);
349
- ok('S phone: a span chip changes the span', await p.evaluate(() => document.querySelector('#ibBody .tg-s').dataset.span === 'year' && document.querySelector('#bdViewMenu [data-spick="year"]').getAttribute('aria-checked') === 'true' && localStorage.getItem('pmos.board.span') === 'year'));
350
- await p.keyboard.press('Escape');
351
- await p.evaluate(() => { const sc = document.querySelector('#ibBody .tg-sc'); sc.scrollLeft = sc.scrollWidth; }); await p.waitForTimeout(200);
352
- const pb = await p.evaluate(() => ({ back: [...document.querySelectorAll('#ibBody .tg-tback')].filter((b) => !b.hidden).map((b) => b.className), tabs: [...document.querySelectorAll('#ibBody .tg-edge')].filter((b) => !b.hidden).length }));
353
- ok('S phone: swiped ahead, Today docks at the axis edge; only late work leaves an edge tab', pb.back.length === 1 && pb.tabs === 0, JSON.stringify(pb));
354
- ok('S phone threw nothing', !errors.length, errors.join('\n'));
345
+ const ph = await p.evaluate(() => ({ tg: document.querySelectorAll('#ibBody .tg, #ibBody .tgq-r').length, rows: document.querySelectorAll('#ibBody .bd-lrow.ini2').length, scroll: document.documentElement.scrollWidth <= innerWidth + 1 }));
346
+ ok('S the phone draws no timeline: the List, with no sideways page scroll', ph.tg === 0 && ph.rows >= 1 && ph.scroll, JSON.stringify(ph));
347
+ ok('the phone threw nothing', !errors.length, errors.join('\n'));
355
348
  await ctx.close();
356
349
  }
357
350
 
@@ -452,7 +445,8 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
452
445
  ok('Z with no program on the board: no group head, no band, and no grouping control', await p.evaluate(() => !document.querySelector('#ibBody .bt-pg, #ibBody .bt-prd') && !document.querySelector('#bdGrpw')));
453
446
  await ctx.close();
454
447
  const R = await open({ w: 390, h: 844 });
455
- ok('Z on a phone the program is a head card with its next milestone, and nothing scrolls sideways', await R.page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1 && !!document.querySelector('#ibBody .bt-pg .bd-pm') && getComputedStyle(document.querySelector('#ibBody .bt-pg .bt-spread')).display === 'none'));
448
+ // PhIniB: a phone has no stage track; its List groups by what needs you, and nothing scrolls sideways
449
+ ok('Z on a phone the List shows (no stage track), and nothing scrolls sideways', await R.page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1 && !!document.querySelector('#ibBody .bd-plist') && !document.querySelector('#ibBody .bt-pg')));
456
450
  await R.ctx.close();
457
451
  }
458
452
 
@@ -118,7 +118,7 @@ const IVREAD = () => {
118
118
  const view = async (pg, v) => { await pg.evaluate((x) => document.querySelector(`#bdViewMenu [data-pv="${x}"]`).click(), v); await sleep(150); };
119
119
  // the Filter's "Sprint N only" (batch 28 item 3, BhA: the chip row is gone; the chip is Filter's first sprint chip)
120
120
  const sprintOnly = async (pg) => { await pg.click('#bdFilter'); await pg.click('#bdPop [data-fsonly]'); await pg.keyboard.press('Escape'); await sleep(150); };
121
- // a phone's view button (BhA): its menu holds the four views
121
+ // a phone's view button (BhA): its menu holds List and By stage (PhIniB)
122
122
  const pview = async (pg, v) => { await pg.click('#bdView'); await pg.click(`#bdViewMenu [data-pv="${v}"]`); await sleep(150); };
123
123
  const spanTo = async (pg, s) => { await pg.click('#bdView'); await pg.click(`#bdViewMenu [data-spick="${s}"]`); await pg.keyboard.press('Escape'); await sleep(150); }; // the span, in the View chip (UI grill U2)
124
124
  /* the Viewer's shell A (initiative viewer-shell-a, XvABoard): what it shows now, and a press in its ⋯ menu by label */
@@ -452,10 +452,10 @@ const IVREAD = () => {
452
452
  ok(`B13 at 390 px (${theme}) the one row is the picker, the view button, the one pill for what needs a look, Find, the tune button and New; no Jira face, no Shared chip, no workflow chips (BhA)`, m.chips.join() === '1131' && !m.jira && m.order === 'bdPick,bdView,chNeed,bdFind,bdFilter,newIni', JSON.stringify(m));
453
453
  await q.click('#bdView');
454
454
  const pl = await q.evaluate(() => ({ groups: [...document.querySelectorAll('#ibBody .bd-ghd')].map((g) => g.textContent.replace(/\s+/g, ' ').trim()), shared: /Shared with me/.test((document.querySelector('#bdViewMenu [data-vshared]') || {}).textContent || ''), seg: [...document.querySelectorAll('#bdViewMenu [data-pv]')].map((b) => b.textContent + (b.getAttribute('aria-pressed') === 'true' ? '*' : '')).join(), note: /Timeline needs a wider screen/.test(document.querySelector('#ibBody').textContent), small: [...document.querySelectorAll('#bdViewMenu [data-pv], #ibBody .bd-lrow')].filter((b) => b.getBoundingClientRect().height < 44).length }));
455
- ok(`B13 at 390 px (${theme}) the phone opens on the List, grouped your turn first; its view button holds List, By stage, Track and Timeline, then Shared with me (BdPhone, TsCPhone, BhA)`, pl.groups.join('|') === 'At risk or late4|On track3' && pl.seg === 'List*,By stage,Track,Timeline' && pl.shared && !pl.note && pl.small === 0, JSON.stringify(pl));
455
+ ok(`B13 at 390 px (${theme}) the phone opens on the List, grouped your turn first; its view button holds List and By stage (no Gantt on a phone, PhIniB), then Shared with me (BdPhone, BhA)`, pl.groups.join('|') === 'At risk or late4|On track3' && pl.seg === 'List*,By stage' && pl.shared && !pl.note && pl.small === 0, JSON.stringify(pl));
456
456
  await q.click('#bdViewMenu [data-pv="stages"]'); await sleep(150); const s2 = await q.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1 && document.querySelectorAll('#ibBody .bd-scols.ph .bd-scol').length + (((document.querySelector('#ibBody .bd-sempty') || {}).textContent || '').replace(/^Nothing on screen in /, '').match(/[A-Z][a-z]+/g) || []).length === 8);
457
457
  ok(`B13 at 390 px (${theme}) the view button switches to By stage, every step a column down the page (the empty steps named on one line), with no sideways scroll`, s2);
458
- await pview(q, 'track'); await q.locator('#ibBody .bt-l[data-row="board:sso-partners"] .bt-nm').click();
458
+ await pview(q, 'list'); await q.locator('#ibBody .bd-lrow[data-key="board:sso-partners"]').click(); // a phone has no stage track (PhIniB): the List row opens it
459
459
  /* re-pointed (viewer-shell-a, XvABoard; batch 14 item 5): on a phone the Viewer covers the screen; ⋯ Move to a stage opens the stages as a sheet */
460
460
  const g = await until(() => q.evaluate(() => { const v = document.querySelector('#czViewer'); if (!v || v.hidden) return null; const r = v.getBoundingClientRect(); return { l: Math.round(r.left), w: Math.round(r.width), h: Math.round(r.height), vw: innerWidth, vh: innerHeight }; }));
461
461
  ok(`B13 at 390 px (${theme}) the initiative covers the screen`, !!g && g.l === 0 && g.w === g.vw && g.h === g.vh, JSON.stringify(g));
@@ -74,7 +74,7 @@ const ITEMS = [
74
74
  if (o.fold) ls['pmos.board.fold'] = JSON.stringify(o.fold);
75
75
  await page.addInitScript(([s]) => { try { if (!sessionStorage.getItem('set')) { sessionStorage.setItem('set', '1'); for (const [k, v] of Object.entries(s)) localStorage.setItem(k, v); } } catch { /* none */ } }, [ls]);
76
76
  await page.goto(BASE + '/premium-board.html?ws=idpf&board=idpf');
77
- await page.waitForSelector(o.fold ? '#ibBody .tg-r' : '#ibBody [data-row]', { timeout: 15000 });
77
+ await page.waitForSelector(o.fold ? '#ibBody .tg-r' : '#ibBody [data-row], #ibBody .bd-lrow[data-key]', { timeout: 15000 });
78
78
  await page.waitForTimeout(500);
79
79
  return { ctx, page, errors };
80
80
  };
@@ -171,17 +171,12 @@ const ITEMS = [
171
171
  await c2.close();
172
172
  }
173
173
 
174
- // ── M: the phone ──
174
+ /* M — the phone has no Gantt (board PhIniB, initiative phone-initiative-lines): a stored Timeline opens the List, each row with its own line */
175
175
  {
176
176
  const { ctx, page: p, errors } = await open({ w: 390, h: 844, phone: true });
177
- await shot(p, 'calm-390');
178
- const m = await p.evaluate(() => ({
179
- labels: [...document.querySelectorAll('#ibBody .tgq-r[data-row] .tg-endl')].length,
180
- dots: [...document.querySelectorAll('#ibBody .tgq-r[data-row] .tgq-n')].map((b) => (b.querySelector('.cz-dot') || {}).className || ''),
181
- scroll: document.documentElement.scrollWidth <= innerWidth + 1,
182
- }));
183
- ok('M the phone keeps the end labels, a dot only off track (the undated row too, batch 26 item 8), and no sideways page scroll', m.labels >= 5 && m.dots.filter(Boolean).length === 4 && m.scroll, JSON.stringify(m));
184
- ok('M no page error on the phone', errors.length === 0, errors.join(' | '));
177
+ const ph = await p.evaluate(() => ({ tg: document.querySelectorAll('#ibBody .tg, #ibBody .tgq-r').length, rows: document.querySelectorAll('#ibBody .bd-lrow.ini2').length, scroll: document.documentElement.scrollWidth <= innerWidth + 1 }));
178
+ ok('M the phone draws no timeline: the List, with no sideways page scroll', ph.tg === 0 && ph.rows >= 1 && ph.scroll, JSON.stringify(ph));
179
+ ok('the phone threw nothing', !errors.length, errors.join('\n'));
185
180
  await ctx.close();
186
181
  }
187
182
 
@@ -1,4 +1,35 @@
1
1
  [
2
+ {
3
+ "v": "0.733.0",
4
+ "at": "2026-11-23T06:21:18.047Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1634,
9
+ "t": "Approve icon in the Work popup; one jira pin line in cli.md",
10
+ "s": "Approve icon in the Work popup; one jira pin line in cli.md",
11
+ "k": "fix"
12
+ },
13
+ {
14
+ "n": 1635,
15
+ "t": "Goals uses the full width and opens Ask PMOS on the right",
16
+ "s": "Goals uses the full width and opens Ask PMOS on the right",
17
+ "k": "fix"
18
+ },
19
+ {
20
+ "n": 1612,
21
+ "t": "Phone initiatives as a list with their own small line, no Gantt",
22
+ "s": "Phone initiatives as a list with their own small line, no Gantt",
23
+ "k": "new"
24
+ },
25
+ {
26
+ "n": 1624,
27
+ "t": "Pmos press-release, a press release and FAQ draft for a bet (A362)",
28
+ "s": "Pmos press-release, a press release and FAQ draft for a bet (A362)",
29
+ "k": "new"
30
+ }
31
+ ]
32
+ },
2
33
  {
3
34
  "v": "0.732.0",
4
35
  "at": "2026-11-23T06:02:19.112Z",
@@ -125,6 +125,7 @@ A loop never sends a message, moves a Jira ticket, merges into a product reposit
125
125
  | [What you might have missed](claude-proposes.md) | Each Monday, for the week before. It uses no model. | Records only: tasks, dates, initiatives and Jira status | One ✦ in Home's chat, at most 3 items | `pmos ai off drift`. `PMOS_DRIFT=off` |
126
126
  | [The story so far](home.md) | Once, when you open a product that has no story yet. At most once a day for each product. | The initiatives, their stages and dates, and the Intent and Goal | "The story so far" on the product page. After that, the weekly report keeps it current. | `pmos ai off story-seed`. `PMOS_STORY_SEED=off` |
127
127
  | [Principles](initiatives-and-next-steps.md) | Once, when you open the Board of a product that has 3 or more decisions and no principles. At most once a day for each product. | The decisions in `DECISIONS.md` and its ADRs, and `pmos decisions` | Drafts with ✦ in the Board's Principles block, each citing its decisions. Nothing is a principle until you keep it. | `pmos ai off principles-draft` |
128
+ | [Press release](cli.md) | Only when you run `pmos press-release <initiative>`. One run, no tools. | The initiative's record: Intent, Goal, Narrative, Hypothesis, outcome and kill rule | One press release and FAQ file beside the record, for you to edit. PMOS never writes over it. Job `press-release`. | `pmos ai off press-release`. `--no-ai` |
128
129
  | Change check | When no merged pull request waits for the verifier. At most 4 a day. | One change that PMOS made by itself, the record it changed, and its sources | Nothing when it passes. A FAIL removes the change from "did" and counts like an Undo. | `pmos ai off verify`. `PMOS_VERIFY_CHANGES=off` |
129
130
  | [Your impact](claude-proposes.md) | PMOS reads once a day. Home shows the week after it ends. | Slack, mail, Jira, your meeting notes, your documents and your key results | Adler's sprout on Home, and your impact log | Settings › General › Your impact. `PMOS_IMPACT=off` |
130
131
  | [Morning brief and day check](proactive-engine.md) | The morning brief at 06:45, once you schedule it. The day check every 60 minutes by default (30, 60 or off). | Calendar, Wispr Flow, Slack, Jira and Confluence are on by default. Mail, GitHub, Drive, Figma and websites are off by default. Mail: subjects and senders only. | Today | Each source is a setting. `pmos proactive settings` |
@@ -287,6 +287,16 @@ Run it in the product's repository, or pass `--root <dir>`. It changes nothing,
287
287
  - With the workspace running, the list is the same one the workspace reads. Without it, `pmos questions` reads the records on disk and says that held plan changes were not read.
288
288
  - `pmos questions age` prints the median age in days of the lines. Its last line is the number, so a script can read it.
289
289
 
290
+ ### pmos press-release: a press release and FAQ for a bet
291
+
292
+ Write the press release before the build ("working backwards"). Run it in the product's repository, or pass `--root <dir>`. No running workspace is needed.
293
+
294
+ - `pmos press-release <initiative>` drafts a one-page press release and FAQ from the initiative's own record: its Intent, Goal, Narrative, Hypothesis, outcome and kill rule. It writes `planning/press-releases/<id>.md` (`pmos/state/press-releases/<id>.md` in a kit) and prints the path. Open it and edit it like any other document.
295
+ - Where the record does not say a fact, the draft says "(not written yet)". PMOS does not invent numbers, names, dates or quotes.
296
+ - PMOS never writes over the file. `--again` drafts it again and first keeps the old file as `<id>.prev.md`.
297
+ - The draft uses one agent run with no tools. `--no-ai`, `pmos ai off press-release` or `PMOS_AI=off` makes a draft from the record's own lines only. A failed run does the same and says why.
298
+ - `pmos press-release count [--days 7]` prints how many drafts were written in the last days. Its last line is the number.
299
+
290
300
  ### pmos why: why the work exists, in three lines
291
301
 
292
302
  Anyone can run it, not only the PM: an engineer or a stakeholder who wants to know why an initiative or a task exists. Run it in the product's repository, or pass `--root <dir>`. It reads the records on disk, needs no running workspace and changes nothing.
@@ -736,7 +746,6 @@ The benchmark needs a signed-in agent CLI. It never pushes and never opens a pul
736
746
  - `pmos jira answer <initiative> <ticket> <n> --text "<answer>"` or `--keep-default`
737
747
  - `pmos jira epic-asks [--direct|--draft]` lists the tickets waiting to go under their initiative's epic. `--draft` prints the day's draft by owner, for you to send.
738
748
  - `pmos jira epic-done <ask id>` or `--refused "<why>"` records the answer for a ticket that is assigned to you.
739
- - `pmos jira pin <initiative> [--off]` keeps an initiative live: its tickets get the sprint read and full detail on every refresh.
740
749
  - `pmos jira criteria-propose <initiative>` lists, for each open Jira ticket of the initiative, the done-test checks PMOS proposes as acceptance criteria ([Jira tickets](jira.md)).
741
750
  - `pmos jira criteria-ask <initiative> [KEY …]` says yes to them. Tickets assigned to you get the criteria in Jira; the others go to the draft for their owners.
742
751
  - `pmos jira criteria-asks [--direct|--draft|--health]` lists the criteria asks that wait for Jira, prints the draft by owner, or prints the health number.
@@ -249,16 +249,16 @@ The notes of a held meeting look the same wherever you open them: a short summar
249
249
 
250
250
  **Goals** in the navigation answers "Am I on track? What do I do?" for the products you chose at the top left. The product choice and each product's heading show the product's name, such as IDPF, not the name of its folder. When a key result waits on a source, Goals names the tool, such as Confluence, and not a page number. It reads your OKR file as one hierarchy: the North Star, then each objective with its key results, the levers behind them and the initiatives that move them.
251
251
 
252
- The page is one column of blocks.
252
+ The page is one column of blocks. On a computer the blocks use the full width of the page, as on Today, Work and Events.
253
253
 
254
254
  1. The top line is the path (**Goals ›** the product), the period, such as Q4 2026, then Search, **+** (New key result) and **⋯**.
255
255
  2. **Where it stands** says what matters now: how many key results are on pace, which one is behind and the work that moves it with its date, a key result with no reading and since when, and the next check. Press a name to open it.
256
256
  3. Under it, PMOS makes one suggestion. It shows **Why**, **PMOS will**, **What changes** and **Based on**. Press the tick to do it, the pencil to change the words first, or the cross to say no. When PMOS drafted a North Star, the tick keeps it and the cross drops it. You can undo either for a moment.
257
257
  4. **North Star**, **Input** and **Guardrail** show their reading, the day it was read and a small line of the readings. A measure that does not exist shows no block.
258
258
  5. **Key results** is one table, grouped by objective, then health budgets, then the work that names no key result. Each row shows the reading against its target, its pace, the work that moves it and its check date. A dash means nothing reads it yet, and the row says what it waits on. PMOS never shows a number it did not read. The tabs show **All**, **Behind**, **No reading** or **On pace**. **Choose columns** adds **Left** (the days left) and **Levers**.
259
- 6. For work that names no key result, PMOS says which key result it thinks the work moves and the words they share. Press the link button to put the words in the chat box.
259
+ 6. For work that names no key result, PMOS says which key result it thinks the work moves and the words they share. Press the link button to put the words in the Ask PMOS box.
260
260
  7. Press a key result to open it with the chat beside it: what PMOS read, the target and time left, the levers, the work that names it, and the source to connect. Press an initiative to open it. When its outcome check is overdue, the verdict page opens.
261
- 8. **Ask about your goals** at the end is the chat about the product's goals. Ask why a key result is behind, or say a new one.
261
+ 8. Goals has no chat of its own. The tick, the pencil, the link button and **+** open the **Ask PMOS** panel on the right, about the product's goals, beside the page. On a phone the chat opens as a sheet. Ask why a key result is behind, or say a new one.
262
262
  9. Under **⋯**: **Set up** (names to confirm and sources to connect), **Charts and dashboards** (the readings and charts, on the Intelligence page) and **Export CSV**.
263
263
 
264
264
  Reports are routine jobs, so they live in Routine.
@@ -295,7 +295,7 @@ A phone has its own layout. It is not the computer's page made smaller. There is
295
295
 
296
296
  - **⋯** is at the top right of every screen. It opens **Waiting on you** with a count (only when something waits), **Live now** (only while something runs), **Today**, **Work**, **Ask PMOS** and **Settings**. A blue dot on ⋯ means that something waits on you. When an item is open, its own menu items are at the top of the same menu.
297
297
  - **Today** opens first. **Where it stands** says what leads today and why, and which dates are late. Under it is at most one ✦ proposal. Press it to read what changes and why, then press ✓ or ✕. The log has the **All** filter: Reply, Do, Decide or Send. A row has two lines: the title, then the job, the work and how late it is. A dot is before each row: red when it is late, blue for today, grey for Can wait. When PMOS has a fix for a row, the fix is under it with ✦. Swipe a row to the right to do, accept or send it, and to the left to drop it or put it off. Each swipe shows **Undo**. **Can wait** is one folded line. The box at the bottom logs a task, an event or a note; where the browser can listen, the microphone writes what you say into the box. After a recording, the first line says where PMOS filed it, with **Undo**.
298
- - **Work** is the list of initiatives: the product, search and filter, the tabs **Initiatives**, **Backlog** with its count (for example **Backlog 14**) and **Sprint**, a short **Where it stands**, and the groups At risk or late, On track and No signal. A row shows its stage, its next milestone and how many milestones are late. A Project also shows its end date.
298
+ - **Work** is the list of initiatives: the product, search and filter, the tabs **Initiatives**, **Backlog** with its count (for example **Backlog 14**) and **Sprint**, a short **Where it stands**, and the groups At risk or late, On track and No signal. **Next deliveries** is at the top, with no box: the next 3, missed first, and **All**. A row shows its stage, its next milestone and how many milestones are late. Under it is the row's own small line, from its start to its end: the part done up to today, a tick for today and a ◇ for the next milestone, with the start month and the end date below. The line is orange when the work is late or at risk. A row with no dates has no line. The view menu has **List** and **By stage**. There is no timeline on a phone; a shared read-only copy keeps its timeline.
299
299
  - **An initiative** opens full screen: **Where it stands** with one ✦ proposal and the next 3 dates, the **Stages** as one strip with the stage now marked, the **Work breakdown** of the stage now (a red dot when late, blue in progress, an empty ring to do, a tick when done, the Jira key, subtasks under their task), one line that opens the other stages, **The case**, and **Artefacts**. There is no timeline on a phone. Swipe a ✦ line to the right to say yes and to the left to say no; press it to read why. A task, a milestone or an artefact opens full screen with ← back to the initiative, as one page with no boxes. The box at the end of the page asks PMOS about this work.
300
300
  - **Ask PMOS** lists your chats grouped by the work they are about, with its product. "Not in a work yet" is last. A blue dot after the time marks a chat that waits for you. Write in the box at the bottom to start a new chat. In a chat, when PMOS asks before it changes or sends something, the ask is a blue-lined line: swipe it to the right to allow it, and to the left to say no. Press **Why** under it to read why PMOS asks. After you allow a change, a line says **Done** with what changed and **Undo**, until you write again.
301
301
  - **Settings** has the theme (Light, Dark or Auto) and the version with **Check update**. When a newer PMOS is ready, the button becomes **Update** (an arrow down to a line). Press it to install that version on your computer. The version line says each step, and Settings comes back on the new version when your computer restarts PMOS. This works when the phone opens the workspace at its Online address. Connectors and workspaces are on your computer.
@@ -139,6 +139,9 @@ const VERBS = Object.freeze({
139
139
  // Not a pm-os-absorb verb (run: null): initiative three-line-why (bet A86) added it through the same table.
140
140
  why: Object.freeze({ module: 'why-cli.js', run: null, guide: 'cli.md',
141
141
  help: 'pmos why <initiative or task> | coverage — why the work exists in three lines: goal, problem, evidence, read from its records (pmos why help)' }),
142
+ // Not a pm-os-absorb verb (run: null): initiative press-release-faq (bet A362) added it through the same table.
143
+ 'press-release': Object.freeze({ module: 'press-release-cli.js', run: null, guide: 'cli.md',
144
+ help: 'pmos press-release <initiative> | count — a one-page press release and FAQ for a bet, drafted from its record, for you to edit (pmos press-release help)' }),
142
145
  // Not a pm-os-absorb verb (run: null): initiative outcome-for-every-initiative added it through the same table.
143
146
  outcomes: Object.freeze({ module: 'outcomes-cli.js', run: null, guide: 'cli.md',
144
147
  help: 'pmos outcomes list|propose|declare|record|live — every initiative\'s expected outcome and check date: Claude\'s cited drafts, the PM\'s yes, the verdict when a check is due, and the version a place runs (pmos outcomes help)' }),
@@ -0,0 +1,108 @@
1
+ 'use strict';
2
+ /* press-release-cli.js — `pmos press-release …`: a one-page press release and FAQ for a bet, for the PM to edit
3
+ * (initiative press-release-faq, bet A362).
4
+ *
5
+ * pmos press-release <initiative> [--again] [--no-ai] draft it beside the record and print the path
6
+ * pmos press-release count [--days 7] the drafts written in the window; the last line is the number
7
+ * every command: [--json] [--root <dir>]
8
+ *
9
+ * The draft goes to planning/press-releases/<id>.md (pmos/state/press-releases/<id>.md in kit layout). A file that is there is never
10
+ * written over: --again first keeps it as <id>.prev.md. The model run is one `claude -p` with no tools (lib/press-release.js); when it
11
+ * is off (`pmos ai off press-release`, PMOS_AI=off), fails or answers something unreadable, the draft is the record's own lines.
12
+ * Exit codes: 0 done, 1 refused (no such initiative, a draft is there), 2 usage.
13
+ */
14
+ const fs = require('fs');
15
+ const path = require('path');
16
+ const { execFileSync } = require('child_process');
17
+ const PR = require('./press-release.js');
18
+
19
+ const TAG = '[press-release]';
20
+ const COMMANDS = { 'press-release': ['count'] };
21
+ const USAGE = [
22
+ 'usage: pmos press-release <initiative> | count — a one-page press release and FAQ for a bet, drafted from its record, for you to edit',
23
+ ' pmos press-release <id> draft it beside the record and print the path',
24
+ ' pmos press-release <id> --again draft it again; the old file is kept as <id>.prev.md',
25
+ ' pmos press-release <id> --no-ai draft it from the record only, without a model run',
26
+ ' pmos press-release count [--days 7] the drafts written in the last days; the last line is the number',
27
+ ' every command: [--json] [--root <dir>]',
28
+ 'Where the record does not say a fact, the draft says "(not written yet)". PMOS never writes over your file.',
29
+ ];
30
+
31
+ function repoRoot(cwd) {
32
+ try { return execFileSync('git', ['rev-parse', '--show-toplevel'], { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim() || cwd; }
33
+ catch { return cwd; }
34
+ }
35
+
36
+ function parse(argv) {
37
+ const pos = []; const flags = {};
38
+ for (let i = 0; i < argv.length; i++) {
39
+ const a = argv[i];
40
+ if (a === '--root' || a === '--days') flags[a.slice(2)] = argv[++i];
41
+ else if (/^--(root|days)=/.test(a)) { const [k, v] = a.slice(2).split('='); flags[k] = v; }
42
+ else if (a.startsWith('--')) flags[a.slice(2)] = true;
43
+ else if (a === '-h') flags.help = true;
44
+ else pos.push(a);
45
+ }
46
+ return { pos, flags };
47
+ }
48
+
49
+ function aiOff(env) {
50
+ try {
51
+ let dir = null; try { dir = require('./state-root.js').defaultRoot({ env }); } catch { dir = null; }
52
+ return require('./ai-guard.js').off(PR.JOB, { env, settingsDir: dir });
53
+ } catch { return /^(off|0|false|no)$/i.test(String((env || {}).PMOS_AI || '').trim()) ? 'every AI job is off (PMOS_AI)' : null; }
54
+ }
55
+
56
+ function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), ask = PR.ask, env = process.env, now = Date.now() } = {}) {
57
+ const { pos, flags } = parse(argv[0] === 'press-release' ? argv.slice(1) : argv.slice());
58
+ if (flags.help || pos[0] === 'help') { for (const l of USAGE) say(l); return 0; }
59
+ const root = path.resolve(flags.root || repoRoot(cwd));
60
+ const json = !!flags.json;
61
+
62
+ if (pos[0] === 'count') {
63
+ const days = Math.max(1, Math.min(365, parseInt(flags.days, 10) || 7));
64
+ const n = PR.count(root, { days, now });
65
+ if (json) { say(JSON.stringify({ ok: true, days, drafts: n })); return 0; }
66
+ say(`${TAG} ${n} press release draft${n === 1 ? '' : 's'} in the last ${days} days.`);
67
+ say(String(n));
68
+ return 0;
69
+ }
70
+
71
+ const id = pos[0];
72
+ if (!id) { for (const l of USAGE) say(l); return 2; }
73
+ const inputs = PR.inputsOf(root, id);
74
+ if (!inputs) { say(json ? JSON.stringify({ ok: false, error: `no initiative "${id}" in this repository` }) : `✗ no initiative "${id}" in this repository (pmos initiative list shows them)`); return 1; }
75
+
76
+ const recordAbs = path.join(root, inputs.recordPath);
77
+ const dir = PR.dirOf(recordAbs);
78
+ const file = path.join(dir, inputs.id + '.md');
79
+ const rel = path.relative(root, file).split(path.sep).join('/');
80
+ const there = fs.existsSync(file);
81
+ if (there && !flags.again) {
82
+ say(json ? JSON.stringify({ ok: false, error: 'a draft is there', path: rel }) : `✗ ${rel} is already there. Edit it, or run with --again to draft it again (the old file is kept as ${inputs.id}.prev.md).`);
83
+ return 1;
84
+ }
85
+
86
+ let draft = null; let why = null;
87
+ const off = flags['no-ai'] ? 'you asked for --no-ai' : aiOff(env);
88
+ if (off) why = off;
89
+ else {
90
+ let r = null;
91
+ try { r = ask(PR.promptOf(inputs), { env }); } catch (e) { r = { ok: false, text: e.message }; }
92
+ if (!r || !r.ok) why = `the model run failed (${(r && r.text) || 'no answer'})`;
93
+ else { draft = PR.parseDraft(r.text); if (!draft) why = 'the model answer could not be read'; }
94
+ }
95
+ const by = draft ? 'model' : 'record';
96
+ if (!draft) draft = PR.fallbackOf(inputs);
97
+
98
+ fs.mkdirSync(dir, { recursive: true });
99
+ if (there) fs.copyFileSync(file, file.replace(/\.md$/, '.prev.md'));
100
+ fs.writeFileSync(file, PR.render(draft, inputs, { now, by }));
101
+ say(`${TAG} drafted ${inputs.id} (${by === 'model' ? 'record and model' : 'record only'}) → ${rel}`);
102
+ if (json) { say(JSON.stringify({ ok: true, path: rel, from: by, why })); return 0; }
103
+ if (why) say(`The draft is from the record only: ${why}.`);
104
+ say(`✓ Press release and FAQ for "${inputs.title}": ${rel}. Edit it as you like; PMOS will not write over it.`);
105
+ return 0;
106
+ }
107
+
108
+ module.exports = { run, COMMANDS, USAGE };