create-pmos 0.811.0 → 0.812.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.811.0",
3
+ "version": "0.812.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": {
@@ -34,8 +34,8 @@
34
34
  ],
35
35
  "pmosChanges": [
36
36
  {
37
- "v": "0.811.0",
38
- "at": "2026-11-25T06:16:01.641Z",
37
+ "v": "0.812.0",
38
+ "at": "2026-11-25T06:24:25.632Z",
39
39
  "f": 4,
40
40
  "prs": [
41
41
  {
@@ -44,6 +44,22 @@
44
44
  "s": "Undo on a read line gives back every typed word (job #1845 fix round)",
45
45
  "k": "fix",
46
46
  "i": "capture-words-to-fields"
47
+ },
48
+ {
49
+ "n": 1864,
50
+ "t": "Pmos balance shows the mix of a list in one line",
51
+ "s": "Pmos balance shows the mix of a list in one line",
52
+ "k": "new",
53
+ "h": "Pmos balance shows the mix of a list in one line",
54
+ "try": {
55
+ "steps": [
56
+ "In the chat on Today, ask: what is the mix of my roadmap?",
57
+ "Then ask: how many of them name an expected outcome?"
58
+ ],
59
+ "see": "The chat names the counts by kind (Feature, Fix, Debt, Discovery) with one bar of the mix. A note shows only when one kind is over 60% of the list.",
60
+ "open": "/today.html"
61
+ },
62
+ "i": "balance-meter"
47
63
  }
48
64
  ]
49
65
  },
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@7c208a78e
1
+ kernel-source: pmos@910ccacd2
2
2
  assembled: 2026-11-25
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-25T06:15:57Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-25T06:24:21Z"}
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-25T06:15:57Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-25T06:24:21Z"}
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-25T06:15:57Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-25T06:24:21Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,7 +1,7 @@
1
1
  [
2
2
  {
3
- "v": "0.811.0",
4
- "at": "2026-11-25T06:16:01.641Z",
3
+ "v": "0.812.0",
4
+ "at": "2026-11-25T06:24:25.632Z",
5
5
  "f": 4,
6
6
  "prs": [
7
7
  {
@@ -10,6 +10,22 @@
10
10
  "s": "Undo on a read line gives back every typed word (job #1845 fix round)",
11
11
  "k": "fix",
12
12
  "i": "capture-words-to-fields"
13
+ },
14
+ {
15
+ "n": 1864,
16
+ "t": "Pmos balance shows the mix of a list in one line",
17
+ "s": "Pmos balance shows the mix of a list in one line",
18
+ "k": "new",
19
+ "h": "Pmos balance shows the mix of a list in one line",
20
+ "try": {
21
+ "steps": [
22
+ "In the chat on Today, ask: what is the mix of my roadmap?",
23
+ "Then ask: how many of them name an expected outcome?"
24
+ ],
25
+ "see": "The chat names the counts by kind (Feature, Fix, Debt, Discovery) with one bar of the mix. A note shows only when one kind is over 60% of the list.",
26
+ "open": "/today.html"
27
+ },
28
+ "i": "balance-meter"
13
29
  }
14
30
  ]
15
31
  },
@@ -2,7 +2,7 @@
2
2
  type: Guide
3
3
  title: "Command reference: every pmos command, by area"
4
4
  description: "Every pmos command of the workspace in one page, grouped by area, with its flags, examples and exit codes."
5
- timestamp: 2026-11-23
5
+ timestamp: 2026-11-25
6
6
  ---
7
7
 
8
8
  # Command reference
@@ -376,6 +376,15 @@ Run them in the product's repository, or pass `--root <dir>`.
376
376
  - When you record `didnt-work`, the initiative shows **At risk** on every page, with the check as the reason. PMOS compares the evidence with the kill condition and files one next step under the initiative's ✦. If the evidence meets the kill condition, PMOS suggests that you stop the initiative. If this is the second check that did not work, it suggests a new experiment. Otherwise it suggests one more round with a new check date. Work's Next column asks you the same question. Nothing happens until you press ✓. Undo reverses the step.
377
377
  - `pmos outcomes propose` also reads the experiment's hypothesis. When the hypothesis names a different KR from the initiative's anchor, the draft tells you.
378
378
 
379
+ ### pmos balance: the mix of a list
380
+
381
+ See if a list leans too far one way, for example all features and no fixes. PMOS reads the kind each item already has and says the mix in one line. Run it in the product's repository, or pass `--root <dir>`. It writes nothing.
382
+
383
+ - `pmos balance show` shows the roadmap: the counts of the live initiatives by kind (Feature, Fix, Debt, Discovery, Other), and one bar of the mix. The kind comes from the initiative's lane: feature is Feature, incident is Fix, chore is Debt, and discovery and prototype are Discovery.
384
+ - `--by outcome` counts the initiatives that name an expected outcome and the ones that do not.
385
+ - `--file <items.json>` shows the mix of any list: a JSON array of items, for example ideas or backlog tasks. Each item's `kind`, `lane` or `type` field gives its kind. A Jira Bug is Fix, a Story or Epic is Feature, and a Spike is Discovery. PMOS never guesses a kind from a title.
386
+ - A note shows only when one kind is more than your line of the list, and the list has 5 or more items. The line is 60% unless `--max <percent>` says otherwise. `--json` prints the counts as JSON.
387
+
379
388
  ### pmos decisions: a decision journal
380
389
 
381
390
  Write one line for each product decision, also one that is smaller than an initiative. Each decision has an expected outcome and a date to check it. Run the commands in the product's repository, or pass `--root <dir>`. The journal is `decision-journal.jsonl` in the runs folder (`pmos/state/` in a product, `planning/runs/` in PMOS itself). Commit it to keep it.
@@ -0,0 +1,89 @@
1
+ 'use strict';
2
+ /* balance-cli.js — `pmos balance`: the mix of a list in one line (initiative balance-meter, bet A448; lib/list-balance.js).
3
+ *
4
+ * pmos balance show [--by kind|outcome] [--max <percent>] [--json] the roadmap: the live initiatives of this repository
5
+ * pmos balance show --file <items.json> [--by …] [--max …] [--json] any list: a JSON array of items (ideas, backlog tasks), each with
6
+ * its own kind, lane or type field, and an outcome field
7
+ * every command: [--root <dir>] (default: this repository)
8
+ *
9
+ * It prints the counts, one bar of the mix, and a quiet note only when one kind passes the line (default 60%). Each run writes one
10
+ * `[balance]` line to the server log for the health number. Reading writes nothing in the repository. Exit codes: 0 done, 1 refused, 2 usage.
11
+ */
12
+ const fs = require('fs');
13
+ const path = require('path');
14
+ const B = require('./list-balance.js');
15
+
16
+ const COMMANDS = { balance: ['show'] };
17
+ const USAGE = [
18
+ 'usage: pmos balance show — the mix of a list in one line: feature, fix, debt, discovery, or with and without an expected outcome',
19
+ ' pmos balance show [--by kind|outcome] [--max <percent>] [--json] the roadmap: the live initiatives of this repository',
20
+ ' pmos balance show --file <items.json> [--by kind|outcome] [--json] any list: a JSON array of items with a kind, lane or type field',
21
+ 'A note shows only when one kind is over the line (--max, default 60%). Run it in the product\'s repository, or pass --root <dir>.',
22
+ ];
23
+ const ALLOWED = ['json', 'root', 'by', 'max', 'file'];
24
+ const BOOL = new Set(['json']);
25
+
26
+ function parse(args) {
27
+ const pos = [], flags = {};
28
+ for (let i = 0; i < args.length; i++) {
29
+ const a = args[i];
30
+ if (!a.startsWith('--')) { pos.push(a); continue; }
31
+ const k = a.slice(2);
32
+ if (BOOL.has(k)) flags[k] = true;
33
+ else flags[k] = args[i + 1] !== undefined && !String(args[i + 1]).startsWith('--') ? args[++i] : '';
34
+ }
35
+ return { pos, flags };
36
+ }
37
+ /** The repository this runs in: the nearest folder up from cwd that holds .git (no program is run), else cwd. */
38
+ function repoRoot(cwd) {
39
+ let d = path.resolve(cwd);
40
+ for (;;) {
41
+ if (fs.existsSync(path.join(d, '.git'))) return d;
42
+ const up = path.dirname(d);
43
+ if (up === d) return path.resolve(cwd);
44
+ d = up;
45
+ }
46
+ }
47
+ const WIDTH = 20;
48
+ const GLYPH = { feature: '█', fix: '▓', debt: '▒', discovery: '░', other: '·', with: '█', without: '░' };
49
+ /** One bar of the mix, WIDTH characters: each part's share in its own shade, in the order of the counts line, at least one character for a part that has items. */
50
+ function bar(R) {
51
+ if (!R.total) return '';
52
+ const cells = R.parts.map((p) => Math.max(1, Math.round((p.n / R.total) * WIDTH)));
53
+ const sum = () => cells.reduce((a, b) => a + b, 0);
54
+ while (sum() > WIDTH) { const i = cells.indexOf(Math.max(...cells)); cells[i]--; }
55
+ while (sum() < WIDTH) cells[0]++; // the largest part takes what rounding left
56
+ return R.parts.map((p, i) => (GLYPH[p.key] || '·').repeat(cells[i])).join('');
57
+ }
58
+
59
+ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), log = (s) => console.error(s) } = {}) {
60
+ const args = argv[0] === 'balance' ? argv.slice(1) : argv.slice();
61
+ const sub = args[0];
62
+ if (!sub || ['help', '--help', '-h'].includes(sub)) { for (const l of USAGE) say(l); return sub ? 0 : 1; }
63
+ if (!COMMANDS.balance.includes(sub)) { say(`unknown balance command "${sub}". Use one of: ${COMMANDS.balance.join(', ')}`); return 2; }
64
+ const { pos, flags } = parse(args.slice(1));
65
+ for (const k of Object.keys(flags)) if (!ALLOWED.includes(k)) { say(`✗ --${k} is not an option of pmos balance ${sub}`); return 2; }
66
+ const fail = (error, code = 1) => { say(flags.json ? JSON.stringify({ ok: false, error }) : '✗ ' + error); return code; };
67
+ if (pos.length) return fail('usage: pmos balance show [--by kind|outcome] [--file <items.json>]', 2);
68
+ if (flags.by !== undefined && !['kind', 'outcome'].includes(flags.by)) return fail('--by is kind or outcome', 2);
69
+ if (flags.max !== undefined && !(Number(flags.max) > 0 && Number(flags.max) < 100)) return fail('--max is a percent between 1 and 99', 2);
70
+ const root = path.resolve(flags.root || repoRoot(cwd));
71
+ let items, list = 'roadmap';
72
+ if (flags.file) {
73
+ let text;
74
+ try { text = fs.readFileSync(path.resolve(cwd, flags.file), 'utf8'); } catch { return fail(`${flags.file} could not be read`); }
75
+ try { items = JSON.parse(text); } catch { return fail(`${flags.file} is not JSON`); }
76
+ if (!Array.isArray(items)) return fail(`${flags.file} must hold a JSON array of items`);
77
+ list = path.basename(flags.file);
78
+ } else items = B.roadmapItems(root);
79
+ const R = B.balanceOf(items, { by: flags.by, max: flags.max });
80
+ try { log(`${B.TAG} ${list} of ${R.total} by ${R.by}${R.over ? ' over ' + R.max + '%' : ''}`); } catch { /* no log */ }
81
+ if (flags.json) { say(JSON.stringify({ ok: true, list, ...R, line: B.line(R) })); return 0; }
82
+ if (!R.total) { say(`${list === 'roadmap' ? 'The roadmap' : list} has no items.`); return 0; }
83
+ say(`${list === 'roadmap' ? 'Roadmap' : list}, ${R.total} item${R.total === 1 ? '' : 's'}: ${B.line(R)}`);
84
+ say(bar(R));
85
+ if (R.note) say(R.note);
86
+ return 0;
87
+ }
88
+
89
+ module.exports = { run, COMMANDS, USAGE, bar };
@@ -0,0 +1,111 @@
1
+ 'use strict';
2
+ /* list-balance.js — the balance meter (initiative balance-meter, bet A448). THE PURE CORE of `pmos balance` (lib/balance-cli.js), and the
3
+ * shape a page can draw as one thin bar over any list: ideas, a backlog or the roadmap.
4
+ *
5
+ * A list drifts: all features and no fixes, or all fixes and no discovery, and nobody sees it until a review. This reads the kind each
6
+ * item already has and says the mix in one line, with a quiet note only when one kind passes the PM's line (default 60 percent).
7
+ *
8
+ * kindOf(item) → 'feature' | 'fix' | 'debt' | 'discovery' | 'other'
9
+ * the item's own words, first that names one: kind, lane, type (a Jira issue type). feature · story · epic → feature;
10
+ * incident · bug · defect · fix → fix; chore · debt · tech-debt · refactor → debt (a plain Jira Task is other); discovery · spike · prototype ·
11
+ * research → discovery. Anything else, or nothing, is other. Never guessed from the title.
12
+ * outcomeOf(item) → 'with' | 'without' with: the item names an expected outcome (outcome_metric, outcome, metric)
13
+ * balanceOf(items, { by, max }) → { by, total, parts: [{ key, label, n, pct }], over, note }
14
+ * parts: only the kinds that have items (zero is silence), largest first, the fixed order breaking ties. pct is whole percent.
15
+ * over: the largest part when its share is above `max` percent and the list has at least MIN_ITEMS items, else null.
16
+ * note: one sentence when over, else ''.
17
+ * line(B) → 'Feature 6 · Fix 3 · Debt 1' (the counts in one line) or 'No items'
18
+ * roadmapItems(root, { today }) → the live initiatives of a repository (not stopped, not accepted), with lane and outcome_metric
19
+ * CLI: node lib/list-balance.js share <root> [--max 60] prints `[balance] …` and the largest kind's share alone on the last line
20
+ *
21
+ * Reading writes nothing and sends nothing. Works on any product built with PMOS, in either layout.
22
+ */
23
+ const path = require('path');
24
+
25
+ const KINDS = Object.freeze(['feature', 'fix', 'debt', 'discovery', 'other']);
26
+ const KIND_LABEL = Object.freeze({ feature: 'Feature', fix: 'Fix', debt: 'Debt', discovery: 'Discovery', other: 'Other' });
27
+ const OUTCOMES = Object.freeze(['with', 'without']);
28
+ const OUTCOME_LABEL = Object.freeze({ with: 'With an outcome', without: 'No outcome' });
29
+ const DEFAULT_MAX = 60;
30
+ const MIN_ITEMS = 5;
31
+ const TAG = '[balance]';
32
+
33
+ const WORDS = {
34
+ feature: ['feature', 'story', 'user story', 'epic', 'new feature', 'improvement'],
35
+ fix: ['fix', 'bug', 'defect', 'incident', 'hotfix', 'regression'],
36
+ debt: ['debt', 'tech debt', 'tech-debt', 'technical debt', 'chore', 'refactor', 'maintenance'],
37
+ discovery: ['discovery', 'spike', 'prototype', 'research', 'experiment'],
38
+ };
39
+ const norm = (s) => String(s == null ? '' : s).trim().toLowerCase().replace(/[_]+/g, ' ').replace(/\s+/g, ' ');
40
+ const valOf = (v) => (v && typeof v === 'object' && 'value' in v ? v.value : v);
41
+
42
+ function wordKind(w) {
43
+ const t = norm(w);
44
+ if (!t) return '';
45
+ for (const k of ['feature', 'fix', 'debt', 'discovery']) if (WORDS[k].includes(t)) return k;
46
+ return '';
47
+ }
48
+
49
+ /** The item's kind from its own fields, never from its title. */
50
+ function kindOf(item) {
51
+ if (!item || typeof item !== 'object') return 'other';
52
+ for (const f of ['kind', 'lane', 'type', 'issuetype']) {
53
+ const v = valOf(item[f]);
54
+ const k = wordKind(v && typeof v === 'object' ? v.name : v);
55
+ if (k) return k;
56
+ }
57
+ return 'other';
58
+ }
59
+
60
+ /** 'with' when the item names an expected outcome. */
61
+ function outcomeOf(item) {
62
+ if (!item || typeof item !== 'object') return 'without';
63
+ for (const f of ['outcome_metric', 'outcome', 'metric']) { const v = valOf(item[f]); if (typeof v === 'string' && v.trim()) return 'with'; }
64
+ return 'without';
65
+ }
66
+
67
+ function maxOf(max) { const n = Number(max); return Number.isFinite(n) && n > 0 && n < 100 ? Math.round(n) : DEFAULT_MAX; }
68
+
69
+ function balanceOf(items, { by = 'kind', max = DEFAULT_MAX } = {}) {
70
+ const mode = by === 'outcome' ? 'outcome' : 'kind';
71
+ const keys = mode === 'outcome' ? OUTCOMES : KINDS;
72
+ const label = mode === 'outcome' ? OUTCOME_LABEL : KIND_LABEL;
73
+ const list = Array.isArray(items) ? items.filter((x) => x && typeof x === 'object') : [];
74
+ const n = Object.fromEntries(keys.map((k) => [k, 0]));
75
+ for (const it of list) n[mode === 'outcome' ? outcomeOf(it) : kindOf(it)]++;
76
+ const total = list.length;
77
+ const parts = keys.filter((k) => n[k] > 0).map((k, i) => ({ key: k, label: label[k], n: n[k], pct: Math.round((n[k] / total) * 100), i }))
78
+ .sort((a, b) => b.n - a.n || a.i - b.i).map(({ i, ...p }) => p);
79
+ const line = maxOf(max);
80
+ const top = parts[0];
81
+ const isOver = !!top && total >= MIN_ITEMS && (top.n / total) * 100 > line && !(mode === 'outcome' && top.key === 'with');
82
+ const over = isOver ? top : null;
83
+ const note = !over ? '' : mode === 'outcome'
84
+ ? `${over.pct}% of this list names no expected outcome, over your ${line}% line.`
85
+ : `${over.label} is ${over.pct}% of this list, over your ${line}% line.`;
86
+ return { by: mode, total, max: line, parts, over, note };
87
+ }
88
+
89
+ function line(B) {
90
+ if (!B || !B.total) return 'No items';
91
+ return B.parts.map((p) => `${p.label} ${p.n}`).join(' · ');
92
+ }
93
+
94
+ /** The live initiatives of a repository: the roadmap list. Not stopped, not accepted (shipped), work lanes only. */
95
+ function roadmapItems(root, { today } = {}) {
96
+ const O = require('./outcomes.js');
97
+ const S = O.scan(path.resolve(root), today ? { today } : {});
98
+ return S.subjects.filter((it) => !it.accepted).map((it) => ({ id: it.id, title: it.title, lane: it.lane, outcome_metric: it.metric }));
99
+ }
100
+
101
+ module.exports = { KINDS, KIND_LABEL, OUTCOMES, OUTCOME_LABEL, DEFAULT_MAX, MIN_ITEMS, TAG, kindOf, outcomeOf, balanceOf, line, roadmapItems };
102
+
103
+ if (require.main === module) {
104
+ const a = process.argv.slice(2);
105
+ if (a[0] !== 'share') { console.error('usage: node lib/list-balance.js share <root> [--max 60]'); process.exit(2); }
106
+ const root = path.resolve(a[1] && !a[1].startsWith('--') ? a[1] : '.');
107
+ const i = a.indexOf('--max');
108
+ const B = balanceOf(roadmapItems(root), { max: i >= 0 ? a[i + 1] : DEFAULT_MAX });
109
+ console.log(`${TAG} roadmap of ${B.total}: ${line(B)}${B.over ? ' · over the ' + B.max + '% line' : ''}`);
110
+ console.log(String(B.parts[0] ? B.parts[0].pct : 0));
111
+ }
@@ -160,6 +160,9 @@ const VERBS = Object.freeze({
160
160
  // Not a pm-os-absorb verb (run: null): initiative decision-journal-outcome-checks added it through the same table.
161
161
  decisions: Object.freeze({ module: 'decisions-cli.js', run: null, guide: 'cli.md',
162
162
  help: 'pmos decisions add|list|show|check|record — a decision journal: what you decided, what you expect, a date to check, and how your calls turned out (pmos decisions help)' }),
163
+ // Not a pm-os-absorb verb (run: null): initiative balance-meter (bet A448) added it through the same table.
164
+ balance: Object.freeze({ module: 'balance-cli.js', run: null, guide: 'cli.md',
165
+ help: 'pmos balance show — the mix of a list in one line: feature, fix, debt, discovery, or with and without an expected outcome, with a note when one kind is over your line (pmos balance help)' }),
163
166
  // Not a pm-os-absorb verb (run: null): initiative product-principles-draft (bet A352) added it through the same table.
164
167
  principles: Object.freeze({ module: 'principles-cli.js', run: null, guide: 'cli.md',
165
168
  help: 'pmos principles list|sources|draft|keep|drop|undo|add — the product\'s principles, drafted from its decisions, each citing them; keep or drop each (pmos principles help)' }),
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.811.0",
3
+ "version": "0.812.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.811.0",
9
+ "version": "0.812.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.811.0",
3
+ "version": "0.812.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",
@@ -0,0 +1,5 @@
1
+ {
2
+ "_comment": "balance-meter (bet A448): the mix of a list in one line by kind or by outcome, with a quiet note over the PM's line (lib/list-balance.js, pmos balance).",
3
+ "modules": ["balance-meter.test.js"],
4
+ "seconds": { "balance-meter.test.js": 1 }
5
+ }