create-pmos 0.606.0 → 0.607.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.606.0",
3
+ "version": "0.607.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.607.0",
38
+ "at": "2026-11-18T11:44:39.758Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1351,
43
+ "t": "Prototype Design shows only the design, with the run's notes as annotations beside it",
44
+ "s": "Prototype Design shows only the design, with the run's notes as annotations beside it",
45
+ "k": "fix"
46
+ }
47
+ ]
48
+ },
36
49
  {
37
50
  "v": "0.606.0",
38
51
  "at": "2026-11-18T11:27:58.320Z",
@@ -303,19 +316,6 @@
303
316
  "k": "new"
304
317
  }
305
318
  ]
306
- },
307
- {
308
- "v": "0.587.0",
309
- "at": "2026-11-17T10:24:56.955Z",
310
- "f": 4,
311
- "prs": [
312
- {
313
- "n": 1322,
314
- "t": "The live round's compare view is always reachable: no early ✓, Specimens line opens it",
315
- "s": "The live round's compare view is always reachable: no early ✓, Specimens line opens it",
316
- "k": "fix"
317
- }
318
- ]
319
319
  }
320
320
  ]
321
321
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@bb83e355
1
+ kernel-source: pmos@2e7dcf5b
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-18T11:27:55Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-18T11:44:35Z"}
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-18T11:27:55Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-18T11:44:35Z"}
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-18T11:27:55Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-18T11:44:35Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,17 @@
1
1
  [
2
+ {
3
+ "v": "0.607.0",
4
+ "at": "2026-11-18T11:44:39.758Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1351,
9
+ "t": "Prototype Design shows only the design, with the run's notes as annotations beside it",
10
+ "s": "Prototype Design shows only the design, with the run's notes as annotations beside it",
11
+ "k": "fix"
12
+ }
13
+ ]
14
+ },
2
15
  {
3
16
  "v": "0.606.0",
4
17
  "at": "2026-11-18T11:27:58.320Z",
@@ -195,7 +195,7 @@ 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. It works like design work with Claude Code: you say what you want, PMOS makes or changes the one prototype, the Viewer shows it, and the chat says what changed.
196
196
 
197
197
  1. **Ask in the initiative's chat.** Say, for example, "prototype this" or "mock this up". PMOS starts one prototype at once. Nothing to press. It opens in the Viewer beside the chat as soon as it opens and renders in a headless browser, in about a minute. The chat answers with a **Version 1** tag and says what was made and for whom. Tap a Version tag to show that version again.
198
- 2. **The Viewer is one canvas, like a design tool.** The prototype is in the middle, at its own size. Three panels sit around it:
198
+ 2. **The Viewer is one canvas, like a design tool.** The prototype is in the middle, at its own size. Only the design shows: there is no browser frame around it, and the canvas is cut to the design itself. A version puts no notes on its screens (a format's name and size, "sample data", the other option to compare). It writes them as notes instead, and the notes sit beside the design as numbered annotations for the screen shown. Tap a note about one block to flash that block on the design. Three panels sit around it:
199
199
  - **Pages, screens and layers** (left). A page is one format or page of the prototype, for example "One Raffles Place LED". A page has screens: its states, for example "Default" and "Sponsor sold". Layers lists the blocks of the screen shown. Tap a screen to show it, or tap a layer to select it. Press [ to hide or show this panel.
200
200
  - **Exact values** (right): the inspector for the selected layer. Set its text, font, size, weight, line height, letter spacing, colour, fill, corner, padding and alignment. The prototype changes at once. PMOS keeps the change with the version, and the next version keeps it. The chat shows one quiet line, for example "You set Temperature to 56px · Bold. Kept as yours." The undo press in the panel clears that layer's changes. Press ] to hide or show the inspector.
201
201
  - **Page copy, The flow and Who does what**: one press each in the toolbar, closed by default. One opens at a time, in the inspector's place. Page copy lists every word on the screen: edit a line in place. The flow shows screens as cards, decisions as diamonds and branches to the other scenarios: tap a screen to see it, or a side branch to play that scenario. Who does what has one column for each role, with the steps going down in order. The role names stay at the top when you scroll. Both diagrams show at the normal text size. A long one scrolls in the panel. Press the arrows at the top of the panel to make it wider. A press with a dot, or a panel that says **Updated**, is what the last version changed.
@@ -9,7 +9,7 @@
9
9
  * as it renders, and the chat says in one line what was made (deps.tell: the version's own <meta name="pmos-changed"> sentence goes to the
10
10
  * chat's session). Any change sentence while that one version is open ("make the alert orange") is the next round of it, the same way.
11
11
  * PROTOTYPE BY CHATTING (design agreed 2026-11-17 23:31, https://claude.ai/artifact/9fxuukKr3XixwkGFMTfeba): the run that makes a version
12
- * also writes its companions as DATA next to it (PARTS: flow.json, lanes.json, tweaks.json; PMOS writes copy.json from the prototype's
12
+ * also writes its companions as DATA next to it (PARTS: flow.json, lanes.json, tweaks.json, notes.json; PMOS writes copy.json from the prototype's
13
13
  * data-copy text), and the Viewer draws them as one canvas (pm/cozy-proto.js). The chat is told once per round, "Version n" first, with
14
14
  * what the version changed beside the prototype (changesOf: "Also updated: step 3, the swimlane and the copy"). The canvas's marks before
15
15
  * the PM's words (marksOf: the element pointed at, Continue from version n) and the PM's in-place edits (edits.json) reach the next run.
@@ -83,6 +83,9 @@ const PARTS = Object.freeze([
83
83
  Object.freeze({ kind: 'flow', title: 'The flow', name: 'flow.json' }),
84
84
  Object.freeze({ kind: 'lanes', title: 'Who does what', name: 'lanes.json' }),
85
85
  Object.freeze({ kind: 'tweaks', title: 'Tweaks', name: 'tweaks.json', optional: true }),
86
+ // the notes beside the design (Wawan 2026-11-18, batch 31: "the design part should only show the actual design, without any
87
+ // instruction. In case of instruction, it should be put as comment or annotation"): what the run wants the PM to know, never on a screen
88
+ Object.freeze({ kind: 'notes', title: 'Notes', name: 'notes.json', optional: true }),
86
89
  ]);
87
90
  const SCAFFOLD_MAX = 12000;
88
91
  const FROM = Object.freeze({ chat: 'Your ask in the initiative chat', cli: 'pmos lab round', meeting: 'Said in the meeting' });
@@ -247,7 +250,7 @@ function promptOf(o) {
247
250
  for (const r of o.refs || []) L.push(`The PM attached a reference (an image, a sketch or a file): ${r}. Read it first with the Read tool. Build from it (its layout, hierarchy and colours) unless the PM's words above say otherwise ("only the colours", "ignore the layout"). In your pmos-changed line, say what you took from it.`);
248
251
  if (o.base) {
249
252
  L.push('', `This is a new version of prototype ${o.key} (${one(o.base.title, 140)}). Read the last version first: ${o.base.abs}`,
250
- `and its companions next to it (flow.json, lanes.json, tweaks.json in ${path.dirname(o.base.abs)}). Change what the PM asked for in the idea above, usually one thing, and keep the rest as it was, ids and copy keys included.`);
253
+ `and its companions next to it (flow.json, lanes.json, tweaks.json, notes.json in ${path.dirname(o.base.abs)}). Change what the PM asked for in the idea above, usually one thing, and keep the rest as it was, ids and copy keys included.`);
251
254
  } else if (o.alone) L.push('', 'This is the one version the PM sees: make the plainest honest version of the idea, not a showcase.');
252
255
  else L.push('', `Your direction, ${o.key}: ${one(o.title, 200)}. Other runs take the other directions: keep yours clearly different.`);
253
256
  if (o.point && (o.point.el || o.point.label)) L.push('', `The PM pointed at one element: ${o.point.el ? 'data-el="' + one(o.point.el, 60) + '"' : ''}${o.point.label ? ' ("' + one(o.point.label, 80) + '")' : ''}. Their words are about that element: change it, and only what must follow from it.`);
@@ -266,6 +269,8 @@ function promptOf(o) {
266
269
  `1. ${o.file}: the prototype. Write it FIRST: the PM sees it as soon as it lands.`,
267
270
  ' - One self-contained HTML page: inline CSS only, no script, no network, no image files. Real draft copy, never lorem ipsum or a placeholder.',
268
271
  ` - In <head>, one line for the PM: <meta name="pmos-changed" content="…"> with ONE short sentence of what ${o.base ? 'you changed' : 'you made and for whom'}, in plain words, under 140 characters.`,
272
+ ' - Show ONLY the design: each screen is the product exactly as its user sees it. Nothing about the prototype on a screen: no format names or sizes ("Format 1 · 7680 × 1550"), no headings that name the option ("One view: …"), no "sample data" or "placeholder" notes, no notes to the PM, and no buttons that only move between your own options or formats ("See the two-panel option", "All formats"): PMOS lists the pages and screens. Write each such note in notes.json instead.',
273
+ ' - No frame around the design: no browser bar, no device, no extra page or card behind it. Body margin 0; the page background is the design\'s own background.',
269
274
  ' - Each screen is a <section data-screen="<id>" data-label="<screen name>">; the first one is where the user starts. PMOS shows one screen at a time.',
270
275
  ' - When several screens are states of one page or format (default, sponsor sold, rain alert), give each data-page="<that page\'s name>": the PM sees them as one page with its screens.',
271
276
  ' - What the user taps to move on carries data-go="<screen id>" (a button, a row, a link with href="#<screen id>").',
@@ -279,6 +284,7 @@ function promptOf(o) {
279
284
  ' - Scenarios: the main path first, then one per branch (2 to 4 in all). Each step names its screen and the data-el the user taps there to move on ("tap"); the last step has no tap.',
280
285
  `3. ${path.join(dir, 'lanes.json')}: who does what. JSON: { "lanes": [{ "id", "name", "steps": [{ "n", "title", "screen"? }] }] }. One lane per actor (the user, the product, and the people or systems the initiative names). n numbers the steps across all lanes in the order they happen (1, 2, 3 …); "screen" is the data-screen the step shows, when it shows one.`,
281
286
  `4. ${path.join(dir, 'tweaks.json')} (optional): { "tweaks": [{ "var": "--gap", "label": "Spacing", "min": 4, "max": 32, "step": 1, "unit": "px", "value": 16, "el"? }] }, at most 6, for the custom properties the prototype reads. "el" is the data-el a tweak belongs to; without it, it is for the whole screen.`,
287
+ `5. ${path.join(dir, 'notes.json')} (optional): { "notes": [{ "text", "screen"?, "el"? }] }, at most 8: what the PM should know that is not part of the design (the format and its size, that the data is sample data, what a placeholder stands for, the other option to compare). PMOS shows them as annotations beside the design. "screen" is the data-screen a note is about, "el" the data-el it points at; without them, it is for the whole prototype.`,
282
288
  'Write nothing else and do not read anything else' + (o.base || (o.refs || []).length ? ' but what is named above.' : '.'));
283
289
  if (o.scaffold && o.scaffold.css) L.push('', 'The stylesheet:', '```css', o.scaffold.css, '```');
284
290
  return L.join('\n');
@@ -326,6 +332,18 @@ function lanesOf(j, { screens = null } = {}) {
326
332
  if (!lanes.length || !ns.size) return { error: 'lanes.json has no lanes with steps' };
327
333
  return { lanes };
328
334
  }
335
+ /** PURE. notes.json → { notes: [{ text, screen?, el? }] } | { error }: the annotations beside the design, at most 8, each text once. */
336
+ function notesOf(j) {
337
+ if (!isObj(j)) return { error: 'notes.json is not a JSON object' };
338
+ const seen = new Set();
339
+ const notes = arr(j.notes, 12).map((n) => {
340
+ const text = isObj(n) ? one(n.text, 240) : '';
341
+ if (!text || seen.has(text)) return null;
342
+ seen.add(text);
343
+ return { text, ...(ID.test(str(n.screen)) ? { screen: n.screen } : {}), ...(ID.test(str(n.el)) ? { el: n.el } : {}) };
344
+ }).filter(Boolean).slice(0, 8);
345
+ return { notes };
346
+ }
329
347
  /** PURE. tweaks.json → { tweaks: [{ var, label, min, max, step, unit, value, el? }] } | { error }. */
330
348
  function tweaksOf(j) {
331
349
  if (!isObj(j)) return { error: 'tweaks.json is not a JSON object' };
@@ -377,6 +395,7 @@ function partsAt(abs) {
377
395
  const f = flowOf(rd('flow.json')); if (!f.error) out.flow = f;
378
396
  const l = lanesOf(rd('lanes.json'), { screens: out.flow ? new Set(out.flow.screens.map((x) => x.id)) : null }); if (!l.error) out.lanes = l;
379
397
  const t = tweaksOf(rd('tweaks.json')); if (!t.error && t.tweaks.length) out.tweaks = t;
398
+ const nt = notesOf(rd('notes.json')); if (!nt.error && nt.notes.length) out.notes = nt;
380
399
  const c = rd('copy.json'); if (isObj(c)) out.copy = c;
381
400
  const e = editsOf(rd('edits.json')); if (Object.keys(e.copy).length || Object.keys(e.vars).length || Object.keys(e.styles).length) out.edits = e;
382
401
  return out;
@@ -440,7 +459,7 @@ function contextOf(cur, { ini, ws = '', rt = null, versions = [] } = {}) {
440
459
  + 'never delete the folder by hand, and say in one line what was deleted and that "undo" brings it back (`pmos lab undo <batch>`, the batch it prints). ';
441
460
  const abs = (rt && LAB.specimenPath(rt, cur.file)) || cur.file, dir = path.dirname(abs);
442
461
  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. `
443
- + `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. `
462
+ + `Its files are in ${dir}: ${path.basename(abs)} (the prototype), flow.json, lanes.json, copy.json, tweaks.json, notes.json, and edits.json (the PM's own edits in the Viewer). Read them to answer questions about it. `
444
463
  + `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>"\` `
445
464
  + `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. ` + del(cur) + never;
446
465
  }
@@ -631,12 +650,12 @@ function create(deps) {
631
650
  if (deps.artefact && R.slots.length === 1 && R.from !== 'cli') try { deps.artefact(R.dir, { scope: 'experiment:' + R.ini, artefact: 'specimens', field: 'kept', text: one(`Version ${R.n}: ${s.said || s.title} (${LAB.specimenUrl(s.file)})`, 600), sources: [{ label: 'live round', ref: LAB.specimenUrl(s.file) }] }, 'agent:live-round'); } catch (e) { warn('live round kept', e); }
632
651
  write(R); settle(R);
633
652
  }
634
- /** A companion lands: it must parse and be well formed (flowOf, lanesOf, tweaksOf), else it is "not made" with the reason. */
653
+ /** A companion lands: it must parse and be well formed (flowOf, lanesOf, tweaksOf, notesOf), else it is "not made" with the reason. */
635
654
  function provePart(R, s, x) {
636
655
  if (x.state !== 'working') return;
637
656
  let j = null, err = '';
638
657
  try { j = JSON.parse(fs.readFileSync(x.abs, 'utf8')); } catch (e) { err = x.name + ' is not JSON'; }
639
- if (!err) { const v = x.kind === 'flow' ? flowOf(j) : x.kind === 'lanes' ? lanesOf(j) : tweaksOf(j); if (v.error) err = v.error; }
658
+ if (!err) { const v = x.kind === 'flow' ? flowOf(j) : x.kind === 'lanes' ? lanesOf(j) : x.kind === 'notes' ? notesOf(j) : tweaksOf(j); if (v.error) err = v.error; }
640
659
  if (err) return partNotMade(R, s, x, err);
641
660
  x.state = 'ok';
642
661
  write(R); settle(R);
@@ -751,5 +770,5 @@ function stopRound(id) { return inst ? inst.stop(id) : { ok: false, error: NOT_R
751
770
  function status() { return inst ? inst.status() : []; }
752
771
 
753
772
  module.exports = { DELETE_RE, JOB, ORIGIN, STALL_MS, progressOf, KEYS, DEFAULT_DIRECTIONS, ONE_DIRECTION, PARTS, FROM, marksOf, intentOf, parseDirs, askOf, waiting, baseOf, currentOf: PR.currentOf, contextOf, scaffoldOf, promptOf, saidOf, roundLine,
754
- flowOf, lanesOf, tweaksOf, copyOf, changesOf, partsAt, editsOf, styleWords, STYLE_OK,
773
+ flowOf, lanesOf, tweaksOf, notesOf, copyOf, changesOf, partsAt, editsOf, styleWords, STYLE_OK,
755
774
  create, install, round, startNow, proposeNow, cancel, stopRound, dropCard, running, status };
@@ -7,8 +7,9 @@
7
7
  * data-screen one screen shows at a time; the first is the start data-go a tap moves to that screen
8
8
  * data-el what the PM can point at, comment on or tap in Play data-label its name in plain words
9
9
  * data-copy text the Page copy card edits in place :root vars what Tweaks change
10
- * Parent → frame { pmos: 1, t }: mode (view | point | comment | play), screen, copy, copyAll, vars, styles (the inspector's, all of them), hint, sel, pins.
11
- * Frame → parent { pmos: 1, t }: ready (screens with their data-page, els with their screen and copy key, copy), screen, point (with looks: the
10
+ * Parent → frame { pmos: 1, t }: mode (view | point | comment | play), screen, copy, copyAll, vars, styles (the inspector's, all of them), hint, sel, pins, box (measure again).
11
+ * Frame → parent { pmos: 1, t }: ready (screens with their data-page, els with their screen and copy key, copy), screen, box (the design's
12
+ * own box on the screen shown, and the page's size: Design crops the frame to it), point (with looks: the
12
13
  * selected element's current styles), looks (after styles), pin, tap.
13
14
  *
14
15
  * withRuntime(html) → html with the runtime's <script> before </body> (or at the end) */
@@ -31,6 +32,32 @@ function runtime() {
31
32
  all.forEach(function (s) { s.classList.toggle('pmos-on', s === on); });
32
33
  window.scrollTo(0, 0);
33
34
  post({ t: 'screen', id: on.getAttribute('data-screen') });
35
+ box();
36
+ };
37
+ // the design's own box on the screen shown (Wawan 2026-11-18: Design shows only the actual design): the union of what draws something
38
+ // (text, a fill, a border, an image or a control), so the canvas can crop the frame to it. The page's own background does not count.
39
+ var drawn = function (e, cs) {
40
+ if (/^(IMG|SVG|CANVAS|VIDEO|INPUT|BUTTON|SELECT|TEXTAREA|HR)$/i.test(e.tagName)) return true;
41
+ if (cs.backgroundImage !== 'none' || (cs.backgroundColor && !/^(transparent|rgba\(0, 0, 0, 0\))$/.test(cs.backgroundColor))) return true;
42
+ if (parseFloat(cs.borderTopWidth) || parseFloat(cs.borderLeftWidth) || parseFloat(cs.borderBottomWidth) || parseFloat(cs.borderRightWidth)) return true;
43
+ for (var n = e.firstChild; n; n = n.nextSibling) if (n.nodeType === 3 && /\S/.test(n.nodeValue)) return true;
44
+ return false;
45
+ };
46
+ var lastBox = '', box = function () {
47
+ var on = document.querySelector('[data-screen].pmos-on') || document.body; if (!on) return;
48
+ var x0 = Infinity, y0 = Infinity, x1 = -Infinity, y1 = -Infinity;
49
+ var list = [on].concat(Array.prototype.slice.call(on.querySelectorAll('*')));
50
+ list.forEach(function (e) {
51
+ if (e.closest && e.closest('.pmos-pin')) return;
52
+ var cs = window.getComputedStyle(e); if (cs.display === 'none' || cs.visibility === 'hidden' || !drawn(e, cs)) return;
53
+ var r = e.getBoundingClientRect(); if (r.width < 1 || r.height < 1) return;
54
+ x0 = Math.min(x0, r.left + window.scrollX); y0 = Math.min(y0, r.top + window.scrollY);
55
+ x1 = Math.max(x1, r.right + window.scrollX); y1 = Math.max(y1, r.bottom + window.scrollY);
56
+ });
57
+ var W = document.documentElement.scrollWidth, H = document.documentElement.scrollHeight;
58
+ var m = { t: 'box', docW: W, docH: H };
59
+ if (x0 !== Infinity) { var pad = 12; m.x = Math.max(0, Math.floor(x0 - pad)); m.y = Math.max(0, Math.floor(y0 - pad)); m.w = Math.min(W, Math.ceil(x1 + pad)) - m.x; m.h = Math.min(H, Math.ceil(y1 + pad)) - m.y; }
60
+ var k = JSON.stringify(m); if (k === lastBox) return; lastBox = k; post(m);
34
61
  };
35
62
  var elOf = function (n) { return n && n.closest ? n.closest('[data-el]') : null; };
36
63
  var info = function (e) {
@@ -120,12 +147,18 @@ function runtime() {
120
147
  var se = document.querySelector('.pmos-sel'); if (se) post({ t: 'looks', el: se.getAttribute('data-el') || '', looks: looks(se) });
121
148
  }
122
149
  else if (m.t === 'pins') pins(m.pins);
150
+ else if (m.t === 'box') { lastBox = ''; box(); }
151
+ if (m.t === 'copy' || m.t === 'copyAll' || m.t === 'vars' || m.t === 'styles') box();
123
152
  });
124
153
  var start = function () {
125
154
  var all = screens(); if (all.length) all[0].classList.add('pmos-on');
126
155
  var copy = {}; Array.prototype.forEach.call(document.querySelectorAll('[data-copy]'), function (x) { var k = x.getAttribute('data-copy'); if (!(k in copy)) copy[k] = (x.textContent || '').trim(); });
127
156
  post({ t: 'ready', screens: all.map(function (s) { return { id: s.getAttribute('data-screen'), label: s.getAttribute('data-label') || '', page: s.getAttribute('data-page') || '' }; }),
128
157
  els: Array.prototype.map.call(document.querySelectorAll('[data-el]'), function (e) { return info(e); }), copy: copy });
158
+ box();
159
+ // fonts, images and the PM's own edits can move the design: measure again when the page settles or changes size
160
+ window.addEventListener('load', box); window.addEventListener('resize', box);
161
+ if (window.ResizeObserver) try { new ResizeObserver(function () { box(); }).observe(document.body); } catch (e) { /* old browser */ }
129
162
  };
130
163
  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start); else start();
131
164
  }
@@ -16,7 +16,7 @@
16
16
  * POST /api/lab/round { ws?, board?, ini, brief, base?, dirs?, propose? } → the live round (lib/live-round.js): `pmos lab round` starts one,
17
17
  * or with propose: true files its ✦ ask. No page press needed (D98); it writes no record.
18
18
  * Prototype by chatting (initiative live-round-iterative): the compare view of a live round carries its version's companions as data
19
- * (data: { flow, lanes, copy, tweaks, edits }, lib/live-round.js partsAt) and the initiative's comments; GET /api/lab/specimen with rt=1
19
+ * (data: { flow, lanes, copy, tweaks, notes, edits }, lib/live-round.js partsAt) and the initiative's comments; GET /api/lab/specimen with rt=1
20
20
  * adds the canvas runtime (lib/proto-runtime.js) inside the same sandbox, so the canvas can point, pin, play and edit through postMessage.
21
21
  * POST /api/lab/edit { ws, file, copy?: { key: text }, vars?: { --var: value }, styles?: { el: { prop: value } | null } } → { ok } the PM's in-place copy edits, tweaks and inspector styles,
22
22
  * kept with the version (edits.json next to it); the next version reads them
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.606.0",
3
+ "version": "0.607.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.606.0",
9
+ "version": "0.607.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.606.0",
3
+ "version": "0.607.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",
@@ -86,6 +86,21 @@
86
86
  .pc-dev.desktop::before { content: ''; position: absolute; left: 12px; top: 10px; width: 36px; height: 8px; border-radius: 4px; background: radial-gradient(circle at 4px 4px, var(--cz-hair) 3.5px, transparent 4px) 0 0 / 14px 8px repeat-x; }
87
87
  .pc-dev.desktop .pc-frame { height: 560px; border-radius: 0 0 12px 12px; }
88
88
  .pc-frame { position: relative; overflow: hidden; background: var(--cz-c-ffffff); }
89
+ /* Design: only the design (Wawan 2026-11-18). No bar, no device, no card behind it: the frame is cut to the design's own box (cozy-proto.js
90
+ cropTo), and the notes sit beside it as annotations. */
91
+ .pc-proto:has(.pc-dev.design) { padding: 0; border: 0; background: transparent; }
92
+ .pc-drow { display: flex; align-items: flex-start; gap: 20px; }
93
+ .pc-dev.design { flex: none; }
94
+ .pc-dev.design .pc-frame { width: 900px; height: 560px; background: transparent; }
95
+ .pc-dev.design .pc-frame iframe { background: transparent; }
96
+ .pc-notes { width: 240px; flex: none; }
97
+ .pc-notes ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
98
+ .pc-note { box-sizing: border-box; display: flex; align-items: flex-start; gap: 8px; width: 100%; padding: 10px 12px; border: 0; border-left: 3px solid var(--cz-risk); border-radius: 4px 12px 12px 4px; background: var(--cz-riskbg); color: var(--cz-ink2); font: inherit; font-size: var(--fs-meta); line-height: var(--lh-meta); text-align: left; }
99
+ button.pc-note { cursor: pointer; }
100
+ button.pc-note:hover, button.pc-note:focus-visible { color: var(--cz-ink); }
101
+ .pc-note .w { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
102
+ .pc-note small { color: var(--cz-ink3); }
103
+ .pc-nn { width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--cz-risk); color: var(--cz-onsolid); display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-badge); font-weight: var(--fw-strong); }
89
104
  .pc-frame iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--cz-c-ffffff); }
90
105
  .pc-frame .pc-none { padding: 20px; }
91
106
  .pc-ink { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; border-radius: inherit; }
@@ -204,5 +219,7 @@
204
219
  .pc-pflow { width: 100%; }
205
220
  .pc .pc-ib { width: 44px; height: 44px; }
206
221
  .pc-dev.desktop { width: 100%; }
222
+ .pc-drow { flex-direction: column; }
223
+ .pc-notes { width: 100%; }
207
224
  .pc-pframe.phone iframe { width: 100%; box-shadow: none; margin: 0; }
208
225
  }
@@ -10,7 +10,8 @@
10
10
  * page is a data-page, its screens are its states, its layers are the data-el blocks of the screen shown); the inspector on the right
11
11
  * (Exact values: text, font, size, weight, line height, spacing, colour, fill, corner, padding, align), saved with the version in
12
12
  * edits.json (styles) and kept by the next version; a change says "You set … Kept as yours." once in the chat ('pmos:note').
13
- * The cards, which update together: the prototype in a phone or desktop frame (the comments,
13
+ * The cards, which update together: the prototype bare, cut to the design itself, with its notes beside it as annotations (notes.json;
14
+ * Wawan 2026-11-18: no frame, no instructions on a screen) (the comments,
14
15
  * the ✦ test-link suggestion); the flow (screens as cards, decisions as diamonds, drawn as SVG from flow.json: a screen shows that moment
15
16
  * on the prototype, a branch plays its scenario); the page copy, in its side panel (copy.json, edited in place: the prototype changes as the PM types and
16
17
  * the edit is kept with the version, POST /api/lab/edit); who does what (lanes.json as a swimlane with arrows: a step shows its screen).
@@ -160,7 +161,7 @@ export function lanesLayout(lanes) {
160
161
  /* Design mode is the default (design "Prototype like Figma", Wawan "build" 2026-11-18): Select is on, Pages > Screens > Layers on the left,
161
162
  * the inspector (Exact values) on the right; both hide ([ and ]). Page copy, The flow and Who does what are side panels behind toolbar
162
163
  * presses, closed by default; one shows at a time, in the inspector's place. The device switch is only for Play. */
163
- const V = { body: null, c: null, at: null, H: null, last: null, mode: 'point', pdev: store.get('pmos.pc.pdev') || 'own', zoom: Number(store.get('pmos.pc.zoom')) || 0,
164
+ const V = { body: null, box: null, c: null, at: null, H: null, last: null, mode: 'point', pdev: store.get('pmos.pc.pdev') || 'own', zoom: Number(store.get('pmos.pc.zoom')) || 0,
164
165
  sel: null, looks: null, screen: '', frameUrl: '', ready: null, edits: { copy: {}, vars: {}, styles: {} }, pend: null, saveT: null, draft: null, drawing: false, strokes: 0,
165
166
  play: null, sig: '', side: null, wide: store.get('pmos.pc.wide') === '1', left: store.get('pmos.pc.left') !== '0', insp: store.get('pmos.pc.insp') !== '0', noteT: null };
166
167
  const ARROW = '<marker id="pcArr" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0 0L10 5L0 10z" fill="currentColor"/></marker>';
@@ -230,6 +231,19 @@ function protoCard(c, v, making) {
230
231
  const lost = c.notMade ? `<p class="pc-making pc-lost">Version ${c.round} was not made: ${esc(c.notMade)}.${c.fallbackN ? ` This is version ${c.fallbackN}.` : ''} Ask in the chat for it in smaller steps, one screen or format at a time.</p>` : '';
231
232
  return { pre: lost + (making ? progressHtml(c) : ''), dev: `<div class="pc-frame" data-pc-frame>${v.url ? '' : '<p class="pc-none">PMOS is making it.</p>'}</div>${draw}`, post: sel + draft + list + sug };
232
233
  }
234
+ /** The notes beside the design (notes.json): what the run wants the PM to know, kept off the screens (Wawan 2026-11-18). Only the notes for
235
+ * the screen shown and the ones for the whole prototype; none at all is silence. A note on a layer flashes it on the design. */
236
+ export function notesFor(notes, screen) { return ((notes && notes.notes) || []).filter((n) => !n.screen || !screen || n.screen === screen); }
237
+ function notesHtml(v) {
238
+ const L = layersOf(V.ready, V.screen), list = notesFor((v.data || {}).notes, L.screen);
239
+ if (!list.length) return '';
240
+ const lab = (el) => { const e = ((V.ready && V.ready.els) || []).find((x) => x.el === el); return e ? e.label || human(el) : ''; };
241
+ return `<aside class="pc-notes" aria-label="Notes on the design"><ol>${list.map((n, i) => {
242
+ const on = n.el ? lab(n.el) : '';
243
+ const inner = `<span class="pc-nn" aria-hidden="true">${i + 1}</span><span class="w">${esc(n.text)}${on ? `<small>on ${esc(on)}</small>` : ''}</span>`;
244
+ return `<li>${n.el ? `<button type="button" class="pc-note" data-pc-note="${esc(n.el)}" aria-label="${esc('Show ' + (on || n.el) + ' on the design: ' + n.text)}">${inner}</button>` : `<div class="pc-note">${inner}</div>`}</li>`;
245
+ }).join('')}</ol></aside>`;
246
+ }
233
247
  function suggestion(c) {
234
248
  // the design sprint runs silently: PMOS recommends good practice as ONE ✦ (canvas PbcChat), here: test it with people once it settles
235
249
  const H = (c.history || []).filter((h) => h.round), N = H.length;
@@ -369,24 +383,35 @@ export function draw(body, c, o = {}) {
369
383
  // everything around the frame is drawn again; the frame stays where it is (moving an iframe reloads it)
370
384
  const put = (sel, html) => { const n = root.querySelector(sel); if (n) n.innerHTML = html; };
371
385
  put('.pc-barw', barHtml(c, v)); put('.pc-trayw', trayHtml(c)); put('.pc-leftw', leftHtml()); put('.pc-rightw', rightHtml(c, v));
372
- put('.pc-pre', P.pre); put('.pc-post', P.post);
386
+ put('.pc-pre', P.pre); put('.pc-post', P.post); put('.pc-notesw', notesHtml(v));
373
387
  root.querySelectorAll('.pc-dev > :not(.pc-frame)').forEach((n) => n.remove());
374
388
  const dv = root.querySelector('.pc-dev'); if (dv) dv.insertAdjacentHTML('beforeend', P.dev.slice(P.dev.indexOf('</div>') + 6));
375
389
  } else {
376
390
  root.innerHTML = `<div class="pc-barw">${barHtml(c, v)}</div><div class="pc-trayw">${trayHtml(c)}</div><div class="pc-dbody"><div class="pc-leftw">${leftHtml()}</div>`
377
- + `<div class="pc-vp"><div class="pc-board"><section class="pc-card pc-proto" aria-label="The prototype"><div class="pc-pre">${P.pre}</div><div class="pc-dev desktop">${P.dev}</div><div class="pc-post">${P.post}</div></section></div></div>`
391
+ + `<div class="pc-vp"><div class="pc-board"><section class="pc-card pc-proto" aria-label="The prototype"><div class="pc-pre">${P.pre}</div><div class="pc-drow"><div class="pc-dev design">${P.dev}</div><div class="pc-notesw">${notesHtml(v)}</div></div><div class="pc-post">${P.post}</div></section></div></div>`
378
392
  + `<div class="pc-rightw">${rightHtml(c, v)}</div></div>`;
379
393
  const slot = root.querySelector('[data-pc-frame]');
380
- if (slot && v.url) { V.frameUrl = frameUrl(v); V.ready = null; slot.innerHTML = `<iframe src="${esc(V.frameUrl)}" sandbox="allow-scripts" title="${esc('The prototype, version ' + (v.round || 1))}"></iframe>`; }
394
+ if (slot && v.url) { V.frameUrl = frameUrl(v); V.ready = null; V.box = null; slot.innerHTML = `<iframe src="${esc(V.frameUrl)}" sandbox="allow-scripts" title="${esc('The prototype, version ' + (v.round || 1))}"></iframe>`; }
381
395
  }
382
396
  if (!V.play) { const op = root.querySelector('.pc-play'); if (op) op.remove(); }
383
397
  if (draftText && root.querySelector('#pcCm')) root.querySelector('#pcCm').value = draftText;
398
+ cropTo(root);
384
399
  applyZoom(root);
385
400
  if (V.mode === 'draw') ink(root);
386
401
  if (keepFrame) { toFrame({ t: 'mode', mode: V.play ? 'view' : V.mode === 'draw' ? 'view' : V.mode }); pins(); }
387
402
  if (V.play) startPlay(V.play.id, V.play.i);
388
403
  if (V.draft && root.querySelector('#pcCm')) root.querySelector('#pcCm').focus();
389
404
  }
405
+ /** Design shows only the design (Wawan 2026-11-18): no browser bar, no device, no page around it. The frame is cut to the design's own box
406
+ * on the screen shown (the runtime's 'box' message); the page stays full size inside, so a tap, a comment pin or a layer lands where it is. */
407
+ function cropTo(root) {
408
+ const f = root && root.querySelector('.pc-dev.design .pc-frame'), fr = f && f.querySelector('iframe'); if (!f || !fr) return;
409
+ const b = V.box;
410
+ if (!b || !(b.w > 0 && b.h > 0)) { f.style.width = ''; f.style.height = ''; fr.style.cssText = ''; return; }
411
+ f.style.width = b.w + 'px'; f.style.height = b.h + 'px';
412
+ fr.style.cssText = `position:absolute;left:${-b.x}px;top:${-b.y}px;width:${FRAME_W}px;height:${Math.max(b.docH || 0, b.y + b.h)}px`;
413
+ }
414
+ const FRAME_W = 900;
390
415
  function applyZoom(root) {
391
416
  const b = root.querySelector('.pc-board'), vp = root.querySelector('.pc-vp'); if (!b || !vp) return;
392
417
  let z = V.zoom;
@@ -415,6 +440,10 @@ if (typeof window !== 'undefined') window.addEventListener('message', (e) => {
415
440
  if (V.sel) toFrame({ t: 'sel', el: V.sel.el });
416
441
  pins();
417
442
  V.sig = ''; draw(V.body, V.c);
443
+ } else if (m.t === 'box') {
444
+ const n = (k) => Math.max(0, Math.round(Number(m[k]) || 0));
445
+ V.box = { x: n('x'), y: n('y'), w: n('w'), h: n('h'), docH: n('docH') };
446
+ cropTo(V.body.querySelector('.pc')); applyZoom(V.body.querySelector('.pc'));
418
447
  } else if (m.t === 'screen') {
419
448
  V.screen = String(m.id || '');
420
449
  V.sig = ''; draw(V.body, V.c);
@@ -453,6 +482,7 @@ function wire(root) {
453
482
  if (d.pcZoom != null) { const k = Number(d.pcZoom); V.zoom = k === 0 ? 0 : Math.max(0.4, Math.min(1.6, Math.round(((V.zoom || currentZoom()) + k * 0.1) * 10) / 10)); store.set('pmos.pc.zoom', V.zoom ? String(V.zoom) : null); applyZoom(root); return; }
454
483
  if ('pcPlay' in d) { const sc = ((V.v.data || {}).flow || {}).scenarios || []; startPlay(sc.length ? sc[0].id : '', 0, true); return; }
455
484
  if (d.pcFrom) { fire('pmos:from', { ini: V.c.ini, n: Number(d.pcFrom) }); say('The next change you send continues from version ' + d.pcFrom + '.'); return; }
485
+ if (d.pcNote) { toFrame({ t: 'hint', els: [d.pcNote] }); return; }
456
486
  if (d.pcScreen) { V.screen = d.pcScreen; toFrame({ t: 'screen', id: d.pcScreen }); V.sig = ''; draw(V.body, V.c); return; }
457
487
  if (d.pcScen) { startPlay(d.pcScen, 0, true); return; }
458
488
  if ('pcStop' in d) { pmPost('/api/lab/stop', { ws: (V.at || {}).ws, run: d.pcStop }).then((r) => { if (!r || !r.ok) say((r && r.error) || 'It did not stop.'); }).catch(() => say('It did not stop.')); return; }