create-pmos 0.586.0 → 0.587.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.586.0",
3
+ "version": "0.587.0",
4
4
  "description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -33,6 +33,19 @@
33
33
  "audit"
34
34
  ],
35
35
  "pmosChanges": [
36
+ {
37
+ "v": "0.587.0",
38
+ "at": "2026-11-17T10:24:56.955Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1322,
43
+ "t": "The live round's compare view is always reachable: no early ✓, Specimens line opens it",
44
+ "s": "The live round's compare view is always reachable: no early ✓, Specimens line opens it",
45
+ "k": "fix"
46
+ }
47
+ ]
48
+ },
36
49
  {
37
50
  "v": "0.586.0",
38
51
  "at": "2026-11-17T09:31:31.443Z",
@@ -285,19 +298,6 @@
285
298
  "k": "new"
286
299
  }
287
300
  ]
288
- },
289
- {
290
- "v": "0.567.0",
291
- "at": "2026-11-12T04:54:34.259Z",
292
- "f": 4,
293
- "prs": [
294
- {
295
- "n": 1298,
296
- "t": "A refuted outcome reads at risk and files its next step under the ✦",
297
- "s": "A refuted outcome reads at risk and files its next step under the ✦",
298
- "k": "new"
299
- }
300
- ]
301
301
  }
302
302
  ]
303
303
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@528a0e89
1
+ kernel-source: pmos@8b05fc39
2
2
  assembled: 2026-11-17
3
3
  mode: vendor
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Eval calibration log"
4
4
  description: "Append-only record of every PM override of an evaluator verdict."
5
- generated: {by: process:create-pmos, at: "2026-11-17T09:31:28Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-17T10:24:53Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Health budgets"
4
4
  description: "Closed registry of health-budget anchors (D59), edited only by the PM."
5
- generated: {by: process:create-pmos, at: "2026-11-17T09:31:28Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-17T10:24:53Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Discoveries and friction log"
4
4
  description: "Append-only record of what runs discovered and where the process rubbed."
5
- generated: {by: process:create-pmos, at: "2026-11-17T09:31:28Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-17T10:24:53Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,17 @@
1
1
  [
2
+ {
3
+ "v": "0.587.0",
4
+ "at": "2026-11-17T10:24:56.955Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1322,
9
+ "t": "The live round's compare view is always reachable: no early ✓, Specimens line opens it",
10
+ "s": "The live round's compare view is always reachable: no early ✓, Specimens line opens it",
11
+ "k": "fix"
12
+ }
13
+ ]
14
+ },
2
15
  {
3
16
  "v": "0.586.0",
4
17
  "at": "2026-11-17T09:31:31.443Z",
@@ -195,9 +195,10 @@ Not proven yet: the compare view's Production and Design columns stay left out u
195
195
  You can ask to see an idea at any moment: alone while you work on an initiative, or with stakeholders in the room. You do not have to step away first.
196
196
 
197
197
  1. **Ask in the initiative's chat.** Say, for example, "show me 3 ways" or "prototype this". PMOS answers with one ✦ under the initiative: "PMOS will show 3 ways", with one line for each direction it chose. Nothing is made yet.
198
- 2. **Press ✓ on that ✦.** PMOS starts three runs at once, one version each. The card shows each version as soon as it opens and renders in a headless browser. A version that is still being made says so. A version that does not render, or that takes more than 2 minutes, shows as "not made" with the reason. A round took about a minute in the dry run on the Mac mini.
198
+ 2. **Press ✓ on that ✦.** PMOS starts three runs at once, one version each. The card shows each version as soon as it opens and renders in a headless browser. A version that is still being made says so. A version that does not render, or that takes more than 2 minutes, shows as "not made" with the reason. The card has no ✓ while a version is still being made. Once every version has landed, ✓ opens the compare view, and you keep one there. A round took about a minute in the dry run on the Mac mini.
199
199
  3. **Give feedback in one sentence.** For example, "B, but lead with the risk, fewer rows". PMOS files one ✦: "Round 2 of B: …". Its ✓ makes one new version of B, which reads the last one.
200
200
  4. **Compare and keep one.** Press a thumbnail to open the compare view. It shows A, B and C side by side, with each round in History. Press a column to pick it, then ✓ keeps that version as the initiative's kept specimen. ✕ drops a round, and you can say why.
201
+ 5. **Find it again.** The **Specimens** line of the Experiment card names every version of the newest round, for example "Round 1 · A, B, C are made · none kept yet". Press it to open the compare view, also for a round you kept or dropped.
201
202
 
202
203
  What each part does:
203
204
 
@@ -283,4 +283,20 @@ function compareOf(P, id, { key = '', titleOf = () => '', proven = PROVEN } = {}
283
283
  return { ini: p.ini, board: p.board || '', id: p.id, sig: PRsig(p), state: stateOf(p), title: name, round, key: k, say, columns: cols, pins, history, ...(live ? { live: true, working: (p.data.live.slots || []).some((s) => s.state === 'working' || s.state === 'proving') } : {}) };
284
284
  }
285
285
 
286
- module.exports = { LEDGER, GROUPS, TITLES, LOOSE, PROVEN, specimenDir, specimenPath, specimenUrl, result, loose, ledgerFile, readLines, read, append, fold, looseOpen, labOf, compareOf, fmtMs };
286
+ /** PURE. The initiative's prototype rounds, newest first, open or not: a kept or dropped round stays reachable from the initiative page
287
+ * (2026-11-17: a round kept too early left no way to its compare view). Each: { id, at, state, keys, made, rounds, working }. */
288
+ function roundsOf(P, ini) {
289
+ if (!P || !ini) return [];
290
+ const keptP = new Set(); for (const k of P.kept) if (!P.undone.has(k.batch)) for (const x of k.ids) keptP.add(x);
291
+ const PRsig = require('./proposals.js').sigOf;
292
+ const stateOf = (x) => (keptP.has(x.id) ? 'kept' : P.drops.has(PRsig(x)) ? 'dropped' : 'open');
293
+ const all = [...P.props.values()];
294
+ return all.filter((x) => x.group === 'prototyped' && x.ini === ini).sort((a, b) => String(b.at).localeCompare(String(a.at))).map((root) => {
295
+ const d = root.data || {}, slots = (d.live && d.live.slots) || [];
296
+ const keys = slots.length ? slots.filter((s) => s.state === 'ok' && s.file).map((s) => s.key) : (d.specimens || []).map((s) => s.key);
297
+ const n = 1 + all.filter((x) => x.group === 'improved' && x.ini === ini && x.data && x.data.of === root.id).length;
298
+ return { id: root.id, at: root.at, state: stateOf(root), keys, made: keys.length, rounds: n, working: slots.some((s) => s.state === 'working' || s.state === 'proving') };
299
+ });
300
+ }
301
+
302
+ module.exports = { LEDGER, GROUPS, TITLES, LOOSE, PROVEN, specimenDir, specimenPath, specimenUrl, result, loose, ledgerFile, readLines, read, append, fold, looseOpen, labOf, compareOf, roundsOf, fmtMs };
@@ -5,6 +5,7 @@
5
5
  *
6
6
  * GET /api/lab?ws&board → { ok, lab } lab: lib/idle-lab.js labOf (null: nothing ran this week and nothing waits)
7
7
  * GET /api/lab/compare?ws&board&id[&key] → { ok, compare } lib/idle-lab.js compareOf (404 when the prototype is gone)
8
+ * GET /api/lab/rounds?ws&initiative → { ok, rounds } lib/idle-lab.js roundsOf: every round of the initiative, newest first, open or not
8
9
  * GET /api/lab/present?ws&board&id → { ok, present } lib/lab-present.js presentOf: the round's frames for present mode (GET /pm/present)
9
10
  * GET /api/lab/specimen?file → text/html, a specimen from <runtime>/idle-lab/specimens/, served sandboxed (no scripts that can
10
11
  * reach PMOS: CSP sandbox without allow-same-origin, no network but the fonts)
@@ -116,6 +117,14 @@ const READS = {
116
117
  ctx.json(res, { ok: true, compare: c });
117
118
  return true;
118
119
  },
120
+ // the initiative page's Specimens line: every round, open or not, so a kept or dropped round can still open its compare view
121
+ '/api/lab/rounds': (ctx, res, url) => {
122
+ const w = wsOf(ctx, url.searchParams.get('ws')); if (!w) return fail(ctx, res, 404, 'no such workspace');
123
+ const dir = dirOf(ctx, w), ini = url.searchParams.get('initiative') || '';
124
+ if (!dir || !ID_RE.test(ini)) return fail(ctx, res, 400, 'initiative names an initiative');
125
+ ctx.json(res, { ok: true, rounds: LAB.roundsOf(PR.read(dir), ini) });
126
+ return true;
127
+ },
119
128
  '/api/lab/present': (ctx, res, url) => {
120
129
  const w = wsOf(ctx, url.searchParams.get('ws')); if (!w) return fail(ctx, res, 404, 'no such workspace');
121
130
  const dir = dirOf(ctx, w), id = url.searchParams.get('id') || '';
@@ -81,6 +81,7 @@ function keepCore(ctx, p, g, f, ini, want, choices = {}, extra = {}) {
81
81
  const w = applyOne(ctx, p, g, f, ini, x, choices, outbox);
82
82
  if (x.group === 'build' && !w.length) { failed.push({ id: x.id, why: x.failed || 'not opened' }); continue; } // stays open, says why
83
83
  if (x.group === 'live' && !w.length) { failed.push({ id: x.id, why: x.failed || 'the round did not start' }); continue; } // stays open, says why
84
+ if ((x.group === 'prototyped' || x.group === 'improved') && !w.length && x.failed) { failed.push({ id: x.id, why: x.failed }); continue; } // a round still being made stays open
84
85
  wrote.push(...w);
85
86
  if (x.group === 'dates' && x.plan && w.some((y) => y.op === 'dates')) plans++;
86
87
  keptIds.push(x.group === 'dates' ? x.id + ':' + x.sig : x.id);
@@ -307,6 +308,9 @@ function applyOne(ctx, p, g, f, ini, x, choices, outbox) {
307
308
  // experiment's kept specimen; then the grill runs once on it, as the Review step (D60 as amended 2026-11-17: grill after the session).
308
309
  const LAB = require('./idle-lab.js'), d = x.data || {}, name = (sp) => 'Prototype ' + sp.key + ' · ' + sp.title;
309
310
  const live = !!d.live, pick = live && choices && typeof choices[x.id] === 'string' ? choices[x.id] : '';
311
+ // a round still being made cannot be kept: the card stays open and says so (2026-11-17: a second ✓ on the fresh round card kept
312
+ // nothing and closed it 20 s before the three versions landed)
313
+ if (live && (d.live.slots || []).some((y) => y.state === 'working' || y.state === 'proving')) { x.failed = 'PMOS is still making this round. ✓ comes back when every version has landed.'; return wrote; }
310
314
  const docOf = (title, ref, kind) => add({ op: 'doc', id: 'fd-' + PR.hash(ini + '|' + x.id + '|' + (ref || title)), title: String(title).slice(0, 140), source: live ? 'PMOS, live round' : 'PMOS, while you were away', at: x.at || '', ref, kind, claude: true });
311
315
  const keptOnes = [];
312
316
  if (x.group === 'prototyped') for (const sp of (d.specimens || []).filter((y) => !pick || y.key === pick)) { docOf(name(sp), LAB.specimenUrl(sp.file), 'prototype'); keptOnes.push({ key: sp.key, title: sp.title, file: sp.file }); }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.586.0",
3
+ "version": "0.587.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.586.0",
9
+ "version": "0.587.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@anthropic-ai/sdk": "^1.3.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.586.0",
3
+ "version": "0.587.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",
@@ -60,8 +60,12 @@ function srcLine(p) {
60
60
  /** The ✦ card. why: the ✕ was pressed, so the card asks why before it drops. */
61
61
  export function cardHtml(p, { why = false } = {}) {
62
62
  const d = p.data || {}, id = esc(p.id);
63
+ // a live round still being made has no ✓: the round card takes the ask's place with ✓ in the same spot, and on 2026-11-17 a second
64
+ // tap kept an unfinished round and closed the card (the server refuses the same keep). ✓ returns when every version has landed.
65
+ const making = !!(d.live && (d.live.slots || []).some((x) => x.state === 'working' || x.state === 'proving'));
63
66
  const acts = (p.group !== 'scanned' ? ib(`data-lab-open="${id}"`, 'Compare it with production and the design', I.open) : '')
64
- + ib(`data-lab-why="${id}" aria-expanded="${why}"`, 'Drop it', I.x) + ib(`data-pp-keep="${id}"`, 'Keep it', I.check, 'ok');
67
+ + ib(`data-lab-why="${id}" aria-expanded="${why}"`, 'Drop it', I.x)
68
+ + (making ? '' : d.live ? ib(`data-lab-open="${id}"`, 'Keep one: open the compare view and pick it there', I.check, 'ok') : ib(`data-pp-keep="${id}"`, 'Keep it', I.check, 'ok'));
65
69
  let head = '', body = '';
66
70
  if (p.group === 'live') {
67
71
  // the live round's ask: ✓ starts it, ✕ asks why first. Nothing is made before ✓.
@@ -79,7 +79,22 @@ const one = (a, f) => { const v = a && a.fields && a.fields[f]; return v && !Arr
79
79
  const list = (a, f) => { const v = a && a.fields && a.fields[f]; return Array.isArray(v) ? v.filter((x) => x && x.text) : []; };
80
80
  const carried = (a, f) => ((a && a.carried) || []).filter((c) => c.field === f && c.text);
81
81
 
82
- /** The Viewer's model. art: GET /api/artefacts answer for scope experiment:<id>; auto: GET /api/autonomy answer; o: { now }. */
82
+ /** The Specimens row. rounds: GET /api/lab/rounds (newest first, open or not). With a round, the row names every version that landed and opens
83
+ * the compare view (lab: the round's id), so a round kept or closed too early stays reachable (2026-11-17). Without one, the artefact's words. */
84
+ function specimensRow(kept, tries, rounds) {
85
+ const R = Array.isArray(rounds) && rounds.length ? rounds[0] : null;
86
+ if (R && (R.keys.length || R.working)) {
87
+ const made = R.keys.length ? R.keys.join(', ') + (R.keys.length === 1 ? ' is made' : ' are made') : 'none made yet';
88
+ const n = rounds.length > 1 ? rounds.length + ' rounds' : R.rounds > 1 ? R.rounds + ' rounds' : 'Round 1';
89
+ const text = n + ' · ' + made + (R.working ? ', more on the way' : '') + (kept ? ' · kept: ' + kept.text : R.state === 'kept' ? ' · you kept this round' : R.state === 'dropped' ? ' · you dropped this round' : ' · none kept yet');
90
+ return { key: 'specimens', label: 'Specimens', text, by: (kept && kept.by) || '', at: (kept && kept.at) || R.at || '', edit: null, lab: R.id };
91
+ }
92
+ if (kept) return { key: 'specimens', label: 'Specimens', text: 'Kept: ' + kept.text + (tries.length > 1 ? ' (of ' + tries.length + ' attempts)' : ''), by: kept.by || '', at: kept.at || '', edit: null };
93
+ if (tries.length) return { key: 'specimens', label: 'Specimens', text: tries.length + (tries.length === 1 ? ' attempt' : ' attempts') + ', none kept yet: ' + tries[tries.length - 1].text, by: '', at: tries[tries.length - 1].at || '', edit: null };
94
+ return null;
95
+ }
96
+
97
+ /** The Viewer's model. art: GET /api/artefacts answer for scope experiment:<id>; auto: GET /api/autonomy answer; o: { now, ahead, rounds }. */
83
98
  export function agentModel(A, U, id, o = {}) {
84
99
  const now = o.now || Date.now();
85
100
  const X = art(A, 'experiment'), S = art(A, 'specimens'), T = art(A, 'done-test');
@@ -92,8 +107,7 @@ export function agentModel(A, U, id, o = {}) {
92
107
  row('kill', 'Stop if', kill, { artefact: 'experiment', field: 'kill' }),
93
108
  row('budget', 'Budget', budget, { artefact: 'experiment', field: 'budget' }),
94
109
  ex ? { key: 'executor', label: 'Who builds', text: whoText(ex.text, factory), value: ex.text, by: ex.by || '', at: ex.at || '', edit: { artefact: 'experiment', field: 'executor', pick: picks(factory, ex.text) } } : null,
95
- kept ? row('specimens', 'Specimens', { ...kept, text: 'Kept: ' + kept.text + (tries.length > 1 ? ' (of ' + tries.length + ' attempts)' : '') })
96
- : tries.length ? row('specimens', 'Specimens', { text: tries.length + (tries.length === 1 ? ' attempt' : ' attempts') + ', none kept yet: ' + tries[tries.length - 1].text, at: tries[tries.length - 1].at }) : null,
110
+ specimensRow(kept, tries, o.rounds),
97
111
  checks.length ? { key: 'done', label: 'Done when', text: checks.map((c) => c.text).join(' · '), sub: result ? 'Result: ' + result.text : '', at: checks[checks.length - 1].at || '', edit: null } : null,
98
112
  ].filter(Boolean);
99
113
  // the newest line Claude wrote dates the section: "Claude keeps it · 3 Nov"
@@ -169,6 +183,7 @@ export function expHtml(M, kind) {
169
183
  const rowHtml = (r) => {
170
184
  const val = `<span class="ia-v">${esc(r.text)}${r.sub ? `<small>${esc(r.sub)}</small>` : ''}</span>`;
171
185
  return r.edit ? `<button type="button" class="ia-xr" data-ia-edit="${esc(r.key)}" aria-label="${esc(r.label + ': ' + r.text + '. Edit')}" title="Edit"><b>${esc(r.label)}</b>${val}</button>`
186
+ : r.lab ? `<button type="button" class="ia-xr" data-ia-lab="${esc(r.lab)}" aria-label="${esc(r.label + ': ' + r.text + '. Open the compare view')}" title="Open the compare view"><b>${esc(r.label)}</b>${val}</button>`
172
187
  : `<div class="ia-xr"><b>${esc(r.label)}</b>${val}</div>`;
173
188
  };
174
189
  return `<section class="ia-sec" aria-label="Experiment" data-ia-exp><div class="ia-th"><b>Experiment</b><span class="n"><b>${esc(KIND[k])}</b>${esc(' · PMOS wrote it' + (M.exp.at ? ' · ' + dm(M.exp.at) : ''))}</span></div>`
@@ -223,9 +238,10 @@ export function want(ws, id, done, title) {
223
238
  const q = ws ? 'ws=' + encodeURIComponent(ws) + '&' : '';
224
239
  const p = Promise.all([pmGet('/api/artefacts?' + q + 'scope=' + encodeURIComponent('experiment:' + id)).catch(() => null), pmGet('/api/autonomy' + (ws ? '?ws=' + encodeURIComponent(ws) : '')).catch(() => null),
225
240
  pmGet('/api/autonomy/ahead?' + q + 'ini=' + encodeURIComponent(id) + (title ? '&title=' + encodeURIComponent(title) : '')).catch(() => null),
226
- pmGet('/api/kind-control?' + q + 'ini=' + encodeURIComponent(id)).catch(() => null)])
227
- .then(([a, u, h, k]) => {
228
- const M = agentModel(a && a.ok ? a : null, u && u.ok ? u : null, id, { ahead: h && h.ok ? h : null });
241
+ pmGet('/api/kind-control?' + q + 'ini=' + encodeURIComponent(id)).catch(() => null),
242
+ pmGet('/api/lab/rounds?' + q + 'initiative=' + encodeURIComponent(id)).catch(() => null)])
243
+ .then(([a, u, h, k, r]) => {
244
+ const M = agentModel(a && a.ok ? a : null, u && u.ok ? u : null, id, { ahead: h && h.ok ? h : null, rounds: r && r.ok ? r.rounds : null });
229
245
  const C = k && k.ok && k.kind !== 'product' ? k : null;
230
246
  const was = JSON.stringify([cached(id), cachedControl(id)]);
231
247
  CACHE.set(id, { M, C, at: Date.now() });
@@ -483,6 +483,8 @@ export function wireView(body, h) {
483
483
  const d = b.dataset;
484
484
  // agent-run (AwB): edit a line of the experiment, Undo a change of Claude's, the rest of Claude's work
485
485
  if (d.iaEdit) { e.preventDefault(); IA.edit(b); return; }
486
+ // the Specimens line opens the newest round's compare view, kept or not (2026-11-17: a round kept too early had no way back)
487
+ if (d.iaLab) { e.preventDefault(); import('./cozy-lab.js').then((LC) => LC.openCompare({ where: { ws: wsOf(), board: (H.where && H.where().board) || '' }, id: d.iaLab, H: { toast: (body.__iv || {}).toast, reload: () => { IA.forget(id); IA.want(wsOf(), id, () => paintAgent(id)); } } })); return; }
486
488
  if ('iaCancel' in d) { e.preventDefault(); paintAgent(id); return; }
487
489
  if (d.iaUndo) { e.preventDefault(); IA.undo(b, wsOf(), () => paintAgent(id), H.toast); return; }
488
490
  if ('iaMore' in d) { e.preventDefault(); IA.toggleMore(id); paintAgent(id); return; }