create-pmos 0.816.0 → 0.817.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 +26 -16
- 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 +25 -2
- package/workspace/guide/cli.md +11 -0
- package/workspace/lib/approver-cli.js +98 -0
- package/workspace/lib/approver-memory.js +119 -0
- package/workspace/lib/pmos-verbs.js +3 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/test-lists/approver-memory.json +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.817.0",
|
|
4
4
|
"description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -33,6 +33,29 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.817.0",
|
|
38
|
+
"at": "2026-11-25T08:16:43.538Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1878,
|
|
43
|
+
"t": "Pmos approver shows what each approver asked before",
|
|
44
|
+
"s": "Pmos approver shows what each approver asked before",
|
|
45
|
+
"k": "new",
|
|
46
|
+
"h": "Pmos approver shows what each approver asked before",
|
|
47
|
+
"try": {
|
|
48
|
+
"steps": [
|
|
49
|
+
"In the chat on Today, ask: what did Ana ask on earlier sign-offs?",
|
|
50
|
+
"Open an initiative in Work that waits on a sign-off and ask the chat: what did its approvers ask before?"
|
|
51
|
+
],
|
|
52
|
+
"see": "The chat lists what that person had to sign off, what they answered and what they objected to, newest first, each with its source. A person with nothing recorded is left out.",
|
|
53
|
+
"open": "/premium-board.html"
|
|
54
|
+
},
|
|
55
|
+
"i": "approver-memory"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
36
59
|
{
|
|
37
60
|
"v": "0.816.0",
|
|
38
61
|
"at": "2026-11-25T07:54:58.764Z",
|
|
@@ -43,6 +66,7 @@
|
|
|
43
66
|
"t": "File a typed Today line to its initiative (job #1870)",
|
|
44
67
|
"s": "File a typed Today line to its initiative (job #1870)",
|
|
45
68
|
"k": "new",
|
|
69
|
+
"i": "capture-to-initiative",
|
|
46
70
|
"h": "File a typed Today line to its initiative (job #1870)",
|
|
47
71
|
"try": {
|
|
48
72
|
"steps": [
|
|
@@ -52,8 +76,7 @@
|
|
|
52
76
|
],
|
|
53
77
|
"see": "The line shows a chip with the initiative and its stage, and a toast says where it was filed with Undo. A typed task also appears as a task on that initiative in Work. Picking Not filed removes the…",
|
|
54
78
|
"open": "/today.html"
|
|
55
|
-
}
|
|
56
|
-
"i": "capture-to-initiative"
|
|
79
|
+
}
|
|
57
80
|
},
|
|
58
81
|
{
|
|
59
82
|
"n": 1856,
|
|
@@ -397,19 +420,6 @@
|
|
|
397
420
|
"k": "new"
|
|
398
421
|
}
|
|
399
422
|
]
|
|
400
|
-
},
|
|
401
|
-
{
|
|
402
|
-
"v": "0.791.0",
|
|
403
|
-
"at": "2026-11-24T18:45:09.361Z",
|
|
404
|
-
"f": 4,
|
|
405
|
-
"prs": [
|
|
406
|
-
{
|
|
407
|
-
"n": 1764,
|
|
408
|
-
"t": "Ask PMOS answers with the real rows and a picker (ask-cards-and-pickers, job #1747)",
|
|
409
|
-
"s": "Ask PMOS answers with the real rows and a picker (ask-cards-and-pickers, job #1747)",
|
|
410
|
-
"k": "new"
|
|
411
|
-
}
|
|
412
|
-
]
|
|
413
423
|
}
|
|
414
424
|
]
|
|
415
425
|
}
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-25T08:16:39Z"}
|
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-25T08:16:39Z"}
|
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-25T08:16:39Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.817.0",
|
|
4
|
+
"at": "2026-11-25T08:16:43.538Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1878,
|
|
9
|
+
"t": "Pmos approver shows what each approver asked before",
|
|
10
|
+
"s": "Pmos approver shows what each approver asked before",
|
|
11
|
+
"k": "new",
|
|
12
|
+
"h": "Pmos approver shows what each approver asked before",
|
|
13
|
+
"try": {
|
|
14
|
+
"steps": [
|
|
15
|
+
"In the chat on Today, ask: what did Ana ask on earlier sign-offs?",
|
|
16
|
+
"Open an initiative in Work that waits on a sign-off and ask the chat: what did its approvers ask before?"
|
|
17
|
+
],
|
|
18
|
+
"see": "The chat lists what that person had to sign off, what they answered and what they objected to, newest first, each with its source. A person with nothing recorded is left out.",
|
|
19
|
+
"open": "/premium-board.html"
|
|
20
|
+
},
|
|
21
|
+
"i": "approver-memory"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
2
25
|
{
|
|
3
26
|
"v": "0.816.0",
|
|
4
27
|
"at": "2026-11-25T07:54:58.764Z",
|
|
@@ -9,6 +32,7 @@
|
|
|
9
32
|
"t": "File a typed Today line to its initiative (job #1870)",
|
|
10
33
|
"s": "File a typed Today line to its initiative (job #1870)",
|
|
11
34
|
"k": "new",
|
|
35
|
+
"i": "capture-to-initiative",
|
|
12
36
|
"h": "File a typed Today line to its initiative (job #1870)",
|
|
13
37
|
"try": {
|
|
14
38
|
"steps": [
|
|
@@ -18,8 +42,7 @@
|
|
|
18
42
|
],
|
|
19
43
|
"see": "The line shows a chip with the initiative and its stage, and a toast says where it was filed with Undo. A typed task also appears as a task on that initiative in Work. Picking Not filed removes the…",
|
|
20
44
|
"open": "/today.html"
|
|
21
|
-
}
|
|
22
|
-
"i": "capture-to-initiative"
|
|
45
|
+
}
|
|
23
46
|
},
|
|
24
47
|
{
|
|
25
48
|
"n": 1856,
|
package/workspace/guide/cli.md
CHANGED
|
@@ -954,6 +954,17 @@ An outside sign-off is a yes that someone outside the team must give before the
|
|
|
954
954
|
|
|
955
955
|
An open sign-off that waited 3 days, or is past its due date, goes on your question list for the day, on the same card as the dry-run gaps of your tickets ([Jira tickets](jira.md)). Nothing is sent. Every command takes `--json` and `--root <dir>`.
|
|
956
956
|
|
|
957
|
+
### pmos approver
|
|
958
|
+
|
|
959
|
+
Walk into a sign-off with what that person asked last time. PMOS reads the sign-offs above and the decision journal, and groups what each approver had to say yes to, what they answered, and what they objected to. It writes nothing.
|
|
960
|
+
|
|
961
|
+
- `pmos approver list` lists the people who signed off or objected before, with the most items first.
|
|
962
|
+
- `pmos approver show "<name>"` lists one person's past asks, answers and objections, newest first, each with its source. "Ana" also finds "Ana Lim".
|
|
963
|
+
- `pmos approver brief <initiative>` is for before a sign-off: for each open sign-off of the initiative, at most 3 things that approver asked or objected to on other work. A person with nothing recorded is left out.
|
|
964
|
+
- An objection counts only when a decision's `--against` starts with the person's name, for example `--against "Ana: the ROI is not shown"`. PMOS never guesses a name from other text.
|
|
965
|
+
|
|
966
|
+
Every command takes `--json` and `--root <dir>`.
|
|
967
|
+
|
|
957
968
|
## Intelligence and reports
|
|
958
969
|
|
|
959
970
|
### pmos forecast
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* approver-cli.js — `pmos approver`: what each approver asked or objected to before (initiative approver-memory, bet A190;
|
|
3
|
+
* lib/approver-memory.js).
|
|
4
|
+
*
|
|
5
|
+
* pmos approver list [--json] the people who signed off or objected before, most items first
|
|
6
|
+
* pmos approver show <name> [--json] one person's past asks, answers and objections, newest first, each with its source
|
|
7
|
+
* pmos approver brief <initiative> [--json] before a sign-off: for each open sign-off of the initiative, what that approver asked or
|
|
8
|
+
* objected to on other work (at most 3 each). Nothing when nobody has history
|
|
9
|
+
* every command: [--root <dir>] (default: this repository)
|
|
10
|
+
*
|
|
11
|
+
* Read only: it writes nothing and sends nothing. Each run writes one `[approver]` line to the server log for the health number.
|
|
12
|
+
* Exit codes: 0 done, 1 refused, 2 usage.
|
|
13
|
+
*/
|
|
14
|
+
const fs = require('fs');
|
|
15
|
+
const path = require('path');
|
|
16
|
+
const A = require('./approver-memory.js');
|
|
17
|
+
|
|
18
|
+
const COMMANDS = { approver: ['list', 'show', 'brief'] };
|
|
19
|
+
const USAGE = [
|
|
20
|
+
'usage: pmos approver list|show|brief — what each approver asked or objected to before, from the sign-offs and the decision journal',
|
|
21
|
+
' pmos approver list [--json] the people who signed off or objected before',
|
|
22
|
+
' pmos approver show <name> [--json] one person\'s past asks, answers and objections, newest first, with sources',
|
|
23
|
+
' pmos approver brief <initiative> [--json] before a sign-off: what each open sign-off\'s approver asked on other work',
|
|
24
|
+
'Run it in the product\'s repository, or pass --root <dir>. It writes nothing.',
|
|
25
|
+
];
|
|
26
|
+
const ID_RE = /^[a-z0-9][a-z0-9._-]{0,80}$/;
|
|
27
|
+
const KIND = { signoff: 'had to sign off', answer: 'answered', objection: 'objected' };
|
|
28
|
+
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
29
|
+
const short = (d) => { const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(String(d || '')); return m ? +m[3] + ' ' + MON[+m[2] - 1] + ' ' + m[1] : String(d || ''); };
|
|
30
|
+
|
|
31
|
+
/** The repository this runs in: the nearest folder up from cwd that holds .git (no program is run), else cwd. */
|
|
32
|
+
function repoRoot(cwd) {
|
|
33
|
+
let d = path.resolve(cwd);
|
|
34
|
+
for (;;) {
|
|
35
|
+
if (fs.existsSync(path.join(d, '.git'))) return d;
|
|
36
|
+
const up = path.dirname(d);
|
|
37
|
+
if (up === d) return path.resolve(cwd);
|
|
38
|
+
d = up;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function parse(args) {
|
|
42
|
+
const pos = [], flags = {};
|
|
43
|
+
for (let i = 0; i < args.length; i++) {
|
|
44
|
+
const a = args[i];
|
|
45
|
+
if (!a.startsWith('--')) { pos.push(a); continue; }
|
|
46
|
+
const k = a.slice(2);
|
|
47
|
+
if (k === 'json') flags.json = true;
|
|
48
|
+
else flags[k] = args[i + 1] !== undefined && !String(args[i + 1]).startsWith('--') ? args[++i] : '';
|
|
49
|
+
}
|
|
50
|
+
return { pos, flags };
|
|
51
|
+
}
|
|
52
|
+
const itemLine = (it) => ` ${short(it.date)} · ${KIND[it.kind]}: ${it.text}${it.ini ? ' (' + it.ini + ')' : ''} · ${it.source}`;
|
|
53
|
+
|
|
54
|
+
async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), log = (s) => console.error(s) } = {}) {
|
|
55
|
+
const args = argv[0] === 'approver' ? argv.slice(1) : argv.slice();
|
|
56
|
+
const sub = args[0];
|
|
57
|
+
if (!sub || ['help', '--help', '-h'].includes(sub)) { for (const l of USAGE) say(l); return sub ? 0 : 1; }
|
|
58
|
+
if (!COMMANDS.approver.includes(sub)) { say(`unknown approver command "${sub}". Use one of: ${COMMANDS.approver.join(', ')}`); return 2; }
|
|
59
|
+
const { pos, flags } = parse(args.slice(1));
|
|
60
|
+
for (const k of Object.keys(flags)) if (!['json', 'root'].includes(k)) { say(`✗ --${k} is not an option of pmos approver ${sub}`); return 2; }
|
|
61
|
+
const fail = (error, code = 1) => { say(flags.json ? JSON.stringify({ ok: false, error }) : '✗ ' + error); return code; };
|
|
62
|
+
const root = path.resolve(flags.root || repoRoot(cwd));
|
|
63
|
+
const note = (s) => { try { log(`${A.TAG} ${sub} ${s}`); } catch { /* no log */ } };
|
|
64
|
+
const items = A.itemsOf(root);
|
|
65
|
+
|
|
66
|
+
if (sub === 'list') {
|
|
67
|
+
if (pos.length) return fail('usage: pmos approver list', 2);
|
|
68
|
+
const rows = A.approvers(items);
|
|
69
|
+
note(`${rows.length}`);
|
|
70
|
+
if (flags.json) { say(JSON.stringify({ ok: true, approvers: rows })); return 0; }
|
|
71
|
+
if (!rows.length) { say('No approver has asked or objected yet. Sign-offs (pmos signoff) and decisions with --against "<Name>: <why>" fill this.'); return 0; }
|
|
72
|
+
for (const r of rows) say(`${r.who} · ${r.n} item${r.n === 1 ? '' : 's'} · last ${short(r.last)}`);
|
|
73
|
+
return 0;
|
|
74
|
+
}
|
|
75
|
+
if (sub === 'show') {
|
|
76
|
+
if (pos.length !== 1) return fail('usage: pmos approver show "<name>"', 2);
|
|
77
|
+
const h = A.historyOf(items, pos[0]);
|
|
78
|
+
note(`${h.length}`);
|
|
79
|
+
if (flags.json) { say(JSON.stringify({ ok: true, who: pos[0], items: h })); return 0; }
|
|
80
|
+
if (!h.length) { say(`Nothing recorded for ${pos[0]} yet.`); return 0; }
|
|
81
|
+
say(`${h[0].who}, newest first:`);
|
|
82
|
+
for (const it of h) say(itemLine(it));
|
|
83
|
+
return 0;
|
|
84
|
+
}
|
|
85
|
+
// brief
|
|
86
|
+
if (pos.length !== 1 || !ID_RE.test(pos[0])) return fail('usage: pmos approver brief <initiative id>', 2);
|
|
87
|
+
const B = A.briefOf(root, pos[0], { items });
|
|
88
|
+
note(`${pos[0]} ${B.length}`);
|
|
89
|
+
if (flags.json) { say(JSON.stringify({ ok: true, initiative: pos[0], brief: B })); return 0; }
|
|
90
|
+
if (!B.length) { say(`No open sign-off on ${pos[0]} has an approver with past asks.`); return 0; }
|
|
91
|
+
for (const b of B) {
|
|
92
|
+
say(`${b.who} must sign off: ${b.what}${b.due ? ' (due ' + short(b.due) + ')' : ''}. Before, on other work:`);
|
|
93
|
+
for (const it of b.past) say(itemLine(it));
|
|
94
|
+
}
|
|
95
|
+
return 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
module.exports = { run, COMMANDS, USAGE };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* approver-memory.js — what each approver asked or objected to before (initiative approver-memory, bet A190). THE PURE-ISH CORE of
|
|
3
|
+
* `pmos approver` (lib/approver-cli.js).
|
|
4
|
+
*
|
|
5
|
+
* A sign-off goes better when the PM walks in with what that person asked last time. PMOS already records the sign-offs
|
|
6
|
+
* (lib/signoffs.js: who, what, and the answer with its source) and the decision journal records who disagreed and why
|
|
7
|
+
* (lib/decision-journal.js `against`). Neither is read back by person. This reads both, groups them by approver, and, before an open
|
|
8
|
+
* sign-off, lists what that approver asked or objected to on earlier work.
|
|
9
|
+
*
|
|
10
|
+
* itemsOf(root) → [item] every past ask, answer and objection, oldest first. An item:
|
|
11
|
+
* { who, kind: 'signoff' | 'answer' | 'objection', text, ini, date, source }
|
|
12
|
+
* signoff a sign-off asked of them: what they had to say yes to (signoffs.jsonl)
|
|
13
|
+
* answer their recorded answer to it, with where it was given
|
|
14
|
+
* objection a journal decision's `against` that starts with a name: "Ana: the ROI is not shown" (never a guess from other text)
|
|
15
|
+
* whoOf(text) → { who, text } | null the name an `against` starts with, before ':', ' - ', ' — ', or ' said'/' asked'
|
|
16
|
+
* same(a, b) → true when two names are the same person: equal, or one is the other's first name ("Ana" and "Ana Lim")
|
|
17
|
+
* approvers(items) → [{ who, n, last }] one row per person, most items first
|
|
18
|
+
* historyOf(items, who, o) → [item] that person's items, newest first; o.except leaves out one initiative
|
|
19
|
+
* briefOf(root, ini, o) → [{ who, what, due, past: [item] }] for each OPEN sign-off of the initiative, at most MAX_PAST of the
|
|
20
|
+
* approver's items from OTHER initiatives, newest first. A person with none is left out (zero is silence)
|
|
21
|
+
* CLI: node lib/approver-memory.js count <root> prints `[approver] …` and the open sign-offs whose approver has history, alone on
|
|
22
|
+
* the last line (the health number)
|
|
23
|
+
*
|
|
24
|
+
* READ ONLY. It keeps no store of its own and writes nothing: every item comes from a record the PM or the Driver already wrote, and
|
|
25
|
+
* carries its source. Nothing is sent. Works on any product built with PMOS, in either layout.
|
|
26
|
+
*/
|
|
27
|
+
const path = require('path');
|
|
28
|
+
|
|
29
|
+
const MAX_PAST = 3;
|
|
30
|
+
const TAG = '[approver]';
|
|
31
|
+
const NAME_RE = /^\s*(\p{Lu}[\p{L}.'’-]*(?:\s+\p{Lu}[\p{L}.'’-]*){0,2})\s*(?::|\s[-—–]\s|\s(?:said|asked|wants|objected)\b)\s*(.+)$/u;
|
|
32
|
+
const one = (s, n = 300) => String(s == null ? '' : s).replace(/\s+/g, ' ').trim().slice(0, n);
|
|
33
|
+
const norm = (s) => one(s, 80).toLowerCase();
|
|
34
|
+
|
|
35
|
+
function whoOf(text) {
|
|
36
|
+
const m = NAME_RE.exec(one(text, 600));
|
|
37
|
+
if (!m) return null;
|
|
38
|
+
return { who: m[1].trim(), text: one(m[2]) };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function same(a, b) {
|
|
42
|
+
const x = norm(a), y = norm(b);
|
|
43
|
+
if (!x || !y) return false;
|
|
44
|
+
if (x === y) return true;
|
|
45
|
+
const fx = x.split(' ')[0], fy = y.split(' ')[0];
|
|
46
|
+
return (x === fy && !x.includes(' ')) || (y === fx && !y.includes(' '));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function signoffsOf(root) {
|
|
50
|
+
try {
|
|
51
|
+
const SO = require('./signoffs.js');
|
|
52
|
+
const JT = require('./jira-tickets.js');
|
|
53
|
+
return SO.list(SO.fileOf(JT.stateDirOf(root)));
|
|
54
|
+
} catch { return []; }
|
|
55
|
+
}
|
|
56
|
+
function decisionsOf(root) {
|
|
57
|
+
try { const J = require('./decision-journal.js'); return J.fold(J.read(root).rows); } catch { return []; }
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function itemsOf(root) {
|
|
61
|
+
root = path.resolve(root);
|
|
62
|
+
const out = [];
|
|
63
|
+
for (const s of signoffsOf(root)) {
|
|
64
|
+
if (!s || !s.who) continue;
|
|
65
|
+
const date = String(s.asked || s.at || '').slice(0, 10);
|
|
66
|
+
out.push({ who: one(s.who, 80), kind: 'signoff', text: one(s.what), ini: s.ini || '', date, source: s.source || 'sign-off ' + s.id });
|
|
67
|
+
if (s.state === 'answered' && s.answer) out.push({ who: one(s.who, 80), kind: 'answer', text: one(s.answer), ini: s.ini || '', date: String(s.answeredAt || '').slice(0, 10) || date, source: s.answerSource || 'sign-off ' + s.id });
|
|
68
|
+
}
|
|
69
|
+
for (const e of decisionsOf(root)) {
|
|
70
|
+
const w = e && e.against ? whoOf(e.against) : null;
|
|
71
|
+
if (!w) continue;
|
|
72
|
+
out.push({ who: w.who, kind: 'objection', text: w.text, ini: e.initiative || '', date: e.date || '', source: 'decision ' + e.id, decided: one(e.decided, 160) });
|
|
73
|
+
}
|
|
74
|
+
return out.sort((a, b) => String(a.date).localeCompare(String(b.date)));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function approvers(items) {
|
|
78
|
+
const rows = [];
|
|
79
|
+
for (const it of items || []) {
|
|
80
|
+
const r = rows.find((x) => same(x.who, it.who));
|
|
81
|
+
if (r) { r.n++; if (String(it.date) > String(r.last)) r.last = it.date; if (it.who.length > r.who.length) r.who = it.who; }
|
|
82
|
+
else rows.push({ who: it.who, n: 1, last: it.date });
|
|
83
|
+
}
|
|
84
|
+
return rows.sort((a, b) => b.n - a.n || String(b.last).localeCompare(String(a.last)) || a.who.localeCompare(b.who));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function historyOf(items, who, { except } = {}) {
|
|
88
|
+
return (items || []).filter((it) => same(it.who, who) && (!except || it.ini !== except))
|
|
89
|
+
.sort((a, b) => String(b.date).localeCompare(String(a.date)));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function briefOf(root, ini, { items } = {}) {
|
|
93
|
+
const all = items || itemsOf(root);
|
|
94
|
+
const open = signoffsOf(path.resolve(root)).filter((s) => s.ini === ini && s.state === 'open');
|
|
95
|
+
const out = [];
|
|
96
|
+
for (const s of open) {
|
|
97
|
+
const past = historyOf(all, s.who, { except: ini }).slice(0, MAX_PAST);
|
|
98
|
+
if (past.length) out.push({ who: s.who, what: s.what, due: s.due || null, past });
|
|
99
|
+
}
|
|
100
|
+
return out;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** The health number: open sign-offs (any initiative) whose approver has at least one item on other work. */
|
|
104
|
+
function countBriefed(root) {
|
|
105
|
+
const all = itemsOf(root);
|
|
106
|
+
const open = signoffsOf(path.resolve(root)).filter((s) => s.state === 'open');
|
|
107
|
+
const briefed = open.filter((s) => historyOf(all, s.who, { except: s.ini }).length > 0).length;
|
|
108
|
+
return { open: open.length, briefed, approvers: approvers(all).length };
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
module.exports = { MAX_PAST, TAG, whoOf, same, itemsOf, approvers, historyOf, briefOf, countBriefed };
|
|
112
|
+
|
|
113
|
+
if (require.main === module) {
|
|
114
|
+
const a = process.argv.slice(2);
|
|
115
|
+
if (a[0] !== 'count') { console.error('usage: node lib/approver-memory.js count <root>'); process.exit(2); }
|
|
116
|
+
const C = countBriefed(path.resolve(a[1] || '.'));
|
|
117
|
+
console.log(`${TAG} ${C.briefed} of ${C.open} open sign-offs have an approver with past asks (${C.approvers} approvers known)`);
|
|
118
|
+
console.log(String(C.briefed));
|
|
119
|
+
}
|
|
@@ -163,6 +163,9 @@ const VERBS = Object.freeze({
|
|
|
163
163
|
// Not a pm-os-absorb verb (run: null): initiative decision-journal-outcome-checks added it through the same table.
|
|
164
164
|
decisions: Object.freeze({ module: 'decisions-cli.js', run: null, guide: 'cli.md',
|
|
165
165
|
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)' }),
|
|
166
|
+
// Not a pm-os-absorb verb (run: null): initiative approver-memory (bet A190) added it through the same table.
|
|
167
|
+
approver: Object.freeze({ module: 'approver-cli.js', run: null, guide: 'cli.md',
|
|
168
|
+
help: 'pmos approver list|show|brief — what each approver asked or objected to before, from the sign-offs and the decision journal, before the next sign-off (pmos approver help)' }),
|
|
166
169
|
// Not a pm-os-absorb verb (run: null): initiative balance-meter (bet A448) added it through the same table.
|
|
167
170
|
balance: Object.freeze({ module: 'balance-cli.js', run: null, guide: 'cli.md',
|
|
168
171
|
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)' }),
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.817.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.817.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED