create-pmos 0.593.0 → 0.594.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.593.0",
3
+ "version": "0.594.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.594.0",
38
+ "at": "2026-11-18T02:08:44.140Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1335,
43
+ "t": "Continue the PM's kept prototype and show it under Prototype & design",
44
+ "s": "Continue the PM's kept prototype and show it under Prototype & design",
45
+ "k": "fix"
46
+ }
47
+ ]
48
+ },
36
49
  {
37
50
  "v": "0.593.0",
38
51
  "at": "2026-11-18T01:08:15.346Z",
@@ -285,19 +298,6 @@
285
298
  "k": "new"
286
299
  }
287
300
  ]
288
- },
289
- {
290
- "v": "0.574.0",
291
- "at": "2026-11-16T06:14:05.146Z",
292
- "f": 4,
293
- "prs": [
294
- {
295
- "n": 1306,
296
- "t": "The phone chat's composer and menu button stay in place after touch scrolling",
297
- "s": "The phone chat's composer and menu button stay in place after touch scrolling",
298
- "k": "fix"
299
- }
300
- ]
301
301
  }
302
302
  ]
303
303
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@a59cfcc4
1
+ kernel-source: pmos@accc257a
2
2
  assembled: 2026-11-18
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-18T01:08:11Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-18T02:08:41Z"}
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-18T01:08:11Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-18T02:08:41Z"}
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-18T01:08:11Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-18T02:08:41Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,17 @@
1
1
  [
2
+ {
3
+ "v": "0.594.0",
4
+ "at": "2026-11-18T02:08:44.140Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1335,
9
+ "t": "Continue the PM's kept prototype and show it under Prototype & design",
10
+ "s": "Continue the PM's kept prototype and show it under Prototype & design",
11
+ "k": "fix"
12
+ }
13
+ ]
14
+ },
2
15
  {
3
16
  "v": "0.593.0",
4
17
  "at": "2026-11-18T01:08:15.346Z",
@@ -206,8 +206,8 @@ You can ask to see an idea at any moment: alone while you work on an initiative,
206
206
  6. **Draw or attach an image.** Press Draw (D), sketch over the prototype, then attach the sketch. It goes with your next message. An image you attach does the same. PMOS builds from it (its layout, hierarchy and colours) unless your words say otherwise, for example "only the colours".
207
207
  7. **Play.** Press Play to run the prototype full size through a scenario of the flow. Tap where the user would tap. A tap that misses shows where to tap. Restart and Close are above it. Ask in the chat for another scenario.
208
208
  8. **Several versions only when you ask.** Say "show me 3 ways" (or "two options"). PMOS picks that many directions and shows them in a tray. Tap one to preview it, then keep it (✓) or close the tray (✕).
209
- 9. **The initiative's prototype.** The newest version made from the chat is the initiative's prototype: the **Prototype** document of the initiative and the kept specimen on its Experiment card. Your edits in the Viewer are part of that version. Earlier versions stay in ‹ ›. PMOS never keeps a round by itself. A round of several ways, or one started from a terminal (a test), becomes the prototype only when you keep it with ✓ in the Viewer; the grill then runs once on it. ✕ drops a round, and you can say why.
210
- 10. **The chat knows the prototype.** Every message in the initiative's chat tells PMOS which version is current, where its files are, and the one command that makes the next version. So "Improve the prototype based on the PRD" or "Rebuild A from this list" makes the next version in the Viewer. The chat never writes a loose HTML file.
209
+ 9. **The initiative's prototype.** The newest version made from the chat is the initiative's prototype. It is the one entry under **Prototype & design** on the initiative page (above Documents), and the **Prototype** line on its Experiment card. Both open it in the Viewer. Older rounds stay in the Viewer's history, not on the page. Your edits in the Viewer are part of that version. Earlier versions stay in ‹ ›. PMOS never keeps a round by itself. A round of several ways, or one started from a terminal (a test), becomes the prototype only when you keep it with ✓ in the Viewer; the grill then runs once on it. ✕ drops a round, and you can say why.
210
+ 10. **The chat knows the prototype.** Every message in the initiative's chat tells PMOS which version is current, where its files are, and the one command that makes the next version. So "Improve the prototype based on the PRD" or "Rebuild A from this list" makes the next version in the Viewer. When no version is current yet, the chat gets the list of recent versions with the command to continue each one (`--of <round>`), and asks you which one if it is not clear. The chat never writes a loose HTML file.
211
211
 
212
212
  What each part does:
213
213
 
@@ -231,7 +231,7 @@ The idle lab run uses only the first three commands:
231
231
  - `pmos lab page <url>`: a scan run reads one public page. PMOS refuses a private or local address and keeps the page text, so a quote can be checked.
232
232
  - `pmos lab file <group> --json -`: a run files one result. It waits until the run ends and the proof passes.
233
233
  - `pmos lab status`: in a run, what it filed. Outside a run, this month's idle lab runs and spend.
234
- - `pmos lab round <initiative> --brief "<what to show>" [--one] [--base B] [--dirs "A: …|B: …|C: …"] [--propose] [--chat] [--ws <id>]`: a live round. With `--one`, PMOS makes one version with its flow, swimlane and copy, and shows it on the Viewer's canvas as soon as it renders; without it, PMOS starts three runs at once, one version each, side by side. With `--base B`, PMOS makes one new round of B from the brief. With `--propose`, PMOS files the ✦ ask instead, and your ✓ starts it. With `--chat`, the initiative chat started it: the chat is told when the version renders, and the version becomes the initiative's prototype (a round from a terminal without it waits for your ✓). A background lab run cannot use this command. See [The live round](agent-capabilities.md).
234
+ - `pmos lab round <initiative> --brief "<what to show>" [--one] [--base B] [--dirs "A: …|B: …|C: …"] [--of <round> [--from n]] [--propose] [--chat] [--ws <id>]`: a live round. With `--one`, PMOS makes one version with its flow, swimlane and copy, and shows it on the Viewer's canvas as soon as it renders; without it, PMOS starts three runs at once, one version each, side by side. With `--base B`, PMOS makes one new round of B from the brief: of the current prototype, or of the round that `--of` names (and its version n with `--from n`). With `--propose`, PMOS files the ✦ ask instead, and your ✓ starts it. With `--chat`, the initiative chat started it: the chat is told when the version renders, and the version becomes the initiative's prototype (a round from a terminal without it waits for your ✓). A background lab run cannot use this command. See [The live round](agent-capabilities.md).
235
235
 
236
236
  ### pmos outcomes: expected outcomes
237
237
 
@@ -30,7 +30,7 @@ const USAGE = [
30
30
  ' pmos lab file scanned --json - { "title", "why", "claims": [{ "text", "sources": [{ "page": 1, "line": 12, "quote": "<words on that line>" }] }], "refreshed"? }',
31
31
  ' pmos lab file scan --json - the same, for a finding that fits no initiative',
32
32
  ' pmos lab status',
33
- ' pmos lab round <initiative> --brief "<what to show>" [--one] [--base B] [--dirs "A: …|B: …|C: …"] [--propose] [--chat] [--ws <id>]',
33
+ ' pmos lab round <initiative> --brief "<what to show>" [--one] [--base B] [--dirs "A: …|B: …|C: …"] [--propose] [--chat] [--of <round> [--from n]] [--ws <id>]',
34
34
  ' the live round: three versions now (--one: one, with its flow, swimlane and copy; --base B: the next',
35
35
  ' version of B from the brief), each shown as soon as it renders. --propose files the ✦ ask instead',
36
36
  'A specimen must open and render; every claim must quote what was read. What is not proven is dropped. Nothing is sent.',
@@ -139,7 +139,7 @@ async function run(argv, { say = (s) => console.log(s), env = process.env, stdin
139
139
  if (base !== undefined && !/^[A-C]$/i.test(String(base))) { say('✗ --base is the key of the version to improve: A, B or C'); return 2; }
140
140
  if (typeof call !== 'function') { say('✗ no PMOS server answers: start PMOS, then ask again'); return 1; }
141
141
  let by = ''; try { by = require('./actor.js').fromCli({ env }).by || ''; } catch { by = ''; }
142
- const body = { ini, brief: brief.trim(), ...(base ? { base: String(base).toUpperCase() } : {}), ...(typeof dirs === 'string' ? { dirs } : {}), ...(typeof ws === 'string' ? { ws } : {}), ...(typeof board === 'string' ? { board } : {}), ...(flag(args, 'propose') ? { propose: true } : {}), ...(flag(args, 'one') ? { one: true } : {}), ...(flag(args, 'chat') ? { from: 'chat' } : {}), ...(by ? { by } : {}) };
142
+ const body = { ini, brief: brief.trim(), ...(base ? { base: String(base).toUpperCase() } : {}), ...(typeof dirs === 'string' ? { dirs } : {}), ...(typeof ws === 'string' ? { ws } : {}), ...(typeof board === 'string' ? { board } : {}), ...(flag(args, 'propose') ? { propose: true } : {}), ...(flag(args, 'one') ? { one: true } : {}), ...(flag(args, 'chat') ? { from: 'chat' } : {}), ...(typeof flag(args, 'of') === 'string' ? { of: flag(args, 'of') } : {}), ...(typeof flag(args, 'from') === 'string' ? { fromV: Number(flag(args, 'from')) || undefined } : {}), ...(by ? { by } : {}) };
143
143
  let r = null; try { r = await call('POST', '/api/lab/round', body); } catch { r = null; }
144
144
  if (!r) { say('✗ no PMOS server answers: start PMOS, then ask again'); return 1; }
145
145
  if (!r.ok) { say('✗ ' + (r.error || 'the round did not start')); return 1; }
@@ -42,7 +42,7 @@
42
42
  * first round's versions that rendered, the ones a feedback sentence may name)
43
43
  * baseOf(P, ini, key, { from?, of? }) PURE → { of, round, file, title } | null what a feedback round on `key` builds on (start: the
44
44
  * current version, lib/proposals.js currentOf, unless the PM said Continue from version n)
45
- * contextOf(cur, { ini, ws, rt }) PURE → the line the initiative chat's agent reads before every message while a prototype exists: the
45
+ * contextOf(cur, { ini, ws, rt, versions }) PURE → the line the initiative chat's agent reads before every message while a prototype exists: the
46
46
  * version, its folder and files, and the one command that makes the next version (never a loose HTML file)
47
47
  * promptOf(o) PURE · scaffoldOf(roots) → { css, from }
48
48
  * create(deps) → { start(input), propose(input), cancel(id, why), running(ini), status() } and the module-level shortcuts below,
@@ -92,7 +92,7 @@ const FEEDBACK_RE = /^\s*(?:(?:take|keep|go with|try|use|make)\s+)?([A-C])(?:\s*
92
92
  const CHANGE_RE = /^\s*(?:please\s+|can you\s+|could you\s+|now\s+)?(change|make|add|drop|remove|move|put|use|try|lead|swap|replace|turn|show|hide|fewer|more|less|bigger|smaller|larger|instead|but|also|without|with|give|start|end|rename|call|colou?r|shorten|simplify|keep|take out|bring|flip|split|merge|stack|sort|group|open|close|round|tighten|loosen|lighten|darken|center|centre|align)\b/i;
93
93
  // 2026-11-18 ("Improve the prototype based on the PRD" got "I can't find the rendered files"): a word that asks for work on what is there counts
94
94
  // as a change of the prototype when the sentence names it (the prototype, a version, a screen, the layout, the design, or its letter)
95
- const WORK_RE = /^\s*(?:please\s+|can you\s+|could you\s+|now\s+|ok(?:ay)?,?\s+|yes,?\s+)?(improve|update|refine|rework|redo|rebuild|redesign|restyle|polish|fix|adjust|tweak|iterate( on)?|apply|continue|cover|base|follow|align|write)\b/i;
95
+ const WORK_RE = /^\s*(?:please\s+|can you\s+|could you\s+|now\s+|ok(?:ay)?,?\s+|yes,?\s+)?(improv|updat|refin|rework|redo|rebuild|redesign|restyl|polish|fix|adjust|tweak|iterat|apply|continu|cover|base|follow|align|writ)\w*/i;
96
96
  const PROTO_NOUN_RE = /\b(prototype|version|screens?|page|layout|design|mock ?up|ui|viewer|canvas|flow|swimlane|copy)\b/i;
97
97
  const COUNT_RE = /\b(\d|two|three|a few|some|(?:a )?couple of)\s+(ways|options|versions|takes|directions|variants)\b/i;
98
98
  const WORDS = { two: 2, three: 3, 'a few': 3, some: 3, 'couple of': 2, 'a couple of': 2 };
@@ -379,15 +379,25 @@ function saidOf(abs) {
379
379
  * currentOf; rt: the runtime folder). 2026-11-18: asked to "Improve the prototype based on the PRD", the chat found no files and asked the
380
380
  * PM for a path; asked to "Rebuild A", it tried the idle lab's `pmos lab file` and wrote a loose a2.html in its scratchpad instead of a
381
381
  * version in the Viewer. → '' when there is no prototype. */
382
- function contextOf(cur, { ini, ws = '', rt = null } = {}) {
383
- if (!cur || !cur.file || !ini) return '';
384
- const abs = (rt && LAB.specimenPath(rt, cur.file)) || cur.file, dir = path.dirname(abs);
382
+ function contextOf(cur, { ini, ws = '', rt = null, versions = [] } = {}) {
383
+ if (!ini) return '';
385
384
  const wsf = ws ? ` --ws ${ws}` : '';
385
+ const never = 'Never write the prototype yourself, never write an HTML file in the repository, a scratchpad or elsewhere, and never use `pmos lab file`: that is for the background lab only.';
386
+ if (!cur || !cur.file) {
387
+ // no version is the prototype yet: list what exists, so "improve the prototype" continues the one the PM means, never a new file
388
+ const vs = (versions || []).filter((v) => v && v.file).slice(0, 6);
389
+ if (!vs.length) return '';
390
+ const at = (v) => { const a = (rt && LAB.specimenPath(rt, v.file)) || v.file; return path.dirname(a); };
391
+ const lines = vs.map((v, i) => `${i + 1}. ${v.n > 1 ? 'Version ' + v.n + ' of ' + v.key : v.key + (v.ways > 1 ? ' (one of ' + v.ways + ' ways)' : '')}${v.from === 'cli' ? ', started from a terminal (often a test)' : ''}: "${one(v.said || v.title, 120)}", asked as "${one(v.brief, 160)}". Files: ${at(v)}. Continue it with --base ${v.key} --of ${v.of}${v.n > 1 ? ' --from ' + v.n : ''}`);
392
+ return `[PMOS] This initiative has prototype versions in the Viewer, but the PM has not chosen one yet:\n${lines.join('\n')}\n`
393
+ + `To change, improve or rebuild the prototype, in any words, pick the version the PM means (read its files and the brief; when the PM names a document such as the PRD, the one built from it), then run exactly: \`pmos lab round ${ini}${wsf} --base <letter> --of <round> [--from <n>] --chat --brief "<what to change, under 600 characters>"\` `
394
+ + 'and say in one line which version you continue and what will change. If you cannot tell which one, ask the PM in one line, naming two at most. ' + never;
395
+ }
396
+ const abs = (rt && LAB.specimenPath(rt, cur.file)) || cur.file, dir = path.dirname(abs);
386
397
  return `[PMOS] This initiative's prototype is Version ${cur.n} (${cur.key}${cur.said ? ': "' + one(cur.said, 140) + '"' : ''}), open in the Viewer beside this chat. `
387
398
  + `Its files are in ${dir}: ${path.basename(abs)} (the prototype), flow.json, lanes.json, copy.json, tweaks.json, and edits.json (the PM's own edits in the Viewer). Read them to answer questions about it. `
388
399
  + `To change, improve or rebuild it, in any words, run exactly: \`pmos lab round ${ini}${wsf} --base ${cur.key} --chat --brief "<what to change, with the PM's words and anything you read, under 600 characters>"\` `
389
- + `and say in one line what will change: PMOS makes Version ${cur.n + 1} in about a minute and tells you when it is in the Viewer. `
390
- + 'Never write the prototype yourself, never write an HTML file in a scratchpad or elsewhere, and never use `pmos lab file`: that is for the background lab only.';
400
+ + `and say in one line what will change: PMOS makes Version ${cur.n + 1} in about a minute and tells you when it is in the Viewer. ` + never;
391
401
  }
392
402
 
393
403
  /* ── the proposal line of a round ── */
@@ -481,8 +491,9 @@ function create(deps) {
481
491
  if (input.base) {
482
492
  base = String(input.base).toUpperCase();
483
493
  // the version the initiative is at now (lib/proposals.js currentOf), unless the PM said Continue from version n
484
- const cur = fromV ? null : PR.currentOf(P, c.ini);
485
- b = cur && cur.key === base ? baseOf(P, c.ini, base, { from: cur.n, of: cur.of }) : baseOf(P, c.ini, base, { from: fromV });
494
+ const cur = fromV || input.of ? null : PR.currentOf(P, c.ini);
495
+ b = cur && cur.key === base ? baseOf(P, c.ini, base, { from: cur.n, of: cur.of }) : baseOf(P, c.ini, base, { from: fromV, of: str(input.of) });
496
+ if (b && input.of && b.of !== input.of) b = null; // the round named is not on this initiative, or has no version ${base}
486
497
  if (!b) return { ok: false, error: `there is no proven version ${base} on this initiative yet: ask for a first one` };
487
498
  dirs = [{ key: base, title: b.title }];
488
499
  } else {
@@ -332,15 +332,33 @@ function currentOf(F, ini) {
332
332
  }
333
333
  for (const k of F.kept || []) {
334
334
  if (k.ini !== ini || (F.undone && F.undone.has(k.batch)) || k.by === 'agent:auto') continue;
335
+ const files = [];
335
336
  for (const w of k.wrote) {
336
337
  if (w.op !== 'doc' || w.kind !== 'prototype' || !/[?&]file=/.test(str(w.ref))) continue;
337
- let file = ''; try { file = decodeURIComponent(str(w.ref).split(/[?&]file=/)[1].split('&')[0]); } catch { file = ''; }
338
- for (const id of k.ids) { const p = F.props.get(String(id)); const c = live(p) ? of(p, file, k.at) : null; if (c) out.push(c); }
338
+ try { files.push(decodeURIComponent(str(w.ref).split(/[?&]file=/)[1].split('&')[0])); } catch { /* not a specimen link */ }
339
339
  }
340
+ // a keep that wrote no document (2026-11-18: a ✓ on a round of three kept nothing) keeps the round's first version
341
+ for (const id of k.ids) { const p = F.props.get(String(id)); if (!live(p)) continue; for (const file of files.length ? files : ['']) { const c = of(p, file, k.at); if (c) out.push(c); } }
340
342
  }
341
343
  out.sort((a, b) => String(b.at).localeCompare(String(a.at)));
342
344
  return out[0] || null;
343
345
  }
346
+ /** PURE. Every proven version of the live rounds on `ini`, newest first, at most n: { of (the round's first proposal), key, n, file, said,
347
+ * title, brief, from, ways (how many versions its round made), at }. The chat lists them when no version is the prototype yet, so it
348
+ * can continue the one the PM means (2026-11-18: the PRD round had three ways and none kept; the chat built a new one instead). */
349
+ function versionsOf(F, ini, n = 6) {
350
+ if (!F || !F.props) return [];
351
+ const out = [];
352
+ for (const p of F.props.values()) {
353
+ const d = p.data || {};
354
+ if (p.ini !== ini || !isObj(d.live)) continue;
355
+ const from = str(d.live.from), ways = (d.live.slots || []).length || 1;
356
+ if (p.group === 'prototyped') for (const s of Array.isArray(d.specimens) ? d.specimens : []) { if (isObj(s) && str(s.file)) out.push({ of: p.id, key: str(s.key), n: 1, file: s.file, said: str(s.caption), title: str(s.title), brief: str(d.live.brief), from, ways, at: p.at }); }
357
+ else if (p.group === 'improved' && str(d.file)) out.push({ of: str(d.of), key: str(d.base), n: Number(d.round) || 2, file: d.file, said: str(d.said), title: '', brief: str(d.changed), from, ways: 1, at: p.at });
358
+ }
359
+ out.sort((a, b) => String(b.at).localeCompare(String(a.at)) || a.key.localeCompare(b.key));
360
+ return out.slice(0, n);
361
+ }
344
362
  /** What was kept that has no other store: the found documents, the Linked entries and the dates past stages ran. */
345
363
  function foundOf(F, ini) {
346
364
  const docs = [], linked = [], ran = {};
@@ -355,7 +373,7 @@ function foundOf(F, ini) {
355
373
  }
356
374
  // the initiative's prototype is the version it is at now, never an older round someone kept (2026-11-18)
357
375
  const cur = currentOf(F, ini);
358
- if (cur) docs.push({ id: 'fd-proto-' + hash(ini), title: one(`Prototype · Version ${cur.n}${cur.said || cur.title ? ': ' + (cur.said || cur.title) : ''}`, 140), source: 'PMOS, live round', at: cur.at, ref: '/api/lab/specimen?file=' + encodeURIComponent(cur.file), kind: 'prototype', claude: true, version: cur.n });
376
+ if (cur) docs.push({ id: 'fd-proto-' + hash(ini), title: one(`Prototype · Version ${cur.n}${cur.said || cur.title ? ': ' + (cur.said || cur.title) : ''}`, 140), source: 'PMOS, live round', at: cur.at, ref: '/api/lab/specimen?file=' + encodeURIComponent(cur.file), kind: 'prototype', claude: true, version: cur.n, round: cur.id });
359
377
  docs.sort((a, b) => String(b.at).localeCompare(String(a.at)));
360
378
  return docs.length || linked.length || Object.keys(ran).length ? { docs, linked, ran } : null;
361
379
  }
@@ -548,5 +566,5 @@ function decorate(rows, F, items, o = {}) {
548
566
 
549
567
  module.exports = {
550
568
  LEDGER, GROUPS, TYPES, SOURCES, SOURCE_NAMES, RISK_DAYS, ledgerFile, read, readLines, append, fold, lessonsOf, clean, idOf, sigOf, itemSig, factsOf, tidyName, taskOf, lateOf,
551
- datesOf, viewOf, foundOf, currentOf, historyOf, decorate, keptIds, newBatch, dn, isoN, md, hash, workday, staleOf, expiredSince, EXPIRE_DAYS, EXPIRE_WHY,
569
+ datesOf, viewOf, foundOf, currentOf, versionsOf, historyOf, decorate, keptIds, newBatch, dn, isoN, md, hash, workday, staleOf, expiredSince, EXPIRE_DAYS, EXPIRE_WHY,
552
570
  };
@@ -85,7 +85,7 @@ function liveAsk(ctx, key, text, wsId, refs = []) {
85
85
  const cur = P ? PR.currentOf(P, ini) : null, open = P ? LR.waiting(P, ini) : null;
86
86
  const it = LR.intentOf(q, { waiting: open || (cur ? { keys: [cur.key] } : null) });
87
87
  // every other message on an initiative with a prototype carries where it is and how to change it, so the chat never hunts for files
88
- const ctxLine = cur && w ? LR.contextOf(cur, { ini, ws: w.id, rt: ctx.runtimeDir || null }) : '';
88
+ const ctxLine = P && w ? LR.contextOf(cur, { ini, ws: w.id, rt: ctx.runtimeDir || null, versions: cur ? [] : PR.versionsOf(P, ini) }) : '';
89
89
  if (!it || !w) return ctxLine ? { text: ctxLine + '\n\nThe PM says: ' + q, filed: false } : null;
90
90
  // Wawan 2026-11-17 20:25, "iterative, like Claude Code design work": the round starts at once, no ✦ ask and no ✓. One version unless the
91
91
  // PM asked for several; a change sentence while one is open is its next round. The Viewer shows it; the chat says what changed.
@@ -5,7 +5,8 @@
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
+ * GET /api/lab/rounds?ws&initiative → { ok, rounds } lib/idle-lab.js roundsOf: every round of the initiative, newest first, open or not;
9
+ * the round of the initiative's prototype first, with current: { n, key, said, version }
9
10
  * GET /api/lab/present?ws&board&id → { ok, present } lib/lab-present.js presentOf: the round's frames for present mode (GET /pm/present)
10
11
  * GET /api/lab/specimen?file → text/html, a specimen from <runtime>/idle-lab/specimens/, served sandboxed (no scripts that can
11
12
  * reach PMOS: CSP sandbox without allow-same-origin, no network but the fonts)
@@ -135,7 +136,10 @@ const READS = {
135
136
  const w = wsOf(ctx, url.searchParams.get('ws')); if (!w) return fail(ctx, res, 404, 'no such workspace');
136
137
  const dir = dirOf(ctx, w), ini = url.searchParams.get('initiative') || '';
137
138
  if (!dir || !ID_RE.test(ini)) return fail(ctx, res, 400, 'initiative names an initiative');
138
- ctx.json(res, { ok: true, rounds: LAB.roundsOf(PR.read(dir), ini) });
139
+ // the round the initiative's prototype is in leads, marked with its version (lib/proposals.js currentOf): the Specimens line opens it
140
+ const P = PR.read(dir), cur = PR.currentOf(P, ini), rounds = LAB.roundsOf(P, ini);
141
+ if (cur) { const i = rounds.findIndex((r) => r.id === cur.of); if (i >= 0) rounds.unshift({ ...rounds.splice(i, 1)[0], current: { n: cur.n, key: cur.key, said: cur.said || cur.title, version: cur.id } }); }
142
+ ctx.json(res, { ok: true, rounds });
139
143
  return true;
140
144
  },
141
145
  '/api/lab/present': (ctx, res, url) => {
@@ -260,7 +264,7 @@ function liveRound(ctx, res, b) {
260
264
  const w = wsOf(ctx, typeof b.ws === 'string' && b.ws ? b.ws : null); if (!w) return fail(ctx, res, 404, 'no such workspace');
261
265
  const by = /^(pm|agent):[\w.:-]{1,80}$/.test(String(b.by || '')) ? b.by : 'agent:cli';
262
266
  const input = { ws: w.id, board: typeof b.board === 'string' ? b.board : '', ini: String(b.ini || ''), brief: String(b.brief || ''), base: /^[A-C]$/i.test(String(b.base || '')) ? String(b.base).toUpperCase() : '',
263
- dirs: typeof b.dirs === 'string' ? b.dirs : '', from: b.from === 'meeting' ? 'meeting' : b.from === 'chat' || b.propose ? 'chat' : 'cli', by, ...(b.one === true ? { count: 1 } : {}) };
267
+ dirs: typeof b.dirs === 'string' ? b.dirs : '', from: b.from === 'meeting' ? 'meeting' : b.from === 'chat' || b.propose ? 'chat' : 'cli', by, ...(b.one === true ? { count: 1 } : {}), ...(/^pr-[0-9a-f]{6,40}$/.test(String(b.of || '')) ? { of: b.of } : {}), ...(Number.isInteger(b.fromV) && b.fromV > 0 ? { fromV: b.fromV } : {}) };
264
268
  const r = b.propose === true ? LR.proposeNow(input) : LR.startNow(input);
265
269
  if (!r.ok) return fail(ctx, res, 409, r.error);
266
270
  ctx.json(res, r);
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.593.0",
3
+ "version": "0.594.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.593.0",
9
+ "version": "0.594.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.593.0",
3
+ "version": "0.594.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",
@@ -83,6 +83,8 @@ const carried = (a, f) => ((a && a.carried) || []).filter((c) => c.field === f &
83
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
84
  function specimensRow(kept, tries, rounds) {
85
85
  const R = Array.isArray(rounds) && rounds.length ? rounds[0] : null;
86
+ // the initiative's prototype (2026-11-18: the line said "kept" for an old test round): its version, and it opens that version
87
+ if (R && R.current) return { key: 'specimens', label: 'Prototype', text: 'Version ' + R.current.n + (R.current.said ? ': ' + R.current.said : '') + (R.working ? ' · the next version is on the way' : ''), by: '', at: R.at || '', edit: null, lab: R.current.version || R.id };
86
88
  if (R && (R.keys.length || R.working)) {
87
89
  const made = R.keys.length ? R.keys.join(', ') + (R.keys.length === 1 ? ' is made' : ' are made') : 'none made yet';
88
90
  const n = rounds.length > 1 ? rounds.length + ' rounds' : R.rounds > 1 ? R.rounds + ' rounds' : 'Round 1';
@@ -94,7 +94,7 @@ export function lookHtml(v) {
94
94
  }
95
95
  export function foundDocs(v) {
96
96
  const f = v && v.found;
97
- return f && f.docs ? f.docs.map((d) => ({ title: d.title, meta: [d.source, md(d.at)].filter(Boolean).join(' · '), ref: d.ref || '' })) : [];
97
+ return f && f.docs ? f.docs.map((d) => ({ title: d.title, meta: [d.source, md(d.at)].filter(Boolean).join(' · '), ref: d.ref || '', kind: d.kind || '', round: d.round || '' })) : [];
98
98
  }
99
99
 
100
100
  /* ── the Viewer ── */
@@ -389,7 +389,16 @@ function openIn(sec) {
389
389
  function foldsHtml(v, o) {
390
390
  const rows = [];
391
391
  // the documents a ✓ kept from elsewhere (batch 12 item 4) list inline under Documents, each with its source and date
392
- const fd = PP.foundDocs(v);
392
+ const all = PP.foundDocs(v);
393
+ // the initiative's prototype has its own fold, first (Wawan 2026-11-18: "the prototype under the Prototype and Design section so the
394
+ // workspace always refers to the correct one"): ONE entry, the current version (lib/proposals.js currentOf); it opens the Viewer.
395
+ // Older versions live in the Viewer's ‹ ›, never as documents.
396
+ const proto = all.filter((d) => d.kind === 'prototype' && d.round), fd = all.filter((d) => !(d.kind === 'prototype' && d.round));
397
+ if (proto.length) {
398
+ const op = isOpen(v, 'proto', true);
399
+ rows.push(`<button type="button" class="iv-fr" data-iv-fold="proto" aria-expanded="${op}"><b>Prototype &amp; design</b><span class="n">${proto.length}</span>${chev(op)}</button>`
400
+ + (op ? `<div class="iv-fb"><div class="iv-fds">${proto.map((d) => `<button type="button" class="iv-fd" data-ia-lab="${esc(d.round)}" title="Open it in the Viewer"><b>${esc(d.title)}</b>${d.meta ? `<small>${esc(d.meta)}</small>` : ''}</button>`).join('')}</div></div>` : ''));
401
+ }
393
402
  const fdHtml = fd.map((d) => (/^https?:\/\//.test(d.ref) ? `<a class="iv-fd" href="${esc(d.ref)}" target="_blank" rel="noopener">` : '<span class="iv-fd">') + `<b>${esc(d.title)}</b>${d.meta ? `<small>${esc(d.meta)}</small>` : ''}` + (/^https?:\/\//.test(d.ref) ? '</a>' : '</span>')).join('');
394
403
  if ((o.docs && o.docs.n) || fd.length) {
395
404
  const n = ((o.docs && o.docs.n) || 0) + fd.length, inl = !!(o.docs && o.docs.html) || fd.length > 0;