create-pmos 0.386.0 → 0.388.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 (39) hide show
  1. package/package.json +30 -30
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-calendar-test.js +2 -1
  7. package/workspace/briefing-premium-initiative-test.js +4 -0
  8. package/workspace/briefing-premium-insights-test.js +1 -1
  9. package/workspace/briefing-premium-test.js +1 -1
  10. package/workspace/c3-settings-test.js +1 -1
  11. package/workspace/changelog.json +29 -0
  12. package/workspace/fixtures/initiative-premium-facts.js +1 -1
  13. package/workspace/guide/briefing-premium.md +5 -1
  14. package/workspace/guide/report-design.md +1 -1
  15. package/workspace/lib/core-docs.js +33 -4
  16. package/workspace/lib/initiative-premium.js +1 -0
  17. package/workspace/lib/lead-cli.js +27 -3
  18. package/workspace/lib/pmos-verbs.js +1 -1
  19. package/workspace/lib/popup-leads.js +46 -1
  20. package/workspace/lib/refresh-run.js +22 -5
  21. package/workspace/lib/refresh.js +6 -1
  22. package/workspace/lib/report-design.js +16 -2
  23. package/workspace/lib/report-setups.js +49 -7
  24. package/workspace/lib/routes-briefing-premium.js +13 -0
  25. package/workspace/lib/routes-report-design.js +8 -1
  26. package/workspace/lib/routes-report-setups.js +38 -7
  27. package/workspace/package-lock.json +2 -2
  28. package/workspace/package.json +1 -1
  29. package/workspace/premium-board-actions-test.js +1 -1
  30. package/workspace/premium-briefing-depth-test.js +1 -1
  31. package/workspace/premium-report-read-test.js +11 -4
  32. package/workspace/premium-studio-report-test.js +11 -2
  33. package/workspace/public/pm/premium-initiative.js +7 -4
  34. package/workspace/public/pm/premium-report-read.js +17 -2
  35. package/workspace/public/pm/premium-shell.js +10 -0
  36. package/workspace/public/pm/premium-studio-design.js +15 -3
  37. package/workspace/public/pm/premium.css +8 -0
  38. package/workspace/server.js +2 -0
  39. package/workspace/skills/popup-leads.skill +31 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.386.0",
3
+ "version": "0.388.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": {
@@ -32,6 +32,35 @@
32
32
  "audit"
33
33
  ],
34
34
  "pmosChanges": [
35
+ {
36
+ "v": "0.388.0",
37
+ "at": "2026-10-21T22:35:51.404Z",
38
+ "f": 2,
39
+ "prs": [
40
+ {
41
+ "n": 1000,
42
+ "t": "Report templates reschedule and delete, drafts discard, issued reports stay",
43
+ "s": "Report templates reschedule and delete, drafts discard, issued reports stay"
44
+ }
45
+ ]
46
+ },
47
+ {
48
+ "v": "0.387.0",
49
+ "at": "2026-10-21T15:59:17.829Z",
50
+ "f": 2,
51
+ "prs": [
52
+ {
53
+ "n": 998,
54
+ "t": "Remove a sample from a report's design",
55
+ "s": "Remove a sample from a report's design"
56
+ },
57
+ {
58
+ "n": 999,
59
+ "t": "Popup leads after each refresh, and a derived document's PRD section",
60
+ "s": "Popup leads after each refresh, and a derived document's PRD section"
61
+ }
62
+ ]
63
+ },
35
64
  {
36
65
  "v": "0.386.0",
37
66
  "at": "2026-10-21T14:59:05.016Z",
@@ -272,35 +301,6 @@
272
301
  "s": "Insights' first screen shows the list, not the empty card (calmer first screen 2/5)"
273
302
  }
274
303
  ]
275
- },
276
- {
277
- "v": "0.368.0",
278
- "at": "2026-10-21T02:13:10.598Z",
279
- "f": 2,
280
- "prs": [
281
- {
282
- "n": 976,
283
- "t": "The phone conversation gets the screen when it scrolls",
284
- "s": "The phone conversation gets the screen when it scrolls"
285
- }
286
- ]
287
- },
288
- {
289
- "v": "0.367.0",
290
- "at": "2026-10-21T02:01:19.184Z",
291
- "f": 2,
292
- "prs": [
293
- {
294
- "n": 969,
295
- "t": "My work's first screen has one solid button (calmer first screen 1/5)",
296
- "s": "My work's first screen has one solid button (calmer first screen 1/5)"
297
- },
298
- {
299
- "n": 968,
300
- "t": "A prompt waits for Claude Code's input box; one brief ends one run with its real count",
301
- "s": "A Claude Code prompt is typed only once the agent is ready."
302
- }
303
- ]
304
304
  }
305
305
  ]
306
306
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@4c08eee0
1
+ kernel-source: pmos@e49a7af3
2
2
  assembled: 2026-10-21
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-10-21T14:59:02Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-21T22:35:48Z"}
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-10-21T14:59:02Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-21T22:35:48Z"}
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-10-21T14:59:02Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-21T22:35:48Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -194,7 +194,8 @@ const MOCKUP = fs.readFileSync(path.join(__dirname, '..', 'prototype', 'premium-
194
194
  ok('C4 when the calendar answer is down, a Today row keeps the plain dialog', await until(() => Mg.page.evaluate(() => document.querySelector('#dlg').classList.contains('on') && document.querySelector('#dTitle').textContent === 'Sprint planning' && !document.querySelector('#mtgSel'))));
195
195
 
196
196
  /* C9 */
197
- const allPosts = [].concat(A.reqs, R.reqs, Tt.reqs).filter((r) => /^POST /.test(r));
197
+ // an opened popup is recorded for its lead (popup context slice 11, R1); that record is not a press
198
+ const allPosts = [].concat(A.reqs, R.reqs, Tt.reqs).filter((r) => /^POST /.test(r) && r !== 'POST /api/briefing-premium/seen');
198
199
  ok('C9 the only write the page sent is the link', allPosts.length === 1 && allPosts[0] === 'POST /api/calendar-links', JSON.stringify(allPosts));
199
200
  ok('C9 no recording, Focus or material write was sent', ![].concat(A.reqs, R.reqs, Tt.reqs).some((r) => /POST \/api\/(notes|meeting-focus|meeting-material)/.test(r)));
200
201
  ok('C9 no page error', [A, E, Z, R, Tt, Mg].every((x) => x.errors.length === 0), JSON.stringify([A, E, Z, R, Tt, Mg].map((x) => x.errors)));
@@ -235,6 +235,10 @@ const HEALTH = { ok: true, path: 'planning/prd/self-serve-v2-prd.md', health: {
235
235
  ok('I8 a document with no file says what it is for, who writes it and offers Draft it', ab.title === 'Problem statement' && /Who writes it/.test(ab.body) && ab.draft && ab.ask === false, JSON.stringify(ab)); }
236
236
  const nD = A.posts.length; A.set({ status: 200, body: { ok: true, run: 'r1' } }); await p.click('#abDraft');
237
237
  ok('I8 Draft it in that popup posts the draft route and closes the popup', await until(() => A.posts.length > nD && A.posts[A.posts.length - 1].path === '/api/core-docs/draft' && A.posts[A.posts.length - 1].body.key === 'problem') && await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on'))));
238
+ await p.click('#dmList .dmo[data-doc="research"]'); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && document.querySelector('#dTitle').textContent === 'Research notes')); await sleep(400);
239
+ { const rs = await p.evaluate(() => ({ say: document.querySelector('#dBody .stream').textContent, prd: (document.querySelector('#oMain .dprd') || {}).textContent || '', body: document.querySelector('#oMain').textContent, first: !!document.querySelector('#oMain .dprd') && document.querySelector('#oMain .dprd').compareDocumentPosition(document.querySelector('#oMain .kv2')) === Node.DOCUMENT_POSITION_FOLLOWING }));
240
+ ok('I8 a derived document with no file shows the PRD section it comes from, before its details, and the first line says so', /The PRD’s “Evidence” section covers it/.test(rs.say) && /Five of eight trial teams stalled/.test(rs.prd) && /• Support tickets doubled/.test(rs.prd) && /From the PRD: Evidence/.test(rs.body) && /planning\/prd\/self-serve-v2-prd\.md § Evidence/.test(rs.body) && !/nothing to read here/.test(rs.body) && rs.first, JSON.stringify(rs)); }
241
+ await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
238
242
  ok('0 no page error', A.errors.length === 0, A.errors.join(' | '));
239
243
  await A.ctx.close();
240
244
 
@@ -217,7 +217,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
217
217
  ok('R4 a set-up report shows its schedule and next draft, with Draft it now, Pause and Shape it in the Studio', /ScheduleEvery other Monday at 09:00/.test(su.kv) && /Next draft26 Oct/.test(su.kv) && su.acts === 'draft,pause,studio', JSON.stringify(su));
218
218
  await q.click('#oMain [data-rx="pause"]'); await sleep(300);
219
219
  ok('R4 Pause posts that report', last()[0] === '/api/report-setups/pause' && last()[1].id === 'partner-update', JSON.stringify(last()));
220
- ok('R7 every press went to the dashboard save route or an existing report-setups route', R.posts.every((x) => /^POST \/api\/(premium-dashboards\/save|report-setups\/(ask|change|cancel|setup|dismiss|pause|resume|draft))$/.test(x)), R.posts.join());
220
+ ok('R7 every press went to the dashboard save route or an existing report-setups route; an opened popup is only recorded (seen)', R.posts.every((x) => /^POST \/api\/(premium-dashboards\/save|report-setups\/(ask|change|cancel|setup|dismiss|pause|resume|draft)|briefing-premium\/seen)$/.test(x)), R.posts.join());
221
221
  ok('R6 the Reports card shows no demo row', !/demo/i.test(await qt('#repBody')));
222
222
  await R.ctx.close();
223
223
  }
@@ -368,7 +368,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
368
368
  await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
369
369
 
370
370
  /* R10 */
371
- ok('R10 a page where nothing was pressed to record sent only GET requests (the one confirmed Start and closing the bell aside)', A.reqs.every((r) => r.startsWith('GET ') || r === 'POST /api/agent/start' || r === 'POST /api/inbox/seen'), A.reqs.filter((r) => !r.startsWith('GET ')).join());
371
+ ok('R10 a page where nothing was pressed to record sent only GET requests (the one confirmed Start, closing the bell and recording an opened popup aside)', A.reqs.every((r) => r.startsWith('GET ') || r === 'POST /api/agent/start' || r === 'POST /api/inbox/seen' || r === 'POST /api/briefing-premium/seen'), A.reqs.filter((r) => !r.startsWith('GET ')).join());
372
372
  ok('0 no page error', A.errors.length === 0, A.errors.join(' | '));
373
373
 
374
374
  /* slice 2: the buttons that record (initiative briefing-premium-writes). The POST routes are answered by the test, so no real file is written;
@@ -119,7 +119,7 @@ async function waitFor(page, fn, arg, ms = 8000) {
119
119
  ok('R1 Connectors links to Data refresh instead of holding its schedule', await waitFor(page, () => { const a = document.querySelector('[data-c3set-row="conn.cal.refresh"]'); const b = document.querySelector('[data-c3set-row="conn.jira.refresh"]'); return !!a && !!b && !!a.querySelector('button.lk') && /Data refresh/.test(a.textContent) && !a.querySelector('select') && !b.querySelector('select'); }));
120
120
  await page.click('[data-c3set-row="conn.cal.refresh"] button.lk');
121
121
  ok('R2 the link opens the Data refresh section', await waitFor(page, () => !!document.querySelector('[data-c3set-section="refresh"] [data-c3set-rf-card]')));
122
- ok('R3 the section draws 14 source rows in three cards', await waitFor(page, () => document.querySelectorAll('[data-c3set-section="refresh"] [data-c3set-rf]').length === 14 && document.querySelectorAll('[data-c3set-rf-card]').length === 3));
122
+ ok('R3 the section draws 15 source rows in three cards', await waitFor(page, () => document.querySelectorAll('[data-c3set-section="refresh"] [data-c3set-rf]').length === 15 && document.querySelectorAll('[data-c3set-rf-card]').length === 3));
123
123
  ok('R3b the overview, the rules and the log are there', await page.evaluate(() => !!document.querySelector('[data-c3set-rf-sum]') && !!document.querySelector('[data-c3set-rf-all]') && !!document.querySelector('[data-c3set-rf-rules]') && !!document.querySelector('[data-c3set-rf-log]')));
124
124
  ok('R3c a source with its own home says where, and has no editor button', await page.evaluate(() => { const r = document.querySelector('[data-c3set-rf="scan"]'); return !!r && /Set in Initiatives/.test(r.textContent) && !r.querySelector('[data-c3set-rf-open]'); }));
125
125
  ok('R3d the filter Off lists the sources that are off', await (async () => { await page.click('[data-c3set-section="refresh"] .seg [data-v="off"]'); const n = await page.evaluate(() => document.querySelectorAll('[data-c3set-rf]').length); await page.click('[data-c3set-section="refresh"] .seg [data-v="all"]'); return n > 0 && n < 14; })());
@@ -1,4 +1,33 @@
1
1
  [
2
+ {
3
+ "v": "0.388.0",
4
+ "at": "2026-10-21T22:35:51.404Z",
5
+ "f": 2,
6
+ "prs": [
7
+ {
8
+ "n": 1000,
9
+ "t": "Report templates reschedule and delete, drafts discard, issued reports stay",
10
+ "s": "Report templates reschedule and delete, drafts discard, issued reports stay"
11
+ }
12
+ ]
13
+ },
14
+ {
15
+ "v": "0.387.0",
16
+ "at": "2026-10-21T15:59:17.829Z",
17
+ "f": 2,
18
+ "prs": [
19
+ {
20
+ "n": 998,
21
+ "t": "Remove a sample from a report's design",
22
+ "s": "Remove a sample from a report's design"
23
+ },
24
+ {
25
+ "n": 999,
26
+ "t": "Popup leads after each refresh, and a derived document's PRD section",
27
+ "s": "Popup leads after each refresh, and a derived document's PRD section"
28
+ }
29
+ ]
30
+ },
2
31
  {
3
32
  "v": "0.386.0",
4
33
  "at": "2026-10-21T14:59:05.016Z",
@@ -30,7 +30,7 @@ const doc = (key, title, o = {}) => Object.assign({ cat: 'Plan', key, title, ic:
30
30
  const DOCS = { scope: 'initiative:self-serve-v2', docs: [
31
31
  doc('record', 'Initiative record', { st: 'ok', when: '2026-10-16', open: { path: 'planning/initiatives/self-serve-v2.md' }, act: null }),
32
32
  doc('problem', 'Problem statement', { cat: 'Discover' }),
33
- doc('research', 'Research notes', { cat: 'Discover' }),
33
+ doc('research', 'Research notes', { cat: 'Discover', from: { path: 'planning/prd/self-serve-v2-prd.md', heading: 'Evidence', text: 'Five of eight trial teams stalled at the invite step.\n\n- Support tickets doubled in September.', cut: false } }),
34
34
  doc('prd', 'PRD', { st: 'ok', when: '2026-10-17', open: { path: 'planning/prd/self-serve-v2-prd.md' }, act: null }),
35
35
  doc('risks', 'Risks', { st: 'draft', act: { label: 'Review the draft', do: 'review' } }),
36
36
  doc('launch', 'Launch checklist and comms', { running: true }),
@@ -281,10 +281,14 @@ My work is the second place on the rail, at `/premium-work.html`. It reads the l
281
281
 
282
282
  **Claude's lead in a popup.** A popup such as a task, a document, a report or a measure opens on Claude's short lead, written ahead of time: why the thing matters now, what is asked or blocking, and what to do. Under it is when the lead was written and what Claude read for it. Opening a popup starts nothing: the lead is read from what is stored. **Refresh** asks the popup's own Claude Code session to write the lead again from the stored reads, and the new lead replaces the old one. A popup with no lead yet says so and offers **Write the lead**. An agent session saves a lead with `pmos lead put --key <popup key> --text "<lead>" --cite "<what it read, when>"`, and `pmos lead show [<key>]` prints what is stored. `pmos lead` calls no tool.
283
283
 
284
+ **Leads written after each refresh.** PMOS keeps a short list of the popups you opened in the last 14 days, with what each one showed. Forms such as Add a task and Settings are left out. Opening a popup only adds it to that list and starts nothing. When a read of your tools ends well, and once no other read is going, one **Popup leads** session writes the lead of each popup on the list whose lead is missing or older than the newest stored read, at most 12. Refresh all runs it after the reads and before the Briefing. It reads only the stored reads and the repository, never a tool, and runs only when a lead is due. `pmos lead due` lists the popups it will write for. Popup leads is on whenever the Briefing is, and you can turn it off under Settings › Data refresh.
285
+
284
286
  **A Jira ticket PMOS has not read.** A task's Jira tab first looks in the initiative's ticket draft and the sprint reads. When neither holds the ticket, it shows the newest Jira check that read it, or else what the stored Jira read says about it, and names which one. When nothing stored holds it, the tab says **Not read yet**, gives the time of the last Jira read, and offers **Read it now**. Read it now asks the popup's own Claude session to read that one ticket with your Atlassian connection, read only, and to save the popup's lead. Nothing reads Jira when the tab opens.
285
287
 
286
288
  **A Board measure popup.** On Insights, a measure's popup first says what the numbers are: this week's value, the change from last week, and the target. For Merged a week it also says when the trunk was last fetched, and the details list it as **Trunk read**. When the last two weeks are 0 after a busy week, it says that is a quiet trunk or an old fetch, and gives the fetch time, so you can tell which. PMOS does not fetch when the popup opens.
287
289
 
290
+ **A document with no file of its own.** Some initiative documents, such as the Problem statement or Research notes, have no file. When the initiative's PRD has a section that covers one, its popup shows that section first, under **From the PRD**, with the PRD's path. A long section is cut short, and the PRD has the rest. The first line names the section. When no section matches, the popup says what the document is for and who writes it.
291
+
288
292
  **The agent's draft.** The draft shows as formatted text in the detail panel on the right, labelled as the agent's and not checked, with **Open** and **Copy**. Its heading names the item ("Draft for IDPF-2989", or "Draft for you"), the round and the time of the latest round, and an approved step shows as "Step when you approve". A long draft is cut short, with **Show all**. It appears there as soon as the agent finishes, even while the dialog is open. The left column keeps the conversation (with **View round**) and the decision cards, in the console's words: **Post it to Jira** (marked outward, with exactly the text that goes), **Edit the draft**, **Keep it as a draft** and **Mark it done**. Post asks you to confirm the exact text first, and nothing is posted before that.
289
293
 
290
294
  **An agent's offer.** When an agent has offered to draft an item, the dialog shows three choices: let the agent draft it (suggested), do it today, or not before next Monday. You pick one and press its button. A row with steps says how many it has and how many an agent can do. PMOS does not record that a step is done, so it shows no "done" count.
@@ -372,7 +376,7 @@ Insights is the fifth place on the rail, at `/premium-insights.html`. It reads t
372
376
  - **Set up.** Your recurring reports, with their schedule and next draft. A report opens with **Draft it now** (for a report drawn from your work) and **Pause** or **Resume**.
373
377
  - **Report files.** The report files of the workspace, in the list, with cadence, slot and whether each is a draft or issued. Pressing one opens it on the page at the normal dialog size, with a status line (Draft or Issued, the saved design version, the file). The **slide deck / Document** menu picks the view: a deck is a title slide, then one slide for each section, with the arrow keys and a strip of slides; a document is a page. The **Read** menu holds **Present**, which shows the slide on the whole screen (the arrow keys move and Escape stops), and **Print or save as PDF**, which prints one slide to a page. **Download** gives PowerPoint, Word, Excel, CSV or the Markdown file; the files carry the words, not the look. **Edit** opens the words as a page. On a draft, **Issue** first says what it does, then **Issue it** freezes the cycle as you read it, through the console's own route; if the file changed since you opened it, nothing is issued and the reader shows the new words. Copies in Confluence or other tools are made in the console. Nothing is sent from this page.
374
378
  - **Edit the slides.** In the **Read** menu of a draft, **Edit the slides** opens the same file as a **Slides** tab beside the report. The rail on the left lists the slides. Drag a slide to move it, or use the up and down buttons on it; the buttons also duplicate and delete a slide, and **+ Slide** adds one from a layout. On the slide, click an item to select it, drag it to move it (a line shows when it is centred), and drag a corner to resize it. Double-click text to type. The toolbar adds text, an image, a chart, a table or a shape, and changes the layout of the slide or the theme of the deck. The bar under it changes the selected item: text style, alignment and colour; bars or a line and **Edit data** for a chart; rows and columns for a table. An image is a file that is already in the workspace: type its path, such as `planning/design/screen.png`. Speaker notes go in the box under the slide. **Undo** and **Redo** cover every change. **Present** opens the presenter view: the slide, the next slide, your speaker notes (you can type in them) and a timer. The arrow keys move, and Escape stops. **Slides only** hides the notes. **Audience window** opens a second window with the slide alone, for the screen you share; it follows your slide and closes when you stop. **Save** asks why the slides change, then writes the file; the reason goes in the Edit log. The file stays markdown: each slide is a heading with its text under it, and a hidden comment keeps the layout and the notes. If someone changed the text of a slide in the file, the editor shows the file's text and says so. If the file changed while the slides were open, Save stops and tells you to open the slides again. An issued report opens its slides read-only, with **Open the slides**.
375
- - **Shape a report's look.** On a draft, **Add a sample** takes a PDF, PowerPoint, Word, PNG or JPG file to follow. Say how it should look in the conversation; PMOS draws the next design version (D1, D2, …) and says what it changed. Press a version to go back to it. **This is it** saves the version shown as the report's design, and PMOS draws the cycle to match. An issued cycle is frozen with its look.
379
+ - **Shape a report's look.** On a draft, **Add a sample** takes a PDF, PowerPoint, Word, PNG or JPG file to follow. Each sample has an **×**: press it to remove that sample, and the next version, the design brief and each new cycle stop following it. Say how it should look in the conversation; PMOS draws the next design version (D1, D2, …) and says what it changed. Press a version to go back to it. **This is it** saves the version shown as the report's design, and PMOS draws the cycle to match. An issued cycle is frozen with its look.
376
380
 
377
381
  Not built: a second measure next to a chart, bar highlights, speaker notes and notes on a slide, changing a set-up report's audience, format or schedule, tile sizes and free layout, the finder's settings, and any measure no record holds. The console's own dashboards are separate and unchanged. KR metric records belong to a workspace, so every board of a workspace shows the same charts.
378
382
 
@@ -26,7 +26,7 @@ Use one of these two buttons:
26
26
 
27
27
  1. Select **Deck** or **Document** at the top of the studio.
28
28
  2. Write what the report is for and who reads it. For example: "This goes to the progress session every other Thursday. The decisions must stand out."
29
- 3. Press **Add a sample** to give PMOS a report that people liked. You can upload a file, paste a link, add a page from Chrome (see below), or pick a report document that PMOS has. Each sample shows what PMOS took from it. PMOS reads a link from Google Slides, Docs or Sheets, or from Confluence, through your own connectors. It saves the words and the structure (slide titles, order, sections and tables), and it changes nothing in the file. It does not get the look. To match the look, also add the file as a PDF or a screenshot. For Google Slides, choose **File**, **Download**, **PDF document (.pdf)** in Slides, then add that file. If your connectors cannot read the link, the sample says so. Any other link is kept by its address, and PMOS cannot open it. PMOS sees the pages of a PDF or an image, so it can follow their look. From a .pptx or a .docx, PMOS gets only the words.
29
+ 3. Press **Add a sample** to give PMOS a report that people liked. You can upload a file, paste a link, add a page from Chrome (see below), or pick a report document that PMOS has. Each sample shows what PMOS took from it. To remove a sample, press its **×**. The next version, the design brief and each new cycle stop following it. To follow it again, add it again. PMOS reads a link from Google Slides, Docs or Sheets, or from Confluence, through your own connectors. It saves the words and the structure (slide titles, order, sections and tables), and it changes nothing in the file. It does not get the look. To match the look, also add the file as a PDF or a screenshot. For Google Slides, choose **File**, **Download**, **PDF document (.pdf)** in Slides, then add that file. If your connectors cannot read the link, the sample says so. Any other link is kept by its address, and PMOS cannot open it. PMOS sees the pages of a PDF or an image, so it can follow their look. From a .pptx or a .docx, PMOS gets only the words.
30
30
  4. Press **Make the next version**. PMOS makes a version from your words and this cycle's data. This takes a short time. You can leave the studio. The studio shows when the version is ready. While PMOS works, the version on screen and its slides stay as they are, and you can keep reading it or write your next turn.
31
31
  5. Read the version in the preview. Write what to change and press **Make the next version** again. Each turn makes a new version: D1, D2, D3 and so on.
32
32
 
@@ -527,13 +527,42 @@ function lastMoveOf(folded, id) {
527
527
  return at;
528
528
  }
529
529
 
530
+ /** popup context slice 4b: the PRD section a derived document with no file of its own comes from, so its popup shows it.
531
+ * The first `##`/`###` heading whose words match the document, up to the next heading at its level or above. → { path, heading, text, cut } | null */
532
+ const PRD_HEAD = Object.freeze({ problem: /problem|background|context|why/i, research: /research|evidence|finding/i, rice: /priorit|why now|impact/i, risks: /risk/i,
533
+ stories: /stor(y|ies)|slices?|requirement/i, launch: /launch|rollout|release/i, outcome: /outcome|success|metric/i, explainer: /summary|overview/i });
534
+ const SECTION_MAX = 1500;
535
+ function prdSection(root, rel, key, memo = new Map()) {
536
+ const re = PRD_HEAD[key];
537
+ if (!re || !rel) return null;
538
+ if (!memo.has(rel)) { try { memo.set(rel, frontmatterOf(fs.readFileSync(path.join(root, rel), 'utf8')).body); } catch { memo.set(rel, null); } }
539
+ const body = memo.get(rel);
540
+ if (body == null) return null;
541
+ const lines = body.split(/\r?\n/);
542
+ const at = lines.findIndex((l) => { const h = /^(#{2,3})\s+(.+?)\s*#*\s*$/.exec(l); return !!h && re.test(h[2]); });
543
+ if (at < 0) return null;
544
+ const lvl = /^#+/.exec(lines[at])[0].length, heading = lines[at].replace(/^#+\s+/, '').replace(/\s*#*\s*$/, '');
545
+ const out = [];
546
+ for (let i = at + 1; i < lines.length; i++) { const h = /^(#+)\s/.exec(lines[i]); if (h && h[1].length <= lvl) break; out.push(lines[i]); }
547
+ let text = out.join('\n').trim();
548
+ if (!text) return null;
549
+ const cut = text.length > SECTION_MAX;
550
+ if (cut) { text = text.slice(0, SECTION_MAX); const nl = text.lastIndexOf('\n'); if (nl > SECTION_MAX / 2) text = text.slice(0, nl); text = text.trimEnd(); }
551
+ return { path: rel, heading, text, cut };
552
+ }
553
+
530
554
  /** One initiative's set with its state. `row` is routes-boards boardRow; `board` its board. */
531
555
  function initiativeSet(w, { row, base, board, folded, store, extra, now, ctx }) {
532
556
  const scope = `initiative:${row.id}`;
533
557
  const sources = initiativeSources(ctx || {}, w, base, extra, now);
534
558
  const has = (k) => !!sources[k] || !!(store.get(`${scope}|${k}`) && (store.get(`${scope}|${k}`).issued || store.get(`${scope}|${k}`).draft));
535
559
  const facts = { now, scope, level: 'initiative', store, cat: row.cat, movedAt: lastMoveOf(folded, row.id), sources, rollups: {}, flags: flagsOf(w.root, store, scope) };
536
- return setFor('initiative', { build: !!board.build, wfTpl: row.template || null, has }).map((x) => ({ entry: x, ...stateOf(x, facts) }));
560
+ const prdRel = sources.prd && sources.prd.open ? sources.prd.open.path : null, memo = new Map();
561
+ return setFor('initiative', { build: !!board.build, wfTpl: row.template || null, has }).map((x) => {
562
+ const st = stateOf(x, facts);
563
+ const from = x.kind === 'derived' && !(st.open && st.open.path) ? prdSection(w.root, prdRel, x.key, memo) : null;
564
+ return { entry: x, ...st, from };
565
+ });
537
566
  }
538
567
 
539
568
  /** The facts of one level. → { ok, facts } | { pending: true } | { ok: false, status, error } */
@@ -584,10 +613,10 @@ function actOf(entry, st) {
584
613
  function answer(facts, { running = () => false } = {}) {
585
614
  const L = LEVEL[facts.level];
586
615
  const list = facts.level === 'initiative' ? facts.list : facts.entries.map((x) => ({ entry: x, ...stateOf(x, facts) }));
587
- const docs = list.map(({ entry: x, st, when, due, flag, staleWhy, open, draft }) => ({
616
+ const docs = list.map(({ entry: x, st, when, due, flag, staleWhy, open, draft, from }) => ({
588
617
  key: x.key, title: x.title, ic: x.ic, for: x.for, reader: x.reader, cadence: x.cadence, by: x.by, kind: x.kind, cat: x.cat, isNew: !!x.isNew,
589
618
  st, when: when || null, due: due || null, flag: flag || null, staleWhy: staleWhy || null, open: open || null, draft: draft || null,
590
- act: actOf(x, st), running: !!running(facts.scope, x.key),
619
+ act: actOf(x, st), running: !!running(facts.scope, x.key), ...(from ? { from } : {}),
591
620
  }));
592
621
  const ini = facts.level === 'initiative';
593
622
  return {
@@ -736,5 +765,5 @@ module.exports = {
736
765
  LEDGER, DIR, LEVELS, LEVEL, SETS, CATS, KINDS, EVENTS, BY, RESEARCH_KEEP, BUILD_ONLY_INI, STALE_ON_MOVE, ID_RE, SLOT_RE, GUIDE,
737
766
  entryOf, parseScope, levelOfScope, scopeDir, scopeLabel, draftable, storable, actOf, FILLS, setFor, stateOf, summaryOf, localDay, addDays,
738
767
  ledgerFile, readLines, append, fold, storeOf, checkEntry, writeDraft, issue, drop, frontmatterOf,
739
- gather, answer, initiativeDocs, initiativeSet, driverLists, runPrompt, batchPrompt,
768
+ gather, answer, initiativeDocs, initiativeSet, prdSection, driverLists, runPrompt, batchPrompt,
740
769
  };
@@ -106,6 +106,7 @@ function build(f) {
106
106
  key: d.key, title: d.title, what: d.for || '', st: d.st, state: d.kind === 'live' ? 'Live' : DOC_STATE[d.st] || d.st || '', by: BY[d.by] || d.by || '', byKey: d.by || '',
107
107
  when: d.when ? shortDate(d.when) : '', cat: d.cat === 'Do' ? 'Build' : d.cat === 'Learn' ? 'Evaluate' : d.cat || 'Board', path: d.open && d.open.path ? d.open.path : null, slot: d.st === 'draft' && d.draft && d.draft.slot ? d.draft.slot : '', running: !!d.running, tech: TECH.has(d.key), kind: d.kind || '', reader: d.reader || '', cadence: d.cadence || '', sections: ((GUIDE[d.key] || {}).sections || []).slice(),
108
108
  act: d.act && d.act.do === 'draft' ? { kind: 'draft', label: d.running ? 'Drafting' : d.act.label || 'Draft it' } : null,
109
+ from: d.from && d.from.text ? { path: d.from.path, heading: d.from.heading, text: d.from.text, cut: !!d.from.cut } : null,
109
110
  })) : [];
110
111
  const custom = (f.custom || []).map((d) => Object.assign(Custom.rowOf(d), { added: shortDate(d.at), cat: d.phase || 'Board' }));
111
112
  const rows = all.concat(custom);
@@ -2,18 +2,22 @@
2
2
  /* lead-cli.js — `pmos lead …`: Claude's short lead for a popup (popup context slice 3).
3
3
  * pmos lead put --key <pop:kind:id> --text "<lead>" [--cite "<what you read, when>"] … save the lead the popup shows first
4
4
  * pmos lead show [<key>] [--json] what is stored, for one popup or all
5
+ * pmos lead due [--json] the popups the PM opened whose lead is missing or older than the newest read
5
6
  * The leads are kept in the per-user runtime folder (lib/popup-leads.js). This command calls no tool: write the lead from stored
6
7
  * reads (`pmos source show`, the repository files) and name them in --cite.
7
8
  */
8
9
  const stateRoot = require('./state-root');
9
10
  const PL = require('./popup-leads.js');
11
+ const SR = require('./source-reads.js');
10
12
 
11
- const COMMANDS = { lead: ['put', 'show'] };
13
+ const COMMANDS = { lead: ['put', 'show', 'due'] };
12
14
  const USAGE = [
13
- 'usage: pmos lead put|show — Claude\'s short lead for a popup, written ahead and shown first',
15
+ 'usage: pmos lead put|show|due — Claude\'s short lead for a popup, written ahead and shown first',
14
16
  ' pmos lead put --key <pop:kind:id> --text "<lead>" [--cite "<what you read, when>"] …',
15
17
  ' the lead: why it matters now, what is asked or blocking, and what to do, in at most 400 characters; at most 4 cites',
16
18
  ' pmos lead show [<key>] the stored lead of one popup, or every stored lead',
19
+ ' pmos lead due the popups you opened in the last 14 days whose lead is missing or older than',
20
+ ' the newest stored read, newest first, at most 12, with what each popup showed',
17
21
  ' every command: [--json]',
18
22
  'This command never calls a tool. Write the lead from stored reads and name them.',
19
23
  ];
@@ -31,6 +35,13 @@ function parseArgs(argv) {
31
35
  return out;
32
36
  }
33
37
 
38
+ /** The newest stored source read (ms), or null: a lead older than it may be out of date. */
39
+ function newestRead(dir) {
40
+ let at = 0;
41
+ try { for (const r of Object.values(SR.all(dir))) { const t = Date.parse(r && r.read_at) || 0; if (t > at) at = t; } } catch { at = 0; }
42
+ return at || null;
43
+ }
44
+
34
45
  function run(argv, { say = console.log, env = process.env, stateDir, now = () => new Date() } = {}) {
35
46
  const a = parseArgs(argv.slice(1));
36
47
  const sub = a._[0];
@@ -45,6 +56,19 @@ function run(argv, { say = console.log, env = process.env, stateDir, now = () =>
45
56
  out({ ok: true, lead: rec }, `saved the lead of ${rec.key} at ${rec.at}`);
46
57
  return 0;
47
58
  }
59
+ if (sub === 'due') {
60
+ const readAt = newestRead(dir);
61
+ const list = PL.due(dir, { readAt, now: now() });
62
+ if (a.json) { say(JSON.stringify({ ok: true, read_at: readAt ? new Date(readAt).toISOString() : null, due: list })); return 0; }
63
+ if (!list.length) { say('no lead is due: every popup opened in the last 14 days has a lead newer than the last read'); return 0; }
64
+ say(`${list.length} lead${list.length === 1 ? '' : 's'} due` + (readAt ? `, the newest stored read is ${new Date(readAt).toISOString()}` : ''));
65
+ for (const t of list) {
66
+ say(`${t.key} · ${t.title}${t.subject ? ' · ' + t.subject : ''}${t.lead_at ? ' · lead of ' + t.lead_at : ' · no lead yet'}`);
67
+ if (t.say) say(' shows: ' + t.say);
68
+ for (const [k, v] of t.facts) say(` ${k}: ${v}`);
69
+ }
70
+ return 0;
71
+ }
48
72
  const key = a._[1];
49
73
  if (key) {
50
74
  const r = PL.get(dir, key);
@@ -60,4 +84,4 @@ function run(argv, { say = console.log, env = process.env, stateDir, now = () =>
60
84
  return 0;
61
85
  }
62
86
 
63
- module.exports = { run, COMMANDS, USAGE };
87
+ module.exports = { run, COMMANDS, USAGE, newestRead };
@@ -58,7 +58,7 @@ const VERBS = Object.freeze({
58
58
  help: 'pmos source save|status|show — the stored read of each tool the Briefing uses: Mail, Slack, Confluence and the rest (pmos source help)' }),
59
59
  // Not a pm-os-absorb verb (run: null): the popup context work (premium-chat-session slice 7) added it through the same table.
60
60
  lead: Object.freeze({ module: 'lead-cli.js', run: null, guide: 'briefing-premium.md',
61
- help: 'pmos lead put|show — Claude\'s short lead for a popup, written ahead from stored reads (pmos lead help)' }),
61
+ help: 'pmos lead put|show|due — Claude\'s short lead for a popup, written ahead from stored reads (pmos lead help)' }),
62
62
  // Not a pm-os-absorb verb (run: null): c3-meet-extension added it through the same table.
63
63
  extension: Object.freeze({ module: 'extension-cli.js', run: null, guide: 'console-calendar.md',
64
64
  help: 'pmos extension — the folder of the Chrome extension for Google Meet, and the three steps to load it' }),
@@ -3,6 +3,8 @@
3
3
  *
4
4
  * validate({ key, text, cites }) → { ok, lead } | { ok: false, error }
5
5
  * put(runtimeDir, lead, now) → the stored record · get(runtimeDir, key) → record | null · all(runtimeDir) → { key: record }
6
+ * seen(runtimeDir, { key, title, subject, say, facts }, now) → the stored target | null a popup the PM opened, with what it showed
7
+ * due(runtimeDir, { readAt, now, max }) → [target] opened popups whose lead is missing or older than the newest stored read
6
8
  *
7
9
  * A lead says why the thing in the popup matters now, what is asked or blocking, and what to do, in at most 400 characters, with
8
10
  * the reads it came from (at most 4 cites). It is keyed by the popup's conversation key (`pop:<kind>:<id>`, premium-shell popKey).
@@ -65,4 +67,47 @@ function put(runtimeDir, lead, now = new Date()) {
65
67
  return { key: lead.key, ...rec };
66
68
  }
67
69
 
68
- module.exports = { KEY_RE, MAX_TEXT, validate, put, get, all, fileOf };
70
+ /* popup context slice 3b (PM pick, 2026-10-21: "One leads session per refresh"): the popups a leads session writes for are the
71
+ * ones the PM opened in the last 14 days, with the context each one showed. A form (Add a task, Settings) gets no lead. */
72
+ const TARGETS = 'popup-targets.json';
73
+ const TARGET_DAYS = 14, TARGET_KEEP = 60, DUE_MAX = 12;
74
+ const FORM_KINDS = Object.freeze(['new-task', 'new-doc', 'settings', 'sources', 'act']);
75
+ const kindOf = (key) => String(key).split(':')[1] || '';
76
+ const targetsFile = (runtimeDir) => path.join(runtimeDir, TARGETS);
77
+ function targets(runtimeDir) {
78
+ if (!runtimeDir) return {};
79
+ try { const m = JSON.parse(fs.readFileSync(targetsFile(runtimeDir), 'utf8')); return m && typeof m === 'object' && !Array.isArray(m) ? m : {}; } catch { return {}; }
80
+ }
81
+ function seen(runtimeDir, c, now = new Date()) {
82
+ const key = c && typeof c.key === 'string' ? c.key : '';
83
+ if (!runtimeDir || !KEY_RE.test(key) || key.length > 140 || FORM_KINDS.includes(kindOf(key))) return null;
84
+ if (typeof c.title !== 'string' || !clean(c.title)) return null;
85
+ const cut = (v, n) => (typeof v === 'string' ? clean(v).slice(0, n) : '');
86
+ const facts = (Array.isArray(c.facts) ? c.facts : []).filter((f) => Array.isArray(f) && f[1] != null && clean(String(f[1])))
87
+ .slice(0, 12).map(([a, b]) => [cut(String(a), 40), cut(String(b), 240)]);
88
+ const rec = { title: cut(c.title, 160), subject: cut(c.subject, 240), say: cut(c.say, 600), facts, at: now.toISOString() };
89
+ const m = targets(runtimeDir);
90
+ delete m[key];
91
+ m[key] = rec;
92
+ const old = now.getTime() - TARGET_DAYS * 86400000;
93
+ for (const k of Object.keys(m)) if (!(Date.parse(m[k].at) >= old)) delete m[k];
94
+ const ks = Object.keys(m).sort((a, b) => String(m[a].at).localeCompare(String(m[b].at)));
95
+ for (const k of ks.slice(0, Math.max(0, ks.length - TARGET_KEEP))) delete m[k];
96
+ const f = targetsFile(runtimeDir);
97
+ fs.mkdirSync(path.dirname(f), { recursive: true });
98
+ const tmp = `${f}.${process.pid}.tmp`;
99
+ fs.writeFileSync(tmp, JSON.stringify(m) + '\n');
100
+ fs.renameSync(tmp, f);
101
+ return { key, ...rec };
102
+ }
103
+ /** Opened popups, newest first, whose lead is missing or older than `readAt` (ms, the newest stored source read). At most `max`. */
104
+ function due(runtimeDir, { readAt = null, now = new Date(), max = DUE_MAX } = {}) {
105
+ const m = targets(runtimeDir), leads = all(runtimeDir);
106
+ const old = now.getTime() - TARGET_DAYS * 86400000;
107
+ return Object.keys(m).filter((k) => Date.parse(m[k].at) >= old && !FORM_KINDS.includes(kindOf(k)))
108
+ .filter((k) => { const l = leads[k]; return !l || !l.at || (readAt != null && Date.parse(l.at) < readAt); })
109
+ .sort((a, b) => String(m[b].at).localeCompare(String(m[a].at))).slice(0, max)
110
+ .map((k) => ({ key: k, ...m[k], lead_at: leads[k] && leads[k].at ? leads[k].at : null }));
111
+ }
112
+
113
+ module.exports = { KEY_RE, MAX_TEXT, FORM_KINDS, TARGET_DAYS, DUE_MAX, validate, put, get, all, fileOf, seen, due, targets };
@@ -18,7 +18,7 @@
18
18
  * { stateDir, now?, homeWs(), proactive() → { quiet, dayCheck: { start, end, every } }, schedules: { read, write },
19
19
  * startSkill(wsId, skill, name, origin) → { ok, session?, error? }, jobs: { [id]: (ws) → { ok, error? } },
20
20
  * freshRows(ws) → [freshness row], copyPaths(id, ws) → [path], tell({ source, label, error, ws }), sessionAlive(id) → bool,
21
- * setDayCheckEvery(every), setRepoWatch(on), warn(what, e) }
21
+ * setDayCheckEvery(every), setRepoWatch(on), warn(what, e), leadsDue?(ws) → number of popup leads due }
22
22
  * Nothing here calls out of this machine: a skill source's run is the PM's own agent session, with the PM's connections.
23
23
  */
24
24
  const fs = require('fs');
@@ -28,8 +28,8 @@ const R = require('./refresh.js');
28
28
  const PRUNE_EVERY_MS = 24 * 3600 * 1000;
29
29
  const LOST_MS = 6 * 3600 * 1000; // a run with no live session and no end after this long is written as interrupted
30
30
  const ALL_MS = 3 * 3600 * 1000; // a Refresh all that has not ended after this long is over: a new press starts a new one
31
- const DERIVED = Object.freeze(['brief']); // what Refresh all writes again after the sources, in this order
32
- const DERIVED_LIST = Object.freeze(['scan', 'coredocs', 'brief']); // what Sources lists as derived content: built from stored reads, never a tool
31
+ const DERIVED = Object.freeze(['leads', 'brief']); // what Refresh all writes again after the sources, in this order
32
+ const DERIVED_LIST = Object.freeze(['scan', 'coredocs', 'leads', 'brief']); // what Sources lists as derived content: built from stored reads, never a tool
33
33
  const AUTH_RETRY_MS = 2 * 60 * 1000; // a run that failed on Claude's sign-in is tried once more after this (the token is usually refreshed by then)
34
34
 
35
35
  function create(host) {
@@ -141,10 +141,26 @@ function create(host) {
141
141
  state[id] = next;
142
142
  R.writeState(dir, state);
143
143
  R.append(dir, { source: id, ws: s.ws || null, ev: 'end', run: o.run, result, took_ms: t - o.at, got, error, ...(copy ? { copy } : {}) }, t);
144
+ // popup context slice 3b: a read of the tools that ends well is followed by one leads session, once no other read is going
145
+ if (result === 'done' && src && src.group === 'tools') afterRead(s.ws || null);
144
146
  if (result === 'failed' && scheduled && rules.tell === 'brief' && !next.retry_at) {
145
147
  try { host.tell({ source: id, label: src ? src.label : id, error: error || 'it failed', ws: s.ws || null }); } catch (e) { warn('refresh failure note', e); }
146
148
  }
147
149
  }
150
+ /** One leads session after the reads (PM pick, 2026-10-21), when the leads are on and a popup's lead is due. It waits for the
151
+ * reads still going (runNow), and a second read that ends joins the one that is waiting or running. */
152
+ function leadsWanted(ws) {
153
+ const set = settings();
154
+ if (!set.sources.leads || !set.sources.leads.on) return false;
155
+ let n = 0; try { n = host.leadsDue ? Number(host.leadsDue(ws)) || 0 : 0; } catch (e) { warn('popup leads due', e); }
156
+ return n > 0;
157
+ }
158
+ function afterRead(ws) {
159
+ const st = R.readState(dir).leads;
160
+ if (running(st) || (st && st.pending) || !leadsWanted(ws)) return;
161
+ const r = runNow('leads', { ws });
162
+ if (!r.ok) warn('popup leads', { message: r.error || 'it could not start' });
163
+ }
148
164
  /** The morning brief arrived: ONE open brief run is done, the one that started first (one brief is one run). Two open runs used to
149
165
  * both end as done on one brief (2026-10-21), so the log said two briefs arrived when one did. */
150
166
  function briefDone(got) {
@@ -345,14 +361,15 @@ function create(host) {
345
361
  if (cur && !cur.done) return { ok: true, joined: true, all: cur };
346
362
  const set = settings();
347
363
  const reads = R.SOURCES.filter((x) => x.run === 'skill' && x.group === 'tools' && set.sources[x.id] && set.sources[x.id].on).map((x) => x.id);
348
- writeAll({ started_at: t, ws: ws || null, reads, derived: DERIVED.slice() });
364
+ const derivedNow = DERIVED.filter((id) => id !== 'leads' || leadsWanted(ws));
365
+ writeAll({ started_at: t, ws: ws || null, reads, derived: derivedNow });
349
366
  const started = []; const already = []; const failed = [];
350
367
  for (const id of reads) {
351
368
  if (running(R.readState(dir)[id])) { already.push(id); continue; }
352
369
  const r = start(R.BY_ID.get(id), (set.sources[id] && set.sources[id].ws) || ws || host.homeWs(), { trigger: 'pressed', note: 'Refresh all' });
353
370
  (r.ok ? started : failed).push(id);
354
371
  }
355
- for (const id of DERIVED) {
372
+ for (const id of derivedNow) {
356
373
  const st = R.readState(dir);
357
374
  // A Briefing that is being written now read the sources before this press: it is written once more after them.
358
375
  if (running(st[id])) { st[id] = { ...st[id], pending: { trigger: 'pressed', at: t, ws: ws || null } }; R.writeState(dir, st); continue; }
@@ -61,6 +61,11 @@ const SOURCES = Object.freeze([
61
61
  what: 'Your Briefing for the day, ranked by what needs you first. When it is due, the sources it is built on that are older than 2 hours are refreshed first.', uses: ['calendar', 'jira', 'mywork', 'tools'],
62
62
  impact: 'No new Briefing for the day, and the day check has nothing to update.',
63
63
  def: { kind: 'daily', times: ['06:45'] } },
64
+ // popup context slice 3b (PM pick, 2026-10-21): one leads session after the reads, for the popups the PM opened; it reads no tool
65
+ { id: 'leads', label: 'Popup leads', group: 'pmos', ic: 'notes', run: 'skill', skill: 'popup-leads', how: 'bg',
66
+ what: 'Claude\'s short lead for each popup you opened in the last 14 days, written from the stored reads after they are refreshed. It reads no tool.', uses: ['calendar', 'jira', 'mywork', 'tools'],
67
+ impact: 'Popups show their last lead, or none, until you press Refresh in the popup.',
68
+ def: { kind: 'manual' } },
64
69
  { id: 'daycheck', label: 'Day check', group: 'pmos', ic: 'clock', run: 'job', how: 'bg',
65
70
  what: 'Looks at today\'s plan, moves what is done and flags what slipped. It also runs before and after meetings, on a day with a plan.', uses: ['brief'],
66
71
  impact: 'Today\'s plan is not checked during the day.', def: { kind: 'every', every: '60', work: true }, every: ['30', '60'] },
@@ -173,7 +178,7 @@ function withDefaults(raw) {
173
178
  const x = (r.sources && r.sources[src.id]) || {};
174
179
  let on = typeof x.on === 'boolean' ? x.on : src.run !== 'skill'; // a job or watcher is on unless the PM turned it off; a skill source starts off
175
180
  // briefing-source-flow: Your tools feeds the brief, so until the PM sets it, it is on whenever the brief is
176
- if (src.id === 'tools' && typeof x.on !== 'boolean') on = !!(r.sources && r.sources.brief && r.sources.brief.on === true);
181
+ if ((src.id === 'tools' || src.id === 'leads') && typeof x.on !== 'boolean') on = !!(r.sources && r.sources.brief && r.sources.brief.on === true); // the popup leads follow the reads the same way
177
182
  const n = src.run === 'skill' && x.s ? normalize(src, x.s) : null;
178
183
  sources[src.id] = { on, s: n && n.ok ? n.s : (src.def ? { ...src.def, ...(src.def.times ? { times: src.def.times.slice() } : {}) } : null), ws: typeof x.ws === 'string' ? x.ws : null };
179
184
  }