create-pmos 0.403.0 → 0.404.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.403.0",
3
+ "version": "0.404.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,18 @@
32
32
  "audit"
33
33
  ],
34
34
  "pmosChanges": [
35
+ {
36
+ "v": "0.404.0",
37
+ "at": "2026-10-24T05:07:12.902Z",
38
+ "f": 2,
39
+ "prs": [
40
+ {
41
+ "n": 1034,
42
+ "t": "Chat names the real program press; add Turn into a program to the initiative ⋯",
43
+ "s": "Chat names the real program press; add Turn into a program to the initiative ⋯"
44
+ }
45
+ ]
46
+ },
35
47
  {
36
48
  "v": "0.403.0",
37
49
  "at": "2026-10-24T03:40:15.576Z",
@@ -274,23 +286,6 @@
274
286
  "s": "A task's Jira ticket from the stored reads, with Read it now"
275
287
  }
276
288
  ]
277
- },
278
- {
279
- "v": "0.384.0",
280
- "at": "2026-10-21T13:39:28.616Z",
281
- "f": 2,
282
- "prs": [
283
- {
284
- "n": 993,
285
- "t": "A Work item from the brief opens on its source",
286
- "s": "A Work item from the brief opens on its source"
287
- },
288
- {
289
- "n": 995,
290
- "t": "Claude's stored lead shows first in a popup, with Refresh",
291
- "s": "Claude's stored lead shows first in a popup, with Refresh"
292
- }
293
- ]
294
289
  }
295
290
  ]
296
291
  }
package/payload/AGENTS.md CHANGED
@@ -48,6 +48,8 @@ It refuses frontmatter, fenced and indented code, table rows, headings, delibera
48
48
  | `log_friction` / `log_discovery` | append to `pmos/state/discoveries.md` (ISO date, `#friction` tag where applicable) |
49
49
  | `get_agent_runs` / `get_friction` | read those same files (your episodic memory — consult before contracting) |
50
50
 
51
+ **Programs** (the level above initiatives, across products) are not an initiative key. A program is a line in `pmos/state/programs.jsonl`: `{"kind":"program",…}` is the charter and `{"kind":"member","program":"<id>","initiative":"<id>"}` puts an initiative in it. Never add `kind`, `program`, `programme`, `parent_program` or `parent_programme` to an initiative record: nothing reads them. You do not write `programs.jsonl`: the PM makes a program on the Board (an initiative's ⋯ → **Turn into a program**, or + → **New program**).
52
+
51
53
  State files are **append-only**: never rewrite or delete an existing line or initiative record; correct by appending. When a vendored skill names a hosted tool, apply this table — the skill bodies are single-sourced from the PMOS kernel and are not forked for file mode.
52
54
 
53
55
  ## Work-type lanes (D56)
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@1a2052c2
1
+ kernel-source: pmos@d588f370
2
2
  assembled: 2026-10-24
3
3
  mode: vendor
@@ -18,7 +18,7 @@ export const PRODUCT_STEPS = ['route', 'anchor', 'prototype', 'understand', 'spe
18
18
  export const PM_ARTIFACT_STEPS = ['route', 'brief', 'draft', 'review', 'approved', 'handoff'];
19
19
  export const KNOWN_STEPS = new Set([...PRODUCT_STEPS, ...PM_ARTIFACT_STEPS]);
20
20
  export const STEP_STATUSES = ['done', 'na', 'unknown', 'pending', 'blocked'];
21
- export const STAGES = ['intake', 'spec', 'contract', 'build', 'eval', 'accepted', 'brief', 'draft', 'review'];
21
+ export const STAGES = ['intake', 'spec', 'contract', 'build', 'eval', 'accepted', 'brief', 'draft', 'review', 'handoff'];
22
22
  export const LANES = ['feature', 'discovery', 'chore', 'incident', 'content', 'prototype'];
23
23
  export const PROFILES = ['product-code', 'pm-artifacts'];
24
24
 
@@ -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-24T03:40:12Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-24T05:07:10Z"}
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-24T03:40:12Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-24T05:07:10Z"}
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-24T03:40:12Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-24T05:07:10Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -223,5 +223,31 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
223
223
  ok('Z on a phone the program is a head card with its next milestone, and nothing scrolls sideways', await R.page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1 && !!document.querySelector('#ibBody .bt-pg .bd-pm') && getComputedStyle(document.querySelector('#ibBody .bt-pg .bt-spread')).display === 'none'));
224
224
  await R.ctx.close();
225
225
  }
226
+
227
+ /* P7 Turn into a program: the initiative's ⋯ offers it when the initiative is in no program, presses POST /api/programs/turn and opens
228
+ * the new program (bug 2026-10-24: the press was never on the page, so "Set Project Ascent as Program" had nowhere to go) */
229
+ {
230
+ const { ctx, page: p, errors } = await open({ programs: [] });
231
+ let sent = null;
232
+ await p.route('**/api/programs/turn', (r) => { sent = JSON.parse(r.request().postData() || '{}'); r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, program: { id: 'legacy-idp-sunset' } }) }); });
233
+ const menu = async () => { await p.click('#czViewer [data-cz-vw="more"]'); await p.waitForTimeout(80); return p.evaluate(() => [...document.querySelectorAll('.cz-vw-menu [role="menuitem"]')].map((b) => b.textContent.trim())); };
234
+ await p.click('#ibBody .bt-nm >> text=Legacy IdP sunset');
235
+ await p.waitForSelector('#czViewer:not([hidden])');
236
+ const m = await menu();
237
+ ok('P7 an initiative in no program: ⋯ offers Turn into a program, after the plan dates', m.indexOf('Turn into a program') === m.indexOf('Change the plan dates') + 1, JSON.stringify(m));
238
+ await p.click('.cz-vw-menu [role="menuitem"] >> text=Turn into a program');
239
+ await p.waitForTimeout(400);
240
+ const ev = await events(p);
241
+ ok('P7 the press sends the initiative and its title, then opens the new program', sent && sent.initiative && sent.title === 'Legacy IdP sunset' && ev.includes('legacy-idp-sunset'), JSON.stringify({ sent, ev }));
242
+ ok('P7 the page threw nothing', !errors.length, errors.join('\n'));
243
+ await ctx.close();
244
+ const R = await open();
245
+ await R.page.click('#ibBody .bt-kid .bt-nm >> text=Legacy IdP sunset');
246
+ await R.page.waitForSelector('#czViewer:not([hidden])');
247
+ await R.page.click('#czViewer [data-cz-vw="more"]'); await R.page.waitForTimeout(80);
248
+ const m2 = await R.page.evaluate(() => [...document.querySelectorAll('.cz-vw-menu [role="menuitem"]')].map((b) => b.textContent.trim()));
249
+ ok('P7 an initiative that is in a program has no Turn into a program', m2.length > 0 && !m2.includes('Turn into a program'), JSON.stringify(m2));
250
+ await R.ctx.close();
251
+ }
226
252
  finish();
227
253
  })();
@@ -1,4 +1,16 @@
1
1
  [
2
+ {
3
+ "v": "0.404.0",
4
+ "at": "2026-10-24T05:07:12.902Z",
5
+ "f": 2,
6
+ "prs": [
7
+ {
8
+ "n": 1034,
9
+ "t": "Chat names the real program press; add Turn into a program to the initiative ⋯",
10
+ "s": "Chat names the real program press; add Turn into a program to the initiative ⋯"
11
+ }
12
+ ]
13
+ },
2
14
  {
3
15
  "v": "0.403.0",
4
16
  "at": "2026-10-24T03:40:15.576Z",
@@ -20,6 +20,8 @@ Programs do not change how Insights, the weekly update or sprints count initiati
20
20
  - The **timeline** draws a program row that brackets its initiatives' bars, on every span. Program milestones are diamonds. Milestones that are close together merge into one diamond with a count.
21
21
  - **List** has a Product column and a Program column. Press a column header to sort by it.
22
22
  - **New** opens a menu: **New initiative** or **New program**.
23
+ - To make an initiative a program, open the initiative, press **⋯**, then **Turn into a program**. The initiative joins the new program, and the program panel opens. **Turn into a program** shows only for an initiative that is in no program.
24
+ - The chat cannot make or change a program. Every program change is a press on the Board. When you ask the chat about a program, it tells you which press to use.
23
25
 
24
26
  ## The program panel
25
27
 
@@ -16,6 +16,7 @@ const crypto = require('crypto');
16
16
  const headless = require('./headless.js');
17
17
  const Goal = require('./goal-chat.js');
18
18
  const ReportChat = require('./report-chat.js');
19
+ const ProgramChat = require('./program-chat.js');
19
20
 
20
21
  const THREADS = 'briefing-premium-threads.jsonl';
21
22
  const KEY_RE = /^(decision|blocked|waited|src|ev|work|board|init|doc|ins|chat|pop):[A-Za-z0-9][A-Za-z0-9._:-]{0,100}$/; // chat: the PM's own chat on the Chat page (premium-chat-page); pop: a popup with no row of its own (premium-popup-context P1)
@@ -196,6 +197,8 @@ function chat({ runtimeDir, key, text, model, context, sessions, wsId, now = new
196
197
  if (cmd) { const b = Goal.begin({ runtimeDir, key, text: cmd.text, now }); if (b.error) return fail(400, b.error); msg = b.prompt; goal = b.id; }
197
198
  // premium-reports-from-chat R1: a message about a report, a chart or a dashboard carries the pmos-report rule (lib/report-chat.js)
198
199
  else if (ReportChat.isAsk(q)) msg = ReportChat.wrap(q);
200
+ // bug 2026-10-24: a message about a program carries the program rule (lib/program-chat.js), so the chat names the real press
201
+ else if (ProgramChat.isAsk(q)) msg = ProgramChat.wrap(q);
199
202
  const extra = goal ? { goal } : {};
200
203
  if (alive) {
201
204
  if (!sessions.type(live, msg)) return fail(409, 'The message did not reach the session. Open it in Sessions.');
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+ /* program-chat — what a chat knows about programs (bug 2026-10-24: "Set Project Ascent as Program" in Home chat).
3
+ * A program is the level above initiatives, across products (initiative program-hierarchy). It is a PMOS record in each workspace's
4
+ * <state>/programs.jsonl (lib/programs.js), not a key on an initiative record. Without this rule a chat looked for "a program marker", found
5
+ * none, and invented one (`kind: programme` in the initiative's front matter, children linked by `parent_programme`). Nothing reads those keys.
6
+ * When a message is about a program, the chat route types it into the session with this rule first, as lib/report-chat.js does for reports.
7
+ * Every program write is a page press (lib/routes-programs.js, pm-guard requirePagePress): the chat points the PM at the press and makes none. */
8
+
9
+ // The first line of every message PMOS wraps. The page reads it to show the PM's turn as typed (public/pm/goal-chat.js shownUser).
10
+ const MARK = '[PMOS program]';
11
+ const SAYS = 'The PM says: ';
12
+ // A message about a program (or programme). Other messages go to the session as typed.
13
+ const ASK_RE = /\bprogram(me)?s?\b/i;
14
+
15
+ const isAsk = (text) => ASK_RE.test(String(text == null ? '' : text)) && !String(text).trim().startsWith('/');
16
+
17
+ const RULE = [
18
+ 'PMOS has programs. A program is the level above initiatives (Program > Initiative > Epic) and can span products. It has no stages of its own: its state, products and stage spread come from its initiatives.',
19
+ 'A program is a record in programs.jsonl in a workspace state folder (pmos/state/ or the workspace state folder), one JSON line each: {"kind":"program",…} is the charter, {"kind":"member","program":"<id>","initiative":"<id>"} puts an initiative in it, and "leave", "task", "check" and "archive" lines follow the same pattern. A program id is its title in lower case with dashes, for example project-ascent.',
20
+ 'A program is NOT a key on an initiative. Never add kind, program, programme, parent_program or parent_programme to an initiative record or any front matter: nothing reads them.',
21
+ 'You never make, change, join, leave or archive a program yourself, and you never write programs.jsonl: the routes refuse an agent session, and the PM presses on the Board.',
22
+ 'Tell the PM which press does what they asked:',
23
+ '- An initiative becomes a program (for example "set X as a program"): on the Board, open the initiative, press ⋯, then Turn into a program. The initiative joins the new program, and the program panel opens with a card to sort its tasks.',
24
+ '- A new, empty program: on the Board, press + (New), then New program.',
25
+ '- To see a program: press its name on the Board, or open /premium-board.html?program=<id>.',
26
+ 'You can read programs.jsonl to answer a question about a program. If the PM asks you to sort a turned program\'s tasks into program, initiative or epic, propose a level for each task in a list and let the PM decide.',
27
+ ].join('\n');
28
+
29
+ /** The message as PMOS types it into the session: the rule, then the PM's words. */
30
+ function wrap(text) { return MARK + ' ' + RULE + '\n\n' + SAYS + String(text == null ? '' : text); }
31
+
32
+ module.exports = { MARK, isAsk, wrap, RULE };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.403.0",
3
+ "version": "0.404.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.403.0",
9
+ "version": "0.404.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.403.0",
3
+ "version": "0.404.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",
@@ -4,7 +4,8 @@
4
4
  *
5
5
  * mount(o) once, from premium-board.js. o: { M() the model, statusOf(r), fmt(iso), md(date), ago(iso), segHtml(r), barHtml(o),
6
6
  * grill(id) the open first questions, dayTitle(track) the current step's tooltip, rowOf(key), pageHref(r), askHref(r, q), refreshJira(), send(r) the Send to Jira sheet, acts(r, btn) the row
7
- * actions popover, grillOpen(r, btn), onShow(key, from) / onHide() so the page marks the row the item came from }
7
+ * actions popover, grillOpen(r, btn), onShow(key, from) / onHide() so the page marks the row the item came from,
8
+ * programOf(r) the program it is in or null, turnProgram(r) "Turn into a program" (POST /api/programs/turn) }
8
9
  * openIni(r, from) the initiative: the shell's header (icon, the title once, Discuss in chat, ⋯, open wide, close), the summary card with
9
10
  * its one primary, the stage bar, then the folding rows: the current output, drafted tickets, Jira against the PRD,
10
11
  * linked, and dates and trend
@@ -125,6 +126,8 @@ function iniMore(r) {
125
126
  const more = [];
126
127
  if (r.acts) more.push({ label: 'Move, hold, cancel or archive', on: (b) => O.acts(r, b) });
127
128
  if (r.id) more.push({ label: 'Change the plan dates', on: () => location.assign(O.askHref(r, 'Propose new start and end dates for ' + r.title)) });
129
+ // P7 (program-hierarchy PRD): an initiative in no program can become one; the chat cannot, because every program write is a page press
130
+ if (r.id && O.turnProgram && !(O.programOf && O.programOf(r))) more.push({ label: 'Turn into a program', on: () => O.turnProgram(r) });
128
131
  if ((O.M() || {}).jira) more.push({ sep: true }, { label: 'Read Jira again', on: () => O.refreshJira() });
129
132
  more.push({ sep: true });
130
133
  if (r.id) more.push({ label: 'Copy link', on: () => copyText(new URL(O.pageHref(r), location.href).href, 'Link copied.') });
@@ -39,7 +39,7 @@ export function shownUser(text) {
39
39
  const g = t.indexOf(MARK.grill + ' The PM set a goal: ');
40
40
  if (g >= 0) return '/goal ' + t.slice(g + (MARK.grill + ' The PM set a goal: ').length).split('\n')[0];
41
41
  if (t.startsWith(OPENING)) { const i = t.lastIndexOf('\nThe PM says: '); if (i >= 0) return t.slice(i + '\nThe PM says: '.length); }
42
- if (t.startsWith('[PMOS report]')) { const i = t.lastIndexOf('\nThe PM says: '); if (i >= 0) return t.slice(i + '\nThe PM says: '.length); } // premium-reports-from-chat: lib/report-chat.js wrap
42
+ if (t.startsWith('[PMOS report]') || t.startsWith('[PMOS program]')) { const i = t.lastIndexOf('\nThe PM says: '); if (i >= 0) return t.slice(i + '\nThe PM says: '.length); } // premium-reports-from-chat: lib/report-chat.js wrap; lib/program-chat.js wrap
43
43
  return t;
44
44
  }
45
45
 
@@ -459,6 +459,15 @@ const pageHref = (r) => { const ws = r.ws || M.board.ws, b = r.boardId || M.boar
459
459
  const TI = (r) => (r && r.trail) || null;
460
460
  /** The programs (GET /api/programs), then the rows of their initiatives in this board's other products, read once each, so a program's
461
461
  * readiness and its products count every product (its other products' initiatives are not drawn here: PRD decision 5). */
462
+ /** "Turn into a program" (P7): a charter named after the initiative, which joins it; then the program's panel opens, with its sort card. */
463
+ async function turnProgram(r) {
464
+ const res = await pmPost('/api/programs/turn', { ws: r.ws || M.board.ws || null, initiative: r.id, title: r.title }).catch(() => null);
465
+ if (!res || !res.ok || !res.program) { say((res && res.error) || 'The program was not made. Try again.'); return; }
466
+ closePanel();
467
+ await loadPrograms();
468
+ say('Now a program · ' + r.title + '.');
469
+ PG.openProgram(res.program.id);
470
+ }
462
471
  async function loadPrograms() {
463
472
  let r = null; try { r = await (await fetch('/api/programs', { credentials: 'same-origin' })).json(); } catch { r = null; }
464
473
  if (!r || !r.ok) return;
@@ -715,7 +724,8 @@ Acts.init({ M: () => M, load, say, panel: actsPanel, close: closePanel, redraw:
715
724
  grouping: () => ({ on: groupingOn(), byProduct }), setGrouping });
716
725
  BI.mount({ M: () => M, statusOf, dayTitle, fmt, md, ago, segHtml, barHtml: V.barHtml, grill: (id) => GR[id], rowOf, pageHref, askHref, refreshJira: () => refreshJira(), viewDoc,
717
726
  send: (r) => import('./tk-send.js').then((S) => S.openSend({ ws: r.ws || M.board.ws || null, board: r.boardId || M.board.id, initiative: r.id, toast: say })),
718
- acts: (r, b) => Acts.open.row(r, b), grillOpen: (r, b) => Asks.openGrill(r.id, r.title, (r.track && r.track.label) || 'Triage', false, b), onShow: iniShown, onHide: iniHidden });
727
+ acts: (r, b) => Acts.open.row(r, b), grillOpen: (r, b) => Asks.openGrill(r.id, r.title, (r.track && r.track.label) || 'Triage', false, b), onShow: iniShown, onHide: iniHidden,
728
+ programOf: (r) => programOf(PGS, r.ws || M.board.ws || '', r.id), turnProgram });
719
729
  setSay(say);
720
730
  PP.mount({ M: () => M, programs: () => PGS, openIni: (id, from) => openIni((M.rows || []).find((x) => x.id === id && x.track), from), close: closePanel, reload: loadPrograms, say }); // the program panel (PgProgram)
721
731
  setTab('ini');
@@ -0,0 +1,6 @@
1
+ {
2
+ "_comment": "Bug 2026-10-24 (Set Project Ascent as Program): the program rule a chat carries, and Turn into a program in the initiative's ⋯ (program-hierarchy P7).",
3
+ "modules": [
4
+ "program-chat.test.js"
5
+ ]
6
+ }