create-pmos 0.683.0 → 0.684.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 +14 -14
- 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 +13 -0
- package/workspace/guide/cli.md +12 -0
- package/workspace/lib/decision-journal-needs.js +33 -0
- package/workspace/lib/decision-journal.js +238 -0
- package/workspace/lib/decisions-cli.js +152 -0
- package/workspace/lib/needs-providers.js +1 -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/decision-journal-outcome-checks.json +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.684.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,19 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.684.0",
|
|
38
|
+
"at": "2026-11-22T08:41:57.186Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1497,
|
|
43
|
+
"t": "A decision journal with dated outcome checks (A331)",
|
|
44
|
+
"s": "A decision journal with dated outcome checks (A331)",
|
|
45
|
+
"k": "new"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
36
49
|
{
|
|
37
50
|
"v": "0.683.0",
|
|
38
51
|
"at": "2026-11-22T08:20:39.884Z",
|
|
@@ -369,19 +382,6 @@
|
|
|
369
382
|
"k": "new"
|
|
370
383
|
}
|
|
371
384
|
]
|
|
372
|
-
},
|
|
373
|
-
{
|
|
374
|
-
"v": "0.648.0",
|
|
375
|
-
"at": "2026-11-20T05:58:53.312Z",
|
|
376
|
-
"f": 4,
|
|
377
|
-
"prs": [
|
|
378
|
-
{
|
|
379
|
-
"n": 1430,
|
|
380
|
-
"t": "Work's This sprint tab holds all work in the sprint's dates",
|
|
381
|
-
"s": "Work's This sprint tab holds all work in the sprint's dates",
|
|
382
|
-
"k": "new"
|
|
383
|
-
}
|
|
384
|
-
]
|
|
385
385
|
}
|
|
386
386
|
]
|
|
387
387
|
}
|
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-22T08:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-22T08:41:53Z"}
|
|
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-22T08:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-22T08:41:53Z"}
|
|
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-22T08:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-22T08:41:53Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.684.0",
|
|
4
|
+
"at": "2026-11-22T08:41:57.186Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1497,
|
|
9
|
+
"t": "A decision journal with dated outcome checks (A331)",
|
|
10
|
+
"s": "A decision journal with dated outcome checks (A331)",
|
|
11
|
+
"k": "new"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
2
15
|
{
|
|
3
16
|
"v": "0.683.0",
|
|
4
17
|
"at": "2026-11-22T08:20:39.884Z",
|
package/workspace/guide/cli.md
CHANGED
|
@@ -276,6 +276,18 @@ Run them in the product's repository, or pass `--root <dir>`.
|
|
|
276
276
|
- 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. The Board's Next column asks you the same question. Nothing happens until you press ✓. Undo reverses the step.
|
|
277
277
|
- `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.
|
|
278
278
|
|
|
279
|
+
### pmos decisions: a decision journal
|
|
280
|
+
|
|
281
|
+
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.
|
|
282
|
+
|
|
283
|
+
- `pmos decisions add "<what was decided>" --expect "<what should happen>"` adds a decision. The check date is 30 days later. `--check <YYYY-MM-DD>` or `--check +2w` sets another date. `--why "<text>"`, `--against "<who disagreed, and why>"` and `--initiative <id>` are optional.
|
|
284
|
+
- `pmos decisions add "<new decision>" --expect "<text>" --replaces <id> --changed-mind "<evidence>"` reverses an earlier decision. You must say what evidence changed your mind. The old decision then shows as reversed and is not checked.
|
|
285
|
+
- `pmos decisions list` shows the checks that are due, then the open decisions. `--all` also shows the closed ones.
|
|
286
|
+
- `pmos decisions show <id>` shows one decision, its checks and its reversal.
|
|
287
|
+
- `pmos decisions check <id> <worked|didnt-work|cant-tell> --evidence "<text>"` records your verdict. With `cant-tell`, `--again <date>` sets a new date to look again.
|
|
288
|
+
- `pmos decisions record` shows how your decisions turned out: for each quarter, the decisions that worked, did not work and could not be told, and the hit rate (worked divided by worked plus did not work). It also shows the reversals and their reasons.
|
|
289
|
+
- On the check date, the decision shows on Today as a gate that waits for you, with the command to record the verdict. PMOS never records a verdict for you.
|
|
290
|
+
|
|
279
291
|
### pmos rehearse: rehearse a change
|
|
280
292
|
|
|
281
293
|
- `pmos rehearse move <task> --by <days>` — the task moves later by whole days, or earlier with a minus (`--by -2`).
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* decision-journal-needs.js — the needs provider of the decision journal (initiative decision-journal-outcome-checks, done test C4).
|
|
3
|
+
* lib/needs-providers.js folds these rows into server.js deriveNeeds, and from there into /api/needs and Today.
|
|
4
|
+
*
|
|
5
|
+
* kinds: decision-check
|
|
6
|
+
* rowsFor(w, { lead }) → rows · sig(w) → string
|
|
7
|
+
*
|
|
8
|
+
* decision-check one row per journal decision whose check date is today or past, with no verdict (lib/decision-journal.js fold, state
|
|
9
|
+
* `due`). Kind 1 (a gate is owed). The act is the command that records the verdict. The row goes when a verdict is
|
|
10
|
+
* recorded, when cant-tell moves the date, or when a later decision replaces it.
|
|
11
|
+
*
|
|
12
|
+
* The journal is repository-wide, so a tree that is not the lead returns []. Nothing here writes or sends. */
|
|
13
|
+
const J = require('./decision-journal.js');
|
|
14
|
+
|
|
15
|
+
const NAME = 'decision-journal-needs';
|
|
16
|
+
const clip = (s, n) => { const t = String(s || '').replace(/\s+/g, ' ').trim(); return t.length > n ? t.slice(0, n - 1).replace(/\s+\S*$/, '') + '…' : t; };
|
|
17
|
+
|
|
18
|
+
function rowsFor(w, { lead } = {}) {
|
|
19
|
+
if (!lead || !w || !w.root) return [];
|
|
20
|
+
const { entries, file } = J.entriesOf(w.root, { today: J.todayOf() });
|
|
21
|
+
return entries.filter((e) => e.state === 'due').map((e) => {
|
|
22
|
+
const cause = `Did it work? You decided: ${clip(e.decided, 140)}. You expected: ${clip(e.expected, 140)}.`;
|
|
23
|
+
return {
|
|
24
|
+
run_id: `${NAME}:${w.id}:${e.id}`, kind: 'decision-check', initiative_id: e.initiative || null, question: cause, doc: file, ws: w.id,
|
|
25
|
+
today: { kind: 1, source: NAME, cause, evidence: `${file} · check date ${e.check}`,
|
|
26
|
+
act: { label: 'Check', cli: `pmos decisions check ${e.id} worked|didnt-work|cant-tell --evidence "<what shows it>"` } },
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
// the date is in the signature: a decision becomes due at midnight with no change to the file
|
|
31
|
+
function sig(w) { return w && w.root ? J.stamp(w.root) + '@' + J.todayOf() : ''; }
|
|
32
|
+
|
|
33
|
+
module.exports = { kinds: ['decision-check'], rowsFor, sig };
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* decision-journal.js — one line per product decision, with a dated outcome check (initiative decision-journal-outcome-checks, bet A331
|
|
3
|
+
* with A412). THE CORE of `pmos decisions` (lib/decisions-cli.js) and of the Today card a due check makes (lib/decision-journal-needs.js).
|
|
4
|
+
*
|
|
5
|
+
* Decisions are made without a stated expected outcome or a date to look again (A331 proof: 0 of 34 initiative records on 2 products state
|
|
6
|
+
* one), and many decisions are smaller than an initiative, so they have no record at all. The journal holds them in any repository built with
|
|
7
|
+
* PMOS: `decision-journal.jsonl` in the runs folder (PMOS-self: planning/runs/; kit layout: pmos/state/). It is append-only; nothing is
|
|
8
|
+
* rewritten. Two kinds of line:
|
|
9
|
+
* { type: 'decision', id, date, decided, expected, check, why?, against?, initiative?, replaces?, changed_mind?, at, by, via }
|
|
10
|
+
* { type: 'check', id, verdict: worked | didnt-work | cant-tell, evidence, date, again?, at, by, via }
|
|
11
|
+
*
|
|
12
|
+
* read(root) → { rows, file, layout } every line, from the runs folder and (in a kit tree) the state folder
|
|
13
|
+
* fold(rows, { today }) → [entry] one entry per decision, with its state:
|
|
14
|
+
* open the check date is after today
|
|
15
|
+
* due the check date is today or before, and no verdict closes it
|
|
16
|
+
* checked a verdict closes it (worked, didnt-work, or cant-tell with no --again date)
|
|
17
|
+
* replaced a later decision replaces it (a reversal) before a verdict closed it; it leaves the due list
|
|
18
|
+
* An entry: { id, date, decided, expected, check (the date it is due now), why, against, initiative, replaces, changed_mind, replacedBy,
|
|
19
|
+
* replacedWhy, checks: [line], verdict (the closing check line or null), dueAt (the date the closing verdict answered), state, days }
|
|
20
|
+
* add(root, fields, { now, by, via }) → { ok, id, line, file } | { ok: false, error }
|
|
21
|
+
* check(root, { id, verdict, evidence, again }, { now, by, via }) → { ok, line, file } | { ok: false, error }
|
|
22
|
+
* record(entries, { today }) → { quarters: [{ quarter, worked, didnt, cantTell, hitRate }], total, worked, didnt, cantTell, hitRate,
|
|
23
|
+
* onTime, due, open, reversals: [{ id, decided, replacedBy, why }] }
|
|
24
|
+
* checkDate(text, today) → 'YYYY-MM-DD' | null a date, or +N d / w / m from today
|
|
25
|
+
*
|
|
26
|
+
* A verdict is the PM's: PMOS never records one from a metric alone, and every verdict carries evidence. Nothing here sends anything.
|
|
27
|
+
*/
|
|
28
|
+
const fs = require('fs');
|
|
29
|
+
const path = require('path');
|
|
30
|
+
|
|
31
|
+
const FILE = 'decision-journal.jsonl';
|
|
32
|
+
const DAY = 86400000;
|
|
33
|
+
const DEFAULT_DAYS = 30;
|
|
34
|
+
const ON_TIME_DAYS = 7;
|
|
35
|
+
const VERDICTS = Object.freeze(['worked', 'didnt-work', 'cant-tell']);
|
|
36
|
+
const VERDICT_WORDS = Object.freeze({ worked: 'worked', 'didnt-work': "didn't work", 'cant-tell': "can't tell" });
|
|
37
|
+
const ID_RE = /^[a-z0-9][a-z0-9._-]{0,79}$/;
|
|
38
|
+
const MAX = { decided: 300, expected: 300, why: 600, against: 600, evidence: 1000, changed: 600 };
|
|
39
|
+
|
|
40
|
+
const one = (s) => String(s == null ? '' : s).replace(/\s+/g, ' ').trim();
|
|
41
|
+
const isDate = (s) => /^\d{4}-\d{2}-\d{2}$/.test(String(s || '')) && Number.isFinite(Date.parse(s + 'T00:00:00Z'));
|
|
42
|
+
const todayOf = (now = Date.now()) => new Date(now).toISOString().slice(0, 10);
|
|
43
|
+
const addDays = (day, n) => new Date(Date.parse(day + 'T00:00:00Z') + n * DAY).toISOString().slice(0, 10);
|
|
44
|
+
const daysBetween = (a, b) => Math.round((Date.parse(b + 'T00:00:00Z') - Date.parse(a + 'T00:00:00Z')) / DAY);
|
|
45
|
+
const quarterOf = (d) => (isDate(d) ? d.slice(0, 4) + '-Q' + (Math.floor((+d.slice(5, 7) - 1) / 3) + 1) : '');
|
|
46
|
+
const rel = (root, f) => path.relative(root, f).split(path.sep).join('/');
|
|
47
|
+
|
|
48
|
+
function layoutOf(root) {
|
|
49
|
+
try { const l = require('./console-state').loadEngine(); if (l.ok) return l.engine.layout(root); } catch { /* fall through */ }
|
|
50
|
+
const kit = fs.existsSync(path.join(root, 'pmos', 'state'));
|
|
51
|
+
return { root, kit, runsDir: kit ? path.join(root, 'pmos', 'state') : path.join(root, 'planning', 'runs') };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** The journal files a repository may hold, the one this module writes first. */
|
|
55
|
+
function filesOf(root) {
|
|
56
|
+
const L = layoutOf(root);
|
|
57
|
+
return { layout: L, file: path.join(L.runsDir, FILE), all: [...new Set([path.join(L.runsDir, FILE), path.join(root, 'pmos', 'state', FILE), path.join(root, 'planning', 'runs', FILE)])] };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function read(root) {
|
|
61
|
+
root = path.resolve(root);
|
|
62
|
+
const F = filesOf(root);
|
|
63
|
+
const rows = [];
|
|
64
|
+
for (const f of F.all) {
|
|
65
|
+
let text = '';
|
|
66
|
+
try { text = fs.readFileSync(f, 'utf8'); } catch { continue; }
|
|
67
|
+
for (const s of text.split('\n')) { if (!s.trim()) continue; try { const o = JSON.parse(s); if (o && typeof o === 'object' && !Array.isArray(o)) rows.push(o); } catch { /* a torn line is skipped */ } }
|
|
68
|
+
}
|
|
69
|
+
rows.sort((a, b) => String(a.at || '').localeCompare(String(b.at || '')));
|
|
70
|
+
return { rows, file: F.file, layout: F.layout };
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** A check date from text: YYYY-MM-DD, or +N d|w|m (days, weeks, months of 30 days) from today. */
|
|
74
|
+
function checkDate(text, today) {
|
|
75
|
+
const t = one(text).toLowerCase();
|
|
76
|
+
if (isDate(t)) return t;
|
|
77
|
+
const m = /^\+?(\d{1,3})\s*(d|day|days|w|week|weeks|m|month|months)$/.exec(t);
|
|
78
|
+
if (!m || !isDate(today)) return null;
|
|
79
|
+
const n = +m[1] * (m[2][0] === 'w' ? 7 : m[2][0] === 'm' ? 30 : 1);
|
|
80
|
+
return n > 0 ? addDays(today, n) : null;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function fold(rows, { today = todayOf() } = {}) {
|
|
84
|
+
const by = new Map();
|
|
85
|
+
for (const r of rows || []) {
|
|
86
|
+
if (!r || r.type !== 'decision' || typeof r.id !== 'string' || by.has(r.id)) continue;
|
|
87
|
+
by.set(r.id, { id: r.id, date: r.date || String(r.at || '').slice(0, 10), decided: r.decided || '', expected: r.expected || '', check: r.check || '',
|
|
88
|
+
why: r.why || '', against: r.against || '', initiative: r.initiative || '', replaces: r.replaces || '', changed_mind: r.changed_mind || '',
|
|
89
|
+
replacedBy: '', replacedWhy: '', replacedAt: '', checks: [], verdict: null, dueAt: '', at: r.at || '', by: r.by || '' });
|
|
90
|
+
}
|
|
91
|
+
for (const r of rows || []) {
|
|
92
|
+
if (!r || r.type !== 'check') continue;
|
|
93
|
+
const e = by.get(r.id);
|
|
94
|
+
if (!e || !VERDICTS.includes(r.verdict)) continue;
|
|
95
|
+
e.checks.push(r);
|
|
96
|
+
if (r.verdict === 'cant-tell' && isDate(r.again)) { e.verdict = null; e.check = r.again; continue; }
|
|
97
|
+
e.verdict = r; e.dueAt = e.check;
|
|
98
|
+
}
|
|
99
|
+
for (const e of by.values()) {
|
|
100
|
+
if (!e.replaces || !by.has(e.replaces)) continue;
|
|
101
|
+
const old = by.get(e.replaces);
|
|
102
|
+
if (!old.replacedBy) { old.replacedBy = e.id; old.replacedWhy = e.changed_mind; old.replacedAt = e.date; }
|
|
103
|
+
}
|
|
104
|
+
const out = [...by.values()];
|
|
105
|
+
for (const e of out) {
|
|
106
|
+
e.state = e.verdict ? 'checked' : e.replacedBy ? 'replaced' : isDate(e.check) && e.check <= today ? 'due' : 'open';
|
|
107
|
+
e.days = isDate(e.check) && isDate(today) ? daysBetween(e.check, today) : 0; // > 0: days past the check date
|
|
108
|
+
}
|
|
109
|
+
return out;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const ORDER = { due: 0, open: 1, checked: 2, replaced: 3 };
|
|
113
|
+
/** Due checks first (oldest first), then open ones by check date, then the closed ones, newest first. */
|
|
114
|
+
function sorted(entries) {
|
|
115
|
+
return entries.slice().sort((a, b) => ORDER[a.state] - ORDER[b.state]
|
|
116
|
+
|| (a.state === 'due' || a.state === 'open' ? a.check.localeCompare(b.check) : String(b.verdict ? b.verdict.date : b.replacedAt).localeCompare(String(a.verdict ? a.verdict.date : a.replacedAt)))
|
|
117
|
+
|| a.id.localeCompare(b.id));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function slugOf(text) {
|
|
121
|
+
const w = one(text).toLowerCase().replace(/[^a-z0-9\s-]/g, ' ').split(/\s+/).filter((x) => x && !/^(the|a|an|to|of|and|we|i|will|for|on|in)$/.test(x)).slice(0, 5);
|
|
122
|
+
return (w.join('-') || 'decision').slice(0, 48).replace(/-+$/, '');
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function append(file, line) {
|
|
126
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
127
|
+
const st = (() => { try { return fs.lstatSync(file); } catch { return null; } })();
|
|
128
|
+
if (st && !st.isFile()) throw new Error('the decision journal is not a plain file');
|
|
129
|
+
fs.appendFileSync(file, JSON.stringify(line) + '\n');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function add(root, f = {}, { now = Date.now(), by, via } = {}) {
|
|
133
|
+
root = path.resolve(root);
|
|
134
|
+
const today = todayOf(now);
|
|
135
|
+
const decided = one(f.decided), expected = one(f.expected);
|
|
136
|
+
if (decided.length < 8) return { ok: false, error: 'say what was decided, in a few words (at least 8 characters)' };
|
|
137
|
+
if (expected.length < 8) return { ok: false, error: 'say what you expect to happen because of it (--expect, at least 8 characters): a decision with no expected outcome cannot be checked' };
|
|
138
|
+
if (decided.length > MAX.decided || expected.length > MAX.expected) return { ok: false, error: `keep the decision and the expected outcome under ${MAX.decided} characters each` };
|
|
139
|
+
let check = addDays(today, DEFAULT_DAYS);
|
|
140
|
+
if (f.check != null && f.check !== '') {
|
|
141
|
+
check = checkDate(f.check, today);
|
|
142
|
+
if (!check) return { ok: false, error: '--check is a date (YYYY-MM-DD) or a time from today (+30d, +2w, +3m)' };
|
|
143
|
+
if (check <= today) return { ok: false, error: 'the check date must be after today: an outcome needs time to show' };
|
|
144
|
+
}
|
|
145
|
+
const why = one(f.why), against = one(f.against), initiative = one(f.initiative), replaces = one(f.replaces), changed = one(f.changed_mind);
|
|
146
|
+
if (why.length > MAX.why || against.length > MAX.against || changed.length > MAX.changed) return { ok: false, error: 'keep --why, --against and --changed-mind under 600 characters each' };
|
|
147
|
+
if (initiative && !ID_RE.test(initiative)) return { ok: false, error: '--initiative takes the initiative\'s id' };
|
|
148
|
+
const J = read(root);
|
|
149
|
+
const E = fold(J.rows, { today });
|
|
150
|
+
if (replaces) {
|
|
151
|
+
const old = E.find((e) => e.id === replaces);
|
|
152
|
+
if (!old) return { ok: false, error: `no decision ${replaces} in this journal (pmos decisions list shows the ids)` };
|
|
153
|
+
if (old.replacedBy) return { ok: false, error: `${replaces} was already replaced by ${old.replacedBy}` };
|
|
154
|
+
if (changed.length < 12) return { ok: false, error: 'a reversal says what changed your mind (--changed-mind, at least 12 characters): the evidence, not only the new view' };
|
|
155
|
+
} else if (changed) return { ok: false, error: '--changed-mind goes with --replaces <id>' };
|
|
156
|
+
const base = today.replace(/-/g, '') + '-' + slugOf(decided);
|
|
157
|
+
let id = base, n = 2;
|
|
158
|
+
const have = new Set(E.map((e) => e.id));
|
|
159
|
+
while (have.has(id)) id = base + '-' + n++;
|
|
160
|
+
const line = { type: 'decision', id, date: today, decided, expected, check, ...(why ? { why } : {}), ...(against ? { against } : {}),
|
|
161
|
+
...(initiative ? { initiative } : {}), ...(replaces ? { replaces, changed_mind: changed } : {}), at: new Date(now).toISOString(), by: by || 'agent:unknown', via: via || 'cli' };
|
|
162
|
+
try { append(J.file, line); } catch (e) { return { ok: false, error: 'the decision journal could not be written: ' + String((e && e.message) || e).slice(0, 160) }; }
|
|
163
|
+
return { ok: true, id, line, file: rel(root, J.file) };
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function check(root, { id, verdict, evidence, again } = {}, { now = Date.now(), by, via } = {}) {
|
|
167
|
+
root = path.resolve(root);
|
|
168
|
+
const today = todayOf(now);
|
|
169
|
+
if (!VERDICTS.includes(verdict)) return { ok: false, error: 'the verdict is worked, didnt-work or cant-tell' };
|
|
170
|
+
const ev = one(evidence);
|
|
171
|
+
if (ev.length < 12) return { ok: false, error: 'say what shows it (--evidence, at least 12 characters): a number, a link or what you saw' };
|
|
172
|
+
if (ev.length > MAX.evidence) return { ok: false, error: `keep the evidence under ${MAX.evidence} characters` };
|
|
173
|
+
let next = '';
|
|
174
|
+
if (again != null && again !== '') {
|
|
175
|
+
if (verdict !== 'cant-tell') return { ok: false, error: '--again goes with cant-tell: a new date to look again' };
|
|
176
|
+
next = checkDate(again, today);
|
|
177
|
+
if (!next || next <= today) return { ok: false, error: '--again is a date after today (YYYY-MM-DD, or +30d, +2w, +3m)' };
|
|
178
|
+
}
|
|
179
|
+
const J = read(root);
|
|
180
|
+
const e = fold(J.rows, { today }).find((x) => x.id === id);
|
|
181
|
+
if (!e) return { ok: false, error: `no decision ${id} in this journal (pmos decisions list shows the ids)` };
|
|
182
|
+
if (e.state === 'checked') return { ok: false, error: `${id} was already checked: ${VERDICT_WORDS[e.verdict.verdict]} on ${e.verdict.date}` };
|
|
183
|
+
const line = { type: 'check', id, verdict, evidence: ev, date: today, ...(next ? { again: next } : {}), at: new Date(now).toISOString(), by: by || 'agent:unknown', via: via || 'cli' };
|
|
184
|
+
try { append(J.file, line); } catch (err) { return { ok: false, error: 'the decision journal could not be written: ' + String((err && err.message) || err).slice(0, 160) }; }
|
|
185
|
+
return { ok: true, line, file: rel(root, J.file) };
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const rate = (w, d) => (w + d ? Math.round((100 * w) / (w + d)) : null);
|
|
189
|
+
|
|
190
|
+
/** The track record: how the user's calls turned out, per quarter of the date each check answered. */
|
|
191
|
+
function record(entries, { today = todayOf() } = {}) {
|
|
192
|
+
const q = new Map();
|
|
193
|
+
let worked = 0, didnt = 0, cantTell = 0, acted = 0, onTime = 0;
|
|
194
|
+
for (const e of entries || []) {
|
|
195
|
+
if (e.checks.length) {
|
|
196
|
+
// on time: the first verdict line came within ON_TIME_DAYS of the date the check was first due
|
|
197
|
+
const first = e.checks[0], dueFirst = firstDue(e);
|
|
198
|
+
acted++;
|
|
199
|
+
if (isDate(first.date) && isDate(dueFirst) && daysBetween(dueFirst, first.date) <= ON_TIME_DAYS) onTime++;
|
|
200
|
+
}
|
|
201
|
+
if (!e.verdict) continue;
|
|
202
|
+
const k = quarterOf(e.dueAt || e.verdict.date);
|
|
203
|
+
if (!q.has(k)) q.set(k, { quarter: k, worked: 0, didnt: 0, cantTell: 0 });
|
|
204
|
+
const row = q.get(k);
|
|
205
|
+
if (e.verdict.verdict === 'worked') { row.worked++; worked++; }
|
|
206
|
+
else if (e.verdict.verdict === 'didnt-work') { row.didnt++; didnt++; }
|
|
207
|
+
else { row.cantTell++; cantTell++; }
|
|
208
|
+
}
|
|
209
|
+
const quarters = [...q.values()].sort((a, b) => a.quarter.localeCompare(b.quarter)).map((r) => ({ ...r, hitRate: rate(r.worked, r.didnt) }));
|
|
210
|
+
const reversals = (entries || []).filter((e) => e.replacedBy).map((e) => ({ id: e.id, decided: e.decided, replacedBy: e.replacedBy, why: e.replacedWhy, date: e.replacedAt }));
|
|
211
|
+
return { total: (entries || []).length, worked, didnt, cantTell, hitRate: rate(worked, didnt), quarters,
|
|
212
|
+
onTime: acted ? Math.round((100 * onTime) / acted) : null, acted,
|
|
213
|
+
due: (entries || []).filter((e) => e.state === 'due').length, open: (entries || []).filter((e) => e.state === 'open').length, reversals, today };
|
|
214
|
+
}
|
|
215
|
+
/** The date a decision was first due: its decision line's check date (a cant-tell --again only moves it later). */
|
|
216
|
+
function firstDue(e) { return e._check0 || e.check; }
|
|
217
|
+
|
|
218
|
+
/** fold() keeps the moved date in `check`; remember the first one for the on-time count. */
|
|
219
|
+
function foldWithFirst(rows, opts) {
|
|
220
|
+
const first = new Map();
|
|
221
|
+
for (const r of rows || []) if (r && r.type === 'decision' && r.id && !first.has(r.id)) first.set(r.id, r.check);
|
|
222
|
+
return fold(rows, opts).map((e) => Object.assign(e, { _check0: first.get(e.id) || e.check }));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/** Every entry of a repository's journal, sorted for a reader. */
|
|
226
|
+
function entriesOf(root, { today = todayOf() } = {}) {
|
|
227
|
+
const J = read(root);
|
|
228
|
+
return { entries: sorted(foldWithFirst(J.rows, { today })), file: rel(path.resolve(root), J.file) };
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/** A signature that changes when a journal file changes. */
|
|
232
|
+
function stamp(root) {
|
|
233
|
+
const out = [];
|
|
234
|
+
for (const f of filesOf(path.resolve(root)).all) { try { const st = fs.statSync(f); out.push(st.mtimeMs + ':' + st.size); } catch { /* none */ } }
|
|
235
|
+
return out.join('|');
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
module.exports = { FILE, VERDICTS, VERDICT_WORDS, DEFAULT_DAYS, ON_TIME_DAYS, read, fold: foldWithFirst, sorted, add, check, record, entriesOf, checkDate, quarterOf, todayOf, stamp, filesOf };
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* decisions-cli.js — `pmos decisions`: a decision journal with dated outcome checks (initiative decision-journal-outcome-checks; lib/decision-journal.js).
|
|
3
|
+
*
|
|
4
|
+
* pmos decisions add "<what was decided>" --expect "<what should happen>" [--check <YYYY-MM-DD|+30d>] [--why "<text>"]
|
|
5
|
+
* [--against "<who disagreed, and why>"] [--initiative <id>] [--replaces <id> --changed-mind "<evidence>"]
|
|
6
|
+
* one line in the journal; the check date is 30 days later unless --check says otherwise
|
|
7
|
+
* pmos decisions list [--all] [--json] due checks first, then the open ones; --all adds the checked and replaced ones
|
|
8
|
+
* pmos decisions show <id> [--json] one decision, its checks, and the decision that replaced it
|
|
9
|
+
* pmos decisions check <id> <worked|didnt-work|cant-tell> --evidence "<text>" [--again <date>]
|
|
10
|
+
* the verdict on a decision; cant-tell --again sets a new date to look again
|
|
11
|
+
* pmos decisions record [--json] the track record: per quarter, worked, didn't work, can't tell and the hit rate
|
|
12
|
+
* every command: [--root <dir>] (default: this repository)
|
|
13
|
+
*
|
|
14
|
+
* The agent runs add and check only after the PM said yes in the chat; the line names who wrote it (lib/actor.js). A verdict is the PM's:
|
|
15
|
+
* never record one from a metric alone. Exit codes: 0 done, 1 refused, 2 usage. Nothing is sent.
|
|
16
|
+
*/
|
|
17
|
+
const path = require('path');
|
|
18
|
+
const { execFileSync } = require('child_process');
|
|
19
|
+
const J = require('./decision-journal.js');
|
|
20
|
+
|
|
21
|
+
const COMMANDS = { decisions: ['add', 'list', 'show', 'check', 'record'] };
|
|
22
|
+
const USAGE = [
|
|
23
|
+
'usage: pmos decisions add|list|show|check|record — a decision journal: each decision has an expected outcome and a date to check it',
|
|
24
|
+
' pmos decisions add "<what was decided>" --expect "<what should happen>" [--check <YYYY-MM-DD|+30d>] [--why "<text>"] [--against "<who disagreed, and why>"] [--initiative <id>]',
|
|
25
|
+
' pmos decisions add "<new decision>" --expect "<text>" --replaces <id> --changed-mind "<the evidence that changed your mind>"',
|
|
26
|
+
' pmos decisions list [--all] [--json] due checks first, then the open ones',
|
|
27
|
+
' pmos decisions show <id> [--json] one decision and its checks',
|
|
28
|
+
' pmos decisions check <id> <worked|didnt-work|cant-tell> --evidence "<text>" [--again <date>] your verdict on a decision',
|
|
29
|
+
' pmos decisions record [--json] how your decisions turned out, per quarter',
|
|
30
|
+
'Run it in the product\'s repository, or pass --root <dir>. The check date is 30 days after the decision unless --check says otherwise.',
|
|
31
|
+
];
|
|
32
|
+
const VERDICT = { worked: 'worked', validated: 'worked', 'didnt-work': 'didnt-work', "didn't-work": 'didnt-work', refuted: 'didnt-work', 'cant-tell': 'cant-tell', "can't-tell": 'cant-tell', inconclusive: 'cant-tell' };
|
|
33
|
+
const ALLOWED = { add: ['json', 'root', 'expect', 'check', 'why', 'against', 'initiative', 'replaces', 'changed-mind'], list: ['json', 'root', 'all'], show: ['json', 'root'], check: ['json', 'root', 'evidence', 'again'], record: ['json', 'root'] };
|
|
34
|
+
const BOOL = new Set(['json', 'all']);
|
|
35
|
+
|
|
36
|
+
function parse(args) {
|
|
37
|
+
const pos = [], flags = {};
|
|
38
|
+
for (let i = 0; i < args.length; i++) {
|
|
39
|
+
const a = args[i];
|
|
40
|
+
if (!a.startsWith('--')) { pos.push(a); continue; }
|
|
41
|
+
const k = a.slice(2);
|
|
42
|
+
if (BOOL.has(k)) flags[k] = true;
|
|
43
|
+
else flags[k] = args[i + 1] !== undefined && !String(args[i + 1]).startsWith('--') ? args[++i] : '';
|
|
44
|
+
}
|
|
45
|
+
return { pos, flags };
|
|
46
|
+
}
|
|
47
|
+
function repoRoot(cwd) {
|
|
48
|
+
try { return execFileSync('git', ['rev-parse', '--show-toplevel'], { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim() || cwd; } catch { return cwd; }
|
|
49
|
+
}
|
|
50
|
+
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
51
|
+
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 || ''); };
|
|
52
|
+
const plural = (n, a, b) => n + ' ' + (n === 1 ? a : b);
|
|
53
|
+
const pct = (n) => (n == null ? 'no verdict yet' : n + '%');
|
|
54
|
+
|
|
55
|
+
function line(e) {
|
|
56
|
+
const when = e.state === 'due' ? `check due ${e.days > 0 ? 'since ' + short(e.check) : 'today'}`
|
|
57
|
+
: e.state === 'open' ? `check on ${short(e.check)}`
|
|
58
|
+
: e.state === 'checked' ? `${J.VERDICT_WORDS[e.verdict.verdict]} (${short(e.verdict.date)})`
|
|
59
|
+
: `reversed by ${e.replacedBy}`;
|
|
60
|
+
return ` ${e.id} — ${e.decided}\n expected: ${e.expected} · ${when}`;
|
|
61
|
+
}
|
|
62
|
+
const pub = (e) => ({ id: e.id, state: e.state, date: e.date, decided: e.decided, expected: e.expected, check: e.check, why: e.why || null, against: e.against || null,
|
|
63
|
+
initiative: e.initiative || null, replaces: e.replaces || null, changed_mind: e.changed_mind || null, replaced_by: e.replacedBy || null, replaced_why: e.replacedWhy || null,
|
|
64
|
+
verdict: e.verdict ? { verdict: e.verdict.verdict, evidence: e.verdict.evidence, date: e.verdict.date } : null,
|
|
65
|
+
checks: e.checks.map((c) => ({ verdict: c.verdict, evidence: c.evidence, date: c.date, ...(c.again ? { again: c.again } : {}) })), days_past: e.state === 'due' ? e.days : 0 });
|
|
66
|
+
|
|
67
|
+
async function run(argv, { say = (s) => console.log(s), env = process.env, cwd = process.cwd(), now = Date.now(), isTTY } = {}) {
|
|
68
|
+
const args = argv[0] === 'decisions' ? argv.slice(1) : argv.slice();
|
|
69
|
+
const sub = args[0];
|
|
70
|
+
if (!sub || ['help', '--help', '-h'].includes(sub)) { for (const l of USAGE) say(l); return sub ? 0 : 1; }
|
|
71
|
+
if (!COMMANDS.decisions.includes(sub)) { say(`unknown decisions command "${sub}". Use one of: ${COMMANDS.decisions.join(', ')}`); return 2; }
|
|
72
|
+
const { pos, flags } = parse(args.slice(1));
|
|
73
|
+
for (const k of Object.keys(flags)) if (!ALLOWED[sub].includes(k)) { say(`✗ --${k} is not an option of pmos decisions ${sub}`); return 2; }
|
|
74
|
+
const root = path.resolve(flags.root || repoRoot(cwd));
|
|
75
|
+
const today = J.todayOf(now);
|
|
76
|
+
const fail = (error, code = 1) => { say(flags.json ? JSON.stringify({ ok: false, error }) : '✗ ' + error); return code; };
|
|
77
|
+
const actor = () => require('./actor.js').fromCli({ isTTY: isTTY === undefined ? !!(process.stdin.isTTY && process.stdout.isTTY) : isTTY, env });
|
|
78
|
+
|
|
79
|
+
if (sub === 'add') {
|
|
80
|
+
if (pos.length !== 1) return fail('usage: pmos decisions add "<what was decided>" --expect "<what should happen>" (put the decision in quotes)', 2);
|
|
81
|
+
const a = actor();
|
|
82
|
+
const r = J.add(root, { decided: pos[0], expected: flags.expect, check: flags.check, why: flags.why, against: flags.against, initiative: flags.initiative,
|
|
83
|
+
replaces: flags.replaces, changed_mind: flags['changed-mind'] }, { now, by: a.by, via: a.via });
|
|
84
|
+
if (!r.ok) return fail(r.error);
|
|
85
|
+
if (flags.json) { say(JSON.stringify({ ok: true, id: r.id, check: r.line.check, file: r.file })); return 0; }
|
|
86
|
+
say(`✓ ${r.id}: check on ${short(r.line.check)}${r.line.replaces ? ` · replaces ${r.line.replaces}` : ''} (${r.file}). Commit it to keep it.`);
|
|
87
|
+
say(` On that date it shows on Today. Then: pmos decisions check ${r.id} worked|didnt-work|cant-tell --evidence "<what shows it>"`);
|
|
88
|
+
return 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const { entries, file } = J.entriesOf(root, { today });
|
|
92
|
+
|
|
93
|
+
if (sub === 'list') {
|
|
94
|
+
if (pos.length) return fail('pmos decisions list takes no argument', 2);
|
|
95
|
+
const shown = flags.all ? entries : entries.filter((e) => e.state === 'due' || e.state === 'open');
|
|
96
|
+
if (flags.json) { say(JSON.stringify({ ok: true, file, total: entries.length, decisions: shown.map(pub) })); return 0; }
|
|
97
|
+
if (!entries.length) { say('No decisions in this journal yet. Add one: pmos decisions add "<what was decided>" --expect "<what should happen>"'); return 0; }
|
|
98
|
+
const due = shown.filter((e) => e.state === 'due'), open = shown.filter((e) => e.state === 'open'), rest = shown.filter((e) => e.state === 'checked' || e.state === 'replaced');
|
|
99
|
+
say(`${plural(entries.length, 'decision', 'decisions')} · ${due.length} due · ${open.length} open · ${entries.length - due.length - open.length} closed`);
|
|
100
|
+
if (due.length) say(`\n${plural(due.length, 'check', 'checks')} due:\n` + due.map(line).join('\n'));
|
|
101
|
+
if (open.length) say('\nOpen:\n' + open.map(line).join('\n'));
|
|
102
|
+
if (rest.length) say('\nClosed:\n' + rest.map(line).join('\n'));
|
|
103
|
+
if (due.length) say('\nRecord a verdict: pmos decisions check <id> worked|didnt-work|cant-tell --evidence "<what shows it>"');
|
|
104
|
+
return 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (sub === 'show') {
|
|
108
|
+
if (pos.length !== 1) return fail('usage: pmos decisions show <id>', 2);
|
|
109
|
+
const e = entries.find((x) => x.id === pos[0]);
|
|
110
|
+
if (!e) return fail(`no decision ${pos[0]} in this journal (pmos decisions list shows the ids)`);
|
|
111
|
+
if (flags.json) { say(JSON.stringify({ ok: true, decision: pub(e) })); return 0; }
|
|
112
|
+
say(`${e.id} (${short(e.date)})\n decided: ${e.decided}\n expected: ${e.expected}\n check: ${short(e.check)} · ${e.state}`);
|
|
113
|
+
if (e.why) say(' why: ' + e.why);
|
|
114
|
+
if (e.against) say(' disagreed: ' + e.against);
|
|
115
|
+
if (e.initiative) say(' initiative: ' + e.initiative);
|
|
116
|
+
if (e.replaces) say(` replaces ${e.replaces}: ${e.changed_mind}`);
|
|
117
|
+
for (const c of e.checks) say(` ${short(c.date)}: ${J.VERDICT_WORDS[c.verdict]} — ${c.evidence}${c.again ? ` (look again on ${short(c.again)})` : ''}`);
|
|
118
|
+
if (e.replacedBy) say(` reversed by ${e.replacedBy} on ${short(e.replacedAt)}: ${e.replacedWhy}`);
|
|
119
|
+
return 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (sub === 'check') {
|
|
123
|
+
if (pos.length !== 2) return fail('usage: pmos decisions check <id> <worked|didnt-work|cant-tell> --evidence "<text>"', 2);
|
|
124
|
+
const verdict = VERDICT[String(pos[1]).toLowerCase()];
|
|
125
|
+
if (!verdict) return fail('the verdict is worked, didnt-work or cant-tell', 2);
|
|
126
|
+
const a = actor();
|
|
127
|
+
const r = J.check(root, { id: pos[0], verdict, evidence: flags.evidence, again: flags.again }, { now, by: a.by, via: a.via });
|
|
128
|
+
if (!r.ok) return fail(r.error);
|
|
129
|
+
if (flags.json) { say(JSON.stringify({ ok: true, file: r.file, line: r.line })); return 0; }
|
|
130
|
+
say(`✓ ${pos[0]}: ${J.VERDICT_WORDS[verdict]}${r.line.again ? `, look again on ${short(r.line.again)}` : ''} (${r.file}). Commit it to keep it.`);
|
|
131
|
+
return 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// record
|
|
135
|
+
if (pos.length) return fail('pmos decisions record takes no argument', 2);
|
|
136
|
+
const R = J.record(entries, { today });
|
|
137
|
+
if (flags.json) {
|
|
138
|
+
say(JSON.stringify({ ok: true, file, total: R.total, worked: R.worked, didnt_work: R.didnt, cant_tell: R.cantTell, hit_rate: R.hitRate, on_time: R.onTime, due: R.due, open: R.open,
|
|
139
|
+
quarters: R.quarters.map((q) => ({ quarter: q.quarter, worked: q.worked, didnt_work: q.didnt, cant_tell: q.cantTell, hit_rate: q.hitRate })), reversals: R.reversals }));
|
|
140
|
+
return 0;
|
|
141
|
+
}
|
|
142
|
+
if (!R.total) { say('No decisions in this journal yet. Add one: pmos decisions add "<what was decided>" --expect "<what should happen>"'); return 0; }
|
|
143
|
+
const checked = R.worked + R.didnt + R.cantTell;
|
|
144
|
+
say(`${plural(R.total, 'decision', 'decisions')} · ${checked} checked · hit rate ${pct(R.hitRate)} (worked ${R.worked}, didn't work ${R.didnt}, can't tell ${R.cantTell})`);
|
|
145
|
+
if (R.quarters.length) say('\nBy quarter of the check date:\n' + R.quarters.map((q) => ` ${q.quarter} hit rate ${pct(q.hitRate)} · worked ${q.worked} · didn't work ${q.didnt} · can't tell ${q.cantTell}`).join('\n'));
|
|
146
|
+
if (R.onTime != null) say(`\n${R.onTime}% of checks were answered within ${J.ON_TIME_DAYS} days of their date.`);
|
|
147
|
+
if (R.due) say(`${plural(R.due, 'check is', 'checks are')} due now: pmos decisions list`);
|
|
148
|
+
if (R.reversals.length) say(`\n${plural(R.reversals.length, 'reversal', 'reversals')}:\n` + R.reversals.map((v) => ` ${v.id} → ${v.replacedBy}: ${v.why}`).join('\n'));
|
|
149
|
+
return 0;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
module.exports = { run, COMMANDS, USAGE, VERDICT };
|
|
@@ -38,6 +38,7 @@ const PROVIDERS = Object.freeze([
|
|
|
38
38
|
'report-structure-needs', // report-structure: a Chrome or computer source that failed its check while a draft waits for it (kind 8)
|
|
39
39
|
'folder-needs', // folder repair: a folder PMOS could not put back on its default branch alone, in one plain sentence (kind 8)
|
|
40
40
|
'factory-needs', // factory-builder-inner-loop: a work item blocked after the Builder's CI-fix rounds, with the reason (kind 8)
|
|
41
|
+
'decision-journal-needs', // decision-journal-outcome-checks: a journal decision whose check date came, with no verdict (kind 1)
|
|
41
42
|
]);
|
|
42
43
|
/** Kinds that already mean something in the needs queue. A provider may not reuse one. */
|
|
43
44
|
const RESERVED_KINDS = Object.freeze(['question', 'accept', 'outcome', 'keep', 'evidence', 'plan-flag', 'provider-error']);
|
|
@@ -130,6 +130,9 @@ const VERBS = Object.freeze({
|
|
|
130
130
|
// Not a pm-os-absorb verb (run: null): initiative outcome-for-every-initiative added it through the same table.
|
|
131
131
|
outcomes: Object.freeze({ module: 'outcomes-cli.js', run: null, guide: 'cli.md',
|
|
132
132
|
help: 'pmos outcomes list|propose|declare|record — every initiative\'s expected outcome and check date: Claude\'s cited drafts, the PM\'s yes, and the verdict when a check is due (pmos outcomes help)' }),
|
|
133
|
+
// Not a pm-os-absorb verb (run: null): initiative decision-journal-outcome-checks added it through the same table.
|
|
134
|
+
decisions: Object.freeze({ module: 'decisions-cli.js', run: null, guide: 'cli.md',
|
|
135
|
+
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)' }),
|
|
133
136
|
// Not a pm-os-absorb verb (run: null): chief-unit-owners (Wawan 2026-11-18) added both through the same table.
|
|
134
137
|
units: Object.freeze({ module: 'units-cli.js', run: null, guide: 'cli.md',
|
|
135
138
|
help: 'pmos units [list|show <unit>] — the programs, products and projects, who owns each initiative, and each owner\'s brief (pmos units help)' }),
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.684.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.684.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "decision-journal-outcome-checks (bet A331 with A412): a decision journal with dated outcome checks. The ledger and its fold, pmos decisions, the Today card from the needs provider, reversals and the track record (lib/decision-journal.js, lib/decisions-cli.js, lib/decision-journal-needs.js).",
|
|
3
|
+
"modules": ["decision-journal.test.js"],
|
|
4
|
+
"seconds": { "decision-journal.test.js": 2 }
|
|
5
|
+
}
|