create-pmos 0.719.0 → 0.720.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 +9 -3
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/changelog.json +8 -2
- package/workspace/fixtures/initiatives-api/roadmap.json +6 -0
- package/workspace/lib/opportunity-size.js +177 -0
- package/workspace/lib/routes-initiatives.js +11 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/test-lists/sized-opportunities.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.720.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.
|
|
38
|
-
"at": "2026-11-23T00:
|
|
37
|
+
"v": "0.720.0",
|
|
38
|
+
"at": "2026-11-23T00:13:50.800Z",
|
|
39
39
|
"f": 4,
|
|
40
40
|
"prs": [
|
|
41
41
|
{
|
|
@@ -55,6 +55,12 @@
|
|
|
55
55
|
"t": "Ctrl+K reaches every page, item and action (job #1562)",
|
|
56
56
|
"s": "Ctrl+K reaches every page, item and action (job #1562)",
|
|
57
57
|
"k": "new"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"n": 1591,
|
|
61
|
+
"t": "Sized opportunities with sources and confidence in the Roadmap rank (A363)",
|
|
62
|
+
"s": "Sized opportunities with sources and confidence in the Roadmap rank (A363)",
|
|
63
|
+
"k": "new"
|
|
58
64
|
}
|
|
59
65
|
]
|
|
60
66
|
},
|
package/payload/KIT-VERSION
CHANGED
|
@@ -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-23T00:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-23T00:13:47Z"}
|
|
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-23T00:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-23T00:13:47Z"}
|
|
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-23T00:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-23T00:13:47Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
|
-
"v": "0.
|
|
4
|
-
"at": "2026-11-23T00:
|
|
3
|
+
"v": "0.720.0",
|
|
4
|
+
"at": "2026-11-23T00:13:50.800Z",
|
|
5
5
|
"f": 4,
|
|
6
6
|
"prs": [
|
|
7
7
|
{
|
|
@@ -21,6 +21,12 @@
|
|
|
21
21
|
"t": "Ctrl+K reaches every page, item and action (job #1562)",
|
|
22
22
|
"s": "Ctrl+K reaches every page, item and action (job #1562)",
|
|
23
23
|
"k": "new"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"n": 1591,
|
|
27
|
+
"t": "Sized opportunities with sources and confidence in the Roadmap rank (A363)",
|
|
28
|
+
"s": "Sized opportunities with sources and confidence in the Roadmap rank (A363)",
|
|
29
|
+
"k": "new"
|
|
24
30
|
}
|
|
25
31
|
]
|
|
26
32
|
},
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* opportunity-size.js — a rough size for each initiative, with the source and the confidence of each number, and the
|
|
4
|
+
* Roadmap moves the sizes suggest (initiative sized-opportunities, bet A363; done test planning/done-tests/sized-opportunities.md).
|
|
5
|
+
*
|
|
6
|
+
* The record keys, one line each, in the initiative's frontmatter:
|
|
7
|
+
* size_reach: "<number> [unit] | <source> | measured|estimated|guess" how many people hit it (a month)
|
|
8
|
+
* size_frequency: "<number> [unit] | <source> | measured|estimated|guess" how often each of them hits it (a month)
|
|
9
|
+
* size_worth: "<1 to 5> | <source> | measured|estimated|guess" what one time is worth (1 minor, 5 critical)
|
|
10
|
+
* A line with no source, or with a confidence word not in the list, counts as a guess.
|
|
11
|
+
*
|
|
12
|
+
* size = reach × frequency × worth. The size's confidence is that of its weakest line, and the weighted size is
|
|
13
|
+
* size × 1.0 (measured), 0.7 (estimated) or 0.4 (guess), so a hunch never weighs the same as measured demand.
|
|
14
|
+
*
|
|
15
|
+
* rankHints(rows) only suggests. Nothing here writes a rank: PMOS recommends, the PM approves (D105 keeps one ranked list).
|
|
16
|
+
*
|
|
17
|
+
* CLI: node workspace/lib/opportunity-size.js list [<root>] [--json]
|
|
18
|
+
* node workspace/lib/opportunity-size.js count [<root>] last line: the number of sized initiatives
|
|
19
|
+
* Every log line carries [size].
|
|
20
|
+
*/
|
|
21
|
+
const fs = require('fs');
|
|
22
|
+
const path = require('path');
|
|
23
|
+
|
|
24
|
+
const TAG = '[size]';
|
|
25
|
+
const KEYS = [['reach', 'size_reach'], ['frequency', 'size_frequency'], ['worth', 'size_worth']];
|
|
26
|
+
const FACTOR = { measured: 1, estimated: 0.7, guess: 0.4 };
|
|
27
|
+
const ORDER = ['guess', 'estimated', 'measured'];
|
|
28
|
+
const MAX_HINTS = 3;
|
|
29
|
+
const MIN_RATIO = 2;
|
|
30
|
+
|
|
31
|
+
/** "40" | "1,200" | "1.5k" | "2m" → a number ≥ 0, else null. */
|
|
32
|
+
function parseNumber(raw) {
|
|
33
|
+
const m = /^\s*(\d+(?:,\d{3})*(?:\.\d+)?|\d*\.\d+)\s*([km])?\b/i.exec(String(raw == null ? '' : raw));
|
|
34
|
+
if (!m) return null;
|
|
35
|
+
const n = Number(m[1].replace(/,/g, '')) * (m[2] ? (m[2].toLowerCase() === 'k' ? 1e3 : 1e6) : 1);
|
|
36
|
+
return Number.isFinite(n) ? n : null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** One size line → { number, unit, source, confidence } | null. */
|
|
40
|
+
function parseLine(raw) {
|
|
41
|
+
const text = String(raw == null ? '' : raw).trim();
|
|
42
|
+
if (!text) return null;
|
|
43
|
+
const parts = text.split('|').map((s) => s.trim());
|
|
44
|
+
const number = parseNumber(parts[0]);
|
|
45
|
+
if (number === null) return null;
|
|
46
|
+
const unit = parts[0].replace(/^\s*[\d.,]+\s*[km]?\b\s*/i, '').trim() || null;
|
|
47
|
+
const source = parts[1] || null;
|
|
48
|
+
const word = String(parts[2] || '').toLowerCase();
|
|
49
|
+
const confidence = source && FACTOR[word] !== undefined ? word : 'guess';
|
|
50
|
+
return { number, unit, source, confidence };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const round = (n) => Math.round(n * 100) / 100;
|
|
54
|
+
|
|
55
|
+
/** A record's frontmatter → null (no size line) | { complete: false, missing, lines } | the full size. */
|
|
56
|
+
function sizeOf(fm) {
|
|
57
|
+
fm = fm || {};
|
|
58
|
+
const lines = {};
|
|
59
|
+
const missing = [];
|
|
60
|
+
let any = false;
|
|
61
|
+
for (const [name, key] of KEYS) {
|
|
62
|
+
if (fm[key] !== undefined && String(fm[key]).trim()) any = true;
|
|
63
|
+
const l = parseLine(fm[key]);
|
|
64
|
+
if (name === 'worth' && l && (l.number < 1 || l.number > 5)) { missing.push(name); continue; }
|
|
65
|
+
if (l) lines[name] = l; else missing.push(name);
|
|
66
|
+
}
|
|
67
|
+
if (!any) return null;
|
|
68
|
+
if (missing.length) return { complete: false, missing, lines };
|
|
69
|
+
const size = lines.reach.number * lines.frequency.number * lines.worth.number;
|
|
70
|
+
const confidence = ORDER[Math.min(...Object.values(lines).map((l) => ORDER.indexOf(l.confidence)))];
|
|
71
|
+
return { complete: true, size: round(size), confidence, weighted: round(size * FACTOR[confidence]), lines };
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const fmt = (n) => (n >= 100 ? Math.round(n).toLocaleString('en-US') : String(round(n)));
|
|
75
|
+
const weakest = (s) => Object.values(s.lines).find((l) => l.confidence === s.confidence) || {};
|
|
76
|
+
const said = (s) => `about ${fmt(s.size)} a month (${s.confidence}${weakest(s).source ? `, ${weakest(s).source}` : ', no source'})`;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* rows: [{ id, title, rank, size }] in rank order, top first. → up to 3 hints, the biggest ratio first:
|
|
80
|
+
* { id, title, above, above_title, ratio, why }. A row is suggested once, above the highest row it beats by MIN_RATIO.
|
|
81
|
+
*/
|
|
82
|
+
function rankHints(rows) {
|
|
83
|
+
const sized = (rows || []).filter((r) => r && r.size && r.size.complete);
|
|
84
|
+
const out = [];
|
|
85
|
+
sized.forEach((b, i) => {
|
|
86
|
+
const a = sized.slice(0, i).find((x) => x.size.weighted * MIN_RATIO <= b.size.weighted);
|
|
87
|
+
if (!a) return;
|
|
88
|
+
const ratio = a.size.weighted > 0 ? round(b.size.weighted / a.size.weighted) : null;
|
|
89
|
+
out.push({
|
|
90
|
+
id: b.id, title: b.title || b.id, above: a.id, above_title: a.title || a.id, ratio,
|
|
91
|
+
why: `Consider ranking ${b.title || b.id} above ${a.title || a.id}: ${said(b.size)} against ${said(a.size)}.`,
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
return out.sort((x, y) => (y.ratio === null ? Infinity : y.ratio) - (x.ratio === null ? Infinity : x.ratio)).slice(0, MAX_HINTS);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** rows: [{ id, title, rank }] in rank order; frontmatterOf(id) → fm | null. → { sized, unsized, rows, hints }. */
|
|
98
|
+
function sizingOf(rows, frontmatterOf) {
|
|
99
|
+
const sizes = {};
|
|
100
|
+
const withSize = (rows || []).map((r) => {
|
|
101
|
+
let fm = null;
|
|
102
|
+
try { fm = frontmatterOf(r.id); } catch { fm = null; }
|
|
103
|
+
const size = sizeOf(fm);
|
|
104
|
+
if (size) sizes[r.id] = size;
|
|
105
|
+
return { id: r.id, title: r.title, rank: r.rank, size };
|
|
106
|
+
});
|
|
107
|
+
const sized = withSize.filter((r) => r.size && r.size.complete).length;
|
|
108
|
+
return { sized, unsized: withSize.length - sized, rows: sizes, hints: rankHints(withSize) };
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* ── CLI ───────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
112
|
+
|
|
113
|
+
const FM_RE = /^---\r?\n([\s\S]*?)\r?\n---/;
|
|
114
|
+
function readFm(file) {
|
|
115
|
+
let text = '';
|
|
116
|
+
try { text = fs.readFileSync(file, 'utf8'); } catch { return null; }
|
|
117
|
+
const m = FM_RE.exec(text);
|
|
118
|
+
if (!m) return null;
|
|
119
|
+
const fm = {};
|
|
120
|
+
for (const line of m[1].split('\n')) {
|
|
121
|
+
const kv = /^([a-z_]+):\s*(.*?)\s*$/.exec(line);
|
|
122
|
+
if (kv && !(kv[1] in fm)) fm[kv[1]] = kv[2].replace(/^"(.*)"$/s, '$1');
|
|
123
|
+
}
|
|
124
|
+
return fm;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** The initiative records of a checkout, in either layout: planning/initiatives/ or pmos/state/initiatives/ (kit). */
|
|
128
|
+
function recordsOf(root) {
|
|
129
|
+
for (const rel of [['planning', 'initiatives'], ['pmos', 'state', 'initiatives']]) {
|
|
130
|
+
const dir = path.join(root, ...rel);
|
|
131
|
+
let names = [];
|
|
132
|
+
try { names = fs.readdirSync(dir); } catch { continue; }
|
|
133
|
+
const recs = names.filter((n) => n.endsWith('.md') && !/^(README|index|log)\.md$/i.test(n)).sort()
|
|
134
|
+
.map((n) => { const fm = readFm(path.join(dir, n)) || {}; return { id: fm.id || n.slice(0, -3), title: fm.title || n.slice(0, -3), fm }; });
|
|
135
|
+
if (recs.length) return recs;
|
|
136
|
+
}
|
|
137
|
+
return [];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function main(argv) {
|
|
141
|
+
const cmd = argv[0];
|
|
142
|
+
const json = argv.includes('--json');
|
|
143
|
+
const root = path.resolve(argv.slice(1).find((a) => !a.startsWith('--')) || '.');
|
|
144
|
+
if (cmd !== 'list' && cmd !== 'count') {
|
|
145
|
+
console.error('usage: opportunity-size.js list|count [<root>] [--json]');
|
|
146
|
+
return 2;
|
|
147
|
+
}
|
|
148
|
+
const recs = recordsOf(root);
|
|
149
|
+
const byId = new Map(recs.map((r) => [r.id, r]));
|
|
150
|
+
// The Roadmap's own order (the placements ledger, D105). Hints need a rank, so a record not on the Roadmap is sized
|
|
151
|
+
// and counted but never suggested.
|
|
152
|
+
let ranked = [];
|
|
153
|
+
try { ranked = (require('./placements.js').readPlacements(root).ranked || []).filter((id) => byId.has(id)); } catch { ranked = []; }
|
|
154
|
+
const onMap = new Set(ranked);
|
|
155
|
+
const rows = ranked.map((id, i) => ({ id, title: byId.get(id).title, rank: i + 1 }));
|
|
156
|
+
const s = sizingOf(rows, (id) => byId.get(id).fm);
|
|
157
|
+
const rest = sizingOf(recs.filter((r) => !onMap.has(r.id)).map((r) => ({ id: r.id, title: r.title })), (id) => byId.get(id).fm);
|
|
158
|
+
s.rows = { ...s.rows, ...rest.rows };
|
|
159
|
+
s.sized += rest.sized;
|
|
160
|
+
s.unsized += rest.unsized;
|
|
161
|
+
if (cmd === 'count') {
|
|
162
|
+
console.log(`${TAG} ${s.sized} of ${recs.length} initiatives sized in ${root}`);
|
|
163
|
+
console.log(String(s.sized));
|
|
164
|
+
return 0;
|
|
165
|
+
}
|
|
166
|
+
if (json) { console.log(JSON.stringify(s, null, 2)); return 0; }
|
|
167
|
+
for (const [id, z] of Object.entries(s.rows)) {
|
|
168
|
+
console.log(`${TAG} ${id}: ${z.complete ? `${fmt(z.size)} (${z.confidence}, weighted ${fmt(z.weighted)})` : `incomplete, missing ${z.missing.join(', ')}`}`);
|
|
169
|
+
}
|
|
170
|
+
for (const h of s.hints) console.log(`${TAG} ${h.why}`);
|
|
171
|
+
console.log(`${TAG} ${s.sized} sized, ${s.unsized} not sized`);
|
|
172
|
+
return 0;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
module.exports = { TAG, KEYS, FACTOR, parseNumber, parseLine, sizeOf, rankHints, sizingOf, recordsOf };
|
|
176
|
+
|
|
177
|
+
if (require.main === module) process.exitCode = main(process.argv.slice(2));
|
|
@@ -48,6 +48,7 @@ const planItems = require('./plan-items.js');
|
|
|
48
48
|
const planTree = require('./plan-tree.js');
|
|
49
49
|
const planRules = require('./plan-rules.js');
|
|
50
50
|
const health = require('./health.js');
|
|
51
|
+
const opportunitySize = require('./opportunity-size.js');
|
|
51
52
|
const factoryJoin = require('./factory-join.js');
|
|
52
53
|
const display = require('./initiative-display.js');
|
|
53
54
|
const rowsLib = require('./initiative-rows.js');
|
|
@@ -205,9 +206,19 @@ function roadmapOf(w, F) {
|
|
|
205
206
|
proposals: F.placed.proposals.map((p) => ({ eid: p.eid, initiative: p.init, title: title(p.init), after: p.after, by: actorLib.pageName(p.by), at: p.at })),
|
|
206
207
|
flags: flagsOf(F),
|
|
207
208
|
scan: scanSummary(F),
|
|
209
|
+
// A363: each row's size (reach × frequency × worth, with sources and confidence) and the moves the sizes suggest.
|
|
210
|
+
// Read-only: a hint never moves a rank; the PM does.
|
|
211
|
+
sizing: sizingOf(F, rows),
|
|
208
212
|
};
|
|
209
213
|
}
|
|
210
214
|
|
|
215
|
+
function sizingOf(F, rows) {
|
|
216
|
+
return opportunitySize.sizingOf(rows, (id) => {
|
|
217
|
+
const file = planTree.recordPath(F.root, id);
|
|
218
|
+
return file ? planTree.recordFrontmatter(file) : null;
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
|
|
211
222
|
/**
|
|
212
223
|
* What the document scan found across the repository (scan-documents S7): how many initiatives it read, how many it
|
|
213
224
|
* found a document or a Jira key for, and the repository's profile — the scan reads documents in a `pm-artifacts`
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.720.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.720.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Sized opportunities in the rank (initiative sized-opportunities, bet A363, done test Z1-Z7): each initiative's size with source and confidence, and the Roadmap moves the sizes suggest. Pure checks plus scratch repositories. No server, connector, model or network.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"opportunity-size.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"opportunity-size.test.js": 5
|
|
8
|
+
}
|
|
9
|
+
}
|