create-pmos 0.325.0 → 0.327.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 (30) hide show
  1. package/package.json +1 -1
  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/guide/briefing-premium.md +10 -3
  7. package/workspace/lib/engine/boards.js +28 -1
  8. package/workspace/lib/routes-boards.js +2 -2
  9. package/workspace/package-lock.json +2 -2
  10. package/workspace/package.json +1 -1
  11. package/workspace/premium-vw-backlog-test.js +127 -0
  12. package/workspace/premium-vw-doc-test.js +3 -1
  13. package/workspace/premium-vw-meet-test.js +4 -1
  14. package/workspace/premium-vw-rec-test.js +209 -0
  15. package/workspace/public/pm/premium-board.js +10 -0
  16. package/workspace/public/pm/premium-meeting.js +28 -5
  17. package/workspace/public/pm/premium-shell.js +8 -2
  18. package/workspace/public/pm/premium-vw-backlog.css +30 -0
  19. package/workspace/public/pm/premium-vw-backlog.js +91 -0
  20. package/workspace/public/pm/premium-vw-doc-model.js +3 -2
  21. package/workspace/public/pm/premium-vw-doc.css +1 -0
  22. package/workspace/public/pm/premium-vw-doc.js +7 -4
  23. package/workspace/public/pm/premium-vw-jira.js +3 -1
  24. package/workspace/public/pm/premium-vw-meet.css +4 -0
  25. package/workspace/public/pm/premium-vw-meet.js +29 -4
  26. package/workspace/public/pm/premium-vw-rec.css +75 -0
  27. package/workspace/public/pm/premium-vw-rec.js +257 -0
  28. package/workspace/test-files.json +2 -0
  29. package/workspace/test-lists/premium-viewer.json +4 -2
  30. package/workspace/test-lists/premium-vw-backlog.json +13 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.325.0",
3
+ "version": "0.327.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": {
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@6c9dcd0
1
+ kernel-source: pmos@3505546
2
2
  assembled: 2026-10-19
3
3
  mode: vendor
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Eval calibration log"
4
4
  description: "Append-only record of every PM override of an evaluator verdict."
5
- generated: {by: process:create-pmos, at: "2026-10-19T22:44:01Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-19T23:04:19Z"}
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-19T22:44:01Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-19T23:04:19Z"}
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-19T22:44:01Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-19T23:04:19Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -129,7 +129,13 @@ In **Notes**, each next step has **Make task** when the note is linked to an ini
129
129
 
130
130
  **Record.** A meeting of today that ended less than 10 minutes ago, or has not started, has a **Record** press in the dialog. Before the first press, the dialog says "Tell everyone first" and what the press does: it makes the meeting's note, or uses the one it has, and starts to listen to your microphone and the sound of the meeting. The audio and the notes stay on this machine. The console's own sheet asks where the meeting's sound comes from. While it records, the dialog shows the clock, **Pause** and **Stop**. A paused meeting stays open for one hour and has **Resume**. **Stop** asks first, because a stopped meeting cannot be resumed, and offers **Pause instead**. A refusal shows the reason and changes nothing. What the dialog shows comes from the recorder and from the notes the server holds, not from the last press. Only one meeting records at a time. A row in Today or in the week shows **Recording** or **Paused** when its note is in that state.
131
131
 
132
- **The recording chip.** While a note records or is paused, every premium page shows a chip at the bottom left with its name, **Open** (the meeting's dialog on the Briefing) and **Stop**. On the Briefing it also has **Pause** and **Resume**. The browser can capture audio only while the Briefing is open, because each premium page is its own page. If you leave the Briefing while it records, the browser asks first. If you leave anyway, the meeting is paused, so the record does not say "recording" for audio that nobody captures. The chip on the next page says "Paused", and **Open** takes you back to resume. A note that the server marks as recording, while the Briefing holds no recorder, shows "marked recording, but this page is not capturing audio".
132
+ **The Record control.** The Briefing's top bar has **Record**. A press starts an untitled note at once and listens to your microphone and the sound of the meeting. The arrow next to it lists today's meetings that have not ended more than 10 minutes ago, each with its time and **Now**, **Recording** or **Paused**, and **New note**. The first start on the page asks "Tell everyone first". The control hides while a note records, because only one note records at a time. The other premium pages have no Record control, because only the Briefing can hold the microphone.
133
+
134
+ **Live notes.** A started note opens its meeting's dialog (or a dialog of its own when it has no meeting) with a **Live notes** tab beside the detail. The tab reads the note every 3 seconds while it is shown: Recording with the clock, or Paused with the time it stays open until, and **Highlight**, **Pause** or **Resume**, and **Stop**. **Highlight** keeps the last 30 seconds and the next ones as a highlight, written from the transcript when the window closes, as the console does. **Stop** asks first. **Private** asks first, because it deletes the note's audio, transcript and screen shots now. **Your notes** is saved when you leave the box, through the console's save. The tab lists the highlights and the live transcript with who spoke, as the note holds them. **Focus** opens a **Focus** tab next to it when the note belongs to a calendar meeting.
135
+
136
+ **Focus tab.** Focus in a tab reads the meeting every 3 seconds while the tab is shown, and stops while it is hidden. It shows the bar of talk by topic, the topic now and its sentence, the topics, the counts captured so far, what is being said and the material. A PMOS deck in the material has **Present** (the console's presenter view, with speaker notes) and **Audience view** (a window with the slides only). Google Slides has **Present**, which opens it in present mode in a new tab. A link has **Open**. Other material only names itself.
137
+
138
+ **The recording chip.** While a note records or is paused, every premium page shows a chip at the bottom left with its name, **Open** and **Stop**. On the Briefing, while it records there, the chip has **Highlight**, **Pause**, **Focus**, **Open** (the Live notes tab) and **Stop**; a paused note has **Open**, **Resume** and **Stop**. The browser can capture audio only while the Briefing is open, because each premium page is its own page. If you leave the Briefing while it records, the browser asks first. If you leave anyway, the meeting is paused, so the record does not say "recording" for audio that nobody captures. The chip on the next page says "Paused", and **Open** takes you back to resume. A note that the server marks as recording, while the Briefing holds no recorder, shows "marked recording, but this page is not capturing audio".
133
139
 
134
140
  **Focus.** The dialog has a **Focus** press. Focus shows the meeting as it is now: the state (starts in, recording, paused, ended), a bar of the stretches by topic, the topic now (or the first topic before the start), the last lines of the talk with who said them, the topics, the material and the counts of decisions, next steps and questions. It reads the meeting every 3 seconds while it is open and stops when you leave it. While the note records, PMOS's companion, a read-only Claude run that sends nothing, may read the last minutes of the talk at most every 40 seconds and writes its own notes. The dialog says this before the first read. **Change** lists the topics. A press records one correction on the meeting through the console's route. If the companion is off, has not answered or has failed, Focus says so and shows only the talk. It shows no topic, line or count that the record does not hold.
135
141
 
@@ -180,7 +186,7 @@ The right side can hold more than one item. When the dialog opens a related item
180
186
 
181
187
  Every markdown document opens as one page in a tab: a report, a PRD, a new document or any other `.md` file. On a document sheet, click **Open as a page**. On a report, click **Edit**.
182
188
 
183
- - **Page** shows the document as it reads. **Edit** lets you type on the page itself, with a toolbar, a **/** menu for blocks, and Ctrl+S to save. **Markdown** shows the source text. Only the sections you changed are written; the other sections and the front matter keep their exact text.
189
+ - **Page** shows the document as it reads. **Edit** lets you type on the page itself, with a toolbar, a **/** menu for blocks, and Ctrl+S to save. **Markdown** shows the source text. Only the sections you changed are written; the other sections and the front matter keep their exact text. A line that is only an HTML comment, such as `<!-- pmos:note … -->` or `<!-- pmos:slide … -->`, is not shown on the page, and a save writes it back as it was.
184
190
  - When the agent proposes an edit, the page shows it applied and highlighted. Click a highlight to see the old text, and click **Put it back** to restore it. The bar above the page has **Keep as vN**, which keeps the changes that remain, and **Undo all**, which asks first and then rejects the whole edit.
185
191
  - **Health**, **Links** and **Copies** under the toolbar show the document's checks, the documents it links to, and its linked copies. The checks only read the file.
186
192
  - A report also shows **Present**, **Print** and **Download** on the same toolbar.
@@ -267,6 +273,7 @@ Board is the third place on the rail, at `/premium-board.html`. It reads what th
267
273
  - **By stage** has one column for each stage of the board's workflow with the board's own count and its first five initiatives.
268
274
  - **List** and **Timeline** show ten tasks a page with Previous and Next; **By stage** shows six cards a column with Show more. **Timeline** draws a bar for each initiative that has both a start and an end date, with the days left or over, and counts the rest. With no dates on record it says so and draws nothing.
269
275
  - **Sprint** appears when an agent session has read Jira for the board. Otherwise it says there is none. Press it to open the sprint's facts, with the sprint as a board in a second tab: **To do**, **In progress** and **Done** columns from the last Jira read, with the goal, the dates, the days left and the points. When the board has more than one sprint, you can switch to another one. Press a card to open its ticket in another tab. A card that is on no initiative of this board is drawn, but it does not open. The board is read only: Jira owns each ticket's status and sprint, so you move tickets in Jira. Tickets with no sprint are not in this read. **Coming up** shows the next release, from the releases ledger.
276
+ - **Open the backlog** is in the Sprint dialog and on its sprint tab. It opens the board's Jira backlog in a tab beside the dialog: the open sprints (active, then next) and then **Backlog**, the tickets in no sprint and not done. A row shows the key, title, status, points and initiative, and why a blocked ticket is blocked. **All**, **Blocked** and **Bugs** filter it (Bugs appears only when the Jira read holds the issue type). A row opens its ticket. The list holds only the tickets the board's initiatives pushed to Jira or hold under their epics, in key order: the Jira read has no rank, assignee or capacity. You move and rank tickets in Jira. With no Jira read, the tab says so.
270
277
  - **Metrics** appears above the Initiatives card on the board of any workspace except the home one (PMOS itself), and counts from that workspace's own repository. It has four tiles. **Corrections per 100 runs** is the corrections logged on the week's runs in `planning/runs/agent-runs.jsonl`; a week with fewer than 10 runs is left blank. **Merged a week** counts the commits on the first-parent line of the trunk. **Blocked** and **Idle for a month** come from the workflow engine, which keeps no history. From the first day the card is read, PMOS keeps their counts once a day in the workspace's state folder (`board-metric-history.jsonl`), so their charts start on that day and their caption says **history starts today** (later, the date). Earlier weeks read **Not kept yet**. Move over a chart, or use the arrow keys, to read a week. A tile that cannot be counted says **Not read** and why; a repository with no run log says **No runs yet**. The line above the tiles starts with how many tiles need a look, and those tiles have a **Needs a look** chip and an orange outline. The line ends with **open Insights**, which opens the same board's Insights page. Press a tile for its definition and values, with the read-only agent beside it. A target is set on Insights, not here. A measure with a target shows it under the value, draws it as a dashed line, and carries **On target** or its gap (for example **2 short**); off target, it also has the orange outline. A measure without a target draws no line. Day and Month are off. It was tested only on made-up repositories, not on a real IDPF or microsite repository.
271
278
  - **The top bar** names the page and the board. With more than one board a menu switches between them, and **Chat** opens the board in the dialog with the read-only agent.
272
279
  - **Core documents** lists the board's documents with their state, cadence and writer, a summary (drafts to review, not started, up to date), a progress bar, a filter and a search. A document with a file opens in the dialog, read only, with its path and state; a draft there has **Issue it**, which marks it issued through the console's own route and sends nothing, and **Draft it again**, which starts a new draft that replaces this one (a board draft has no Edit tab). **Draft it** starts the existing read-only run that writes a draft and sends nothing; **Draft the N not started** does that for each document that can be drafted. **Set it up** and **Open** go to the console. **Add a document** opens a form (title, who writes it, where it lives) and saves a document the core set does not cover on the board's record, in `custom-docs.jsonl`. A document with no link reads "Not started". A document with a link to Confluence or Google Docs reads "Linked" and shows its address. PMOS does not read or sync the linked page, so a linked document is never counted as up to date. Issue and Drop are not on this page.
@@ -343,7 +350,7 @@ A calendar meeting's panel follows the mockup's Design review panel: the title w
343
350
 
344
351
  The panel is laid out like the console's note sheet. Under the head, a line shows the time, then what the meeting is about with **Change** (the link choice). When the meeting is part of a series, the series line names it with "N of M" and has a press for the meeting before and the one after. Each opens that meeting's notes as a tab in the viewer, and the tab pages through the series. **Not part of this series** takes the note out of the series, and **Put it back** returns it. A switch then shows one part at a time:
345
352
 
346
- - **Before**: the open steps carried in from the meeting before, the agenda with each item marked when the transcript heard it, what the meeting is for, what to have ready, what to read first and the people. Prepared for you, Material, Previous meetings and Topics follow.
353
+ - **Before**: first the meeting prep the console's Calendar card shows: In short, What matters today (To settle in planning for a planning meeting), Since the last one with its decisions and the steps From last time, To be ready, and the meeting's links. When the note already carries in the meeting before, Since the last one is left to it. Then the open steps carried in from the meeting before, the agenda with each item marked when the transcript heard it, what the meeting is for, what to have ready, what to read first and the people. Prepared for you, Material, Previous meetings and Topics follow.
347
354
  - **During**: the transcript the note holds, with times.
348
355
  - **After**: **Since the last one** (each step from the meeting before as Done, Raised again or Not mentioned, and the new steps), the replay, the summary, a table of decisions with their why, a table of next steps with owner, due and **Make task**, the open questions, the screenshots of the shared screen and the transcript, folded.
349
356
 
@@ -593,6 +593,33 @@ function pointsOf(issues) {
593
593
  const sum = (a) => Math.round(a.reduce((x, i) => x + i.points, 0) * 10) / 10;
594
594
  return { committed: sum(est), done: sum(est.filter((i) => i.category === 'done')), unestimated: issues.length - est.length };
595
595
  }
596
+ /**
597
+ * The backlog (premium-viewer R10): the board's tickets that are in no sprint and not done, from the initiatives' Jira readings.
598
+ * An initiative's reading holds only the tickets it pushed or the children of its linked epics, so this is the backlog PMOS knows,
599
+ * not the whole Jira backlog; the rank is not read, so the list goes by key. A ticket the whole-sprint read puts in a sprint is left
600
+ * out (that read is the newer one for sprints). links maps every board ticket's key to its Jira page, where a reading has one.
601
+ */
602
+ function backlogOf(snapshots, onBoard = () => true, whole = null) {
603
+ const inSprint = new Set();
604
+ for (const t of whole && whole.tickets ? (whole.tickets instanceof Map ? whole.tickets.values() : Array.isArray(whole.tickets) ? whole.tickets : []) : []) if (t && t.key && t.sprint && t.sprint.name) inSprint.add(t.key);
605
+ const seen = new Map(); const links = {};
606
+ let readAt = null;
607
+ for (const s of snapshots || []) {
608
+ if (!s || !onBoard(s.initiative)) continue;
609
+ if (s.fetchedAt && (!readAt || s.fetchedAt < readAt)) readAt = s.fetchedAt; // the oldest read is the honest age
610
+ for (const t of s.tickets instanceof Map ? s.tickets.values() : Array.isArray(s.tickets) ? s.tickets : []) {
611
+ if (!t || !t.key) continue;
612
+ if (typeof t.url === 'string' && /^https:\/\//.test(t.url)) links[t.key] = t.url;
613
+ if (t.sprint && t.sprint.name) continue;
614
+ if (inSprint.has(t.key) || seen.has(t.key) || t.category === 'done') continue;
615
+ const category = ['todo', 'doing'].includes(t.category) ? t.category : 'todo';
616
+ seen.set(t.key, { key: t.key, summary: t.summary || '', status: t.status || '', category, type: typeof t.type === 'string' ? t.type : null, initiative: s.initiative,
617
+ flagged: !!t.flagged, reason: t.flagged && t.reason ? String(t.reason) : null, points: ptsOf(t), stale: !!t.stale });
618
+ }
619
+ }
620
+ const issues = [...seen.values()].sort((a, b) => a.key.localeCompare(b.key, undefined, { numeric: true }));
621
+ return { readAt, issues, points: pointsOf(issues), links };
622
+ }
596
623
  /** Where the tickets are: one entry per Jira status, to do first, then in progress, then done. */
597
624
  function flowOf(issues) {
598
625
  const by = new Map();
@@ -725,7 +752,7 @@ function sprintsOf(snapshots, onBoard = () => true, whole = null, notes = null,
725
752
  module.exports = {
726
753
  CATEGORIES, WORKFLOW_TEMPLATES, TOOLS, SELF_LADDER, READING_CAT, STATUSES, ACTIVE, isActive, duplicatesOf, VIEWS, SORTS,
727
754
  templateWorkflow, isTemplateEdited, fold, readingOf, deriveStage, stageOf, catOf, moveWarnings, cardWarnings,
728
- applyWorkflowEdit, filterRows, health, counts, sprintsOf, key,
755
+ applyWorkflowEdit, filterRows, health, counts, sprintsOf, backlogOf, key,
729
756
  INI_TEMPLATES, TASK_STATES, isBuildStage, templateBuilds, boardSettings, jiraProjectsOf, JIRA_KEY_RE, JIRA_PROJECT_RE, workflowOf, templateOf, applyIniWorkflow, taskOf, shiftDay,
730
757
  ITEM_PROGRESS, itemStatus, taskItem, rollupItems,
731
758
  };
@@ -9,7 +9,7 @@
9
9
  * GET /api/boards/columns?ws&board&q&owner&cap → { ok, columns: [{ stage, cat, hint, count, rows }] }
10
10
  * GET /api/boards/initiative?ws&board&id → { ok, row, board, history, tools }
11
11
  * GET /api/boards/asks?ws&board&state → { ok, asks } state: open (default) | accepted | declined | all
12
- * GET /api/boards/sprints?ws&board → { ok, source: jira|none, readAt, sprints } (each with goal, summary, themes, frozen)
12
+ * GET /api/boards/sprints?ws&board → { ok, source: jira|none, readAt, sprints, backlog } (each sprint with goal, summary, themes, frozen; backlog: B.backlogOf)
13
13
  * GET /api/boards/items?ws&board → { ok, build, jira, items, initiatives } PMOS tasks + Jira items (Build and deliver only)
14
14
  * GET /api/boards/anchors?ws&board → { ok, anchors: [{ value, kind, group, label }], error } the declared KRs,
15
15
  * health budgets and domains a new initiative can anchor to (D59)
@@ -553,7 +553,7 @@ const READS = {
553
553
  try { whole = jiraStatus.readSprints(r.w.root); } catch { whole = null; }
554
554
  let notes = null;
555
555
  try { notes = jiraStatus.readSprintNotes(r.w.root); } catch { notes = null; }
556
- ctx.json(res, { ok: true, ws: r.w.id, board: r.board.id, ...B.sprintsOf(snaps, (id) => ids.has(id), whole, notes) });
556
+ ctx.json(res, { ok: true, ws: r.w.id, board: r.board.id, ...B.sprintsOf(snaps, (id) => ids.has(id), whole, notes), backlog: B.backlogOf(snaps, (id) => ids.has(id), whole) });
557
557
  },
558
558
  };
559
559
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.325.0",
3
+ "version": "0.327.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.325.0",
9
+ "version": "0.327.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.325.0",
3
+ "version": "0.327.0",
4
4
  "private": true,
5
5
  "description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
6
6
  "license": "MIT",
@@ -0,0 +1,127 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* premium-vw-backlog-test.js — the Jira backlog as a viewer tab on the premium Board (initiative premium-viewer, R10, R7; planning/prd/premium-viewer-prd.md).
4
+ * Serves the real Board page from the real server with the Board model and GET /api/boards/sprints answered by stand-ins, opens the Sprint
5
+ * card's dialog, presses "Open the backlog", then reads the tab. Every wait polls the page; no fixed sleep stands in for a state. */
6
+ const path = require('path');
7
+ const { spawn } = require('child_process');
8
+ const { findBrowser } = require('./lib/find-browser');
9
+ const T = require('./test-run').configure({ name: 'premium-vw-backlog' });
10
+ const BP = require('./lib/board-premium.js');
11
+ const F = require('./fixtures/board-premium-facts.js');
12
+
13
+ const BASE = T.BASE;
14
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
15
+ const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
16
+ const results = [];
17
+ const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
18
+ let srv = null; let browser = null;
19
+ const finish = async (code) => {
20
+ if (browser) await browser.close().catch(() => {});
21
+ if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
22
+ T.killTmux();
23
+ const bad = results.filter((x) => !x.cond).length;
24
+ console.log(`\n${results.length - bad}/${results.length} premium-vw-backlog assertions passed`);
25
+ process.exit(code !== undefined ? code : (bad ? 1 : 0));
26
+ };
27
+ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
28
+
29
+ const SPRINT = { name: 'S 14', state: 'active', start: '2026-10-07', end: '2026-10-21', counts: { todo: 0, doing: 1, done: 1 }, points: { committed: 8, done: 3, unestimated: 0 },
30
+ issues: [{ key: 'P-1', summary: 'Ship the setup', status: 'Done', category: 'done', initiative: 'a', points: 3 }, { key: 'P-2', summary: 'Migration check', status: 'In Progress', category: 'doing', initiative: 'a', points: 5, flagged: true, reason: 'Flagged in Jira' }] };
31
+ const SPRINTS = { ok: true, source: 'jira', readAt: '2026-10-19T09:00:00Z', velocity: [], sprints: [SPRINT, { name: 'S 15', state: 'future', counts: { todo: 0, doing: 0, done: 0 }, points: null, issues: [] }],
32
+ backlog: { readAt: '2026-10-19T08:00:00Z', points: { committed: 3, done: 0, unestimated: 1 }, links: { 'Q-2': 'https://x.atlassian.net/browse/Q-2' },
33
+ issues: [{ key: 'P-3', summary: 'Track activation by cohort', status: 'To Do', category: 'todo', initiative: 'a', points: null }, { key: 'Q-2', summary: 'Old onboarding emails still send', status: 'To Do', category: 'todo', initiative: 'b', points: 3, type: 'Bug' }] } };
34
+
35
+ (async () => {
36
+ const exe = findBrowser();
37
+ if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
38
+ let chromium;
39
+ try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
40
+ srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
41
+ await T.waitForServer(BASE);
42
+ browser = await chromium.launch({ executablePath: exe });
43
+
44
+ const open = async ({ w = 1280, h = 900, theme = 'light', sprints = SPRINTS } = {}) => {
45
+ const ctx = await browser.newContext({ viewport: { width: w, height: h } });
46
+ const page = await ctx.newPage();
47
+ const S = { errors: [], reads: [] };
48
+ page.on('pageerror', (e) => S.errors.push(String((e && e.message) || e)));
49
+ const model = BP.build(F.facts({ sprints: { source: 'jira', readAt: SPRINTS.readAt, sprints: [SPRINT] } }));
50
+ await page.route('**/api/board-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model, as_of: Date.now() }) }));
51
+ await page.route('**/api/briefing-premium/**', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, turns: [] }) }));
52
+ await page.route('**/api/boards/sprints*', (r) => { S.reads.push(new URL(r.request().url()).search); r.fulfill({ contentType: 'application/json', body: JSON.stringify(sprints) }); });
53
+ await page.goto(BASE + '/premium-board.html?theme=' + theme);
54
+ S.up = await until(() => page.evaluate(() => !!document.querySelector('#cSpr [data-open="board:sprint"]') && !!window.__premiumViewer), 20000);
55
+ return { page, ctx, S };
56
+ };
57
+ const openBacklog = async (page) => {
58
+ await page.click('#cSpr [data-open="board:sprint"]');
59
+ await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#openBacklog')), 5000);
60
+ const btn = await page.$('#openBacklog');
61
+ if (!btn) return false;
62
+ await page.evaluate(() => document.querySelector('#openBacklog').click());
63
+ return until(() => page.evaluate(() => document.querySelectorAll('#dOut .obody.vw .bl-s').length > 0), 5000);
64
+ };
65
+ const read = (page) => page.evaluate(() => {
66
+ const p = document.querySelector('#dOut .obody.vw:not([hidden])');
67
+ return { secs: p ? [...p.querySelectorAll('.bl-s')].map((s) => [s.querySelector('.bl-h b').textContent, [...s.querySelectorAll('.bl-k')].map((k) => k.textContent)]) : [],
68
+ text: p ? p.textContent.replace(/\s+/g, ' ') : '', tabs: window.__premiumViewer.vwState() };
69
+ });
70
+
71
+ /* R10 desktop */
72
+ {
73
+ const { page, ctx, S } = await open();
74
+ ok('R10 the Board loads with its Sprint card', S.up);
75
+ ok('R10 the sprint dialog has "Open the backlog", and it opens the backlog as a tab', await openBacklog(page));
76
+ let s = await read(page);
77
+ ok('R10 the tab is open beside the dialog\'s own detail and the sprint tab, and #oMain is kept', s.tabs.ids.includes('backlog:w1') && /^backlog:/.test(s.tabs.on) && await page.evaluate(() => !!document.querySelector('#oMain #openBacklog')), JSON.stringify(s.tabs));
78
+ ok('R10 the board is read with its workspace and board', S.reads.length >= 1 && S.reads.every((q) => /board=w1/.test(q) && /ws=w1/.test(q)), JSON.stringify(S.reads));
79
+ ok('R10 the open sprints first, then the Backlog, each with its tickets by key', JSON.stringify(s.secs) === '[["S 14",["P-1","P-2"]],["S 15",[]],["Backlog",["P-3","Q-2"]]]', JSON.stringify(s.secs));
80
+ ok('R10 it says what it leaves out and that Jira owns rank and sprint', /Only the tickets this board's initiatives pushed/.test(s.text) && /Ranking and moving between sprints happen in Jira/.test(s.text));
81
+ ok('R10 a blocked ticket says why; points and initiative are shown', /Flagged in Jira/.test(s.text) && /3 points, 1 not estimated/.test(s.text) && await page.evaluate(() => document.querySelectorAll('#dOut .obody.vw .bl-in').length === 4));
82
+ ok('R10 nothing can be dragged or sent to Jira', await page.evaluate(() => !document.querySelector('#dOut .obody.vw[data-vw="backlog:w1"] [draggable="true"]') && !/Send to Jira/.test(document.querySelector('#dOut .obody.vw[data-vw="backlog:w1"]').textContent)));
83
+ await page.click('#dOut .obody.vw [data-f="bug"]');
84
+ s = await read(page);
85
+ ok('R10 the Bugs filter keeps the bug and says when a section has none', JSON.stringify(s.secs.map((x) => x[1])) === '[[],[],["Q-2"]]' && /None match this filter/.test(s.text), JSON.stringify(s.secs));
86
+ await page.click('#dOut .obody.vw [data-f="blocked"]');
87
+ s = await read(page);
88
+ ok('R10 the Blocked filter keeps the blocked ticket', JSON.stringify(s.secs.map((x) => x[1])) === '[["P-2"],[],[]]', JSON.stringify(s.secs));
89
+ await page.click('#dOut .obody.vw [data-f=""]');
90
+ await page.click('#dOut .obody.vw [data-tk="Q-2"]');
91
+ ok('R10 a row opens its ticket in the Jira ticket tab', await until(() => page.evaluate(() => window.__premiumViewer.vwState().on === 'jira:Q-2'), 5000), JSON.stringify(await page.evaluate(() => window.__premiumViewer.vwState())));
92
+ await page.evaluate(() => window.__premiumViewer.vwClose('backlog:w1'));
93
+ await until(() => page.evaluate(() => !!document.querySelector('#dOut .obody.vw[data-vw="sprint:w1"] [data-jbl]')), 5000);
94
+ await page.evaluate(() => { window.__premiumViewer.vwShow('sprint:w1'); document.querySelector('#dOut .obody.vw[data-vw="sprint:w1"] [data-jbl]').click(); });
95
+ ok('R10 the sprint tab\'s "Open the backlog" opens the backlog tab', await until(() => page.evaluate(() => window.__premiumViewer.vwState().on === 'backlog:w1'), 5000));
96
+ ok('R10 no page error', S.errors.length === 0, S.errors.join(' | '));
97
+ await ctx.close();
98
+ }
99
+
100
+ /* R10 no reading */
101
+ {
102
+ const { page, ctx, S } = await open({ sprints: { ok: true, source: 'none', readAt: null, sprints: [], velocity: [], backlog: { readAt: null, issues: [], points: null, links: {} } } });
103
+ await page.click('#cSpr [data-open="board:sprint"]');
104
+ await until(() => page.evaluate(() => !!document.querySelector('#openBacklog')), 5000);
105
+ await page.evaluate(() => document.querySelector('#openBacklog').click());
106
+ ok('R10 with no Jira reading the tab says so', await until(() => page.evaluate(() => /No Jira reading for this board yet/.test((document.querySelector('#dOut .obody.vw[data-vw="backlog:w1"]') || {}).textContent || '')), 5000));
107
+ ok('R10 no page error (no reading)', S.errors.length === 0, S.errors.join(' | '));
108
+ await ctx.close();
109
+ }
110
+
111
+ /* R7 phone and dark theme */
112
+ {
113
+ const { page, ctx, S } = await open({ w: 390, h: 844, theme: 'dark' });
114
+ ok('R7 the backlog opens at 390px', await openBacklog(page));
115
+ const m = await page.evaluate(() => {
116
+ const p = document.querySelector('#dOut .obody.vw:not([hidden])');
117
+ const small = [...p.querySelectorAll('button')].filter((b) => b.getBoundingClientRect().width && b.getBoundingClientRect().height < 44).map((b) => b.textContent.trim().slice(0, 20));
118
+ return { small, wide: document.documentElement.scrollWidth > window.innerWidth + 1, bg: getComputedStyle(p.querySelector('.bl-s')).backgroundColor };
119
+ });
120
+ ok('R7 every button in the tab is at least 44px tall', m.small.length === 0, JSON.stringify(m.small));
121
+ ok('R7 no sideways scroll at 390px', !m.wide);
122
+ ok('R7 the sections are dark in the dark theme', /rgb\((\d+), (\d+), (\d+)\)/.test(m.bg) && +/rgb\((\d+)/.exec(m.bg)[1] < 80, m.bg);
123
+ ok('R7 no page error (phone)', S.errors.length === 0, S.errors.join(' | '));
124
+ await ctx.close();
125
+ }
126
+ return finish();
127
+ })();
@@ -29,7 +29,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
29
29
 
30
30
  const PATH = 'planning/prd/self-serve-v2-prd.md';
31
31
  const TEXT = '---\ntype: PRD\ntitle: "Self-serve onboarding v2"\nstatus: Draft\ntimestamp: 2026-10-16\ntags: [onboarding, q4]\n---\n\n# PRD: Self-serve onboarding v2\n\n'
32
- + '> [!NOTE]\n> Owned by the onboarding squad.\n\n## Problem\n\nA partner waits for a person.\nIt takes two days.\n\n## Goal\n\n- a first call without help\n\n'
32
+ + '> [!NOTE]\n> Owned by the onboarding squad.\n\n## Problem\n<!-- pmos:note owner=growth -->\n\nA partner waits for a person.\nIt takes two days.\n\n## Goal\n\n- a first call without help\n\n'
33
33
  + '## Requirements\n\n| Id | What | State |\n|---|---|---|\n| R1 | a first call | :status[In progress] |\n\n- [x] draft the flow\n- [ ] test it\n';
34
34
  const AFTER = TEXT.replace('## Goal', '## Summary\n\nPartners reach a first call without help.\n\n## Goal').replace('- a first call without help', '- a first call in under ten minutes');
35
35
  const prop = (o) => Object.assign({ id: 'prop-a', state: 'proposed', prompt: 'add a summary and tighten the goal', at: '2026-10-18T01:00:00Z', hash: 'ha', by: 'agent', why: null, after: AFTER, sections: [
@@ -94,6 +94,7 @@ const prop = (o) => Object.assign({ id: 'prop-a', state: 'proposed', prompt: 'ad
94
94
  ok('D1 the byline says who changed it last, the version and the read time, from the log', /Last change by Before the sheet · 16 Oct 2026 · v1 · 1 min read/.test(head.by), head.by);
95
95
  ok('D1 the properties table and labels come from the front matter', head.props.join('|') === 'type PRD|status Draft|timestamp 16 Oct 2026' && head.labels.join() === 'onboarding,q4', JSON.stringify(head));
96
96
  ok('D1 the body has the panel, the table with its status label, and the task list', await p.evaluate((v) => { const b = document.querySelector(v + ' .cfb'); return !!b.querySelector('.pnl.note') && !!b.querySelector('.tw table .lz.b') && b.querySelectorAll('.tasks li').length === 2 && b.querySelector('.tasks li[data-done="true"]') !== null; }, V));
97
+ ok('D1 a whole-line HTML comment is not drawn on the page', await p.evaluate((v) => { const b = document.querySelector(v + ' .cfb'); return !/pmos:note/.test(b.innerText) && b.querySelectorAll('.vwcm').length === 1 && getComputedStyle(b.querySelector('.vwcm')).display === 'none'; }, V));
97
98
  ok('D1 the footer names the file', /planning\/prd\/self-serve-v2-prd\.md/.test(head.foot));
98
99
  ok('D1 Page, Edit and Markdown are one control, with Page on', await p.evaluate((v) => [...document.querySelectorAll(v + ' .vwseg')].map((b) => b.textContent.trim() + ':' + b.getAttribute('aria-pressed')).join() === 'Page:true,Edit:false,Markdown:false', V));
99
100
 
@@ -134,6 +135,7 @@ const prop = (o) => Object.assign({ id: 'prop-a', state: 'proposed', prompt: 'ad
134
135
  const e1 = A.S.posts[0];
135
136
  const want = TEXT.replace('A partner waits for a person.\nIt takes two days.', 'A partner still waits for a person. It takes two days.');
136
137
  ok('D2 Save posts path, text and why to /api/doc-sheet/edit for the workspace', e1 && e1.route === 'edit' && Object.keys(e1.body).sort().join() === 'path,text,why' && e1.body.path === PATH && e1.body.why === 'say the partner still waits' && /ws=w1/.test(e1.query), JSON.stringify(e1));
138
+ ok('D2 a comment in the typed-in section is written back unchanged, under its heading', e1 && e1.body.text.includes('## Problem\n<!-- pmos:note owner=growth -->\n\nA partner still waits'), JSON.stringify(e1 && e1.body.text));
137
139
  ok('D2 only the section that was typed in changes; the front matter, the panel, the table and the tasks keep their exact text', e1 && e1.body.text === want, JSON.stringify(e1 && e1.body.text));
138
140
  await until(() => p.evaluate((v) => document.querySelector(v + ' .vwseg[aria-pressed="true"]') && /Page/.test(document.querySelector(v + ' .vwseg[aria-pressed="true"]').textContent) && /v2/.test(document.querySelector(v + ' .cfby').textContent), V));
139
141
  ok('D2 after Save the page reads the file again and says v2', /Last change by You · 18 Oct 2026 · v2/.test(await txt(p, V + ' .cfby')));
@@ -3,7 +3,7 @@
3
3
  /* premium-vw-meet-test.js — the meeting detail laid out as the console's note sheet (initiative premium-viewer, R3, slice S3; planning/prd/premium-viewer-prd.md).
4
4
  * Serves the real Briefing from the real server. The Briefing model, the calendar, the notes and the note (GET /api/notes/one) are answered by stand-ins,
5
5
  * so each press can be read off the request the page sent. The routes' own behaviour is in their own suites; the pure half is in premium-vw-meet.test.js.
6
- * S1 stage · S2 head · S3 After · S4 Make task · S5 Before · S6 During · S7 series membership · S8 no note · S9 writes · S10 floors
6
+ * S1 stage · S2 head · S3 After · S4 Make task · S5 Before (with the prep brief) · S6 During · S7 series membership · S8 no note · S9 writes · S10 floors
7
7
  * Every wait polls the page; no fixed sleep stands in for a state. */
8
8
  const path = require('path');
9
9
  const { spawn } = require('child_process');
@@ -76,6 +76,7 @@ const PNG = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR
76
76
  await page.route('**/api/calendar-views*', (r) => json(r, weekAnswer()));
77
77
  await page.route('**/api/meeting-replay*', (r) => json(r, { ok: false, error: 'no note' }, 404));
78
78
  await page.route('**/api/meeting-material*', (r) => json(r, { ok: true, key: 'k', items: [] }));
79
+ await page.route('**/api/meeting-focus?*', (r) => json(r, { ok: true, brief: { gist: ['Agree what blocks the release.'], planning: false, matters: [{ tag: 'Late', tone: 'bad', text: 'Ship the SSO spike', meta: 'due 14 Oct', ref: { type: 'item' } }], last: { id: 'n0', title: 'Weekly sync', at: '2026-10-06T10:00:00Z', private: false, overview: 'The copy test plan.', decisions: [], actions: [] }, earlier: 1, prep: null, links: [], refs: [] } }));
79
80
  await page.route('**/api/notes/recording*', (r) => r.fulfill({ status: 200, contentType: 'audio/wav', body: Buffer.alloc(0) }));
80
81
  await page.route('**/api/notes/screen*', (r) => r.fulfill({ status: 200, contentType: 'image/png', body: PNG }));
81
82
  await page.route('**/api/notes/series?*', (r) => json(r, { ok: true, series: { key: 'weekly-sync', meetings: [] } }));
@@ -139,6 +140,8 @@ const PNG = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR
139
140
  await stage(p, 'before');
140
141
  const bf = (await part(p, 'before')).text;
141
142
  ok('S5 Before shows what was carried in, the agenda with what was heard, and what it is for', /Carried in from/.test(bf) && /Book the readout/.test(bf) && /1 of 2 heard/.test(bf) && /What it is for/.test(bf) && /Release PRD/.test(bf), bf.slice(0, 300));
143
+ const prep = await until(() => p.evaluate(() => { const b = document.querySelector('#oMain .vm-body[data-part="before"] [data-vm-prep]'); return b ? b.textContent : ''; }));
144
+ ok('S5 Before opens with the meeting prep the console card shows: In short and What matters today; the note already carries in the meeting before', /In short/.test(prep) && /Agree what blocks the release/.test(prep) && /What matters today/.test(prep) && /Ship the SSO spike/.test(prep) && !/Since the last one/.test(prep), String(prep).slice(0, 200));
142
145
  ok('S5 Before keeps Prepared for you and Material', /Prepared for you/.test(bf) && /Material/.test(bf) && await p.evaluate(() => !!document.querySelector('#mmAdd') && !!document.querySelector('#mmAdd').offsetParent));
143
146
  ok('S1 pressing a stage shows it, hides the others and moves the pressed state', await p.evaluate(() => document.querySelector('#oMain [data-ph="before"]').getAttribute('aria-pressed') === 'true' && document.querySelector('#oMain .vm-body[data-part="after"]').hidden));
144
147