create-pmos 0.543.0 → 0.544.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.543.0",
3
+ "version": "0.544.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,19 @@
32
32
  "audit"
33
33
  ],
34
34
  "pmosChanges": [
35
+ {
36
+ "v": "0.544.0",
37
+ "at": "2026-11-08T14:45:01.680Z",
38
+ "f": 4,
39
+ "prs": [
40
+ {
41
+ "n": 1272,
42
+ "t": "Claude calls and sign-in advice follow the chosen Claude profile; a session stuck at sign-in ends",
43
+ "s": "Claude calls and sign-in advice follow the chosen Claude profile; a session stuck at sign-in ends",
44
+ "k": "fix"
45
+ }
46
+ ]
47
+ },
35
48
  {
36
49
  "v": "0.543.0",
37
50
  "at": "2026-11-08T10:18:52.684Z",
@@ -410,49 +423,6 @@
410
423
  "k": "fix"
411
424
  }
412
425
  ]
413
- },
414
- {
415
- "v": "0.524.0",
416
- "at": "2026-11-04T08:57:48.087Z",
417
- "f": 4,
418
- "prs": [
419
- {
420
- "n": 1224,
421
- "t": "Setup as one conversation, with the fundamentals settled (onboarding B1)",
422
- "s": "Setup as one conversation, with the fundamentals settled (onboarding B1)",
423
- "k": "new"
424
- },
425
- {
426
- "n": 1223,
427
- "t": "A feature appears when its moment comes (onboarding B3, gradual exposure)",
428
- "s": "A feature appears when its moment comes (onboarding B3, gradual exposure)",
429
- "k": "new"
430
- },
431
- {
432
- "n": 1222,
433
- "t": "After setup, Home shows what it did, the product portrait and the drafted first initiative (onboarding B2)",
434
- "s": "After setup, Home shows what it did, the product portrait and the drafted first initiative (onboarding B2)",
435
- "k": "new"
436
- },
437
- {
438
- "n": 1227,
439
- "t": "Idle lab screens: ✦ cards, compare view and Intelligence › Lab (build U)",
440
- "s": "Idle lab screens: ✦ cards, compare view and Intelligence › Lab (build U)",
441
- "k": "new"
442
- },
443
- {
444
- "n": 1234,
445
- "t": "Good morning reads the quarter — goal states, the PM's line, snapshot, goal tags, Yes effect (GM1)",
446
- "s": "Good morning reads the quarter — goal states, the PM's line, snapshot, goal tags, Yes effect (GM1)",
447
- "k": "new"
448
- },
449
- {
450
- "n": 1228,
451
- "t": "One queue for all background work (idle lab build Q)",
452
- "s": "One queue for all background work (idle lab build Q)",
453
- "k": "new"
454
- }
455
- ]
456
426
  }
457
427
  ]
458
428
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@bf89a7b5
1
+ kernel-source: pmos@83e8d786
2
2
  assembled: 2026-11-08
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-08T10:18:49Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-08T14:44:58Z"}
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-08T10:18:49Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-08T14:44:58Z"}
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-08T10:18:49Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-08T14:44:58Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,17 @@
1
1
  [
2
+ {
3
+ "v": "0.544.0",
4
+ "at": "2026-11-08T14:45:01.680Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1272,
9
+ "t": "Claude calls and sign-in advice follow the chosen Claude profile; a session stuck at sign-in ends",
10
+ "s": "Claude calls and sign-in advice follow the chosen Claude profile; a session stuck at sign-in ends",
11
+ "k": "fix"
12
+ }
13
+ ]
14
+ },
2
15
  {
3
16
  "v": "0.543.0",
4
17
  "at": "2026-11-08T10:18:52.684Z",
@@ -0,0 +1,51 @@
1
+ 'use strict';
2
+ /*
3
+ * lib/claude-signin.js — the command the PM types to sign Claude in again: the one for the Claude profile PMOS runs under.
4
+ *
5
+ * Every background run starts under the PM's chosen Claude profile (prefs.json `claude`, Settings → Claude). The sign-in
6
+ * advice said "run claude" whatever that choice was. On a Mac whose runs use `claude-personal`, that advice signs in the
7
+ * wrong login, and the runs stay signed out (bug 2026-11-08). The advice now names the command of the chosen profile.
8
+ *
9
+ * commandFor(profile, home) → 'claude' | 'claude-personal' | 'CLAUDE_CONFIG_DIR=~/.claude-x claude'
10
+ * profile: the resolved profile (lib/profiles.js shape) or null for Claude's own login.
11
+ * configure({ profile }) the server registers () => profile (setResolver(fn) is the same); the libraries read it through command()
12
+ * command() the command for the profile chosen now ('claude' when nothing is registered or it fails)
13
+ * how() 'Open Terminal, run `<command>`, type /login and sign in.'
14
+ * signedOutWhy() the reason a background run shows when Claude was signed out
15
+ * paneSignedOut(screen) a terminal pane's screen is Claude's sign-in (expired login, login-method picker)
16
+ */
17
+ const path = require('path');
18
+ const os = require('os');
19
+
20
+ const SAFE = /^[a-zA-Z0-9._-]{1,80}$/;
21
+ const tilde = (p, home) => (home && (p === home || p.startsWith(home + path.sep)) ? '~' + p.slice(home.length) : p);
22
+
23
+ function commandFor(profile, home = os.homedir()) {
24
+ if (!profile || typeof profile !== 'object') return 'claude';
25
+ const d = profile.detected && profile.detected.source;
26
+ // an alias, a shell function or a launcher script: its name is a command the PM can type
27
+ if ((d === 'shell' || d === 'launcher') && SAFE.test(String(profile.id || ''))) return String(profile.id);
28
+ const dir = profile.env && typeof profile.env === 'object' ? profile.env.CLAUDE_CONFIG_DIR : '';
29
+ if (typeof dir === 'string' && dir) {
30
+ const shown = tilde(path.resolve(dir), home);
31
+ return /^[~a-zA-Z0-9._/-]+$/.test(shown) ? `CLAUDE_CONFIG_DIR=${shown} claude` : `CLAUDE_CONFIG_DIR='${shown.replace(/'/g, "'\\''")}' claude`;
32
+ }
33
+ return 'claude';
34
+ }
35
+
36
+ let resolver = null;
37
+ function setResolver(fn) { resolver = typeof fn === 'function' ? fn : null; }
38
+ /** The server's wiring: configure({ profile: () => profile }) → this module. */
39
+ function configure({ profile } = {}) { setResolver(profile); return module.exports; }
40
+ function command() {
41
+ if (!resolver) return 'claude';
42
+ try { return commandFor(resolver()); } catch { return 'claude'; }
43
+ }
44
+ const how = () => `Open Terminal, run \`${command()}\`, type /login and sign in.`;
45
+ // Claude Code's own sign-in screens in a terminal pane: the expired-login line, and the login-method picker it opens. Narrower than
46
+ // lib/headless.js signedOut(), which reads a run's result: a pane also shows the agent's own words, which may name a login.
47
+ const PANE_RE = /please run \/login|select login method|oauth (?:session|token) (?:has )?expired/i;
48
+ const paneSignedOut = (screen) => PANE_RE.test(String(screen || ''));
49
+ const signedOutWhy = () => `Claude is signed out on this computer. ${how()} PMOS carries on by itself afterwards.`;
50
+
51
+ module.exports = { commandFor, configure, setResolver, command, how, signedOutWhy, paneSignedOut };
@@ -84,7 +84,7 @@ function of({ now, settings, state = {}, log, briefAt = 0, sessions = [], lastTi
84
84
  if (signedOut.length) {
85
85
  const names = signedOut.map((x) => x.label);
86
86
  const list = names.length === 1 ? names[0] : names.slice(0, -1).join(', ') + ' and ' + names[names.length - 1];
87
- add('bad', 'signedout', `Claude could not sign in at ${hm(Math.max(...signedOut.map((x) => x.at)))}, so ${list} did not refresh. Press Refresh all. If it fails again, open Terminal, run claude and type /login.`);
87
+ add('bad', 'signedout', `Claude could not sign in at ${hm(Math.max(...signedOut.map((x) => x.at)))}, so ${list} did not refresh. Press Refresh all. If it fails again, open Terminal, run ${require('./claude-signin.js').command()} and type /login.`);
88
88
  }
89
89
  const sync = runs('sync')[0];
90
90
  if (set.sources.sync && set.sources.sync.on && sync && sync.result === 'failed') {
@@ -618,7 +618,7 @@ function outcomeOf(r, { code = null, signal = null, timedOut = false, stopped =
618
618
  else if (stopped) why = 'Stopped by you.';
619
619
  else if (timedOut) why = `Stopped: still running after ${timeoutMin || Math.round(DEFAULT_TIMEOUT_MS / 60000)} minutes.`;
620
620
  else if (signal) why = `The process was ended (${signal}).`;
621
- else if (signedOut(res.text)) why = SIGNED_OUT_WHY;
621
+ else if (signedOut(res.text)) why = require('./claude-signin.js').signedOutWhy();
622
622
  else if (!res.ok) why = `It exited with code ${code} and printed no result${res.text ? ': ' + oneLine(res.text.split('\n').filter(Boolean).pop(), 200) : '.'}`;
623
623
  else if (res.isError) why = `The run reported an error${first ? ': ' + oneLine(first, 200) : '.'}`;
624
624
  else why = `It exited with code ${code}.`;
@@ -20,6 +20,7 @@
20
20
  * { stateDir, now?, homeWs(), proactive() → { quiet, dayCheck: { start, end, every } }, schedules: { read, write },
21
21
  * startSkill(wsId, skill, name, origin) → { ok, session?, error? }, jobs: { [id]: (ws) → { ok, error? } },
22
22
  * freshRows(ws) → [freshness row], copyPaths(id, ws) → [path], tell({ source, label, error, ws }), sessionAlive(id) → bool,
23
+ * sessionSignedOut?(id) → bool (its screen shows Claude's sign-in), stopSession?(id),
23
24
  * setDayCheckEvery(every), setRepoWatch(on), warn(what, e), leadsDue?(ws) → number of popup leads due,
24
25
  * readDirs?(ws) → { runtime, jira } where the stored reads are, for their fingerprint (smart refresh step 1); by default the
25
26
  * state folder and the Jira folder copyPaths('jira') names }
@@ -275,6 +276,15 @@ function create(host) {
275
276
  for (const [id, st] of Object.entries(state)) {
276
277
  for (const [sid, o] of Object.entries(openOf(st))) {
277
278
  let alive = true; try { alive = host.sessionAlive(sid); } catch { alive = true; }
279
+ // A terminal session whose Claude is signed out waits at the sign-in screen for ever: Morning brief and Popup leads each sat
280
+ // 6 hours that way (bug 2026-11-08). It ends now as signed out, so the Sources row says how to sign in, and its pane is closed.
281
+ let out = false; if (alive && host.sessionSignedOut) { try { out = !!host.sessionSignedOut(sid); } catch { out = false; } }
282
+ if (out) {
283
+ delete st.open[sid]; st.retry_at = null; changed = true;
284
+ R.append(dir, { source: id, ev: 'end', run: o.run, result: 'failed', took_ms: t - o.at, error: require('./claude-signin.js').signedOutWhy() }, t);
285
+ try { if (host.stopSession) host.stopSession(sid); } catch (e) { warn('stop a signed-out session', e); }
286
+ continue;
287
+ }
278
288
  if (!alive || t - o.at > LOST_MS) {
279
289
  delete st.open[sid]; st.retry_at = null; changed = true;
280
290
  R.append(dir, { source: id, ev: 'end', run: o.run, result: 'interrupted', took_ms: t - o.at, error: alive ? 'no end after 6 hours' : 'the session was gone (PMOS restarted, or the session was closed)' }, t);
@@ -130,7 +130,7 @@ function settleRun(ctx, key, done, now) {
130
130
  const res = done && done.result;
131
131
  if (done && done.stopped) return append(ctx.runtimeDir, key + '.jsonl', { k: 'fail', at, error: 'The run was stopped before it answered.' });
132
132
  if (done && done.timedOut) return append(ctx.runtimeDir, key + '.jsonl', { k: 'fail', at, error: 'The companion took too long and was stopped.' });
133
- if (res && headless.signedOut(res.text)) return append(ctx.runtimeDir, key + '.jsonl', { k: 'fail', at, auth: true, error: headless.SIGNED_OUT_WHY });
133
+ if (res && headless.signedOut(res.text)) return append(ctx.runtimeDir, key + '.jsonl', { k: 'fail', at, auth: true, error: require('./claude-signin.js').signedOutWhy() });
134
134
  if (!res || !res.ok || res.isError) return append(ctx.runtimeDir, key + '.jsonl', { k: 'fail', at, error: 'The companion did not answer (' + ((done && done.note) || 'no result') + ').' });
135
135
  const parsed = F.parseCompanion(res.text);
136
136
  // a malformed answer is dropped, not shown
@@ -119,7 +119,7 @@ function view(h, name = 'It') {
119
119
  const tried = n ? `Claude read it again ${n === 1 ? 'once' : n + ' times'} since ${hm(h.attempts[0].at)}${c ? `, and ${c.why}` : ''}.` : '';
120
120
  let action = null;
121
121
  if (h.state === 'needs-you') {
122
- if (h.cause === 'claude-signin') action = { label: 'Sign in to Claude', how: 'Open Terminal, run claude, type /login and sign in.', sec: 'claude' };
122
+ if (h.cause === 'claude-signin') action = { label: 'Sign in to Claude', how: require('./claude-signin.js').how(), sec: 'claude' };
123
123
  else if (h.cause === 'connector-missing') action = { label: 'Connect ' + name, how: 'Turn on its connector in your Claude connectors.', href: CONNECTORS };
124
124
  else if (h.cause === 'sign-in') action = { label: 'Reconnect ' + name, how: 'Sign in to its connector again in your Claude connectors.', href: CONNECTORS };
125
125
  else action = { label: 'Read ' + name + ' again', how: h.cause === 'manual' ? 'You chose to read it only when you press ↻.' : 'Claude stopped after ' + n + ' tries.', read: true };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.543.0",
3
+ "version": "0.544.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.543.0",
9
+ "version": "0.544.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.543.0",
3
+ "version": "0.544.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",
@@ -3258,6 +3258,9 @@ refreshRun = refreshRunLib.create({
3258
3258
  proactive: () => proSettings(),
3259
3259
  schedules: { read: readSchedules, write: writeSchedules },
3260
3260
  startSkill: (wsId, skill, name, origin) => startSkillSession(wsId, skill, name, origin),
3261
+ // a terminal session stuck at Claude's sign-in screen (the login it runs under expired): read from its pane, ended by the engine
3262
+ sessionSignedOut: (id) => { const x = sessions.get(String(id || '')); return !!x && !!x.tmux && x.state !== 'exited' && require('./lib/claude-signin.js').paneSignedOut(paneScreen(x)); },
3263
+ stopSession: (id) => { const x = sessions.get(String(id || '')); if (x && x.tmux) tmuxKillSession(x.tmux); },
3261
3264
  sessionAlive: (id) => { const x = sessions.get(String(id || '')); return !!x && x.state !== 'exited'; }, sessionOutcome: (id) => { const x = sessions.get(String(id || '')); return (x && x.outcome) || null; },
3262
3265
  // popup context slice 3b: how many opened popups have no lead newer than the newest stored read
3263
3266
  leadsDue: () => require('./lib/popup-leads.js').due(STATE, { readAt: require('./lib/lead-cli.js').newestRead(STATE) }).length,
@@ -4468,6 +4471,10 @@ const claudeSetup = require('./lib/claude-readiness').create({
4468
4471
  envFor: sessionEnvWithProfile,
4469
4472
  savePreference: (id) => { const p = readPrefs(); p.claude = id; return writePrefs(p); },
4470
4473
  });
4474
+ // The sign-in advice names the command of the Claude profile background runs use (lib/claude-signin.js), never plain `claude` when another is chosen.
4475
+ const claudeSignin = require('./lib/claude-signin.js').configure({
4476
+ profile: () => { const r = resolveProfileForSpawn(defaultProfileFor('claude')); return r.ok ? r.profile : null; },
4477
+ });
4471
4478
  claudeSetup.ensureOwn = () => require('./lib/own-profile').ensure(os.homedir(), profilesLib.profilesDir(os.homedir()));
4472
4479
  /* Sign-in (bug 2026-11-02): a login that is signed in already is used as it is, with no terminal. Otherwise the sign-in runs
4473
4480
  * `claude auth login`, not the full Claude Code screen: it opens the browser and at most asks for a pasted code, so a new user
@@ -6040,11 +6047,16 @@ function autoNameTick(s, hx) {
6040
6047
  const fail = () => { s._naming = false; s.nameFail = { at: Date.now(), turns }; };
6041
6048
  const cmd = process.env.PMOS_AUTONAME_CMD || 'claude';
6042
6049
  if (!process.env.PMOS_AUTONAME_CMD && !commandExists('claude')) return;
6050
+ // Naming runs under the PM's chosen Claude profile like every other background call, never Claude's own login when another is chosen
6051
+ // (bug 2026-11-08: the default login had expired, the chosen claude-personal had not). A chosen profile that cannot be read names nothing.
6052
+ const pres = resolveProfileForSpawn(defaultProfileFor('claude'));
6053
+ if (!pres.ok) return;
6054
+ const nenv = { ...sessionEnv(), ...profileOverlay(pres.profile) };
6043
6055
  s._naming = true;
6044
6056
  let child, out = '';
6045
6057
  try {
6046
- const run = winCommand.resolve(cmd, { env: sessionEnv() });
6047
- child = spawn(run.file, [...run.prefix, ...sessionName.argv()], { cwd: s.cwd || s.root, env: sessionEnv(), stdio: ['pipe', 'pipe', 'ignore'] });
6058
+ const run = winCommand.resolve(cmd, { env: nenv });
6059
+ child = spawn(run.file, [...run.prefix, ...sessionName.argv()], { cwd: s.cwd || s.root, env: nenv, stdio: ['pipe', 'pipe', 'ignore'] });
6048
6060
  } catch { return fail(); }
6049
6061
  const timer = setTimeout(() => { try { child.kill('SIGKILL'); } catch { /* gone */ } }, 90000);
6050
6062
  child.on('error', () => { clearTimeout(timer); fail(); });
@@ -0,0 +1,5 @@
1
+ {
2
+ "_comment": "initiative workspace-claude-profile-everywhere: the sign-in command of the chosen Claude profile (lib/claude-signin.js).",
3
+ "modules": ["claude-signin.test.js"],
4
+ "seconds": { "claude-signin.test.js": 1 }
5
+ }