create-pmos 0.439.0 → 0.440.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.
@@ -202,14 +202,17 @@ function launchStatus(r) {
202
202
  return r.status === null ? 1 : r.status;
203
203
  }
204
204
 
205
+ // --no-open: the in-app update (Settings > Updates) reinstalls through here while the PM's tab waits and reloads itself;
206
+ // the restarted server then opens no second tab (batch 18 item 5). It is pmos's own flag, so the server does not inherit it.
205
207
  function launchWorkspace(targetDir, viaGlobal) {
208
+ const NO_OPEN = process.argv.includes('--no-open') ? ['--no-open'] : [];
206
209
  if (viaGlobal && onPath('pmos')) {
207
210
  // `pmos` owns the whole lifecycle: start the server detached, open the browser on this repo.
208
- return launchStatus(spawnSync('pmos', [targetDir], { stdio: 'inherit', shell: process.platform === 'win32' }));
211
+ return launchStatus(spawnSync('pmos', [targetDir, ...NO_OPEN], { stdio: 'inherit', shell: process.platform === 'win32' }));
209
212
  }
210
213
  // Fallback: run the bundled launcher directly. Its ensureInstalled() pulls runtime deps on first run.
211
214
  console.log('Launching from the bundled copy (the `pmos` command is not on PATH).');
212
- return launchStatus(spawnSync(process.execPath, [path.join(WORKSPACE, 'bin', 'pmos.js'), targetDir],
215
+ return launchStatus(spawnSync(process.execPath, [path.join(WORKSPACE, 'bin', 'pmos.js'), targetDir, ...NO_OPEN],
213
216
  { stdio: 'inherit', env: process.env }));
214
217
  }
215
218
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.439.0",
3
+ "version": "0.440.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.440.0",
37
+ "at": "2026-10-28T10:01:00.680Z",
38
+ "f": 2,
39
+ "prs": [
40
+ {
41
+ "n": 1084,
42
+ "t": "Your day rows open, honest Intelligence drafting, update reloads in place, Live pill clear of the chat (feedback batch 18 items 3–6)",
43
+ "s": "Your day rows open, honest Intelligence drafting, update reloads in place, Live pill clear of the chat (feedback batch 18 items 3–6)"
44
+ }
45
+ ]
46
+ },
35
47
  {
36
48
  "v": "0.439.0",
37
49
  "at": "2026-10-28T08:30:50.008Z",
@@ -259,18 +271,6 @@
259
271
  "s": "Tenth testing feedback batch"
260
272
  }
261
273
  ]
262
- },
263
- {
264
- "v": "0.420.0",
265
- "at": "2026-10-26T05:26:08.144Z",
266
- "f": 2,
267
- "prs": [
268
- {
269
- "n": 1057,
270
- "t": "Ninth testing feedback batch",
271
- "s": "Ninth testing feedback batch"
272
- }
273
- ]
274
274
  }
275
275
  ]
276
276
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@669943cd
1
+ kernel-source: pmos@d02bb6e8
2
2
  assembled: 2026-10-28
3
3
  mode: vendor
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Eval calibration log"
4
4
  description: "Append-only record of every PM override of an evaluator verdict."
5
- generated: {by: process:create-pmos, at: "2026-10-28T08:30:46Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-28T10:00:57Z"}
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-28T08:30:46Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-28T10:00:57Z"}
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-28T08:30:46Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-28T10:00:57Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -459,7 +459,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
459
459
  {
460
460
  const R = await open({ model: mk({ outcomes: [] }) });
461
461
  /* re-pointed (batch 16 item 6): the ✦ line never says "no insight"; with no goal it says what Claude drafts, with ✦ to start it */
462
- ok('I10 with no KR metric the ✦ line says no goal is set and offers to draft them, and the page draws no goal; Library still holds the report files', await R.page.evaluate(() => /has no goal yet/.test(document.querySelector('#brief').textContent) && !/no insight/i.test(document.querySelector('#brief').textContent) && !!document.querySelector('#insAct [data-okl="start"]') && /No key result is recorded for this workspace/.test(document.querySelector('#goalTbl').textContent) && document.querySelectorAll('#goalTbl [data-goal]').length === 0 && document.querySelectorAll('#listRows [data-rpt]').length === 2 && /North Star and key results/.test(document.querySelector('#insWhy').textContent) && !document.querySelector('#goalTbl .ins-th')));
462
+ ok('I10 with no KR metric the ✦ line says no goal is set and offers to draft them, and the page draws no goal; Library still holds the report files', await R.page.evaluate(() => /has no goal yet/.test(document.querySelector('#brief').textContent) && !/no insight/i.test(document.querySelector('#brief').textContent) && !!document.querySelector('#insAct [data-okl="start"]') && /No key result is recorded for this workspace/.test(document.querySelector('#goalTbl').textContent) && document.querySelectorAll('#goalTbl [data-goal]').length === 0 && document.querySelectorAll('#listRows [data-rpt]').length === 2 && /draft the North Star/.test(document.querySelector("#insWhy").textContent) && !document.querySelector('#goalTbl .ins-th')));
463
463
  await R.ctx.close();
464
464
  const R2 = await open({ model: mk({ reportsOk: false, reports: [], missing: ['reports'] }) });
465
465
  await R2.page.click('#moreB'); await R2.page.click('#moreMenu [data-more=\"library\"]');
@@ -1,4 +1,16 @@
1
1
  [
2
+ {
3
+ "v": "0.440.0",
4
+ "at": "2026-10-28T10:01:00.680Z",
5
+ "f": 2,
6
+ "prs": [
7
+ {
8
+ "n": 1084,
9
+ "t": "Your day rows open, honest Intelligence drafting, update reloads in place, Live pill clear of the chat (feedback batch 18 items 3–6)",
10
+ "s": "Your day rows open, honest Intelligence drafting, update reloads in place, Live pill clear of the chat (feedback batch 18 items 3–6)"
11
+ }
12
+ ]
13
+ },
2
14
  {
3
15
  "v": "0.439.0",
4
16
  "at": "2026-10-28T08:30:50.008Z",
@@ -17,6 +17,8 @@ Home, the Board, Insights and the Viewer use one type scale: 11, 12, 14, 16, 20
17
17
  - Press **Good morning** to open **Your day** in the Viewer. This is the same on a computer and on a phone. To open the calendar, press the calendar icon in Your day's header. A program's milestone changes that wait on you are the first line of the program's card.
18
18
  - A blue dot after **Good morning** means that something is new for you. It is in the **New for you** fold of Your day.
19
19
  - Your day shows the date, the meetings of the day, **Your move** (the items that wait on you, with their count), **New for you**, and **This week** (the Weekly review).
20
+ - **Drafted for you** lists what Claude drafted today and the weekly update. Press a row to open it: a finished draft opens what Claude wrote, and the weekly update opens the update.
21
+ - Your day does not show the meeting on now or the next meeting. Home's meeting line shows them. On a phone, the **Now** card does not show while a meeting is in progress.
20
22
  - When a conversation in Mentions waits on your answer, Your day names the oldest one under its first line: who asked, where, how many more wait, and what they asked. Press its icon to open that conversation in Mentions.
21
23
  - **New for you** shows only when something is new: tasks given to you, and work that finished while you were away. It shows the 3 newest items, then **N more**. Press an item to open it in the Viewer. Press **N more** to see all of them. Press ✓✓ in the fold's header to mark all of them seen. An item leaves when you open it or mark it seen. Mentions are not here: **Mentions** shows each one once.
22
24
  - After 17:00, Your day is the end of the day. It shows what moved today, then a **Tomorrow** fold with tomorrow's meetings. When tomorrow has no meetings, there is no Tomorrow fold.
@@ -151,6 +153,7 @@ Press the round button at the bottom of the page (bottom left on a desktop, bott
151
153
  - The button has a blue dot when something is new for you, and an amber dot when a source is old. The dots show on every page. When the menu is open, the blue dot is on **Home** (New for you is in Your day) and the amber dot is on **Settings**.
152
154
  - When a source is old, **Settings** opens at **Connectors**, with the old source first.
153
155
  - A screen reader reads both dots in the button's name, for example "Open the menu. 3 new for you. Jira 3 hours old".
156
+ - On Home on a computer, the **Live pill** (the running sessions and a recording) is above the menu button, so it does not cover the chat's **+**.
154
157
  - There is no **More** menu. The end of the day is Your day after 17:00. The calendar is the icon in Your day's header. To record a note, press **+** at the top of the list, then **Recording**.
155
158
 
156
159
  ## The list, and what it does not show
@@ -2,7 +2,7 @@
2
2
  type: Guide
3
3
  title: "Settings in console3: one home for each setting"
4
4
  description: "How to open Settings in console3, what each section holds, what the scope tags and the environment notes mean, and where the settings are kept."
5
- timestamp: 2026-10-12
5
+ timestamp: 2026-10-28
6
6
  ---
7
7
 
8
8
  # Settings in console3: one home for each setting
@@ -59,7 +59,7 @@ Some rows show a feature that PMOS does not have yet, such as choosing calendars
59
59
 
60
60
  Open **Updates** and press **Check now**. PMOS asks the npm registry for the latest version only when you press it.
61
61
 
62
- - **Update to** a version on the **PMOS app** row updates the app. The row asks first: press **Restart and update**, or **Cancel**. PMOS stops, installs the new version, and starts again. Open terminals keep running. The page reloads when the new version starts. If the update is refused, or PMOS starts again on the old version, or PMOS does not come back, the row says so and names the update log.
62
+ - **Update to** a version on the **PMOS app** row updates the app. The row asks first: press **Restart and update**, or **Cancel**. PMOS stops, installs the new version, and starts again. Open terminals keep running. The page that you are on reloads when the new version starts. PMOS does not open a new tab. If the update is refused, or PMOS starts again on the old version, or PMOS does not come back, the row says so and names the update log.
63
63
  - When PMOS runs from a PMOS checkout, the row says to update it with `git pull`. There is no Update button.
64
64
  - **Update** on a workspace row updates the kit in that repository. It replaces the kit files in its `pmos/` folder (AGENTS.md, skills, scripts, templates, `okf/core`, the mod and KIT-VERSION). It does not change `state/`, `planning/` or `okf/product/`, and it does not commit. Review the change in the repository as a normal pull request.
65
65
 
@@ -122,7 +122,8 @@ function lineOf(o = {}) {
122
122
  const read = G.filter((g) => g.reading.dot !== 'none');
123
123
  if (!read.length) {
124
124
  if (drafts) return { head: 'I drafted ' + noun(drafts, 'fix', 'fixes') + ' so every goal can be read.', sub: 'Keep them all at once, or one by one. I test-read each one first.', tone: 'drafts', keepAll };
125
- return { head: G.length ? 'I have not read a goal yet. I read each one when it has a way to be read.' : 'This product has no goal yet. I draft a North Star when the next check runs.', sub: '', tone: 'drafts', keepAll: 0 };
125
+ // batch 18 item 4: no promise of "the next check". The page offers ✦ Draft them now (public/pm/okr-list.js lineOf).
126
+ return { head: G.length ? 'I have not read a goal yet. I read each one when it has a way to be read.' : 'This product has no goal yet.', sub: '', tone: 'drafts', keepAll: 0 };
126
127
  }
127
128
  if (drafts) return { head: 'I drafted ' + noun(drafts, 'fix', 'fixes') + ' for your goals.', sub: 'Keep them all at once, or one by one.', tone: 'drafts', keepAll };
128
129
  const close = G.filter((g) => g.reading.dot === 'close');
@@ -11,6 +11,7 @@
11
11
  * streamLines(line) → { log: [lines], result: object|null } one stream-json event, for the live log
12
12
  * logLines(result, exitCode) → the lines the read-only log pane shows at the end
13
13
  * outcomeOf(result, { code, signal, timedOut, stopped, timeoutMin }) → { ok, headline, why, turns, durationMs, denied } what the run card says
14
+ * runEnvOf(extra) → the variables of a run's spawn spec (spec.env) that reach its process: only RUN_ENV, only strings
14
15
  *
15
16
  * Pure: no I/O, no process. server.js spawnSession starts the child and keeps the session row.
16
17
  *
@@ -387,4 +388,20 @@ function logLines(r, exitCode) {
387
388
  return out;
388
389
  }
389
390
 
390
- module.exports = { HEADLESS_SKILLS, HEADLESS_ORIGINS, ASK_ORIGINS, DRIVE_ORIGINS, SCAN_WEB_ORIGINS, SCAN_REPO_ORIGINS, SCAN_RESEARCH_WEB_ORIGINS, SCAN_RESEARCH_REPO_ORIGINS, WEB_KINDS, REPORT_SETUP_ORIGINS, REPORT_FIND_ORIGINS, CORE_DOC_ORIGINS, REPORT_DESIGN_ORIGINS, REPORT_SAMPLE_FETCH_ORIGINS, REPORT_STRUCTURE_ORIGINS, REPORT_STRUCTURE_DRY_ORIGINS, METRIC_DRAFT_ORIGINS, IMPACT_ORIGINS, TOOLS, SKILL_WRITE_DIRS, DEFAULT_TIMEOUT_MS, kindFor, argsFor, skillWriteDirs, timeoutMs, parseResult, streamLines, outcomeOf, signedOut, SIGNED_OUT_WHY, logLines, switchedOff };
391
+ // The variables a background run's spawn spec may set (spec.env, server.js spawnSession extraEnv). Each one pins the run's one write to its
392
+ // ledger, its scope and its run id; its CLI refuses without them. Batch 18 item 4: the metric-draft, propose, impact, metric-read and
393
+ // ms-review keys were missing here, so those runs started, could file nothing, and ended "ok" with no draft. A key a lib/*.js spec sets
394
+ // that is not on this list fails headless.test.js.
395
+ const RUN_ENV = Object.freeze(['PMOS_SCAN_FILE', 'PMOS_SCAN_ORIGIN', 'PMOS_SCAN_RUN', 'PMOS_REPORT_FILE', 'PMOS_REPORT_RUN',
396
+ 'PMOS_CORE_DOC_SCOPE', 'PMOS_CORE_DOC_KEY', 'PMOS_CORE_DOC_KEYS',
397
+ 'PMOS_METRIC_DRAFT_FILE', 'PMOS_METRIC_DRAFT_WS', 'PMOS_METRIC_DRAFT_SCOPE', 'PMOS_METRIC_DRAFT_ID', 'PMOS_METRIC_DRAFT_RUN',
398
+ 'PMOS_METRIC_READ_FILE', 'PMOS_METRIC_READ_RECORDS', 'PMOS_METRIC_READ_DRAFTS', 'PMOS_METRIC_READ_WS', 'PMOS_METRIC_READ_RUN', 'PMOS_METRIC_READ_RIDS', 'PMOS_METRIC_READ_TEST',
399
+ 'PMOS_PROPOSE_FILE', 'PMOS_PROPOSE_WS', 'PMOS_PROPOSE_BOARD', 'PMOS_PROPOSE_INI', 'PMOS_PROPOSE_RUN',
400
+ 'PMOS_IMPACT_FILE', 'PMOS_IMPACT_RUN', 'PMOS_MS_REVIEW_FILE', 'PMOS_MS_REVIEW_RUN', 'PMOS_MS_REVIEW_PROGRAM']);
401
+ function runEnvOf(extra) {
402
+ const out = {};
403
+ if (extra && typeof extra === 'object') for (const k of RUN_ENV) if (typeof extra[k] === 'string') out[k] = extra[k];
404
+ return out;
405
+ }
406
+
407
+ module.exports = { HEADLESS_SKILLS, HEADLESS_ORIGINS, ASK_ORIGINS, DRIVE_ORIGINS, SCAN_WEB_ORIGINS, SCAN_REPO_ORIGINS, SCAN_RESEARCH_WEB_ORIGINS, SCAN_RESEARCH_REPO_ORIGINS, WEB_KINDS, REPORT_SETUP_ORIGINS, REPORT_FIND_ORIGINS, CORE_DOC_ORIGINS, REPORT_DESIGN_ORIGINS, REPORT_SAMPLE_FETCH_ORIGINS, REPORT_STRUCTURE_ORIGINS, REPORT_STRUCTURE_DRY_ORIGINS, METRIC_DRAFT_ORIGINS, IMPACT_ORIGINS, TOOLS, SKILL_WRITE_DIRS, DEFAULT_TIMEOUT_MS, kindFor, argsFor, skillWriteDirs, timeoutMs, parseResult, streamLines, outcomeOf, signedOut, SIGNED_OUT_WHY, logLines, switchedOff, RUN_ENV, runEnvOf };
@@ -276,7 +276,7 @@ function upgradeApp(root, { version, logFile, spawn = cp.spawn, env = updateEnv(
276
276
  fd = fs.openSync(logFile, 'w');
277
277
  fs.writeSync(fd, `${new Date().toISOString()} clearing npm cache…\n`);
278
278
  fs.writeSync(fd, `${new Date().toISOString()} ${NPM} cache clean --force\n`);
279
- fs.writeSync(fd, `${new Date().toISOString()} ${NPX} ${npxArgs(src, version, ['workspace', '--reinstall', String(root)]).join(' ')}\n`);
279
+ fs.writeSync(fd, `${new Date().toISOString()} ${NPX} ${npxArgs(src, version, ['workspace', '--reinstall', '--no-open', String(root)]).join(' ')}\n`);
280
280
  } catch (e) { return { ok: false, error: `Could not write the log file: ${e.message}` }; }
281
281
  try {
282
282
  // Clear npm cache synchronously before spawning the update, so npx downloads the fresh version
@@ -285,7 +285,7 @@ function upgradeApp(root, { version, logFile, spawn = cp.spawn, env = updateEnv(
285
285
  try { fs.appendFileSync(logFile, `Note: cache clear had an issue, but continuing: ${e.message}\n`); } catch { /* silent */ }
286
286
  }
287
287
  try {
288
- const child = spawn(NPX, npxArgs(src, version, ['workspace', '--reinstall', String(root)]),
288
+ const child = spawn(NPX, npxArgs(src, version, ['workspace', '--reinstall', '--no-open', String(root)]),
289
289
  { cwd: String(root), env, detached: true, stdio: ['ignore', fd, fd], windowsHide: true, shell: IS_WIN });
290
290
  // A child that could not start writes nothing itself: say why in the log, which the page names when it gives up.
291
291
  if (child && typeof child.on === 'function') {
@@ -38,6 +38,7 @@ const flagOff = (v) => /^(off|0|false|no)$/i.test(String(v || '').trim());
38
38
  const off = (env) => flagOff((env || process.env).PMOS_METRIC_DRAFT);
39
39
  const one = (s, n) => String(s == null ? '' : s).replace(/\s+/g, ' ').trim().slice(0, n);
40
40
  const MAX = 2;
41
+ const NOTHING = 'The run ended without drafting anything.';
41
42
  const SCAN_MS = 10 * 60e3;
42
43
  const QUARTER_DAYS = 14;
43
44
  const localDay = (ms) => { const d = new Date(ms); return d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0'); };
@@ -133,8 +134,13 @@ function create(deps) {
133
134
  const s = MD.read(a.dir).scopes.get(MD.keyOf(a.scope, a.id));
134
135
  if (!s || !s.run || s.run.run !== run || s.run.ended) return; // `pmos metrics draft end` or ■ Stop wrote it already
135
136
  const res = (r && r.result) || {};
136
- const ok = !!(r && !r.timedOut && !r.stopped && r.code === 0 && res.ok !== false && !res.isError);
137
- try { MD.append(a.dir, null, { kind: 'end', scope: a.scope, id: a.id, run, ok, ...(ok ? {} : { error: one((r && r.note) || res.text || 'the run failed', 200) }) }, new Date(now).toISOString()); } catch (e) { warn('metric draft end', e); }
137
+ const exitOk = !!(r && !r.timedOut && !r.stopped && r.code === 0 && res.ok !== false && !res.isError);
138
+ // batch 18 item 4: a run that ended well but filed no row drafted nothing. It is not "ready": the page says so and offers Draft again.
139
+ const filed = [...s.rows.values()].some((x) => x.run === run);
140
+ const ok = exitOk && filed;
141
+ const error = ok ? '' : exitOk ? NOTHING : one((r && r.note) || res.text || 'the run failed', 200);
142
+ try { MD.append(a.dir, null, { kind: 'end', scope: a.scope, id: a.id, run, ok, ...(ok ? {} : { error }) }, new Date(now).toISOString()); } catch (e) { warn('metric draft end', e); }
143
+ return ok || (r && r.stopped) ? undefined : { failed: error };
138
144
  }
139
145
 
140
146
  /** Start one run now. → { ok, run } | { ok: false, error, held? } */
@@ -162,7 +168,7 @@ function create(deps) {
162
168
  active.set(run, { ws, scope, id, dir, session: null });
163
169
  let session = null;
164
170
  try {
165
- session = go({ name: 'Drafting metrics · ' + one(title, 60), ws, origin: `metric-draft:${ws}:${scope}:${id}:${run}`, initialInput: prompt + '\r', ...(scope === 'initiative' ? { initiative: id } : {}),
171
+ session = go({ name: 'Drafting metrics · ' + one(title, 60), ws, ...(press ? { byPm: true } : {}), origin: `metric-draft:${ws}:${scope}:${id}:${run}`, initialInput: prompt + '\r', ...(scope === 'initiative' ? { initiative: id } : {}),
166
172
  env: { PMOS_METRIC_DRAFT_FILE: MD.ledgerFile(dir), PMOS_METRIC_DRAFT_WS: ws, PMOS_METRIC_DRAFT_SCOPE: scope, PMOS_METRIC_DRAFT_ID: id, PMOS_METRIC_DRAFT_RUN: run }, onDone: (r) => ended(run, r) });
167
173
  } catch (e) { warn('metric draft run', e); }
168
174
  if (session && session.held) { active.delete(run); return { ok: false, held: true, error: 'Claude is busy with other runs. It tries again in a minute.' }; }
@@ -213,4 +219,4 @@ function create(deps) {
213
219
  return { tick, start, stop, active: () => [...active.keys()], runOf: (ws, scope, id) => { for (const [r, a] of active) if (a.ws === ws && a.scope === scope && a.id === id) return r; return null; } };
214
220
  }
215
221
 
216
- module.exports = { off, quarterOf, dueOf, gapsOf, promptOf, create, MAX, SCAN_MS, QUARTER_DAYS };
222
+ module.exports = { off, quarterOf, dueOf, gapsOf, promptOf, create, MAX, SCAN_MS, QUARTER_DAYS, NOTHING };
@@ -13,7 +13,7 @@
13
13
  * POST /api/metric-drafts/drop { ws, scope, id, row } → { ok } ✕
14
14
  * POST /api/metric-drafts/edit { ws, scope, id, row, name?, target?, source? } → { ok, row } the inline edit of an open row (batch 16 item 1)
15
15
  * POST /api/metric-drafts/undo { ws, scope, id, row } → { ok } kept → open (its record edited { retired: true }); dropped → open
16
- * POST /api/metric-drafts/start { ws, scope, id } → { ok, run } Draft again
16
+ * POST /api/metric-drafts/start { ws, scope, id } → { ok, run, already? } Draft again (already: a run for it was going)
17
17
  * POST /api/metric-drafts/stop { ws, scope, id } → { ok } ■ Stop: the run ends; what it filed stays a draft
18
18
  *
19
19
  * WHICH LEDGER. A product's and an initiative's drafts are in the state folder of `ws`. A program's are in its charter's workspace (its home,
@@ -91,7 +91,7 @@ async function handle(req, res, url, ctx) {
91
91
  if (!ctx.metricDraftRuns) return send(bad(503, 'Claude\'s runs are off on this server.'));
92
92
  const r = ctx.metricDraftRuns.start({ ws: w.id, scope, id, why: 'press' });
93
93
  if (!r || !r.ok) return send(bad(409, (r && r.error) || 'Claude could not start drafting.'));
94
- return send({ status: 200, body: { ok: true, run: r.run } });
94
+ return send({ status: 200, body: { ok: true, run: r.run, ...(r.already ? { already: true } : {}) } });
95
95
  }
96
96
  if (what === 'stop') {
97
97
  const s = S();
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.439.0",
3
+ "version": "0.440.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.439.0",
9
+ "version": "0.440.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.439.0",
3
+ "version": "0.440.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",
@@ -80,8 +80,11 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
80
80
 
81
81
  /* M: the eight moments */
82
82
  let p = await scene({ time: at(10, 20), today: [A, MT('mB', 'Quota review', 14, 0, 15, 0)], name: 'meeting' });
83
- let c = await wait(p, /Under way/);
84
- ok('M1 a meeting under way: says when it ends and names it', c && c.kind === 'meeting' && /Under way · ends in 40 min/.test(c.text) && /Partner sync/.test(c.text) && /Dana, Priya/.test(c.text), c && c.text);
83
+ // batch 18 item 3: the meeting under way is Home's own meeting line, so Your day says nothing of it (say it once): no card, no Now fold
84
+ const m1 = await until(() => p.evaluate(() => { const c = document.querySelector('#phoneCard'); const s = c && c.closest('.czs-sec'); return c && c.dataset.moment === 'meeting' && c.hidden && s && s.hidden ? { card: !c.hidden, fold: !s.hidden, text: c.textContent } : null; }))
85
+ || await p.evaluate(() => { const c = document.querySelector('#phoneCard'); const s = c && c.closest('.czs-sec'); return c ? { moment: c.dataset.moment, card: !c.hidden, fold: !!s && !s.hidden, text: c.textContent } : null; });
86
+ let c = null;
87
+ ok('M1 a meeting under way is left to Home: Your day shows no Now card and no Now fold', !!m1 && !m1.card && !m1.fold && !/Under way/.test(m1.text), JSON.stringify(m1));
85
88
  if (p.__shot) await p.__shot('light');
86
89
  await p.__ctx.close();
87
90
 
@@ -125,13 +128,13 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
125
128
 
126
129
  /* O: Open the meeting */
127
130
  const hit = { ok: true, range: { start: DATE, end: DATE }, cells: [{ key: DATE, end: DATE, events: [{ id: 'ev1', title: A.title, at: A.start, end: A.end, attendees: A.people }] }], context: {} };
128
- p = await scene({ time: at(10, 20), today: [A], week: hit });
129
- await wait(p, /Under way/);
131
+ p = await scene({ time: at(9, 45), today: [A], week: hit }); // a meeting under way is Home's (M1): Open the meeting is pressed before it
132
+ await wait(p, /Starts/);
130
133
  await p.click('#phoneCard [data-pha="phopen"]');
131
134
  ok('O1 Open the meeting opens the meeting in the Viewer', await until(() => p.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); return !!v && /Partner sync/.test(v.textContent); })));
132
135
  await p.__ctx.close();
133
- p = await scene({ time: at(10, 20), today: [A], week: { ok: true, range: { start: DATE, end: DATE }, cells: [], context: {} } });
134
- await wait(p, /Under way/);
136
+ p = await scene({ time: at(9, 45), today: [A], week: { ok: true, range: { start: DATE, end: DATE }, cells: [], context: {} } });
137
+ await wait(p, /Starts/);
135
138
  await p.click('#phoneCard [data-pha="phopen"]');
136
139
  await sleep(800);
137
140
  ok('O2 when the calendar does not list it, the meeting still opens from the day\'s record, never in the old dialog and never the console', await p.evaluate(() => !document.querySelector('#dlg.on') && !!document.querySelector('#czViewer:not([hidden])') && /\/premium\.html$/.test(location.pathname)));
@@ -40,6 +40,12 @@
40
40
  .lv-tm.rec { color: var(--cz-red); }
41
41
  .lv-tm.stop { color: var(--cz-late); }
42
42
 
43
+ /* Home on a desktop (batch 18 item 6): beside the menu button the pill reached into the chat card and covered its +, whenever the list
44
+ is narrow or folded; it sits above the menu button instead, and its list opens above it */
45
+ @media (min-width: 761px) {
46
+ body.cz-home .cz-live { left: 8px; bottom: 68px; }
47
+ body.cz-home .lv-tray { bottom: 116px; }
48
+ }
43
49
  /* a phone: the menu button is bottom right, so the pill sits to its left, and the list is a short sheet */
44
50
  @media (max-width: 760px) {
45
51
  .cz-live { left: auto; right: 68px; }
@@ -358,7 +358,8 @@ function day(on) {
358
358
  if (isPhone()) mountPull(body, { read: rereadDay, label: 'Reading your day again' });
359
359
  body.onclick = (e) => { // the rows are the list's own rows: the same presses open them
360
360
  const b = e.target.closest('button'); if (!b) return;
361
- if (b.dataset.hmSel) { select(b.dataset.hmSel); return; }
361
+ if (b.dataset.hmSel) { if (b.dataset.hmSel === 'n:update' && !rowById('n:update')) openUpdateViewer(); else select(b.dataset.hmSel); return; }
362
+ if (b.dataset.yd === 'fin') { const d = (dayParts().Y.drafts || [])[+b.dataset.i]; if (d && d.fin) { VW.drill(); openFinished(d.fin); } return; }
362
363
  if (b.dataset.yd === 'sel') { const c = b.closest('.yd-call'); if (c) select(c.dataset.id); return; }
363
364
  if (b.dataset.yd === 'retry' || b.dataset.yd === 'prep') { dayAct(b); return; }
364
365
  if (b.dataset.yd === 'sync') { syncAgain(b); return; }
@@ -366,7 +367,6 @@ function day(on) {
366
367
  if (b.dataset.yd === 'news' || b.dataset.yd === 'news-all') { VW.drill(); MORE.openInbox(searchGo, b.dataset.yd === 'news' ? b.dataset.id : ''); return; }
367
368
  if (b.dataset.yd === 'seen') { daySeen(b); return; }
368
369
  if ('hmReview' in b.dataset) { openReviewVw(); return; }
369
- if ('hdMeet' in b.dataset && S.Y && S.Y.next) openMeeting(S.Y.next.meeting);
370
370
  };
371
371
  } });
372
372
  readNews();
@@ -1807,7 +1807,7 @@ mountLivePill(document, {
1807
1807
  return true;
1808
1808
  },
1809
1809
  });
1810
- PHC = mountPhoneCard({ pmGet, pmPost, toast, ws: () => WS || null, openMeeting: (m) => openMeeting(m) }); drawList();
1810
+ PHC = mountPhoneCard({ pmGet, pmPost, toast, ws: () => WS || null, openMeeting: (m) => openMeeting(m), skip: ['meeting'] }); drawList();
1811
1811
  drawList(); drawTop();
1812
1812
  { // a conversation the address names opens at once, before the lists are read, so nothing typed or attached lands in the Home chat
1813
1813
  const a = P.get('about') || '', early = /^(decision|blocked|waited|src|ev|work|board|doc|ins|chat|pop):[A-Za-z0-9][A-Za-z0-9._:-]{0,100}$/.test(a) && !P.get('open') && !P.get('session') ? a : null;
@@ -198,10 +198,11 @@ function waitRow(r) {
198
198
  return `<div class="hm-r hv-r two" data-id="${esc(r.id)}"><button type="button" class="hm-rm" data-hm-sel="${esc(r.id)}"><span class="hv-mk">${mark}</span><span class="hm-rt"><b>${esc(r.name)}</b>${sub}</span></button></div>`;
199
199
  }
200
200
  const DSTATE = { review: 'Ready for you at your desk', done: 'Finished', sent: 'Sent' };
201
- function draftRow(d) {
201
+ /* a draft row opens what it is (batch 18 item 3: both rows were dead on a phone): a finished draft opens what Claude wrote, the weekly update opens the update */
202
+ function draftRow(d, i) {
202
203
  if (d.row) return waitRow({ ...d.row, sub: d.row.sub || 'Drafted for you' });
203
204
  const f = d.fin;
204
- return `<div class="hm-r hv-r two yd-fin"><div class="hm-rm"><span class="hv-mk"><span class="yd-tick">${svg(CHECK, 13, 2.6)}</span></span><span class="hm-rt"><b>${esc(f.title)}</b><em>${esc(DSTATE[f.status] || 'Finished')}${f.summary ? ' · ' + esc(f.summary) : ''}</em></span></div></div>`;
205
+ return `<div class="hm-r hv-r two yd-fin"><button type="button" class="hm-rm" data-yd="fin" data-i="${i}" aria-label="${esc(f.title)}. Open"><span class="hv-mk"><span class="yd-tick">${svg(CHECK, 13, 2.6)}</span></span><span class="hm-rt"><b>${esc(f.title)}</b><em>${esc(DSTATE[f.status] || 'Finished')}${f.summary ? ' · ' + esc(f.summary) : ''}</em></span></button></div>`;
205
206
  }
206
207
 
207
208
  /* the L figure in Your move when nothing needs the PM: his tea on a quiet day (AdB2), celebrating on an earned one (AdB3) */
@@ -256,12 +257,10 @@ export function dayParts(Y, o = {}) {
256
257
  if (Y.calls.length) sections.push({ id: 'move', title: 'Your move', count: Y.calls.length, open: true, html: Y.calls.map(callHtml).join('') });
257
258
  else if (big) sections.push({ id: 'move', title: 'Your move', open: true, html: bigHtml(big) });
258
259
  { const nw = newsSection(Y.news || [], o.now, Y.digests || 0); if (nw) sections.push(nw); }
259
- if (Y.drafts.length) sections.push({ id: 'drafts', title: 'Drafted for you', count: Y.drafts.length, html: `<div class="hv-card">${Y.drafts.map(draftRow).join('')}</div>` });
260
+ if (Y.drafts.length) sections.push({ id: 'drafts', title: 'Drafted for you', count: Y.drafts.length, html: `<div class="hv-card">${Y.drafts.map((d, i) => draftRow(d, i)).join('')}</div>` });
260
261
  if (Y.wait.length) sections.push({ id: 'wait', title: 'Can wait', count: Y.wait.length, html: `<div class="hv-card hd-move">${Y.wait.map(waitRow).join('')}</div>` });
262
+ // the meeting on now or next is Home's own meeting line (say it once, batch 18 item 3); a phone's moment card shows only what Home does not
261
263
  if (o.moment) sections.push({ id: 'now', title: 'Now', open: true, html: '<div class="hd-now"></div>' }); // drawDay puts the moment card in
262
- else if (Y.next) {
263
- sections.push({ id: 'next', title: Y.next.now ? 'On now' : 'Next meeting', count: Y.next.now ? '' : Y.next.time, html: `<div class="hv-card"><div class="hm-r hv-r two"><button type="button" class="hm-rm" data-hd-meet><span class="hv-mk">${svg(CLOCK, 15)}</span><span class="hm-rt"><b>${esc(Y.next.title)}</b><em>${esc(Y.next.now ? 'On now' : Y.next.time)}</em></span><span class="hv-cv">${svg(CHEV, 16)}</span></button></div></div>` });
264
- }
265
264
  if (Y.tomorrow && !o.moment) sections.push(tomorrowSection(Y.tomorrow)); // a phone's moment card already shows tomorrow at the end of the day (say it once)
266
265
  sections.push({ id: 'week', title: 'This week', count: Y.week.sub, html: `<div class="hv-card"><div class="hm-r hv-r two" data-id="review"><button type="button" class="hm-rm" data-hm-review aria-label="Weekly review: ${esc(Y.week.sub)}. Open"><span class="hv-mk">${svg(CAL, 16)}</span><span class="hm-rt"><b>Weekly review</b><em>${esc(Y.week.sub)}</em></span><span class="hv-cv">${svg(CHEV, 16)}</span></button></div></div>` });
267
266
  const scene = !big && o.first && Y.mood !== 'concerned' && new Date(now).getHours() < 12;
@@ -3,7 +3,7 @@
3
3
  * the moment of the day, in the card's shape. At 640 px and narrower only; a desktop never reads /api/phone-day.
4
4
  * The moment comes from momentOf (c3-phone-model.js) over the /api/brief-page day and the clock; every line comes from /api/brief-page or
5
5
  * /api/phone-day. Done and Undo press /api/pm-items/done and /reopen on the PM's own item; nothing is written on load.
6
- * mountPhoneCard({ pmGet, pmPost, toast, ws, openMeeting }) → { el, read } */
6
+ * mountPhoneCard({ pmGet, pmPost, toast, ws, openMeeting, skip }) → { el, read }; skip: moment kinds left to Home (say it once) */
7
7
  import { momentOf, inText } from './phone-moment.js';
8
8
 
9
9
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
@@ -76,8 +76,10 @@ export function mountPhoneCard(o) {
76
76
  let h;
77
77
  if (!P.page) h = '<span class="label">Now</span><p class="phl">Reading your day.</p>';
78
78
  else if (!P.page.ok) h = `<span class="label">Now</span><p class="pherr" role="alert">Your day could not be read: ${esc(P.page.error || 'the workspace server did not answer')}.</p>`;
79
- else { const mo = momentNow(); el.dataset.moment = mo.kind; h = moment(mo); }
79
+ else { const mo = momentNow(); el.dataset.moment = mo.kind; h = (o.skip || []).includes(mo.kind) ? '' : moment(mo); }
80
80
  el.innerHTML = h;
81
+ // a moment Home already shows (batch 18 item 3: the live meeting is Home's own row) is said once: the card and its Now fold go quiet
82
+ el.hidden = !h; { const sec = el.closest('.czs-sec'); if (sec) { sec.hidden = !h; sec.style.display = h ? '' : 'none'; } }
81
83
  if (focus) { const f = el.querySelector(focus); if (f) f.focus(); }
82
84
  }
83
85
  async function read(force) {
@@ -109,7 +109,7 @@ export function budgetMeta(b, today) {
109
109
  const R = b.reading || {};
110
110
  if (R.txt) return [R.txt, ageOf(R.at, today, R.ageDays)].filter(Boolean).join(' · ');
111
111
  if (R.share != null) return Math.round(R.share * 100) + '% of open initiatives' + (b.cap != null ? ' · cap ' + Math.round(b.cap * 100) + '%' : '');
112
- return b.declared === false ? 'Not in the budget registry' : 'No reading yet';
112
+ return b.declared === false ? 'No limit set yet' : 'No reading yet'; // batch 18 item 4: plain words; the Viewer says what to do
113
113
  }
114
114
  /** The owner on the avatar: the server's who (from Jira or the PM), else today's owner string. */
115
115
  export function whoOf(g) {
@@ -163,10 +163,15 @@ export function draftRowHtml(r) {
163
163
  const plural = (n, a, b) => n + ' ' + (n === 1 ? a : b);
164
164
  /** The ✦ line: the one thing that matters this week (GsM1–M5). The server's okr.line wins. Before it: a broken limit (red, the one time); else
165
165
  * the drafts waiting (✓✓ keeps them all); else the goal furthest behind with why; else a stale reading; else all on their line. It never says
166
- * "no insight": with nothing read it says what Claude does next. o = { okr, goals, budgets, drafts, running, product } */
166
+ * "no insight": with nothing read it says what Claude does next. o = { okr, goals, budgets, drafts, running, failed, product } */
167
167
  export function lineOf(o) {
168
168
  const L = o.okr && o.okr.line;
169
169
  const G = (o.goals || []).concat(o.budgets || []), open = (o.drafts || []).filter((r) => r.state === 'open'), name = o.product || 'this product';
170
+ // batch 18 item 4: what the drafting run does now wins over the server's line (it is older than the run), except a broken limit. While it
171
+ // runs, say so; when it failed or drafted nothing, say that plainly and offer ✦ again. o.failed: the run's error.
172
+ const loud = !!(L && L.tone === 'crit');
173
+ if (o.running && !loud) return { head: 'I am drafting the goals for ' + name + '.', sub: o.runningSay || 'I read the PRDs and the sources first, then I propose each goal with how I will read it. You can follow it in Sessions.', tone: 'drafts', keepAll: 0 };
174
+ if (o.failed && !open.length && !loud) return { head: 'I could not draft the goals for ' + name + '.', sub: String(o.failed).replace(/\.?$/, '.') + ' Press ✦ to try again.', tone: 'drafts', keepAll: 0, start: true, retry: true };
170
175
  // The server's line leads (lib/goal-status.js lineOf: one status everywhere). The drafts the page just loaded are fresher than the model, so
171
176
  // they set ✓✓ and the drafted sub; with none left, a sub about drafts is stale and goes.
172
177
  if (L && L.head && !(L.tone === 'calm' && open.length)) {
@@ -176,10 +181,9 @@ export function lineOf(o) {
176
181
  if (open.length && out.tone !== 'drafts') out.sub = open.length === 1 ? 'I drafted one fix under it.' : 'I drafted ' + open.length + ' fixes. Keep them all at once, or one by one.';
177
182
  else if (!open.length && L.keepAll) out.sub = '';
178
183
  }
179
- if (!(o.goals || []).length && !open.length && !o.running) { out.start = true; out.sub = out.sub || 'Or press ✦ and I draft the North Star and key results from your PRDs now, each with how I will read it.'; }
184
+ if (!(o.goals || []).length && !open.length && !o.running) { out.start = true; out.sub = out.sub || 'Press ✦ and I draft the North Star from your PRDs now, with how I will read it.'; }
180
185
  return out;
181
186
  }
182
- if (o.running) return { head: 'I am drafting the goals for ' + name + '.', sub: o.runningSay || 'I read the PRDs and the sources first, then I propose each goal with how I will read it.', tone: 'drafts', keepAll: 0 };
183
187
  const broken = G.filter((g) => dotOf(g) === 'broken');
184
188
  if (broken.length) {
185
189
  const b = broken[0], fix = open.find((r) => r.goal === b.id);
@@ -387,13 +387,13 @@ const listGoals = () => (PF ? [] : M.goals.filter((g) => isOwnKr(g) && (g.role =
387
387
  * the strip's first item; the findings and the reports Claude proposes follow it. It never says "There is no insight yet". */
388
388
  function okrLine() {
389
389
  const run = DR && DR.run;
390
- return OK.lineOf({ okr: M.okr, goals: listGoals(), budgets: M.budgets || [], drafts: drAll(), running: !!(run && run.state === 'running'), product: M.board.name });
390
+ return OK.lineOf({ okr: M.okr, goals: listGoals(), budgets: M.budgets || [], drafts: drAll(), running: !!(run && run.state === 'running'), failed: run && run.state === 'failed' ? (run.error || 'The run failed') : null, product: M.board.name });
391
391
  }
392
392
  function stripList() {
393
393
  const I0 = M.insight || { none: true, text: '' };
394
394
  // Your impact (batch 16 item 7, GmA4Moments): a key result that moved after your work, as one more ✦ line, with its source to open
395
395
  const im = PF ? null : IM.intelItem(), mine = im ? [im] : [];
396
- const ok = PF ? [] : [Object.assign({ okr: true, text: '', why: '' }, (() => { const L = okrLine(); return { text: L.head, why: L.sub, tone: L.tone, keepAll: L.keepAll, start: !!L.start }; })())];
396
+ const ok = PF ? [] : [Object.assign({ okr: true, text: '', why: '' }, (() => { const L = okrLine(); return { text: L.head, why: L.sub, tone: L.tone, keepAll: L.keepAll, start: !!L.start, retry: !!L.retry }; })())];
397
397
  if (I0.none) return ok.concat(PF ? [] : RI.stripItems(), mine);
398
398
  const finds = [{ text: I0.text, why: I0.why || '', chart: I0.chart, move: I0.move || null, calm: !!I0.calm }].concat((I0.more || []).map((x) => ({ text: x.text, why: x.why || '', chart: x.chart, move: x.move || null })));
399
399
  // a calm finding ("Nothing stands out") says what the ✦ line already says: it is left out
@@ -426,7 +426,7 @@ function drawStrip() {
426
426
  : `<button type="button" class="cz-ib sm solid" data-mv="apply" aria-label="${esc(mv.label)}" title="${esc(mv.label)}">${SV(I.chk)}</button>`;
427
427
  // the ✦ line's own press: ✓✓ keeps every draft (GsM1, GsM5); with nothing to read, ✦ asks Claude to draft the goals
428
428
  const okAct = !f.okr ? '' : f.keepAll ? `<button type="button" class="cz-ib sm solid" data-okl="keep-all" aria-label="Keep all ${f.keepAll}" title="Keep all ${f.keepAll}">${OK.SV(OK.P.checks)}</button>`
429
- : f.start && M.board.ws ? `<button type="button" class="cz-ib sm solid" data-okl="start" aria-label="Draft them" title="Draft them">${SV(I.spark)}</button>` : '';
429
+ : f.start && M.board.ws ? `<button type="button" class="cz-ib sm solid" data-okl="start" aria-label="${f.retry ? 'Try drafting again' : 'Draft them'}" title="${f.retry ? 'Try again' : 'Draft them'}">${SV(I.spark)}</button>` : '';
430
430
  if (!f.report) $('#insAct').innerHTML = mvAct + okAct;
431
431
  if (open.length > 1) {
432
432
  if (!f.report) $('#insAct').innerHTML = `<button type="button" class="cz-ib sm" id="insNo" aria-label="Not now" title="Not now">${SV(I.x)}</button>` + mvAct + okAct;
@@ -547,7 +547,8 @@ async function draftPress(k, row, b) {
547
547
  const res = await pmPost('/api/metric-drafts/' + k, Object.assign({}, base, row ? { row } : {}));
548
548
  if (!res || res.ok !== true) { if (b) b.disabled = false; toast((res && res.error) || 'It could not be done. Nothing changed.'); return; }
549
549
  const name = r0 ? r0.text : 'it';
550
- const said = k === 'start' ? 'I am drafting them. They appear under each goal.'
550
+ // batch 18 item 4: say only what the server started. The run is in Sessions; the ✦ line follows it and says when it ends, or why it failed.
551
+ const said = k === 'start' ? (res.already ? 'I am already drafting them. The drafts show here when I finish.' : 'Drafting now. Follow it in Sessions; the drafts show here when I finish.')
551
552
  : k === 'keep-all' ? 'Kept ' + (res.kept || 'them all') + '. I read them from now on.'
552
553
  : k === 'keep' ? (res.outbox ? (r0 && r0.kind === 'ticket' ? 'In the outbox for Jira.' : 'In the outbox. It goes as you.') : res.open === 'settings:connectors' ? 'Opening Connectors.' : 'Kept. I read it from now on.')
553
554
  : k === 'drop' ? 'Not now: ' + name + '.' : k === 'undo' ? 'Undone.' : 'Done.';
@@ -894,7 +895,7 @@ function openBudget(id) {
894
895
  const b = (M.budgets || []).find((x) => x.id === id); if (!b) return;
895
896
  const R = b.reading, has = R && R.share !== null;
896
897
  const sum = { line: [has ? pct(R.share) + ' now' : 'No reading yet', b.cap !== null ? 'cap ' + pct(b.cap) + ' of a quarter’s initiatives' : 'no cap declared'].join(' · '), tone: has && R.over ? 'warn' : '',
897
- text: has ? (R.over ? 'Over its cap.' : 'Within its cap.') + ' ' + R.n + ' of ' + R.total + ' open on the Board.' : 'It has no reading: ' + (b.declared ? 'no open initiative to share.' : 'it is not in the budget registry.'),
898
+ text: has ? (R.over ? 'Over its cap.' : 'Within its cap.') + ' ' + R.n + ' of ' + R.total + ' open on the Board.' : b.declared ? 'It has no reading: no open initiative to share.' : 'Initiatives use it, but no limit is set for it yet. Discuss it in Home and I set one up.',
898
899
  meta: [b.anchor, 'always on', 'judged every week'].join(' · ') };
899
900
  const text = [b.title, sum.line, sum.text].join('\n');
900
901
  vwOpen({ kind: 'Health budget', title: b.title, icon: 'goal', id: 'budget:' + id, more: [{ label: 'Copy as text', on: () => copyText(text, 'Copied as text.') }],
@@ -50,7 +50,7 @@
50
50
  </div>
51
51
 
52
52
  <!-- the ✦ strip (Iq8Overview): one finding at a time, its drafted move when it has one, Ask why, Not now and the dots that page through them -->
53
- <div class="ins-strip ins-hero" id="insHero"><span class="sp" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z"/></svg></span><p class="t" id="insText" aria-live="polite"><b id="insEye"></b> <span id="brief">Reading the records.</span> <span id="insWhy"></span><span class="ins-mv" id="insMv" hidden></span></p><span class="ins-hact" id="insAct"></span><a class="cz-chip gh" id="askWhy" href="/premium.html?ask=insights"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 11l9-7 9 7v9a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z"/></svg>Ask why</a><span class="ins-pg" id="insPg"></span></div>
53
+ <div class="ins-strip ins-hero" id="insHero"><span class="sp" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z"/></svg></span><p class="t" id="insText" aria-live="polite"><b id="insEye"></b> <span id="brief">Reading the records.</span> <span id="insWhy"></span><span class="ins-mv" id="insMv" hidden></span></p><span class="ins-hact" id="insAct"></span><a class="cz-chip gh" id="askWhy" href="/premium.html?ask=insights"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 5h16v11H9l-5 4z"/></svg>Ask why</a><span class="ins-pg" id="insPg"></span></div>
54
54
  <!-- the North Star and its inputs (Iq8Overview): drawn only when a KR metric record has role north-star -->
55
55
  <section class="ins-ns" id="nsRow" aria-label="North Star" hidden></section>
56
56
  <!-- what Claude drafted for this product (Iq8Suggest, Iq9Draft): shown only while a draft is running or waits for your ✓ -->
@@ -2934,7 +2934,7 @@ const metricDraftRuns = require('./lib/metric-draft-runs.js').create({
2934
2934
  env: process.env,
2935
2935
  promptFor: (skillId) => { const h = homeWorkspace(); const t = taskById(skillId, h ? h.root : SELF_ROOT); return t && t.prompt ? t.prompt : null; },
2936
2936
  spawn: (spec) => orchSpawn.spawn({ name: spec.name, agent: 'claude', ws: spec.ws, origin: spec.origin, initialInput: spec.initialInput, initiative: spec.initiative, extraEnv: spec.env, autoDelete: undefined, onDone: spec.onDone }),
2937
- spawnNow: (spec) => spawnSession({ name: spec.name, agent: 'claude', ws: spec.ws, origin: spec.origin, initialInput: spec.initialInput, initiative: spec.initiative, extraEnv: spec.env, autoDelete: undefined, onDone: spec.onDone }),
2937
+ spawnNow: (spec) => spawnSession({ name: spec.name, agent: 'claude', ws: spec.ws, origin: spec.origin, initialInput: spec.initialInput, initiative: spec.initiative, extraEnv: spec.env, autoDelete: undefined, onDone: spec.onDone, byPm: spec.byPm === true }),
2938
2938
  stop: (s) => { if (s && s.child) stopHeadless(s); },
2939
2939
  warn: (what, e) => warnWriteFail(what, e),
2940
2940
  });
@@ -3129,6 +3129,7 @@ function persist(s) {
3129
3129
  state: s.state, note: s.note || '', created: s.created, tmux: s.tmux || null, origin: s.origin || null };
3130
3130
  if (s.autoDelete) meta.autoDelete = s.autoDelete;
3131
3131
  if (s.autoEnded) meta.autoEnded = true;
3132
+ if (s.byPm) meta.byPm = true;
3132
3133
  if (s.headless) meta.headless = s.headless;
3133
3134
  if (s.outcome) meta.outcome = s.outcome; // a background run's end, for its card (initiative background-run-outcome)
3134
3135
  if (s.exitedAt) meta.exitedAt = s.exitedAt;
@@ -3581,7 +3582,7 @@ function sessionList() {
3581
3582
  auto_name: s.autoName ? s.autoName.text : null, name_by: s.nameBy || null,
3582
3583
  model: 'model' in s ? s.model : null, model_line: modelLib.line('model' in s ? s.model : null),
3583
3584
  cwd: path.relative(s.root, s.cwd) || '.', note: s.note || '', origin: s.origin || null,
3584
- automatic: sessionOrigin.isAutomatic(s.origin), // the workspace started it, not the PM: the dock hides these by default
3585
+ automatic: sessionOrigin.isAutomatic(s.origin) && !s.byPm, // the workspace started it, not the PM: the dock hides these by default
3585
3586
  auto_delete: s.autoDelete || null,
3586
3587
  auto_ended: !!s.autoEnded, // PMOS ended it (idle, or room for a newer chat), not the PM: a chat's row stays on Home and resumes (batch 7)
3587
3588
  headless: s.headless || null, // workspace-headless-jobs: a background run with no terminal ('notes' or 'skill')
@@ -4369,7 +4370,7 @@ function spawnSession(opts) {
4369
4370
  return s;
4370
4371
  }
4371
4372
  function noteSessionEnd(s) { try { if (refreshRun) refreshRun.ended(s); } catch (e) { warnWriteFail('refresh log (end)', e); } }
4372
- function spawnSessionInner({ name, agent, cwd, ws, origin, initialInput, profile, initiative, modelAsk, planItem, workType, autoDelete, launchFlags, addDirs, onDone, scratch, extraEnv, writePaths, chatClaude }) {
4373
+ function spawnSessionInner({ name, agent, cwd, ws, origin, initialInput, profile, initiative, modelAsk, planItem, workType, autoDelete, launchFlags, addDirs, onDone, scratch, extraEnv, writePaths, chatClaude, byPm }) {
4373
4374
  const id = nextSessionId();
4374
4375
  /* pm-os-absorb Run 1 — every AGENT session gets a token, `<id>.<8 hex>`, in its environment as PMOS_SESSION, and
4375
4376
  * PMOS_BIN, this workspace's own bin/pmos.js. `pmos item` run inside it is then attributed `agent:<token>` (the token
@@ -4426,9 +4427,10 @@ function spawnSessionInner({ name, agent, cwd, ws, origin, initialInput, profile
4426
4427
  itemEnv.PMOS_WS_PORT = String(PORT);
4427
4428
  Object.assign(penv, itemEnv);
4428
4429
  // horizon-scan: the scan runs set PMOS_SCAN_FILE, PMOS_SCAN_ORIGIN and PMOS_SCAN_RUN for `pmos scan file`; the report-setup and report-find runs
4429
- // (report-workspace) set PMOS_REPORT_FILE and PMOS_REPORT_RUN for `pmos report propose`; nothing else is added.
4430
+ // (report-workspace) set PMOS_REPORT_FILE and PMOS_REPORT_RUN for `pmos report propose`.
4430
4431
  // core-documents: a core-doc run sets PMOS_CORE_DOC_SCOPE and PMOS_CORE_DOC_KEY, the one entry `pmos coredoc write` may write.
4431
- if (extraEnv && typeof extraEnv === 'object') for (const k of ['PMOS_SCAN_FILE', 'PMOS_SCAN_ORIGIN', 'PMOS_SCAN_RUN', 'PMOS_REPORT_FILE', 'PMOS_REPORT_RUN', 'PMOS_CORE_DOC_SCOPE', 'PMOS_CORE_DOC_KEY', 'PMOS_CORE_DOC_KEYS']) if (typeof extraEnv[k] === 'string') penv[k] = extraEnv[k];
4432
+ // A metric-draft, propose, impact, metric-read or ms-review run sets its own pins too (lib/headless.js RUN_ENV).
4433
+ Object.assign(penv, headlessLib.runEnvOf(extraEnv));
4432
4434
  const base = { id, ws: w ? w.id : wsId(SELF_ROOT), root, name: (name && String(name).trim()) || agent, agent, origin: tag,
4433
4435
  profile: pres.id, profileRefusal: pres.ok ? null : pres.error };
4434
4436
  // Hand to agent: the breakdown item this session was started for, or null. Set only by /api/plan-items/handoff/go.
@@ -4437,6 +4439,9 @@ function spawnSessionInner({ name, agent, cwd, ws, origin, initialInput, profile
4437
4439
  if (scratch) base.scratchDir = workdir; // removed when the web run ends (startHeadless)
4438
4440
  // 'never' opts this one job out of the automatic clean-up (lib/session-origin.js); anything else is the workspace policy.
4439
4441
  if (autoDelete === 'never') base.autoDelete = 'never';
4442
+ // batch 18 item 4: a background run the PM's own press started (✦ Draft them on Intelligence) is listed with the PM's sessions while it runs,
4443
+ // not folded into "Started by PMOS", so the press shows a session at once
4444
+ if (byPm === true) base.byPm = true;
4440
4445
  const wt = workTypeOrNull(workType);
4441
4446
  if (wt) base.workType = wt;
4442
4447
  // session names A: a chat that resumes its own Claude conversation keeps the name it had (the PM's, or Claude's)
@@ -116,7 +116,9 @@ function configure({ name = 'run', port = null } = {}) {
116
116
  PORT: chosen, HOST, BASE: `http://${HOST}:${chosen}`, STATE_DIR: stateDir,
117
117
  /** Environment for a spawned server/launcher: this run's state dir and tmux socket. */
118
118
  env(extra = {}) {
119
- return { ...process.env, PMOS_STATE_DIR: stateDir, ...extra };
119
+ // PMOS_IMPACT=off: the daily Your impact run starts on the first tick inside working hours and would take a background slot (and a
120
+ // session row) in whatever suite happens to run then; a suite about it passes PMOS_IMPACT itself (feedback batch 18, CI)
121
+ return { ...process.env, PMOS_STATE_DIR: stateDir, PMOS_IMPACT: 'off', ...extra };
120
122
  },
121
123
  /** A port nobody else holds, for a suite that needs a second server. */
122
124
  port: claimEphemeralPort,