create-pmos 0.704.0 → 0.705.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/guide/cli.md +2 -1
- package/workspace/lib/coming-up.js +4 -0
- package/workspace/lib/outcome-props.js +19 -0
- package/workspace/lib/outcomes-cli.js +21 -6
- package/workspace/lib/outcomes.js +67 -4
- package/workspace/lib/pmos-verbs.js +1 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/ini-agent.js +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.705.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-22T11:
|
|
37
|
+
"v": "0.705.0",
|
|
38
|
+
"at": "2026-11-22T11:04:46.265Z",
|
|
39
39
|
"f": 4,
|
|
40
40
|
"prs": [
|
|
41
41
|
{
|
|
@@ -43,6 +43,12 @@
|
|
|
43
43
|
"t": "A weekly what-moved list in Your move (A441)",
|
|
44
44
|
"s": "A weekly what-moved list in Your move (A441)",
|
|
45
45
|
"k": "new"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"n": 1532,
|
|
49
|
+
"t": "A blocked outcome check shows as blocked, with the step to fix it (A451)",
|
|
50
|
+
"s": "A blocked outcome check shows as blocked, with the step to fix it (A451)",
|
|
51
|
+
"k": "new"
|
|
46
52
|
}
|
|
47
53
|
]
|
|
48
54
|
},
|
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-22T11:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-22T11:04:43Z"}
|
|
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-22T11:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-22T11:04:43Z"}
|
|
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-22T11:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-22T11:04:43Z"}
|
|
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-22T11:
|
|
3
|
+
"v": "0.705.0",
|
|
4
|
+
"at": "2026-11-22T11:04:46.265Z",
|
|
5
5
|
"f": 4,
|
|
6
6
|
"prs": [
|
|
7
7
|
{
|
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
"t": "A weekly what-moved list in Your move (A441)",
|
|
10
10
|
"s": "A weekly what-moved list in Your move (A441)",
|
|
11
11
|
"k": "new"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"n": 1532,
|
|
15
|
+
"t": "A blocked outcome check shows as blocked, with the step to fix it (A451)",
|
|
16
|
+
"s": "A blocked outcome check shows as blocked, with the step to fix it (A451)",
|
|
17
|
+
"k": "new"
|
|
12
18
|
}
|
|
13
19
|
]
|
|
14
20
|
},
|
package/workspace/guide/cli.md
CHANGED
|
@@ -276,10 +276,11 @@ The idle lab run uses only the first three commands:
|
|
|
276
276
|
|
|
277
277
|
Run them in the product's repository, or pass `--root <dir>`.
|
|
278
278
|
|
|
279
|
-
- `pmos outcomes list` shows the checks that are due, the outcomes with no date and the initiatives with no outcome. It changes nothing.
|
|
279
|
+
- `pmos outcomes list` shows the checks that are due or blocked, the outcomes with no date and the initiatives with no outcome. It changes nothing.
|
|
280
280
|
- `pmos outcomes propose [<id>]` shows PMOS's drafts, each with the lines it cites. Before the first draft of a repository it replays them on that repository's records, and shows nothing unless the replay passes.
|
|
281
281
|
- `pmos outcomes declare <id> --metric "<text>" --horizon <YYYY-MM-DD>` writes the outcome and its check date, after you said yes.
|
|
282
282
|
- `pmos outcomes record <id> <worked|didnt-work|cant-tell> --evidence "<text>"` records your verdict on a due check.
|
|
283
|
+
- `pmos outcomes live --where <place> --version <version>` records the version a place runs now, for example after a deploy. When a record says `shipped_in: "<version>"` and `measured_on: "<place>"`, and that place still runs an older version, its outcome check shows as blocked with the step to fix it. PMOS does not ask for a verdict until the place runs the change.
|
|
283
284
|
- 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.
|
|
284
285
|
- `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.
|
|
285
286
|
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* aheadOf(root, ini, { today, schedules, now }) → { outcome: { date, metric, src } | null, jobs: [{ date, name, src }] }
|
|
7
7
|
* outcome the record's outcome check (outcome_metric + outcome_horizon, lib/outcomes.js), only while it is still ahead and nobody
|
|
8
8
|
* recorded a verdict. A check that is due is Your move on Home, so it is not repeated here.
|
|
9
|
+
* A blocked check (bet A451: the place it is measured runs an older version than the one that shipped the change) is shown
|
|
10
|
+
* whether or not its date passed, with blocked: { why, step }: nobody else says it, and it needs one step from someone.
|
|
9
11
|
* jobs PMOS's scheduled jobs that name this initiative (its id or its title, in the schedule's name or its request), enabled,
|
|
10
12
|
* each with its next run in the next 30 days (lib/schedule-logic.js nextRun: what is shown is what fires).
|
|
11
13
|
* Nothing here writes.
|
|
@@ -19,6 +21,8 @@ function outcomeOf(root, ini, today) {
|
|
|
19
21
|
try {
|
|
20
22
|
const O = require('./outcomes.js');
|
|
21
23
|
const S = O.scan(root, { today });
|
|
24
|
+
const b = (S.blocked || []).find((x) => x.id === ini);
|
|
25
|
+
if (b && b.horizon && b.metric) return { date: b.horizon < today ? today : b.horizon, metric: b.metric, src: b.record + ' · shipped_in', blocked: { why: b.blocked.why, step: b.blocked.step } };
|
|
22
26
|
const it = (S.pending || []).find((x) => x.id === ini);
|
|
23
27
|
if (!it || !it.horizon || !it.metric) return null;
|
|
24
28
|
return { date: it.horizon, metric: it.metric, src: it.record + ' · outcome_horizon' };
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
* itself with Undo); a goal PMOS failed to read twice the same way files ONE ask (class C); else one short run per initiative and check date
|
|
29
29
|
* reads the records (deps.startRun, <state>/outcome-runs.jsonl). What none of these can tell stays due, and Your move asks the PM once.
|
|
30
30
|
*
|
|
31
|
+
* A BLOCKED CHECK (bet A451). A check whose place of measure runs an older version than the one that shipped the change (lib/outcomes.js
|
|
32
|
+
* scan `blocked`) is not due: it is never judged and starts no run. The pass logs one `[outcome-blocked]` line when a check becomes blocked
|
|
33
|
+
* (per check and version pair) and one when it clears, so the health number and its dates can be read from the server log.
|
|
34
|
+
*
|
|
31
35
|
* deps: { workspaces() → [w], isLead(w), stateDirFor(w), boardOf(w, id) → board id | null, runtime() → the per-user state folder, open(now),
|
|
32
36
|
* env, every (ms, its own timer), mayRun(), warn(what, err),
|
|
33
37
|
* recordsDir(w)? → the goal records folder, startRun(w, { ini, board, it, why, now })? → { ok, run } | { ok: false, held?, error } }
|
|
@@ -79,6 +83,8 @@ function cases(S, list) {
|
|
|
79
83
|
|
|
80
84
|
function create(deps) {
|
|
81
85
|
const warn = deps.warn || (() => {});
|
|
86
|
+
const log = deps.log || ((s) => console.log(s));
|
|
87
|
+
const blockedSeen = new Map(); // ws id → Map ini → the logged `shipped|runs` pair
|
|
82
88
|
const lastDay = new Map(); // ws id → the local day it ran
|
|
83
89
|
let busy = false;
|
|
84
90
|
|
|
@@ -159,6 +165,7 @@ function create(deps) {
|
|
|
159
165
|
const dir = deps.stateDirFor(w); if (!dir) return { ws: w.id, filed: 0, runs: 0 };
|
|
160
166
|
const S = O.scan(w.root, { today: localDay(now) });
|
|
161
167
|
const F = PR.read(dir), kept = PR.keptIds(F);
|
|
168
|
+
logBlocked(w, S);
|
|
162
169
|
const dueBy = new Map(S.due.map((it) => [it.id, it]));
|
|
163
170
|
// a verdict or ask whose check is no longer due on its date (the PM answered it, or moved the date) goes: zero is silence
|
|
164
171
|
for (const p of F.props.values()) {
|
|
@@ -214,6 +221,18 @@ function create(deps) {
|
|
|
214
221
|
return { ws: w.id, filed, held, runs };
|
|
215
222
|
}
|
|
216
223
|
|
|
224
|
+
/** One log line when a check becomes blocked (or blocked on another version pair), and one when it clears. */
|
|
225
|
+
function logBlocked(w, S) {
|
|
226
|
+
const seen = blockedSeen.get(w.id) || new Map(), now = new Map();
|
|
227
|
+
for (const it of S.blocked || []) {
|
|
228
|
+
const pair = it.blocked.shipped + '|' + it.blocked.runs;
|
|
229
|
+
now.set(it.id, pair);
|
|
230
|
+
if (seen.get(it.id) !== pair) log(`${O.LIVE_TAG} ${w.id} ${it.id} blocked: ${it.blocked.why}. ${it.blocked.step}.`);
|
|
231
|
+
}
|
|
232
|
+
for (const id of seen.keys()) if (!now.has(id)) log(`${O.LIVE_TAG} ${w.id} ${id} cleared`);
|
|
233
|
+
blockedSeen.set(w.id, now);
|
|
234
|
+
}
|
|
235
|
+
|
|
217
236
|
async function tick({ now = Date.now() } = {}) {
|
|
218
237
|
if (off(deps.env) || busy) return { off: off(deps.env), running: busy };
|
|
219
238
|
busy = true;
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
/* outcomes-cli.js — `pmos outcomes`: no initiative without an expected outcome (initiative outcome-for-every-initiative; lib/outcomes.js, D57).
|
|
3
3
|
*
|
|
4
4
|
* pmos outcomes list [--json] every initiative's outcome state in this repository: checks due, outcomes with no
|
|
5
|
-
* date, initiatives with no outcome, pending and checked. Reads only.
|
|
5
|
+
* date, initiatives with no outcome, blocked, pending and checked. Reads only.
|
|
6
|
+
* pmos outcomes live --where <place> --version <v> the version a place runs now (bet A451), appended to live_versions.jsonl. A check
|
|
7
|
+
* whose record says shipped_in a newer version and measured_on that place is blocked.
|
|
6
8
|
* pmos outcomes propose [<id>] [--max <n>] [--json] Claude's ✦ drafts, each claim cited path:line, through the shared guard
|
|
7
9
|
* (lib/ai-guard.js). Before the first draft of a repository it replays them on its real
|
|
8
10
|
* records. Writes only the guard's audit, in the per-user folder.
|
|
@@ -20,13 +22,14 @@ const path = require('path');
|
|
|
20
22
|
const { execFileSync } = require('child_process');
|
|
21
23
|
const O = require('./outcomes.js');
|
|
22
24
|
|
|
23
|
-
const COMMANDS = { outcomes: ['list', 'propose', 'declare', 'record'] };
|
|
25
|
+
const COMMANDS = { outcomes: ['list', 'propose', 'declare', 'record', 'live'] };
|
|
24
26
|
const USAGE = [
|
|
25
|
-
'usage: pmos outcomes list|propose|declare|record — every initiative has an expected outcome and a date to check it',
|
|
27
|
+
'usage: pmos outcomes list|propose|declare|record|live — every initiative has an expected outcome and a date to check it',
|
|
26
28
|
' pmos outcomes list [--json] checks due, outcomes with no date, initiatives with no outcome; reads only',
|
|
27
29
|
' pmos outcomes propose [<id>] [--max <n>] [--json] PMOS\'s ✦ drafts from the PRD and the KR, each one cited',
|
|
28
30
|
' pmos outcomes declare <id> --metric "<text>" --horizon <YYYY-MM-DD> the PM said yes: write the outcome and its check date',
|
|
29
31
|
' pmos outcomes record <id> <worked|didnt-work|cant-tell> --evidence "<text>" the PM\'s verdict on a due check',
|
|
32
|
+
' pmos outcomes live --where <place> --version <v> the version a place runs now; a check measured there waits until it runs the shipped one',
|
|
30
33
|
'Run it in the product\'s repository, or pass --root <dir>. Show each ✦ to the PM and write only after a yes.',
|
|
31
34
|
];
|
|
32
35
|
const VERDICT = { worked: 'validated', validated: 'validated', 'didnt-work': 'refuted', "didn't-work": 'refuted', refuted: 'refuted', 'cant-tell': 'inconclusive', "can't-tell": 'inconclusive', inconclusive: 'inconclusive' };
|
|
@@ -57,7 +60,7 @@ async function run(argv, { say = (s) => console.log(s), env = process.env, cwd =
|
|
|
57
60
|
if (!sub || ['help', '--help', '-h'].includes(sub)) { for (const l of USAGE) say(l); return sub ? 0 : 1; }
|
|
58
61
|
if (!COMMANDS.outcomes.includes(sub)) { say(`unknown outcomes command "${sub}". Use one of: ${COMMANDS.outcomes.join(', ')}`); return 2; }
|
|
59
62
|
const { pos, flags } = parse(args.slice(1));
|
|
60
|
-
const allowed = { list: ['json', 'root'], propose: ['json', 'root', 'max'], declare: ['json', 'root', 'metric', 'horizon'], record: ['json', 'root', 'evidence'] }[sub];
|
|
63
|
+
const allowed = { list: ['json', 'root'], propose: ['json', 'root', 'max'], declare: ['json', 'root', 'metric', 'horizon'], record: ['json', 'root', 'evidence'], live: ['json', 'root', 'where', 'version'] }[sub];
|
|
61
64
|
for (const k of Object.keys(flags)) if (!allowed.includes(k)) { say(`✗ --${k} is not an option of pmos outcomes ${sub}`); return 2; }
|
|
62
65
|
const root = path.resolve(flags.root || repoRoot(cwd));
|
|
63
66
|
const today = O.todayOf(now);
|
|
@@ -67,10 +70,12 @@ async function run(argv, { say = (s) => console.log(s), env = process.env, cwd =
|
|
|
67
70
|
if (pos.length) return fail('pmos outcomes list takes no argument', 2);
|
|
68
71
|
const S = O.scan(root, { today });
|
|
69
72
|
const pick = (a) => a.map((it) => ({ id: it.id, title: it.title, lane: it.lane, metric: it.metric || null, horizon: it.horizon || null }));
|
|
70
|
-
|
|
71
|
-
|
|
73
|
+
const blocked = S.blocked.map((it) => ({ ...pick([it])[0], where: it.blocked.where, runs: it.blocked.runs, shipped: it.blocked.shipped, step: it.blocked.step }));
|
|
74
|
+
if (flags.json) { say(JSON.stringify({ ok: true, total: S.subjects.length, due: pick(S.due), undated: pick(S.undated), missing: pick(S.missing), recent: S.recent, pending: pick(S.pending), blocked, disposed: S.disposed.map((d) => ({ id: d.id, disposition: d.disposition })), shippedWithout: S.shippedWithout, notRead: S.notRead })); return 0; }
|
|
75
|
+
const named = S.due.length + S.undated.length + S.pending.length + S.blocked.length + S.disposed.length;
|
|
72
76
|
say(`${S.subjects.length} initiatives · ${named} name an expected outcome · ${named - S.undated.length} of those have a check date · ${S.disposed.length} checked`);
|
|
73
77
|
if (S.due.length) say(`\n${S.due.length} check${S.due.length === 1 ? '' : 's'} due:\n` + S.due.map((it) => ` ${it.id} — since ${O.short(it.horizon)} · ${it.metric}`).join('\n'));
|
|
78
|
+
if (S.blocked.length) say(`\n${S.blocked.length} check${S.blocked.length === 1 ? '' : 's'} blocked (no verdict until the place it is measured runs the change):\n` + S.blocked.map((it) => ` ${it.id} — ${it.blocked.why}. ${it.blocked.step}, then: pmos outcomes live --where ${JSON.stringify(it.blocked.where)} --version <version>`).join('\n'));
|
|
74
79
|
if (S.undated.length) say(`\n${S.undated.length} with no check date:\n` + S.undated.map((it) => ` ${it.id} — ${it.metric}`).join('\n'));
|
|
75
80
|
if (S.missing.length) say(`\n${S.missing.length} under way with no expected outcome${S.recent ? ` (${S.recent} edited in the last 30 days)` : ''}:\n` + S.missing.slice(0, 15).map((it) => ` ${it.id} — ${it.title}`).join('\n') + (S.missing.length > 15 ? `\n … and ${S.missing.length - 15} more (--json lists all)` : ''));
|
|
76
81
|
if (S.shippedWithout) say(`\n${S.shippedWithout} accepted with no outcome: too late to declare, counted only.`);
|
|
@@ -113,6 +118,16 @@ async function run(argv, { say = (s) => console.log(s), env = process.env, cwd =
|
|
|
113
118
|
return 0;
|
|
114
119
|
}
|
|
115
120
|
|
|
121
|
+
if (sub === 'live') {
|
|
122
|
+
if (pos.length) return fail('usage: pmos outcomes live --where <place> --version <version>', 2);
|
|
123
|
+
const r = O.recordLive(root, { where: flags.where, version: flags.version, by: 'cli' }, { now });
|
|
124
|
+
if (!r.ok) return fail(r.error, 2);
|
|
125
|
+
if (flags.json) { say(JSON.stringify({ ok: true, file: r.file, line: r.line })); return 0; }
|
|
126
|
+
const still = O.scan(root, { today }).blocked.filter((it) => it.blocked.where.toLowerCase() === r.line.where.toLowerCase()).length;
|
|
127
|
+
say(`✓ ${r.line.where} runs ${r.line.version} (${r.file}).${still ? ` ${still} outcome check${still === 1 ? ' is' : 's are'} still blocked there.` : ''} Commit it to keep it.`);
|
|
128
|
+
return 0;
|
|
129
|
+
}
|
|
130
|
+
|
|
116
131
|
const id = pos[0];
|
|
117
132
|
const actor = require('./actor.js').fromCli({ isTTY: isTTY === undefined ? !!(process.stdin.isTTY && process.stdout.isTTY) : isTTY, env });
|
|
118
133
|
|
|
@@ -6,7 +6,11 @@
|
|
|
6
6
|
* outcome ledger takes the PM's verdict. On real data almost nothing used it (2026-11-03: 10 of 62 product initiatives named an outcome,
|
|
7
7
|
* 8 had a date, 0 were checked; 3 checks were overdue). The field was optional and nothing asked for it. This module makes Claude ask:
|
|
8
8
|
*
|
|
9
|
-
* scan(root, { today }) → { subjects, missing (newest first), recent (how many of them were edited in the last 30 days), undated, due, pending, disposed, shippedWithout, notRead }
|
|
9
|
+
* scan(root, { today }) → { subjects, missing (newest first), recent (how many of them were edited in the last 30 days), undated, due, pending, blocked, disposed, shippedWithout, notRead }
|
|
10
|
+
* blocked (bet A451) is an outcome check that cannot be read yet: the record names the version that ships the change (`shipped_in`) and
|
|
11
|
+
* the place its outcome is read (`measured_on`), and that place's newest line in live_versions.jsonl is an older version. It is in
|
|
12
|
+
* neither `due` nor `pending`, so nobody is asked for a verdict and no check run starts; it.blocked says why and the one step to fix it.
|
|
13
|
+
* recordLive(root, { where, version, by }) → { ok, file, line } the one writer of live_versions.jsonl (`pmos outcomes live`)
|
|
10
14
|
* every WORK initiative of the repository (document lanes are files, D86) that is not stopped. `missing` is a live one (not accepted)
|
|
11
15
|
* with no outcome_metric; `shippedWithout` counts the accepted ones with none (too late to declare, only counted).
|
|
12
16
|
* drafts(root, S, { today, only? }) → [proposal] ranked: due checks, then undated outcomes, then missing outcomes
|
|
@@ -114,7 +118,8 @@ function scan(root, { today = todayOf() } = {}) {
|
|
|
114
118
|
const disposedBy = new Map();
|
|
115
119
|
for (const c of liveChecks(ledger(root, L, 'outcome_checks.jsonl'))) if (c && c.initiative_id && DISPOSITIONS.includes(c.disposition)) disposedBy.set(String(c.initiative_id), c);
|
|
116
120
|
|
|
117
|
-
const
|
|
121
|
+
const live = liveOf(root, L);
|
|
122
|
+
const subjects = [], missing = [], undated = [], due = [], pending = [], blocked = [], disposed = [];
|
|
118
123
|
let shippedWithout = 0;
|
|
119
124
|
for (const f of files) {
|
|
120
125
|
const file = path.join(L.initiatives, f);
|
|
@@ -139,17 +144,75 @@ function scan(root, { today = todayOf() } = {}) {
|
|
|
139
144
|
const checked = d && !reopened(it, d);
|
|
140
145
|
if (checked) disposed.push({ ...it, disposition: d.disposition });
|
|
141
146
|
else if (!it.horizon) undated.push(it);
|
|
147
|
+
else if ((it.blocked = blockedOf(root, it, live, today))) blocked.push(it);
|
|
142
148
|
else if (it.horizon <= today) due.push(it);
|
|
143
149
|
else pending.push(it);
|
|
144
150
|
}
|
|
145
151
|
due.sort((a, b) => (a.horizon < b.horizon ? -1 : 1));
|
|
152
|
+
blocked.sort((a, b) => (a.horizon < b.horizon ? -1 : 1));
|
|
146
153
|
// newest first: the record's timestamp is its last edit. `recent` is what was touched in the last RECENT_DAYS days, where a backfill
|
|
147
154
|
// starts (an old record with no acceptance line may well have shipped long ago: D94 merges need none).
|
|
148
155
|
const stamp = (it) => String((it.fm.timestamp || {}).value || '').slice(0, 10);
|
|
149
156
|
missing.sort((a, b) => stamp(b).localeCompare(stamp(a)) || a.id.localeCompare(b.id));
|
|
150
157
|
const since = addDays(today, -RECENT_DAYS);
|
|
151
158
|
const recent = missing.filter((it) => stamp(it) >= since).length;
|
|
152
|
-
return { root, layout: L, today, subjects, recent, missing, undated, due, pending, disposed, shippedWithout, notRead };
|
|
159
|
+
return { root, layout: L, today, subjects, recent, missing, undated, due, pending, blocked, disposed, shippedWithout, notRead };
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* ── a check the place it is measured cannot answer yet (bet A451) ─────────────────────────────────────────────────── */
|
|
163
|
+
|
|
164
|
+
const LIVE = 'live_versions.jsonl';
|
|
165
|
+
const LIVE_TAG = '[outcome-blocked]';
|
|
166
|
+
const placeKey = (s) => String(s || '').replace(/\s+/g, ' ').trim().toLowerCase();
|
|
167
|
+
/** Dotted numbers compared (a leading v and a pre-release tail are ignored). → -1 | 0 | 1, or null when either does not compare. */
|
|
168
|
+
function cmpVersion(a, b) {
|
|
169
|
+
const parts = (v) => { const m = /^v?(\d+(?:\.\d+)*)(?:[-+].*)?$/i.exec(String(v || '').trim()); return m ? m[1].split('.').map(Number) : null; };
|
|
170
|
+
const x = parts(a), y = parts(b);
|
|
171
|
+
if (!x || !y) return null;
|
|
172
|
+
for (let i = 0; i < Math.max(x.length, y.length); i++) { const d = (x[i] || 0) - (y[i] || 0); if (d) return d < 0 ? -1 : 1; }
|
|
173
|
+
return 0;
|
|
174
|
+
}
|
|
175
|
+
/** The newest live version of each place, from every live_versions.jsonl of the repository. → Map placeKey → { where, version, at, ref, quote } */
|
|
176
|
+
function liveOf(root, L) {
|
|
177
|
+
const out = new Map();
|
|
178
|
+
const files = [...new Set([path.join(L.runsDir, LIVE), path.join(root, 'pmos', 'state', LIVE), path.join(root, 'planning', 'runs', LIVE)])];
|
|
179
|
+
for (const f of files) (linesOf(f) || []).forEach((l, i) => {
|
|
180
|
+
let o = null; try { o = JSON.parse(l); } catch { return; }
|
|
181
|
+
if (!o || typeof o.where !== 'string' || typeof o.version !== 'string' || !o.where.trim() || !o.version.trim()) return;
|
|
182
|
+
const k = placeKey(o.where), prev = out.get(k), at = String(o.at || '');
|
|
183
|
+
if (!prev || at >= prev.at) out.set(k, { where: o.where.trim(), version: o.version.trim(), at, ref: rel(root, f) + ':' + (i + 1), quote: cut(l) });
|
|
184
|
+
});
|
|
185
|
+
return out;
|
|
186
|
+
}
|
|
187
|
+
/** Why this outcome check cannot be read yet, or null. → { where, runs, shipped, due, step, sources } */
|
|
188
|
+
function blockedOf(root, it, live, today) {
|
|
189
|
+
const sh = it.fm.shipped_in, on = it.fm.measured_on;
|
|
190
|
+
if (!sh || !on || !sh.value || !on.value) return null;
|
|
191
|
+
const now = live.get(placeKey(on.value));
|
|
192
|
+
if (!now || cmpVersion(now.version, sh.value) !== -1) return null;
|
|
193
|
+
const where = now.where;
|
|
194
|
+
return {
|
|
195
|
+
where, runs: now.version, shipped: sh.value, due: it.horizon <= today,
|
|
196
|
+
why: `${where} runs ${now.version}, the change shipped in ${sh.value}`,
|
|
197
|
+
step: `Update ${where} to ${sh.value} or later`,
|
|
198
|
+
sources: [src(root, path.join(root, it.record), sh.n, sh.text, 'Shipped in'), { label: `What ${where} runs`, ref: now.ref, quote: now.quote }],
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
/** The one writer of live_versions.jsonl: the version a place runs now (`pmos outcomes live`, or a deploy script). → { ok, file, line } | { ok: false, error } */
|
|
202
|
+
function recordLive(root, { where, version, by }, { now = Date.now() } = {}) {
|
|
203
|
+
root = path.resolve(root);
|
|
204
|
+
const w = String(where == null ? '' : where).replace(/\s+/g, ' ').trim(), v = String(version == null ? '' : version).trim();
|
|
205
|
+
if (!w || w.length > 80) return { ok: false, error: 'name the place it runs (--where, up to 80 characters), for example production or test bed' };
|
|
206
|
+
if (!v || v.length > 40 || /\s/.test(v)) return { ok: false, error: 'give the version it runs now (--version), for example 2.4.0' };
|
|
207
|
+
const L = layoutOf(root), file = path.join(L.runsDir, LIVE);
|
|
208
|
+
try {
|
|
209
|
+
fs.mkdirSync(L.runsDir, { recursive: true });
|
|
210
|
+
const st = (() => { try { return fs.lstatSync(file); } catch { return null; } })();
|
|
211
|
+
if (st && !st.isFile()) return { ok: false, error: 'the live versions ledger is not a plain file — nothing was saved' };
|
|
212
|
+
const line = { where: w, version: v, at: new Date(now).toISOString(), by: by || 'cli' };
|
|
213
|
+
fs.appendFileSync(file, JSON.stringify(line) + '\n');
|
|
214
|
+
return { ok: true, file: rel(root, file), line };
|
|
215
|
+
} catch (e) { return { ok: false, error: 'the live versions ledger could not be written: ' + String((e && e.message) || e).slice(0, 160) }; }
|
|
153
216
|
}
|
|
154
217
|
|
|
155
218
|
/* ── sources ──────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
@@ -511,4 +574,4 @@ function undoCheck(root, { initiative, at, by, via }, { now = Date.now() } = {})
|
|
|
511
574
|
}
|
|
512
575
|
|
|
513
576
|
module.exports = { VERSION, undoCheck, liveChecks, JOB, DAYS_AFTER, DEFAULT_DAYS, DISPOSITIONS, scan, drafts, prdMetric, anchorMetric, horizonFor, recordCheck, todayOf, short, frontOf,
|
|
514
|
-
experimentField, krMismatch, killMet, anyRefuted, verdictsOf, rowOutcomes, outcomeOfRow, refutedDrafts, setLife, NEXT_WORDS };
|
|
577
|
+
experimentField, krMismatch, killMet, anyRefuted, verdictsOf, rowOutcomes, outcomeOfRow, refutedDrafts, setLife, NEXT_WORDS, cmpVersion, recordLive, LIVE, LIVE_TAG };
|
|
@@ -135,7 +135,7 @@ const VERBS = Object.freeze({
|
|
|
135
135
|
help: 'pmos pages [show|check] — each page\'s fixes, reverts and restores in the last 14 days, and a feature change that adds to a page that keeps breaking (pmos pages help)' }),
|
|
136
136
|
// Not a pm-os-absorb verb (run: null): initiative outcome-for-every-initiative added it through the same table.
|
|
137
137
|
outcomes: Object.freeze({ module: 'outcomes-cli.js', run: null, guide: 'cli.md',
|
|
138
|
-
help: 'pmos outcomes list|propose|declare|record — every initiative\'s expected outcome and check date: Claude\'s cited drafts, the PM\'s yes,
|
|
138
|
+
help: 'pmos outcomes list|propose|declare|record|live — every initiative\'s expected outcome and check date: Claude\'s cited drafts, the PM\'s yes, the verdict when a check is due, and the version a place runs (pmos outcomes help)' }),
|
|
139
139
|
// Not a pm-os-absorb verb (run: null): initiative decision-journal-outcome-checks added it through the same table.
|
|
140
140
|
decisions: Object.freeze({ module: 'decisions-cli.js', run: null, guide: 'cli.md',
|
|
141
141
|
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)' }),
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.705.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.705.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -172,7 +172,9 @@ export function comingUp(v, M) {
|
|
|
172
172
|
for (const g of (st && st.gates && st.gates.open) || []) if (!g.late && g.iso) add('due', g.iso, stop(g.name + ' is due'), 'From the milestone task' + (g.owner ? ', owner ' + g.owner : ''));
|
|
173
173
|
if (st && st.endIso && st.dates && !st.dates.over) add('due', st.endIso, 'The plan ends.', 'From the initiative’s end date');
|
|
174
174
|
const A = M && M.ahead;
|
|
175
|
-
|
|
175
|
+
// bet A451: a check the place it is measured cannot answer yet says so, with the one step that fixes it
|
|
176
|
+
if (A && A.outcome && A.outcome.date && A.outcome.blocked) add('outcome', A.outcome.date < today ? today : A.outcome.date, stop('Outcome check blocked: ' + A.outcome.blocked.why) + ' ' + stop(A.outcome.blocked.step), 'From the version on the record and the version that place runs');
|
|
177
|
+
else if (A && A.outcome && A.outcome.date) add('outcome', A.outcome.date, stop('Outcome check: ' + (A.outcome.metric || 'the outcome')), 'From the outcome check date on the record');
|
|
176
178
|
if (M && M.kill) {
|
|
177
179
|
const k = dateIn(M.kill, today), b = k ? '' : dateIn(M.budget, today);
|
|
178
180
|
if (k || b) add('kill', k || b, stop('Kill check: ' + M.kill), k ? 'From the experiment’s stop line' : 'From the end of the experiment’s budget');
|