create-pmos 0.845.0 → 0.846.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 +31 -15
- 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 +30 -0
- package/workspace/guide/cli.md +9 -0
- package/workspace/lib/cos-chat.js +1 -1
- package/workspace/lib/features.json +2 -1
- package/workspace/lib/pmos-verbs.js +3 -0
- package/workspace/lib/raid-cli.js +5 -0
- package/workspace/lib/raid.js +173 -0
- package/workspace/lib/routes-artefacts.js +5 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/pop-work-model.js +2 -0
- package/workspace/test-lists/raid-fold.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.846.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,36 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.846.0",
|
|
38
|
+
"at": "2026-11-25T18:17:21.842Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1883,
|
|
43
|
+
"t": "The chat runs pmos pick when you say how long you have",
|
|
44
|
+
"s": "The chat runs pmos pick when you say how long you have",
|
|
45
|
+
"k": "fix"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"n": 2031,
|
|
49
|
+
"t": "One RAID list per initiative, read from its own records (A101)",
|
|
50
|
+
"s": "One RAID list per initiative, read from its own records (A101)",
|
|
51
|
+
"k": "new",
|
|
52
|
+
"h": "One RAID list per initiative, read from its own records (A101)",
|
|
53
|
+
"try": {
|
|
54
|
+
"steps": [
|
|
55
|
+
"Open Work and open an initiative that has a late task or a risk nobody touched for two weeks",
|
|
56
|
+
"Read the RAID line in its Overview",
|
|
57
|
+
"Ask PMOS to show the whole RAID list of that initiative"
|
|
58
|
+
],
|
|
59
|
+
"see": "The Overview has one RAID line, for example '2 of 5 have not moved in 14 days: Late: Ship the copy (due 12 Nov)'. An initiative where everything moved has no RAID line. The chat shows each risk,…",
|
|
60
|
+
"open": "/premium-board.html"
|
|
61
|
+
},
|
|
62
|
+
"i": "raid-fold"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
36
66
|
{
|
|
37
67
|
"v": "0.845.0",
|
|
38
68
|
"at": "2026-11-25T18:02:38.683Z",
|
|
@@ -1060,20 +1090,6 @@
|
|
|
1060
1090
|
}
|
|
1061
1091
|
}
|
|
1062
1092
|
]
|
|
1063
|
-
},
|
|
1064
|
-
{
|
|
1065
|
-
"v": "0.823.0",
|
|
1066
|
-
"at": "2026-11-25T09:34:55.769Z",
|
|
1067
|
-
"f": 4,
|
|
1068
|
-
"prs": [
|
|
1069
|
-
{
|
|
1070
|
-
"n": 1888,
|
|
1071
|
-
"t": "Pmos report variants, one report for executives, engineers and customers (A406)",
|
|
1072
|
-
"s": "Pmos report variants, one report for executives, engineers and customers (A406)",
|
|
1073
|
-
"k": "new",
|
|
1074
|
-
"i": "report-three-audiences"
|
|
1075
|
-
}
|
|
1076
|
-
]
|
|
1077
1093
|
}
|
|
1078
1094
|
]
|
|
1079
1095
|
}
|
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-25T18:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-25T18:17:18Z"}
|
|
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-25T18:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-25T18:17:18Z"}
|
|
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-25T18:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-25T18:17:18Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,34 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.846.0",
|
|
4
|
+
"at": "2026-11-25T18:17:21.842Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1883,
|
|
9
|
+
"t": "The chat runs pmos pick when you say how long you have",
|
|
10
|
+
"s": "The chat runs pmos pick when you say how long you have",
|
|
11
|
+
"k": "fix"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"n": 2031,
|
|
15
|
+
"t": "One RAID list per initiative, read from its own records (A101)",
|
|
16
|
+
"s": "One RAID list per initiative, read from its own records (A101)",
|
|
17
|
+
"k": "new",
|
|
18
|
+
"h": "One RAID list per initiative, read from its own records (A101)",
|
|
19
|
+
"try": {
|
|
20
|
+
"steps": [
|
|
21
|
+
"Open Work and open an initiative that has a late task or a risk nobody touched for two weeks",
|
|
22
|
+
"Read the RAID line in its Overview",
|
|
23
|
+
"Ask PMOS to show the whole RAID list of that initiative"
|
|
24
|
+
],
|
|
25
|
+
"see": "The Overview has one RAID line, for example '2 of 5 have not moved in 14 days: Late: Ship the copy (due 12 Nov)'. An initiative where everything moved has no RAID line. The chat shows each risk,…",
|
|
26
|
+
"open": "/premium-board.html"
|
|
27
|
+
},
|
|
28
|
+
"i": "raid-fold"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
2
32
|
{
|
|
3
33
|
"v": "0.845.0",
|
|
4
34
|
"at": "2026-11-25T18:02:38.683Z",
|
package/workspace/guide/cli.md
CHANGED
|
@@ -430,6 +430,15 @@ Right after setup, PMOS drafts up to three starter goals from the product's own
|
|
|
430
430
|
- `pmos goals drop <n>` drops draft n. It writes no goal.
|
|
431
431
|
- `pmos goals undo` undoes the newest keep or drop. When you edited the kept line since, PMOS leaves it.
|
|
432
432
|
|
|
433
|
+
### pmos raid: one RAID list per initiative
|
|
434
|
+
|
|
435
|
+
PMOS reads the risks, assumptions, issues and dependencies of an initiative from its own records and puts them in one list. Nothing is written.
|
|
436
|
+
|
|
437
|
+
- `pmos raid show <initiative>` prints each row with its owner, its next date and the day it last moved. A row with no move in 14 days is stale and comes first. `--json` prints the list as data.
|
|
438
|
+
- `pmos raid count` prints how many open initiatives have a stale row.
|
|
439
|
+
|
|
440
|
+
The risks are the experiment's Risks, the assumption is its hypothesis, the issues are open tasks that are late or blocked, and the dependencies are task links to another initiative's tasks. When an initiative has a stale row, its Overview in Work shows one RAID line.
|
|
441
|
+
|
|
433
442
|
### pmos hire: draft the next hire from the work that waits
|
|
434
443
|
|
|
435
444
|
Show where the team is short before you ask for headcount. Run it in the product's repository, or pass `--root <dir>`, or ask the chat to "draft the next hire". No running workspace is needed.
|
|
@@ -52,7 +52,7 @@ function routeOf(text) {
|
|
|
52
52
|
|
|
53
53
|
const RULE = [
|
|
54
54
|
'You are the PM\'s chief of staff in PMOS. This chat has no scope: it reads everything the PM works on.',
|
|
55
|
-
'Read with the `pmos` commands (pmos today, pmos board, pmos jira, pmos calendar, pmos past, pmos mention, pmos outcomes, pmos metrics, pmos people, pmos docs, pmos report list), never by opening PMOS record files (*.jsonl, planning/ records) yourself: the commands apply the same rules the pages do. Run `pmos <verb> help` when unsure.',
|
|
55
|
+
'Read with the `pmos` commands (pmos today, pmos pick, pmos board, pmos jira, pmos calendar, pmos past, pmos mention, pmos outcomes, pmos metrics, pmos people, pmos docs, pmos report list), never by opening PMOS record files (*.jsonl, planning/ records) yourself: the commands apply the same rules the pages do. Run `pmos <verb> help` when unsure. When the PM says how long they have ("I have 30 minutes", "half an hour"), run `pmos pick --minutes <n>` with those minutes and answer with the line it prints.',
|
|
56
56
|
'End every answer that rests on a read with one fenced code block with the language tag pmos-src holding one JSON array: [{"name":"Work","fresh":"read now"},{"name":"Jira","fresh":"read 4 min ago"}]. Name each source and how fresh it is; say "not read" for one you could not reach. The page shows it under your answer.',
|
|
57
57
|
'Five kinds of work, one rule each. A read runs at once and asks nothing. Upkeep with one right answer (repair a record, close an ask a decision retired, refresh a stale read) you finish, and say it once. A change inside PMOS (move a date, add a task, set a state, a program\'s goal) that the PM asked for in their own words, or said yes to, you make at once with its `pmos` command and give the Undo it prints: the page shows it when your turn ends (Wawan 2026-11-23: a chat write always lands). A change the PM did not ask for is a proposal the PM keeps with ✓: file it with `pmos propose` or `pmos task`. Never write a record file by hand. Anything that leaves PMOS (email, Slack, a Jira comment, an invite) is a draft in the outbox that the PM sends: never send it. A longer job (a report, a grill, an update, a clean-up) runs to its end; stop only for a call that is the PM\'s, and save those for one proposal.',
|
|
58
58
|
'Never from this chat: accept a run, anchor or dispose an initiative, approve a contract, merge a pull request. These stay on the PM-only pages. Say where each one waits and stop.',
|
|
@@ -99,6 +99,7 @@
|
|
|
99
99
|
{"id": "metrics", "audience": "agent", "status": "ga", "group": "Your product", "name": "Metric drafts", "say": "A metric-draft run files a metric for you to keep or drop.", "cmd": "/metrics", "verb": "metrics"},
|
|
100
100
|
{"id": "impact", "audience": "agent", "status": "ga", "group": "Your product", "name": "Impact findings", "say": "An impact run files a finding for you to check.", "cmd": "/impact", "verb": "impact"},
|
|
101
101
|
{"id": "coredoc", "audience": "agent", "status": "ga", "group": "Plan and decide", "name": "Core document drafts", "say": "A run writes one draft of a core document; you issue it on the page.", "cmd": "/coredoc", "verb": "coredoc"},
|
|
102
|
-
{"id": "mcp", "audience": "agent", "status": "ga", "group": "Find your way", "name": "PMOS cards for other agents", "say": "PMOS cards for another agent, over MCP.", "cmd": "/mcp-cards", "verb": "mcp"}
|
|
102
|
+
{"id": "mcp", "audience": "agent", "status": "ga", "group": "Find your way", "name": "PMOS cards for other agents", "say": "PMOS cards for another agent, over MCP.", "cmd": "/mcp-cards", "verb": "mcp"},
|
|
103
|
+
{"id": "raid", "audience": "user", "status": "beta", "group": "Catch up", "name": "RAID list", "say": "Risks, assumptions, late tasks and dependencies of one initiative, with owner, next date and what has gone stale.", "cmd": "/raid", "verb": "raid", "hint": "show <initiative>"}
|
|
103
104
|
]
|
|
104
105
|
}
|
|
@@ -173,6 +173,9 @@ const VERBS = Object.freeze({
|
|
|
173
173
|
// Not a pm-os-absorb verb (run: null): initiative starter-goals (job #1916, A84) added it through the same table.
|
|
174
174
|
goals: Object.freeze({ module: 'goals-cli.js', run: null, guide: 'cli.md',
|
|
175
175
|
help: 'pmos goals [starter|draft|keep <n>|drop <n>|undo] — starter goals PMOS drafts from your own product, each with its source; keep one and it becomes a goal (pmos goals help)' }),
|
|
176
|
+
// Not a pm-os-absorb verb (run: null): initiative raid-fold (job #2025, A101) added it through the same table.
|
|
177
|
+
raid: Object.freeze({ module: 'raid-cli.js', run: null, guide: 'cli.md',
|
|
178
|
+
help: 'pmos raid show|count — one RAID list per initiative: risks, assumptions, late tasks and dependencies, read from its own records (pmos raid help)' }),
|
|
176
179
|
hire: Object.freeze({ module: 'hire-draft.js', run: null, guide: 'cli.md',
|
|
177
180
|
help: 'pmos hire [draft|show|count] — the role your open work most needs, per person, and a one-page role brief PMOS drafts for you to edit (pmos hire help)' }),
|
|
178
181
|
// Not a pm-os-absorb verb (run: null): initiative built-vs-design (job #1903, A380) added it through the same table.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* raid-cli.js — `pmos raid show|count` (initiative raid-fold, A101). The verb lives in lib/raid.js; this file is its name in lib/pmos-verbs.js. */
|
|
3
|
+
const R = require('./raid.js');
|
|
4
|
+
|
|
5
|
+
module.exports = { run: R.run, COMMANDS: R.COMMANDS, USAGE: R.USAGE };
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* raid.js — one RAID list per initiative, read from its own records (initiative raid-fold, idea A101, light bar, read-only slice).
|
|
3
|
+
*
|
|
4
|
+
* fold(input, today) PURE → { id, rows, stale, total }
|
|
5
|
+
* input = { id, owner, check, risks: [{ text, by, at }], assumption: { text, by, at } | null,
|
|
6
|
+
* tasks: [{ id, title, state, owner, due, since, blocked }], links: [{ from, to, at }], taskIni: Map task id → initiative,
|
|
7
|
+
* taskOf: Map task id → { title, due, owner } }
|
|
8
|
+
* row = { kind: 'risk' | 'assumption' | 'issue' | 'dependency', text, owner, next, moved, stale, source }
|
|
9
|
+
* risk each line of the experiment's Risks (lib/artefacts.js); owner the record's owner; next the check date
|
|
10
|
+
* assumption the experiment's hypothesis; owner and next as a risk
|
|
11
|
+
* issue an open task (To do, In progress) that is blocked or past its due day; owner the task's; next its due day
|
|
12
|
+
* dependency a task link with one end on this initiative and the other on another initiative's task; next the other task's due day
|
|
13
|
+
* moved: the day the row last moved (a set's day, a task's last state change, the link's day). A row with no move in STALE_DAYS days is
|
|
14
|
+
* stale; stale rows come first, the stalest first. A row whose move is not known is never called stale.
|
|
15
|
+
* gather(ctx, w, id) → input the experiment artefact, the tasks `pmos task list` reads (lib/stage-read.js), task-links.jsonl, the
|
|
16
|
+
* record's owner and check date (outcome_horizon, check_date)
|
|
17
|
+
* ofRoot(root, id, today) → fold | null the same from a repository folder (the route and the CLI)
|
|
18
|
+
* lineOf(result) → { text, stale, total } | null the Work popup's one line (LINE.md Rule 12): null when no row is stale (zero is silence)
|
|
19
|
+
* CLI (pmos raid, lib/pmos-verbs.js): show <initiative> [--json] [--root <repo>] · count [--root <repo>]
|
|
20
|
+
*
|
|
21
|
+
* WHAT IT NEVER DOES. It writes no record, calls no model and sends nothing. Every read logs one [raid] line. */
|
|
22
|
+
const path = require('path');
|
|
23
|
+
|
|
24
|
+
const TAG = '[raid]';
|
|
25
|
+
const STALE_DAYS = 14;
|
|
26
|
+
const OPEN = new Set(['To do', 'In progress']);
|
|
27
|
+
const KIND_WORD = { risk: 'Risk', assumption: 'Assumption', issue: 'Late', dependency: 'Waits on' };
|
|
28
|
+
const day = (v) => { const s = String(v || '').slice(0, 10); return /^\d{4}-\d{2}-\d{2}$/.test(s) ? s : null; };
|
|
29
|
+
const daysBetween = (a, b) => Math.round((Date.parse(b + 'T00:00:00Z') - Date.parse(a + 'T00:00:00Z')) / 86400000);
|
|
30
|
+
const clean = (s) => String(s == null ? '' : s).replace(/\s+/g, ' ').trim();
|
|
31
|
+
|
|
32
|
+
/** PURE. */
|
|
33
|
+
function fold(input, today) {
|
|
34
|
+
const I = input || {};
|
|
35
|
+
const t0 = day(today) || new Date().toISOString().slice(0, 10);
|
|
36
|
+
const rows = [];
|
|
37
|
+
const push = (r) => {
|
|
38
|
+
const moved = day(r.moved);
|
|
39
|
+
rows.push({ ...r, moved, stale: !!moved && daysBetween(moved, t0) >= STALE_DAYS });
|
|
40
|
+
};
|
|
41
|
+
for (const x of I.risks || []) if (x && clean(x.text)) push({ kind: 'risk', text: clean(x.text), owner: I.owner || '', next: day(I.check), moved: x.at, source: 'the experiment' });
|
|
42
|
+
if (I.assumption && clean(I.assumption.text)) push({ kind: 'assumption', text: clean(I.assumption.text), owner: I.owner || '', next: day(I.check), moved: I.assumption.at, source: 'the experiment' });
|
|
43
|
+
const mine = new Set((I.tasks || []).map((t) => t && t.id));
|
|
44
|
+
for (const t of I.tasks || []) {
|
|
45
|
+
if (!t || !OPEN.has(t.state)) continue;
|
|
46
|
+
const due = day(t.due);
|
|
47
|
+
const late = !!due && due < t0;
|
|
48
|
+
if (!late && !t.blocked) continue;
|
|
49
|
+
push({ kind: 'issue', text: clean(t.title), owner: t.owner || '', next: due, moved: t.since || null, source: 'task ' + t.id, why: t.blocked ? 'blocked' : 'late' });
|
|
50
|
+
}
|
|
51
|
+
const iniOf = I.taskIni || new Map(), taskOf = I.taskOf || new Map();
|
|
52
|
+
for (const l of I.links || []) {
|
|
53
|
+
if (!l) continue;
|
|
54
|
+
const a = mine.has(l.from), b = mine.has(l.to);
|
|
55
|
+
if (a === b) continue; // both ends here, or neither: not a dependency between initiatives
|
|
56
|
+
const other = a ? l.to : l.from;
|
|
57
|
+
const otherIni = iniOf.get(other) || (/^[A-Z][A-Z0-9]{1,9}-\d+$/.test(String(other)) ? 'Jira ' + other : '');
|
|
58
|
+
if (otherIni === I.id) continue;
|
|
59
|
+
const o = taskOf.get(other) || {};
|
|
60
|
+
const here = (I.tasks || []).find((t) => t.id === (a ? l.from : l.to)) || {};
|
|
61
|
+
const words = a ? `${clean(o.title) || other} waits on ${clean(here.title) || l.from}` : `${clean(here.title) || l.to} waits on ${clean(o.title) || other}`;
|
|
62
|
+
push({ kind: 'dependency', text: words + (otherIni ? ' (' + otherIni + ')' : ''), owner: (a ? here.owner : o.owner) || '', next: day(a ? here.due : o.due), moved: l.at, source: 'task link' });
|
|
63
|
+
}
|
|
64
|
+
rows.sort((x, y) => (y.stale - x.stale) || String(x.moved || '9').localeCompare(String(y.moved || '9')));
|
|
65
|
+
return { id: I.id || '', rows, stale: rows.filter((r) => r.stale).length, total: rows.length };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** The Work popup's one line, or null when nothing is stale. */
|
|
69
|
+
function lineOf(res) {
|
|
70
|
+
if (!res || !res.stale) return null;
|
|
71
|
+
const r = res.rows.find((x) => x.stale);
|
|
72
|
+
const dd = (d) => { const t = new Date(d + 'T00:00:00Z'); return t.getUTCDate() + ' ' + ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][t.getUTCMonth()]; };
|
|
73
|
+
const when = r.kind === 'issue' && r.next ? ' (due ' + dd(r.next) + ')' : r.moved ? ' (last moved ' + dd(r.moved) + ')' : '';
|
|
74
|
+
return { text: `${res.stale} of ${res.total} have not moved in ${STALE_DAYS} days. ${KIND_WORD[r.kind]}: ${r.text}${when}`, stale: res.stale, total: res.total };
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* ── reading the records ── */
|
|
78
|
+
function gather(ctx, w, id) {
|
|
79
|
+
const A = require('./artefacts.js');
|
|
80
|
+
let ex = null;
|
|
81
|
+
try { const v = A.viewOf(A.fold(A.readLines(A.file(A.dirOf(w.root)))), 'experiment:' + id); ex = v && v.artefacts.find((a) => a.key === 'experiment'); } catch { ex = null; }
|
|
82
|
+
let front = {};
|
|
83
|
+
try { const IW = require('./item-why.js'), f = IW.recordPathOf(w.root, id); if (f) front = IW.frontOf(require('fs').readFileSync(f, 'utf8')) || {}; } catch { front = {}; }
|
|
84
|
+
let tasks = [];
|
|
85
|
+
try { tasks = require('./stage-read.js').tasksOf(ctx, w, id); } catch { tasks = []; }
|
|
86
|
+
const taskIni = new Map(), taskOf = new Map();
|
|
87
|
+
try {
|
|
88
|
+
const F = require('./routes-boards.js').foldOf(ctx, w);
|
|
89
|
+
for (const t of (F.tasks || new Map()).values()) { taskIni.set(t.id, t.initiative); taskOf.set(t.id, { title: t.title, due: t.due, owner: t.owner }); }
|
|
90
|
+
} catch { /* a board that cannot be read: no other initiative's task is known */ }
|
|
91
|
+
for (const t of tasks) { taskIni.set(t.id, id); taskOf.set(t.id, t); }
|
|
92
|
+
let links = [];
|
|
93
|
+
try { const dir = ctx.stateDirFor ? ctx.stateDirFor(w) : null; if (dir) links = [...require('./task-links.js').read(dir).links.values()]; } catch { links = []; }
|
|
94
|
+
const fx = (ex && ex.fields) || {};
|
|
95
|
+
return {
|
|
96
|
+
id,
|
|
97
|
+
owner: clean(front.owner || (fx.executor && fx.executor.text) || ''),
|
|
98
|
+
check: front.outcome_horizon || front.check_date || null,
|
|
99
|
+
risks: Array.isArray(fx.risks) ? fx.risks : [],
|
|
100
|
+
assumption: fx.hypothesis || null,
|
|
101
|
+
tasks: tasks.map((t) => ({ id: t.id, title: t.title, state: t.state, owner: t.owner, due: t.due, since: t.since || null, blocked: !!t.blocked })),
|
|
102
|
+
links: links.map((l) => ({ from: l.from, to: l.to, at: l.at })),
|
|
103
|
+
taskIni, taskOf,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function ctxOf(root) {
|
|
108
|
+
const driver = require('./driver.js');
|
|
109
|
+
const dir = driver.stateDirOf(root);
|
|
110
|
+
if (!dir) return null;
|
|
111
|
+
const w = { id: driver.wsIdOf(root), name: path.basename(root), root };
|
|
112
|
+
return { w, ctx: { getWs: () => w, workspaceList: () => [w], stateDirFor: () => dir, selfRoot: path.resolve(__dirname, '..', '..') } };
|
|
113
|
+
}
|
|
114
|
+
function ofRoot(root, id, today) {
|
|
115
|
+
const c = ctxOf(root);
|
|
116
|
+
if (!c) return null;
|
|
117
|
+
const res = fold(gather(c.ctx, c.w, id), today);
|
|
118
|
+
console.info(TAG + ' read ini=' + id + ' rows=' + res.total + ' stale=' + res.stale);
|
|
119
|
+
return res;
|
|
120
|
+
}
|
|
121
|
+
function count(root, today) {
|
|
122
|
+
// the open initiatives (lib/notes-links.js); a kit repository keeps its records in pmos/state/initiatives instead
|
|
123
|
+
let ids = require('./notes-links.js').initiativesOf(root).map((i) => i.id);
|
|
124
|
+
if (!ids.length) { try { ids = require('fs').readdirSync(path.join(root, 'pmos', 'state', 'initiatives')).filter((f) => /^[a-z0-9][a-z0-9-]*\.md$/.test(f)).map((f) => f.slice(0, -3)); } catch { ids = []; } }
|
|
125
|
+
const c = ctxOf(root);
|
|
126
|
+
let n = 0;
|
|
127
|
+
if (c) for (const id of ids) { const r = fold(gather(c.ctx, c.w, id), today); if (r.stale) n += 1; }
|
|
128
|
+
console.info(TAG + ' count initiatives=' + ids.length + ' stale=' + n);
|
|
129
|
+
return { initiatives: ids.length, stale: n };
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* ── pmos raid ── */
|
|
133
|
+
const COMMANDS = { raid: ['show', 'count'] };
|
|
134
|
+
const USAGE = [
|
|
135
|
+
'usage: pmos raid show|count — one RAID list per initiative: risks, assumptions, issues and dependencies, read from its own records',
|
|
136
|
+
' pmos raid show <initiative> [--json] each row with its owner, next date and the day it last moved; stale rows (14 days) first',
|
|
137
|
+
' pmos raid count how many initiatives have a stale row, on the last line',
|
|
138
|
+
' every command: [--root <repository>]. Nothing is written.',
|
|
139
|
+
];
|
|
140
|
+
function run(argv, { say = console.log, cwd = process.cwd(), today } = {}) {
|
|
141
|
+
const args = argv.slice(1), pos = [], fl = {};
|
|
142
|
+
for (let i = 0; i < args.length; i++) {
|
|
143
|
+
if (args[i] === '--json' || args[i] === '--help') fl[args[i].slice(2)] = true;
|
|
144
|
+
else if (args[i] === '--root') fl.root = args[++i];
|
|
145
|
+
else pos.push(args[i]);
|
|
146
|
+
}
|
|
147
|
+
let sub = pos[0];
|
|
148
|
+
if (!sub || fl.help || sub === 'help') { USAGE.forEach((l) => say(l)); return sub || fl.help ? 0 : 2; }
|
|
149
|
+
if (!COMMANDS.raid.includes(sub)) { pos.unshift('show'); sub = 'show'; } // pmos raid <initiative> reads as show
|
|
150
|
+
const root = path.resolve(cwd, fl.root || '.');
|
|
151
|
+
if (sub === 'count') {
|
|
152
|
+
const c = count(root, today);
|
|
153
|
+
say(`${c.stale} of ${c.initiatives} open initiatives have a RAID row with no move in ${STALE_DAYS} days`);
|
|
154
|
+
say(String(c.stale));
|
|
155
|
+
return 0;
|
|
156
|
+
}
|
|
157
|
+
const id = pos[1];
|
|
158
|
+
if (!id) { say('usage: pmos raid show <initiative> [--json]'); return 2; }
|
|
159
|
+
const r = ofRoot(root, id, today);
|
|
160
|
+
if (!r) { say('✗ this repository has no PMOS state folder (pmos/state, state or .pmos)'); return 1; }
|
|
161
|
+
if (fl.json) { say(JSON.stringify({ ok: true, ...r })); return 0; }
|
|
162
|
+
if (!r.total) { say(`Nothing to list for ${id}: no risk, assumption, late or blocked task, or dependency on another initiative.`); return 0; }
|
|
163
|
+
say(`${id}: ${r.total} row${r.total === 1 ? '' : 's'}${r.stale ? `, ${r.stale} with no move in ${STALE_DAYS} days` : ''}`);
|
|
164
|
+
for (const x of r.rows) say(` ${x.stale ? '! ' : ' '}${KIND_WORD[x.kind]} · ${x.text} · ${x.owner || 'no owner'} · next ${x.next || 'no date'} · moved ${x.moved || 'unknown'}`);
|
|
165
|
+
return 0;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
module.exports = { TAG, STALE_DAYS, fold, lineOf, gather, ofRoot, count, run, COMMANDS, USAGE };
|
|
169
|
+
|
|
170
|
+
if (require.main === module) {
|
|
171
|
+
// node lib/raid.js count [--root <repo>] → the health number on the last line
|
|
172
|
+
process.exitCode = run(['raid', ...process.argv.slice(2)]);
|
|
173
|
+
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* carries `power` ({ n, weeks, weekly, due, ends, text, path }) only when the record's baseline, min_change
|
|
10
10
|
* and weekly_traffic cannot reach a conclusion by its check date (lib/experiment-power.js), and `copyTests` (lib/copy-tests.js foldOf)
|
|
11
11
|
* when the initiative has a copy or layout test, else `copyTestOffer` { initiative, flag } when its record names a rollout_flag
|
|
12
|
+
* and `raid` ({ text, stale, total }) only when a RAID row has not moved in 14 days (lib/raid.js lineOf)
|
|
12
13
|
* GET /api/artefacts/story?ws → { ok, ws, story: { scope, at, lines: [{ text, sources }] } | null, seeding? } "The story so far" on the
|
|
13
14
|
* product page (board AwE): the Narrative of board:<ws>, else of the portfolio (lib/artefacts.js storyOf). A
|
|
14
15
|
* shared Board carries it without the sources (lib/board-pack.js). seeding: there is no story yet and PMOS is
|
|
@@ -178,6 +179,10 @@ function withRecord(artefacts, root, id) {
|
|
|
178
179
|
if (w) ex.power = { ...w, path: require('path').relative(root, f).split(require('path').sep).join('/') };
|
|
179
180
|
} catch { /* an unreadable record shows no warning */ }
|
|
180
181
|
}
|
|
182
|
+
// a RAID row with no move in 14 days (raid-fold, A101; LINE.md Rule 12): read only, carried only when a row is stale (zero is silence)
|
|
183
|
+
if (ex) {
|
|
184
|
+
try { const R = require('./raid.js'), l = R.lineOf(R.ofRoot(root, id)); if (l) ex.raid = l; } catch { /* an unreadable initiative shows no RAID line */ }
|
|
185
|
+
}
|
|
181
186
|
// the initiative's copy and layout tests (copy-tests, A351): carried only when there is one (zero is silence)
|
|
182
187
|
// with no test yet, a record that names its rollout_flag carries an offer (copyTestOffer), so the block shows by itself (LINE Rule 12)
|
|
183
188
|
if (ex) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.846.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.846.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -305,6 +305,8 @@ export function overviewOf(r, v, o = {}) {
|
|
|
305
305
|
else lines.push({ id: 'done', k: 'Done when', text: '', edit: { to: 'artefact', artefact: 'done-test', field: 'check' }, ...offer('Done when', 'the done test (how we will know it worked, and when we check)', 'done-test', 'check') });
|
|
306
306
|
// too little traffic to conclude by the check date (experiment-traffic-warning, A404): GET /api/artefacts carries it only when it is so
|
|
307
307
|
if (ex.power && ex.power.text) lines.push({ id: 'power', k: 'Can it conclude?', text: String(ex.power.text), src: 'the record', path: ex.power.path || '', edit: null });
|
|
308
|
+
// risks, assumptions, issues and dependencies that stopped moving (raid-fold, A101): GET /api/artefacts carries it only when a row is stale
|
|
309
|
+
if (ex.raid && ex.raid.text) lines.push({ id: 'raid', k: 'RAID', text: String(ex.raid.text), src: 'pmos raid show', edit: null });
|
|
308
310
|
const sm = summaryOf(r, v, o);
|
|
309
311
|
const status = sm.status.replace(/^It is in /, 'In ');
|
|
310
312
|
// status in one line (status-line, A505): the record's line of at most 12 words; the item header shows it before PMOS's own words
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "One RAID list per initiative (initiative raid-fold, done test R1-R3, S1, N1-N2): the pure fold and its stale rule, the Work popup's one line, pmos raid show|count on a scratch repository. No browser, model or network.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"raid.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"raid.test.js": 3
|
|
8
|
+
}
|
|
9
|
+
}
|