create-pmos 0.844.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 +53 -71
- 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/bin/pmos.js +8 -4
- package/workspace/briefing-premium-adddoc-test.js +16 -10
- package/workspace/changelog.json +52 -8
- package/workspace/guide/cli.md +9 -0
- package/workspace/guide/home.md +2 -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/proactive-cli.js +10 -3
- 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/premium-vw-rec-test.js +4 -5
- package/workspace/public/pm/home-ini.js +3 -0
- package/workspace/public/pm/pop-work-model.js +2 -0
- package/workspace/public/pm/premium-viewer.js +11 -2
- package/workspace/public/pm/premium-vw-jira.js +2 -2
- package/workspace/stage-card-tasks-test.js +18 -10
- package/workspace/task-press-test.js +2 -1
- package/workspace/task-views-test.js +5 -4
- package/workspace/test-lists/raid-fold.json +9 -0
- package/workspace/viewer-trail-test.js +3 -2
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,50 @@
|
|
|
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
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"v": "0.845.0",
|
|
68
|
+
"at": "2026-11-25T18:02:38.683Z",
|
|
69
|
+
"f": 4,
|
|
70
|
+
"prs": [
|
|
71
|
+
{
|
|
72
|
+
"n": 2041,
|
|
73
|
+
"t": "Main's browser reds — stage-card-tasks, adddoc, task-views, task-press T3, vw-jira dark, viewer-trail, vw-rec and day-run hold under load",
|
|
74
|
+
"s": "Main's browser reds — stage-card-tasks, adddoc, task-views, task-press T3, vw-jira dark, viewer-trail, vw-rec and day-run hold under load",
|
|
75
|
+
"k": "fix",
|
|
76
|
+
"i": "ci-main-unblock"
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
},
|
|
36
80
|
{
|
|
37
81
|
"v": "0.844.0",
|
|
38
82
|
"at": "2026-11-25T17:36:00.349Z",
|
|
@@ -43,6 +87,7 @@
|
|
|
43
87
|
"t": "Copy and layout tests on an initiative, drafted from plain words (job #1905, A351)",
|
|
44
88
|
"s": "Copy and layout tests on an initiative, drafted from plain words (job #1905, A351)",
|
|
45
89
|
"k": "new",
|
|
90
|
+
"i": "copy-tests",
|
|
46
91
|
"h": "Copy and layout tests on an initiative, drafted from plain words (job #1905, A351)",
|
|
47
92
|
"try": {
|
|
48
93
|
"steps": [
|
|
@@ -52,14 +97,14 @@
|
|
|
52
97
|
],
|
|
53
98
|
"see": "With nothing typed in the chat, the Copy test block shows its ✦ offer; ✦ drafts A against B with Undo. Then a Copy test block with one table (Variant, Copy, the rate and how sure), one ✦ line such…",
|
|
54
99
|
"open": "/premium-board.html"
|
|
55
|
-
}
|
|
56
|
-
"i": "copy-tests"
|
|
100
|
+
}
|
|
57
101
|
},
|
|
58
102
|
{
|
|
59
103
|
"n": 2027,
|
|
60
104
|
"t": "Events says what to bring on each meeting (job #2012, TbEvents)",
|
|
61
105
|
"s": "Events says what to bring on each meeting (job #2012, TbEvents)",
|
|
62
106
|
"k": "new",
|
|
107
|
+
"i": "tb-events-bring",
|
|
63
108
|
"h": "Events says what to bring on each meeting (job #2012, TbEvents)",
|
|
64
109
|
"try": {
|
|
65
110
|
"steps": [
|
|
@@ -69,14 +114,14 @@
|
|
|
69
114
|
],
|
|
70
115
|
"see": "Each meeting tied to your work says what to bring, for example \"Bring two calls: …\", naming dates that Events lists; a meeting with nothing to decide says \"Nothing new for this one yet.\"; focus time…",
|
|
71
116
|
"open": "/premium-events.html"
|
|
72
|
-
}
|
|
73
|
-
"i": "tb-events-bring"
|
|
117
|
+
}
|
|
74
118
|
},
|
|
75
119
|
{
|
|
76
120
|
"n": 1958,
|
|
77
121
|
"t": "What each initiative and merged pull request cost, and a pause for a stall (job #1906)",
|
|
78
122
|
"s": "What each initiative and merged pull request cost, and a pause for a stall (job #1906)",
|
|
79
123
|
"k": "new",
|
|
124
|
+
"i": "initiative-cost",
|
|
80
125
|
"h": "What each initiative and merged pull request cost, and a pause for a stall (job #1906)",
|
|
81
126
|
"try": {
|
|
82
127
|
"steps": [
|
|
@@ -86,14 +131,14 @@
|
|
|
86
131
|
],
|
|
87
132
|
"see": "One row per initiative the factory worked on: agent hours, spend in dollars and how many pull requests merged. An initiative that spent for 7 days with no merge shows one ✦ asking to pause its jobs.…",
|
|
88
133
|
"open": "/premium-board.html?work=cost"
|
|
89
|
-
}
|
|
90
|
-
"i": "initiative-cost"
|
|
134
|
+
}
|
|
91
135
|
},
|
|
92
136
|
{
|
|
93
137
|
"n": 2022,
|
|
94
138
|
"t": "This sprint's Summary card with a ✦ sentence per count, Ticket and Epic columns (job #2018)",
|
|
95
139
|
"s": "This sprint's Summary card with a ✦ sentence per count, Ticket and Epic columns (job #2018)",
|
|
96
140
|
"k": "new",
|
|
141
|
+
"i": "tb-sprint-balanced",
|
|
97
142
|
"h": "This sprint, with a Summary that says what is going on",
|
|
98
143
|
"try": {
|
|
99
144
|
"steps": [
|
|
@@ -103,8 +148,7 @@
|
|
|
103
148
|
],
|
|
104
149
|
"see": "The Summary card gives the same To do, In progress and Done counts as the Tasks tabs, all work in the sprint's dates, Jira and not. Each count with work has one ✦ sentence written from the tickets,…",
|
|
105
150
|
"open": "/premium-board.html"
|
|
106
|
-
}
|
|
107
|
-
"i": "tb-sprint-balanced"
|
|
151
|
+
}
|
|
108
152
|
}
|
|
109
153
|
]
|
|
110
154
|
},
|
|
@@ -1046,68 +1090,6 @@
|
|
|
1046
1090
|
}
|
|
1047
1091
|
}
|
|
1048
1092
|
]
|
|
1049
|
-
},
|
|
1050
|
-
{
|
|
1051
|
-
"v": "0.823.0",
|
|
1052
|
-
"at": "2026-11-25T09:34:55.769Z",
|
|
1053
|
-
"f": 4,
|
|
1054
|
-
"prs": [
|
|
1055
|
-
{
|
|
1056
|
-
"n": 1888,
|
|
1057
|
-
"t": "Pmos report variants, one report for executives, engineers and customers (A406)",
|
|
1058
|
-
"s": "Pmos report variants, one report for executives, engineers and customers (A406)",
|
|
1059
|
-
"k": "new",
|
|
1060
|
-
"i": "report-three-audiences"
|
|
1061
|
-
}
|
|
1062
|
-
]
|
|
1063
|
-
},
|
|
1064
|
-
{
|
|
1065
|
-
"v": "0.822.0",
|
|
1066
|
-
"at": "2026-11-25T09:18:15.859Z",
|
|
1067
|
-
"f": 4,
|
|
1068
|
-
"prs": [
|
|
1069
|
-
{
|
|
1070
|
-
"n": 1880,
|
|
1071
|
-
"t": "Pmos hire drafts the next hire from the work that waits (job #1876)",
|
|
1072
|
-
"s": "Pmos hire drafts the next hire from the work that waits (job #1876)",
|
|
1073
|
-
"k": "new",
|
|
1074
|
-
"i": "next-hire-draft",
|
|
1075
|
-
"h": "Pmos hire drafts the next hire from the work that waits (job #1876)",
|
|
1076
|
-
"try": {
|
|
1077
|
-
"steps": [
|
|
1078
|
-
"Open Today and ask the chat: draft the next hire",
|
|
1079
|
-
"Open the file it names, under planning/hires",
|
|
1080
|
-
"Read the role, why now, the 90-day outcomes and the work it takes"
|
|
1081
|
-
],
|
|
1082
|
-
"see": "One page names the role most loaded or missing (open tasks and waiting asks per person, or work with no owner), why now with the numbers, three outcomes for 90 days from the initiatives that carry…",
|
|
1083
|
-
"open": "/today.html"
|
|
1084
|
-
}
|
|
1085
|
-
},
|
|
1086
|
-
{
|
|
1087
|
-
"n": 1869,
|
|
1088
|
-
"t": "A stage's sign-offs reach You on Today (job #1861, Factory page slice A)",
|
|
1089
|
-
"s": "A stage's sign-offs reach You on Today (job #1861, Factory page slice A)",
|
|
1090
|
-
"k": "new",
|
|
1091
|
-
"i": "factory-signoffs-reach-you"
|
|
1092
|
-
},
|
|
1093
|
-
{
|
|
1094
|
-
"n": 1886,
|
|
1095
|
-
"t": "Pmos ai worth puts each run kind's cost beside what was kept (job #1884)",
|
|
1096
|
-
"s": "Pmos ai worth puts each run kind's cost beside what was kept (job #1884)",
|
|
1097
|
-
"k": "new",
|
|
1098
|
-
"i": "worth-it-by-kind",
|
|
1099
|
-
"h": "Pmos ai worth puts each run kind's cost beside what was kept (job #1884)",
|
|
1100
|
-
"try": {
|
|
1101
|
-
"steps": [
|
|
1102
|
-
"Open Today and ask the chat: is each kind of AI run worth what it costs?",
|
|
1103
|
-
"Read the line for each kind: its runs and cost this month, and what you kept of its work",
|
|
1104
|
-
"Find any kind marked costs most, kept least"
|
|
1105
|
-
],
|
|
1106
|
-
"see": "One line per kind of background run: its runs and cost this month, and how many of its ✦ proposals you kept of those you decided. A kind that costs a large share and is kept less than half the time…",
|
|
1107
|
-
"open": "/today.html"
|
|
1108
|
-
}
|
|
1109
|
-
}
|
|
1110
|
-
]
|
|
1111
1093
|
}
|
|
1112
1094
|
]
|
|
1113
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-
|
|
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-
|
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-25T18:17:18Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/bin/pmos.js
CHANGED
|
@@ -87,15 +87,19 @@ function probe(port, ms = PROBE_MS) {
|
|
|
87
87
|
// old 5 s limit made `pmos proactive day show` say the server was not running (day-run D8b, 2026-11-25). The same commands find the
|
|
88
88
|
// server with discover(API_TIMEOUT_MS): the 2.5 s launcher probe alone still read a busy server as not running (Checker, 2026-11-25).
|
|
89
89
|
const API_TIMEOUT_MS = 30000;
|
|
90
|
+
// Why the last request answered nothing: 'timeout', a socket error code (ECONNREFUSED: no server), or 'not JSON (HTTP n)'.
|
|
91
|
+
// A command says which, so "not running" is said only when nothing listens (lib/proactive-cli.js).
|
|
92
|
+
let LAST_API_ERR = null;
|
|
90
93
|
function api(port, method, pathname, body, extraHeaders) {
|
|
94
|
+
LAST_API_ERR = null;
|
|
91
95
|
return new Promise((res) => {
|
|
92
96
|
const data = body ? JSON.stringify(body) : null;
|
|
93
97
|
const req = http.request(`${urlOf(port)}${pathname}`, {
|
|
94
98
|
method, timeout: API_TIMEOUT_MS,
|
|
95
99
|
headers: { ...(data ? { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(data) } : {}), ...(extraHeaders || {}) },
|
|
96
|
-
}, (r) => { let b = ''; r.on('data', (c) => (b += c)); r.on('end', () => { try { res(JSON.parse(b)); } catch { res(null); } }); });
|
|
97
|
-
req.on('error', () => res(null));
|
|
98
|
-
req.on('timeout', () => { req.destroy(); res(null); });
|
|
100
|
+
}, (r) => { let b = ''; r.on('data', (c) => (b += c)); r.on('end', () => { try { res(JSON.parse(b)); } catch { LAST_API_ERR = 'not JSON (HTTP ' + r.statusCode + ')'; res(null); } }); });
|
|
101
|
+
req.on('error', (e) => { if (!LAST_API_ERR) LAST_API_ERR = (e && e.code) || 'error'; res(null); });
|
|
102
|
+
req.on('timeout', () => { LAST_API_ERR = 'timeout'; req.destroy(); res(null); });
|
|
99
103
|
if (data) req.write(data);
|
|
100
104
|
req.end();
|
|
101
105
|
});
|
|
@@ -608,7 +612,7 @@ function doctor() {
|
|
|
608
612
|
else if (cmd === 'proactive') {
|
|
609
613
|
const port = await serverPort();
|
|
610
614
|
code = await require('../lib/proactive-cli').run(process.argv.slice(2), {
|
|
611
|
-
say, call: async (m, p, b) => (port ? pressApi(port, m, p, b) : null) });
|
|
615
|
+
say, call: async (m, p, b) => (port ? pressApi(port, m, p, b) : null), port, why: () => LAST_API_ERR });
|
|
612
616
|
}
|
|
613
617
|
else if (cmd === 'kg') {
|
|
614
618
|
// Reads tracked .md files straight from disk (lib/kg-cli.js); needs no running server.
|
|
@@ -16,7 +16,9 @@ const BASE = T.BASE;
|
|
|
16
16
|
// the phone design (Ph2_init): a phone shows an initiative as the popup's phone page; the old page is ⋯ › Every part
|
|
17
17
|
const everyPart = async (pg) => { await pg.waitForSelector('#czViewer .pw-ph', { state: 'attached', timeout: 20000 }); await pg.evaluate(() => { const r = (window.__czVwMore ? window.__czVwMore(document.body) : []).find((x) => x.label === 'Every part'); if (r) r.go(); }); await pg.waitForTimeout(800); };
|
|
18
18
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
19
|
-
|
|
19
|
+
// 30 s by default: every wait here is for something to show, and with four browser suites at once on 4 cores the Viewer's
|
|
20
|
+
// form and redraws took over 10 s (2026-11-25); a pass returns as soon as it shows
|
|
21
|
+
const until = async (fn, ms = 30000, step = 100) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
20
22
|
const results = [];
|
|
21
23
|
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
22
24
|
let srv = null; let browser = null;
|
|
@@ -59,9 +61,12 @@ const PAGES = {
|
|
|
59
61
|
await page.route('**/api/briefing-premium/**', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, turns: [], working: false }) }));
|
|
60
62
|
await page.goto(BASE + P.file + P.qs + theme);
|
|
61
63
|
if (w <= 760 && kind === 'initiative') await everyPart(page);
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
// 40 s, not 20: with four browser suites at once on 4 cores the first draw of today.html can take over 20 s (2026-11-25)
|
|
65
|
+
let up = await until(() => page.evaluate((s) => !!document.querySelector(s), P.ready), 40000);
|
|
66
|
+
if (up && kind === 'initiative') { /* the page holds the Tasks (batch 11 item 20) */ await docsView(page); up = await until(() => page.evaluate((s) => !!document.querySelector(s), P.btn), 40000); } // the Overview holds the button
|
|
67
|
+
// when it did not draw: what was on screen, so a failure says which step stopped
|
|
68
|
+
const seen = up ? '' : await page.evaluate(() => { const v = document.querySelector('#czViewer'); return JSON.stringify({ url: location.pathname + location.search, viewer: v ? (v.hidden ? 'hidden' : 'open') : 'none', mc: !!document.querySelector('#czViewer .iv-mc'), views: [...document.querySelectorAll('#czViewer [data-hi-v], #czViewer [data-hi-view]')].map((x) => x.dataset.hiV || x.dataset.hiView), head: ((v && v.querySelector('.cz-vw-hd')) || {}).textContent || '' }); }).catch((e) => String(e));
|
|
69
|
+
return { ctx, page, errors, posts, up, seen, calls: () => calls, setCustom: (c) => { current = c; }, reply: (a) => { reply = a; } };
|
|
65
70
|
};
|
|
66
71
|
const txt = (p, s) => p.evaluate((q) => (document.querySelector(q) || {}).textContent || '', s);
|
|
67
72
|
const viaMore = async (pg, label) => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); await pg.click(`#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${label}"))`); }; // the Overview's other views, Open the full record and Sprint sit under ⋯ (XvATasks)
|
|
@@ -69,7 +74,7 @@ const PAGES = {
|
|
|
69
74
|
// Documents is shell A (XvADocs): Add a document is under its ⋯, with Group by and Show
|
|
70
75
|
async function addDoc(page) { await page.click('#czViewer [data-cz-vw="more"]'); await page.click('#czViewer .cz-vw-menu button:has-text("Add a document")'); }
|
|
71
76
|
// the initiative's page (canvas HbC): its Documents' "Show all N" drills into the Documents view
|
|
72
|
-
async function docsView(page) { if (await until(() => page.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]')),
|
|
77
|
+
async function docsView(page) { if (await until(() => page.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]')), 40000)) await (async (pg) => { if (await pg.$('#czViewer [data-hi-v="page"] [data-iv-docs]')) await pg.click('#czViewer [data-iv-docs]'); else if (await pg.$('#czViewer [data-hi-view="docs"]')) await pg.click('#czViewer [data-hi-view="docs"]'); else await viaMore(pg, 'Documents'); })(page); }
|
|
73
78
|
|
|
74
79
|
/* the Board had its own Add a document on its Documents tab; batch 24 item 7 took that tab off the Board, so only the initiative's is checked */
|
|
75
80
|
for (const kind of ['initiative']) {
|
|
@@ -77,7 +82,7 @@ const PAGES = {
|
|
|
77
82
|
const A = await open(kind), p = A.page;
|
|
78
83
|
const F = '#czViewer:not([hidden])';
|
|
79
84
|
const dlgShut = () => p.evaluate(() => { const d = document.querySelector('#dlg'); return !d || !d.classList.contains('on'); });
|
|
80
|
-
ok(`${kind} 0 the page draws (Home with the initiative, its Overview open)`, A.up);
|
|
85
|
+
ok(`${kind} 0 the page draws (Home with the initiative, its Overview open)`, A.up, A.seen + (A.errors.length ? ' errors: ' + A.errors.join(' | ') : ''));
|
|
81
86
|
if (!A.up) return finish(1);
|
|
82
87
|
await p.click('#czViewer [data-cz-vw="more"]');
|
|
83
88
|
ok(`${kind} A1 the Overview's Documents view has Add a document under ⋯`, await p.evaluate(() => [...document.querySelectorAll('#czViewer .cz-vw-menu button')].some((b) => /^Add a document/.test(b.textContent.trim()))));
|
|
@@ -106,8 +111,8 @@ const PAGES = {
|
|
|
106
111
|
ok(`${kind} A3 nothing else was posted`, A.posts.every((x) => x.path === '/api/custom-docs/add'));
|
|
107
112
|
ok(`${kind} A1 the form closes, the initiative is read again and its Overview comes back`, await until(() => A.calls() > calls0) && await until(() => p.evaluate(() => !document.querySelector('#czViewer #adT') && !!document.querySelector('#czViewer [data-hi-v="docs"]'))));
|
|
108
113
|
A.setCustom(CUSTOM.map((d) => Object.assign({}, d, { scope: P.scope }))); await p.reload();
|
|
109
|
-
await until(() => p.evaluate((s) => !!document.querySelector(s), P.ready),
|
|
110
|
-
await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-ov-doc="custom:cd-2"]')),
|
|
114
|
+
await until(() => p.evaluate((s) => !!document.querySelector(s), P.ready), 40000); if (!ini) await p.click(P.ready); await docsView(p);
|
|
115
|
+
await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-ov-doc="custom:cd-2"]')), 40000);
|
|
111
116
|
// a row: the title, its state pill, then what it is (when, who writes it, where it lives) and the link as text (InDocs)
|
|
112
117
|
// shell A (XvADocs): a row is one press, its title then one quiet line (when, who writes it, the state) and the link as text
|
|
113
118
|
const rows = await p.evaluate(() => [...document.querySelectorAll('#czViewer [data-ov-doc]')].map((r) => { const w = r.querySelector('.w') || r, sub = [...w.querySelectorAll(':scope > span')].map((x) => x.textContent); return { t: (w.firstChild && w.firstChild.nodeType === 3 ? w.firstChild.textContent : '').trim(), meta: sub.filter((x) => !/: https?:/.test(x)).join(' · '), small: sub.filter((x) => /: https?:/.test(x)).join(' '), btn: r.querySelectorAll('button:not([disabled]):not([data-ov-none])').length, none: !!r.querySelector('[data-ov-none]') }; })); // a document with no file says so when pressed (testing fixes); it opens nothing
|
|
@@ -122,8 +127,9 @@ const PAGES = {
|
|
|
122
127
|
ok(`${kind} A8 Escape closes the form`, await p.evaluate(() => !document.querySelector('#czViewer #adT')));
|
|
123
128
|
ok(`${kind} no page error`, A.errors.length === 0, A.errors.join(' | '));
|
|
124
129
|
await A.ctx.close();
|
|
125
|
-
const N = await open(kind, { w: 390, h: 844 }); await addDoc(N.page); await until(() => N.page.evaluate(() => !!document.querySelector('#czViewer #adT')));
|
|
126
|
-
|
|
130
|
+
const N = await open(kind, { w: 390, h: 844 }); if (N.up) await addDoc(N.page); await until(() => N.page.evaluate(() => !!document.querySelector('#czViewer #adT')), 30000);
|
|
131
|
+
// a part that is not there reads 0 (a miss with its name), not a TypeError that stops the suite
|
|
132
|
+
const floors = await N.page.evaluate(() => { const h = (s) => { const e = document.querySelector('#czViewer ' + s); return e ? Math.round(e.getBoundingClientRect().height) : 0; }; return { go: h('.cz-vw-hd [data-cz-vw-p="add"]'), no: h('.cz-vw-hd [data-cz-vw="back"]'), t: h('#adT'), k: h('#adK'), w: h('#adW button'), fs: document.querySelector('#czViewer #adT') ? getComputedStyle(document.querySelector('#czViewer #adT')).fontSize : '0' }; });
|
|
127
133
|
ok(`${kind} A8 at 390 px the presses and fields are at least 44 px and the fields do not zoom the page`, [floors.go, floors.no, floors.t, floors.k, floors.w].every((v) => v >= 44) && parseFloat(floors.fs) >= 16, JSON.stringify(floors));
|
|
128
134
|
ok(`${kind} A8 no sideways scroll at 390 px with the form open`, await N.page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1 && document.querySelector('#czViewer').getBoundingClientRect().right <= innerWidth + 1));
|
|
129
135
|
await N.ctx.close();
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,48 @@
|
|
|
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
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"v": "0.845.0",
|
|
34
|
+
"at": "2026-11-25T18:02:38.683Z",
|
|
35
|
+
"f": 4,
|
|
36
|
+
"prs": [
|
|
37
|
+
{
|
|
38
|
+
"n": 2041,
|
|
39
|
+
"t": "Main's browser reds — stage-card-tasks, adddoc, task-views, task-press T3, vw-jira dark, viewer-trail, vw-rec and day-run hold under load",
|
|
40
|
+
"s": "Main's browser reds — stage-card-tasks, adddoc, task-views, task-press T3, vw-jira dark, viewer-trail, vw-rec and day-run hold under load",
|
|
41
|
+
"k": "fix",
|
|
42
|
+
"i": "ci-main-unblock"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
2
46
|
{
|
|
3
47
|
"v": "0.844.0",
|
|
4
48
|
"at": "2026-11-25T17:36:00.349Z",
|
|
@@ -9,6 +53,7 @@
|
|
|
9
53
|
"t": "Copy and layout tests on an initiative, drafted from plain words (job #1905, A351)",
|
|
10
54
|
"s": "Copy and layout tests on an initiative, drafted from plain words (job #1905, A351)",
|
|
11
55
|
"k": "new",
|
|
56
|
+
"i": "copy-tests",
|
|
12
57
|
"h": "Copy and layout tests on an initiative, drafted from plain words (job #1905, A351)",
|
|
13
58
|
"try": {
|
|
14
59
|
"steps": [
|
|
@@ -18,14 +63,14 @@
|
|
|
18
63
|
],
|
|
19
64
|
"see": "With nothing typed in the chat, the Copy test block shows its ✦ offer; ✦ drafts A against B with Undo. Then a Copy test block with one table (Variant, Copy, the rate and how sure), one ✦ line such…",
|
|
20
65
|
"open": "/premium-board.html"
|
|
21
|
-
}
|
|
22
|
-
"i": "copy-tests"
|
|
66
|
+
}
|
|
23
67
|
},
|
|
24
68
|
{
|
|
25
69
|
"n": 2027,
|
|
26
70
|
"t": "Events says what to bring on each meeting (job #2012, TbEvents)",
|
|
27
71
|
"s": "Events says what to bring on each meeting (job #2012, TbEvents)",
|
|
28
72
|
"k": "new",
|
|
73
|
+
"i": "tb-events-bring",
|
|
29
74
|
"h": "Events says what to bring on each meeting (job #2012, TbEvents)",
|
|
30
75
|
"try": {
|
|
31
76
|
"steps": [
|
|
@@ -35,14 +80,14 @@
|
|
|
35
80
|
],
|
|
36
81
|
"see": "Each meeting tied to your work says what to bring, for example \"Bring two calls: …\", naming dates that Events lists; a meeting with nothing to decide says \"Nothing new for this one yet.\"; focus time…",
|
|
37
82
|
"open": "/premium-events.html"
|
|
38
|
-
}
|
|
39
|
-
"i": "tb-events-bring"
|
|
83
|
+
}
|
|
40
84
|
},
|
|
41
85
|
{
|
|
42
86
|
"n": 1958,
|
|
43
87
|
"t": "What each initiative and merged pull request cost, and a pause for a stall (job #1906)",
|
|
44
88
|
"s": "What each initiative and merged pull request cost, and a pause for a stall (job #1906)",
|
|
45
89
|
"k": "new",
|
|
90
|
+
"i": "initiative-cost",
|
|
46
91
|
"h": "What each initiative and merged pull request cost, and a pause for a stall (job #1906)",
|
|
47
92
|
"try": {
|
|
48
93
|
"steps": [
|
|
@@ -52,14 +97,14 @@
|
|
|
52
97
|
],
|
|
53
98
|
"see": "One row per initiative the factory worked on: agent hours, spend in dollars and how many pull requests merged. An initiative that spent for 7 days with no merge shows one ✦ asking to pause its jobs.…",
|
|
54
99
|
"open": "/premium-board.html?work=cost"
|
|
55
|
-
}
|
|
56
|
-
"i": "initiative-cost"
|
|
100
|
+
}
|
|
57
101
|
},
|
|
58
102
|
{
|
|
59
103
|
"n": 2022,
|
|
60
104
|
"t": "This sprint's Summary card with a ✦ sentence per count, Ticket and Epic columns (job #2018)",
|
|
61
105
|
"s": "This sprint's Summary card with a ✦ sentence per count, Ticket and Epic columns (job #2018)",
|
|
62
106
|
"k": "new",
|
|
107
|
+
"i": "tb-sprint-balanced",
|
|
63
108
|
"h": "This sprint, with a Summary that says what is going on",
|
|
64
109
|
"try": {
|
|
65
110
|
"steps": [
|
|
@@ -69,8 +114,7 @@
|
|
|
69
114
|
],
|
|
70
115
|
"see": "The Summary card gives the same To do, In progress and Done counts as the Tasks tabs, all work in the sprint's dates, Jira and not. Each count with work has one ✦ sentence written from the tickets,…",
|
|
71
116
|
"open": "/premium-board.html"
|
|
72
|
-
}
|
|
73
|
-
"i": "tb-sprint-balanced"
|
|
117
|
+
}
|
|
74
118
|
}
|
|
75
119
|
]
|
|
76
120
|
},
|
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.
|
package/workspace/guide/home.md
CHANGED
|
@@ -105,6 +105,8 @@ Press an initiative's name in the list, or open `?ini=<id>`. The list stays as i
|
|
|
105
105
|
- On a phone the line shows only the next open milestone's name. Press the line to unfold the stages and milestones as a list under it.
|
|
106
106
|
- On a wide Viewer the stage's dates, ⋯ and the next stage always show under the picture, and the milestones are in their own **Milestones** card under it. When the dates are too long for the row, they take their own line. They are never cut.
|
|
107
107
|
- **Group by** (Stage, Owner, Status or Epic) is saved for the initiative. It stays after you change a task.
|
|
108
|
+
- The view button stays marked as open while its sheet is open, also when the list refreshes behind it.
|
|
109
|
+
- When you add a task with **+** on a stage, the field stays open and keeps your text and the cursor, also when another change saves at the same time.
|
|
108
110
|
- When the list is folded, the Live pill above the menu button shows its marks in a column.
|
|
109
111
|
- The picture spans the card from edge to edge. The telescope stands at the left, the launch pad in the middle and the dish at the right, whatever the stages' dates. The rocket gets smaller as it flies toward the planet.
|
|
110
112
|
- Under the card are the 3 most urgent tasks and the documents that need a look. **Show N more** opens all the tasks and **Show all N** opens all the documents. ← goes back to the page. A task or a document that you open from the page also has ← back to the page.
|
|
@@ -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.
|
|
@@ -41,14 +41,21 @@ const COMMANDS = { proactive: ['today', 'scan', 'settings', 'feedback', 'brief',
|
|
|
41
41
|
const BRIEF_SOURCES = ['calendar', 'wispr', 'mail', 'slack', 'jira', 'confluence', 'github', 'drive', 'figma', 'website'];
|
|
42
42
|
const onOff = (v, what) => (v === 'on' || v === 'true' ? true : v === 'off' || v === 'false' ? false : { err: `${what} takes on or off` });
|
|
43
43
|
|
|
44
|
-
async function run(argv, { call, say, cwd = process.cwd() }) {
|
|
44
|
+
async function run(argv, { call, say, cwd = process.cwd(), port = null, why = () => null }) {
|
|
45
45
|
const [group, verb, ...rest] = argv;
|
|
46
46
|
const { pos, flags } = parseArgs(rest);
|
|
47
47
|
const fail = (m) => { say('✗ ' + m); return 1; };
|
|
48
48
|
if (group !== 'proactive' || !verb || flags.help || verb === 'help') { say(`usage: pmos proactive <${COMMANDS.proactive.join('|')}> …`); return verb ? 0 : 1; }
|
|
49
49
|
if (!COMMANDS.proactive.includes(verb)) return fail(`unknown command "${verb}" — use ${COMMANDS.proactive.join(', ')}`);
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
// A server that is not running refuses at once. A busy one can let an ask run past its 30 s wait while agent sessions start
|
|
51
|
+
// (day-run D8b in CI, 2026-11-25), so a timeout is asked again, up to three times, and only a refusal is called not running.
|
|
52
|
+
let probe = null;
|
|
53
|
+
for (let i = 0; i < 3 && !probe; i++) { probe = await call('GET', '/api/proactive/settings'); if (!probe && why() !== 'timeout') break; }
|
|
54
|
+
if (!probe) {
|
|
55
|
+
const w = why();
|
|
56
|
+
if (!w || w === 'ECONNREFUSED' || !port) return fail('the workspace server is not running — start it with: pmos');
|
|
57
|
+
return fail(`the workspace server on port ${port} did not answer (${w === 'timeout' ? 'no answer in 30 s, three times' : w}) — try again`);
|
|
58
|
+
}
|
|
52
59
|
|
|
53
60
|
if (verb === 'today') {
|
|
54
61
|
const t = await call('GET', '/api/proactive/today');
|
|
@@ -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
|
@@ -62,11 +62,10 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
62
62
|
ok('R3 a paused note offers Resume in its recording line, with no Waiting for design marker', await until(async () => !!(await p.$('#czViewer .czs-sum [data-a="resume"]')) && !(await p.$('#czViewer [data-cz-placeholder]'))));
|
|
63
63
|
await tap(p, '.czs-sum [data-a="resume"]');
|
|
64
64
|
ok('R3 Resume records again', await until(() => posted(A.S, '/api/notes/record').length === 2));
|
|
65
|
-
|
|
66
|
-
await tap(p,
|
|
67
|
-
ok('R3 Stop asks first', await
|
|
68
|
-
await
|
|
69
|
-
ok('R3 Stop and write the notes stops the recorder', await until(() => posted(A.S, '/api/notes/stop').length === 1));
|
|
65
|
+
// Resume's answer redraws the card: a press that lands on the old card, or just before the redraw, is lost. Press again until it takes.
|
|
66
|
+
const pressUntil = (sel, done, ms = 20000) => until(async () => { if (await done()) return true; await tap(p, sel).catch(() => {}); return until(done, 2000); }, ms);
|
|
67
|
+
ok('R3 Stop asks first', await pressUntil('.czs-sum [data-a="stop"]', async () => /Stop for good/.test(await text(p))));
|
|
68
|
+
ok('R3 Stop and write the notes stops the recorder', await pressUntil('[data-a="stopgo"]', () => posted(A.S, '/api/notes/stop').length >= 1) && posted(A.S, '/api/notes/stop').length === 1, JSON.stringify(posted(A.S, '/api/notes/stop')));
|
|
70
69
|
ok('R3 no page error', A.errors.length === 0, A.errors.join(' | '));
|
|
71
70
|
await A.ctx.close();
|
|
72
71
|
|
|
@@ -617,8 +617,11 @@ function redrawView() {
|
|
|
617
617
|
if (cur.id === 'all:' + X.ctx.S.ini) { if (ALLB && ALLB.isConnected) { const M = curM(), st = ALLB.scrollTop; ALLB.innerHTML = M ? pageHtml(X.ctx.S.ini, M) : ''; light(ALLB, X.ctx.S.ini); ALLB.scrollTop = st; } return; }
|
|
618
618
|
if (cur.id !== 'ov:' + X.ctx.S.ini) return;
|
|
619
619
|
const ae = document.activeElement, keep = ae && BODY.contains(ae) && ae.id ? ae.id : null, val = keep && ae.value != null ? ae.value : null;
|
|
620
|
+
// a stage's New task field has no id: a redraw while it is typed in (another save landing) keeps its text and the focus
|
|
621
|
+
const addv = !keep && ae && BODY.contains(ae) && ae.matches('[data-iv-addinp]') ? ae.value : null;
|
|
620
622
|
const st = BODY.scrollTop; draw(BODY); BODY.scrollTop = st;
|
|
621
623
|
if (keep) { const n = BODY.querySelector('#' + keep); if (n) { if (val != null) n.value = val; n.focus(); } }
|
|
624
|
+
else if (addv != null) { const n = BODY.querySelector('[data-iv-addinp]'); if (n) { n.value = addv; n.focus({ preventScroll: true }); } }
|
|
622
625
|
else if (ADDING && X.view === 'page') { const f = BODY.querySelector('#ivAddTask'); if (f) f.focus(); } // New → A task on a page still reading
|
|
623
626
|
}
|
|
624
627
|
/** ⋯ of the initiative in the Viewer (xvMore order: change it, then look back). */
|
|
@@ -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
|
|
@@ -154,9 +154,18 @@ function onKey(e) {
|
|
|
154
154
|
else if ((e.key === 'Delete' || e.key === 'Backspace') && tabs[i].dataset.vw !== 'main') { vwClose(tabs[i].dataset.vw); return; }
|
|
155
155
|
if (n < 0) return; e.preventDefault(); vwShow(tabs[n].dataset.vw); const f = q(`#vTabs .vtab[data-vw="${CSS.escape(tabs[n].dataset.vw)}"]`); if (f) f.focus();
|
|
156
156
|
}
|
|
157
|
+
/** Loads a view's stylesheet once. Returns a promise that settles when it has loaded (or failed, or after 3 s), so a view can
|
|
158
|
+
* draw its content styled, never as bare buttons for a moment. Callers that do not wait keep working as before. */
|
|
159
|
+
const VW_CSS = new Map();
|
|
157
160
|
export function vwStyle(name) {
|
|
158
|
-
if (!/^[a-z0-9-]+$/.test(name || '')
|
|
159
|
-
|
|
161
|
+
if (!/^[a-z0-9-]+$/.test(name || '')) return Promise.resolve();
|
|
162
|
+
if (VW_CSS.has(name)) return VW_CSS.get(name);
|
|
163
|
+
const have = document.querySelector(`link[data-vw-css="${name}"]`);
|
|
164
|
+
if (have) { const p = Promise.resolve(); VW_CSS.set(name, p); return p; }
|
|
165
|
+
const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = new URL(`./premium-vw-${name}.css`, import.meta.url).href; l.dataset.vwCss = name;
|
|
166
|
+
const p = new Promise((done) => { l.onload = l.onerror = () => done(); setTimeout(done, 3000); });
|
|
167
|
+
VW_CSS.set(name, p); document.head.append(l);
|
|
168
|
+
return p;
|
|
160
169
|
}
|
|
161
170
|
export function vwConfirm(el, o) {
|
|
162
171
|
return new Promise((done) => {
|
|
@@ -130,10 +130,10 @@ export async function openSprint(o) {
|
|
|
130
130
|
const { ws, board } = o || {};
|
|
131
131
|
let name = (o && o.name) || '';
|
|
132
132
|
let past = false; // the Past sprints fold, open or shut, kept across a redraw of the tab
|
|
133
|
-
vwStyle('jira');
|
|
133
|
+
const css = vwStyle('jira');
|
|
134
134
|
const draw = async (el) => {
|
|
135
135
|
el.innerHTML = '<div class="jv"><p class="jnote">Reading the sprint</p></div>';
|
|
136
|
-
const sprints = await getJson('/api/boards/sprints', { ws, board });
|
|
136
|
+
const [sprints] = await Promise.all([getJson('/api/boards/sprints', { ws, board }), css]); // the cards draw styled, never as bare buttons
|
|
137
137
|
const m = sprintModel(sprints, name, { today: new Date().toISOString() });
|
|
138
138
|
el.innerHTML = sprintHtml(m, past); bars(el);
|
|
139
139
|
el.querySelectorAll('[data-sp]').forEach((b) => { b.onclick = () => { name = b.dataset.sp; draw(el); }; });
|
|
@@ -234,12 +234,13 @@ const TICKETS = [{ key: 'IDPF-3387', title: 'Refactor the AppAuthService', statu
|
|
|
234
234
|
ok('S6 Move to a stage lists the workflow\'s stages, the task\'s own checked', sl && sl.includes('Build*') && sl.includes('Deliver') && sl[sl.length - 1] === 'Not in a stage', JSON.stringify(sl));
|
|
235
235
|
await p.click('.tkc.ivq [data-ive-to="deliver"]');
|
|
236
236
|
const mv = await until(() => { const x = lastPost(A, '/api/boards/tasks/edit'); return x && x.body.section === 'deliver' ? x : null; });
|
|
237
|
-
//
|
|
238
|
-
|
|
237
|
+
// 30 s: the toast shows only after the reload and redraw (ini-edit.js move), which took over 10 s with four browser suites at once
|
|
238
|
+
// on 4 cores (2026-11-25). The toast then stays 9 s. Any toast that says it (an earlier pill can still be the first visible one); its own Undo is kept for the Undo step below
|
|
239
|
+
const t6 = await until(() => p.evaluate(() => { const e = [...document.querySelectorAll('#bdToast, .cz-toast, #czToast, #hiToast, [class*="toast"]')].find((x) => !x.hidden && x.getClientRects().length > 0 && /Moved to Deliver/.test(x.textContent)); if (!e) return null; window.__u6 = [...e.querySelectorAll('button')].find((b) => b.textContent.trim() === 'Undo') || null; return e.textContent; }), 30000);
|
|
239
240
|
const inD = await until(async () => ((await rowsOf(p, 'deliver')).includes('task-b1') ? true : null), 10000);
|
|
240
241
|
ok('S6 a stage picked there moves the task (section), "Moved to Deliver" with Undo, and it shows under Deliver', mv && /Undo/.test(t6 || '') && inD, JSON.stringify({ mv, t6 }));
|
|
241
|
-
await
|
|
242
|
-
const mu = await until(() => { const x = lastPost(A, '/api/boards/tasks/edit'); return x && x.body.section === 'build' ? x : null; });
|
|
242
|
+
await p.evaluate(() => { if (window.__u6) window.__u6.click(); });
|
|
243
|
+
const mu = await until(() => { const x = lastPost(A, '/api/boards/tasks/edit'); return x && x.body.section === 'build' ? x : null; }, 10000);
|
|
243
244
|
ok('S6 Undo puts it back in Build', !!mu, JSON.stringify(A.posts.slice(-2)));
|
|
244
245
|
|
|
245
246
|
/* S7 a milestone has one date */
|
|
@@ -274,13 +275,20 @@ const TICKETS = [{ key: 'IDPF-3387', title: 'Refactor the AppAuthService', statu
|
|
|
274
275
|
await p.keyboard.type('Release note for app teams'); await p.keyboard.press('Enter');
|
|
275
276
|
const ad = await until(() => lastPost(A, '/api/boards/tasks/add'));
|
|
276
277
|
ok('S8 Enter adds the task into that stage (section build)', ad && ad.body.title === 'Release note for app teams' && ad.body.section === 'build', JSON.stringify(ad));
|
|
277
|
-
|
|
278
|
+
// any toast that says it: an earlier one (S7's date Undo) can still be the first visible pill
|
|
279
|
+
const t8 = await until(() => p.evaluate(() => { const e = [...document.querySelectorAll('#bdToast, .cz-toast, #czToast, #hiToast, [class*="toast"]')].find((x) => !x.hidden && x.getClientRects().length > 0 && /Added to Build/.test(x.textContent)); if (!e) return null; window.__u8 = [...e.querySelectorAll('button')].find((b) => b.textContent.trim() === 'Undo') || null; return e.textContent; }), 15000);
|
|
280
|
+
// The field is disabled while the add is saved and gets the focus back only after the host's reload and redraw (home-ini.js
|
|
281
|
+
// addTask); with four browser suites at once on 4 cores that took over 10 s (2026-11-25). Read it before Undo, whose own redraw
|
|
282
|
+
// draws the field again without the focus.
|
|
283
|
+
const k8 = await until(() => p.evaluate(() => { const i = document.querySelector('#czViewer .iv-addin input'); return i && i.value === '' && document.activeElement === i ? true : null; }), 30000)
|
|
284
|
+
|| await p.evaluate(() => { const a = document.activeElement, i = document.querySelector('#czViewer .iv-addin input'); return { field: !!i, value: i ? i.value : null, disabled: i ? i.disabled : null, active: a ? a.tagName + '.' + a.className : null }; });
|
|
285
|
+
ok('S8 the toast says "Added to Build" with Undo; the field stays open, empty and focused', /Undo/.test(t8 || '') && k8 === true, JSON.stringify({ t8, k8 }));
|
|
278
286
|
await shot(p, 'S8-add-390');
|
|
279
|
-
//
|
|
280
|
-
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
const du = await until(() => lastPost(A, '/api/boards/tasks/delete'));
|
|
287
|
+
// the toast's own Undo: once the list is drawn again, the new row carries an Undo of its own too, which undo() would pick
|
|
288
|
+
// kept when the toast showed: a later toast reuses the same pill and replaces its button, whose own handler still runs the delete
|
|
289
|
+
const u8 = await p.evaluate(() => { const b = window.__u8; if (b) b.click(); return !!b; });
|
|
290
|
+
// the delete queues behind the reload's reads, which took over 10 s under the same load
|
|
291
|
+
const du = await until(() => lastPost(A, '/api/boards/tasks/delete'), 30000);
|
|
284
292
|
ok('S8 Undo takes the new task out', du && /^task-n/.test(du.body.task || ''), JSON.stringify({ u8, du, last: A.posts.slice(-3) }));
|
|
285
293
|
await p.keyboard.press('Escape');
|
|
286
294
|
ok('S8 Esc closes the field', await until(() => p.evaluate(() => !document.querySelector('#czViewer .iv-addin')), 3000));
|
|
@@ -109,7 +109,8 @@ const back = (p) => p.evaluate(() => { const b = document.querySelector('#czView
|
|
|
109
109
|
const n0 = H.posts.length;
|
|
110
110
|
await hp.click(`${V} [data-iv-check="t1"]`);
|
|
111
111
|
ok('T3 the check box saves Done and opens nothing', await until(() => H.posts.slice(n0).some((x) => x.path === '/api/boards/tasks/state' && x.body.task === 't1' && x.body.state === 'Done'), 5000)
|
|
112
|
-
&& await until(() => hp.evaluate((v) => !!document.querySelector(v + ' [data-hi-v="page"]'), V),
|
|
112
|
+
&& await until(() => hp.evaluate((v) => !!document.querySelector(v + ' [data-hi-v="page"]'), V), 15000), // the save reloads and redraws the page: a slow runner can look mid-redraw
|
|
113
|
+
await hp.evaluate((v) => JSON.stringify({ open: !!(window.czViewer && window.czViewer.isOpen && window.czViewer.isOpen()), cur: window.czViewer && window.czViewer.current && (window.czViewer.current() || {}).kind, shown: !!document.querySelector(v), hv: [...document.querySelectorAll('#czViewer [data-hi-v]')].map((e) => e.getAttribute('data-hi-v')), url: location.href.slice(-120) }), V).catch((e) => String(e)) + ' ' + JSON.stringify(H.posts.slice(n0)));
|
|
113
114
|
ok('T0 no page error on Home', H.errors.length === 0, H.errors.join(' | '));
|
|
114
115
|
await H.ctx.close();
|
|
115
116
|
|
|
@@ -514,14 +514,15 @@ const everyPart = async (pg) => { await pg.waitForSelector('#czViewer .pw-ph', {
|
|
|
514
514
|
ok('H8 Undo moves it back the same way', !!a2 && a2.key === 'MSD-4376' && a2.to === 'Done' && a2.from === 'In progress' && a2.fromRaw === 'In Review', JSON.stringify(a2));
|
|
515
515
|
const n0 = J.posts.filter((x) => x.path === '/api/boards/tasks/state').length;
|
|
516
516
|
await j.dragAndDrop('#czViewer [data-ivk-jira="MSD-4377"]', '#czViewer .ivk-w');
|
|
517
|
-
|
|
518
|
-
const w1 = await j.evaluate(() => (document.querySelector('#bdToast') || {}).textContent || '');
|
|
517
|
+
// a wait, not 300 ms: under load the Undo toast above was still showing when the drop's own line was read (CI, 2026-11-25)
|
|
518
|
+
const w1 = (await until(() => j.evaluate(() => { const t = (document.querySelector('#bdToast') || {}).textContent || ''; return /moves to To do, In progress or Done/.test(t) ? t : null; }), 10000))
|
|
519
|
+
|| await j.evaluate(() => (document.querySelector('#bdToast') || {}).textContent || '');
|
|
519
520
|
ok('H8 a Jira card dropped on Won\'t do asks nothing and says so', asks.length === 2 && /moves to To do, In progress or Done/.test(w1) && J.posts.filter((x) => x.path === '/api/boards/tasks/state').length === n0, JSON.stringify({ n: asks.length, w1 }));
|
|
520
521
|
// the List: the status press beside the Jira square offers three states and says the pick moves the ticket in Jira
|
|
521
522
|
await sheetPick(j, 'view', 'list');
|
|
522
|
-
await until(() => j.evaluate(() => !!document.querySelector('#czViewer [data-iv-jstat="MSD-4377"]')));
|
|
523
|
+
await until(() => j.evaluate(() => !!document.querySelector('#czViewer [data-iv-jstat="MSD-4377"]')), 20000);
|
|
523
524
|
await j.click('#czViewer [data-iv-jstat="MSD-4377"]');
|
|
524
|
-
const pop = await until(() => j.evaluate(() => { const q = document.querySelector('.tkc.ivq .ivq-st.jq'); return q ? { st: [...q.querySelectorAll('[data-ivq-state]')].map((b) => b.dataset.ivqState).join('|'), on: (q.querySelector('[aria-checked="true"]') || {}).textContent, line: (q.querySelector('.ivq-jn') || {}).textContent } : null; }));
|
|
525
|
+
const pop = await until(() => j.evaluate(() => { const q = document.querySelector('.tkc.ivq .ivq-st.jq'); return q ? { st: [...q.querySelectorAll('[data-ivq-state]')].map((b) => b.dataset.ivqState).join('|'), on: (q.querySelector('[aria-checked="true"]') || {}).textContent, line: (q.querySelector('.ivq-jn') || {}).textContent } : null; }), 20000);
|
|
525
526
|
ok('H8 List: a Jira row\'s status press: To do, In progress, Done; "Moves MSD-4377 in Jira"', !!pop && pop.st === 'To do|In progress|Done' && pop.on === 'In progress' && pop.line === 'Moves MSD-4377 in Jira', JSON.stringify(pop));
|
|
526
527
|
await j.click('.tkc.ivq .ivq-st.jq [data-ivq-state="Done"]');
|
|
527
528
|
const a3 = await until(() => asks[2]);
|
|
@@ -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
|
+
}
|
|
@@ -47,7 +47,8 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
47
47
|
page.on('pageerror', (e) => S.errors.push(String((e && e.message) || e)));
|
|
48
48
|
await page.route('**/api/briefing-premium*', (r) => r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: B.build(F.facts()), as_of: Date.now() }) }));
|
|
49
49
|
await page.goto(BASE + '/today.html?theme=light');
|
|
50
|
-
S.up = await until(() => page.evaluate(() => document.querySelectorAll('#hmList .hm-r').length > 0 && !!window.czViewer),
|
|
50
|
+
S.up = await until(() => page.evaluate(() => document.querySelectorAll('#hmList .hm-r').length > 0 && !!window.czViewer), 60000); // a cold CI runner can take over 20 s to draw Home's first rows
|
|
51
|
+
if (!S.up) S.seen = await page.evaluate(() => JSON.stringify({ list: !!document.querySelector('#hmList'), rows: document.querySelectorAll('#hmList .hm-r').length, vw: !!window.czViewer, text: ((document.querySelector('#hmList') || document.body).textContent || '').replace(/\s+/g, ' ').slice(0, 200) })).catch((e) => String(e));
|
|
51
52
|
await page.evaluate(() => {
|
|
52
53
|
const item = (x) => ({ id: 't:' + x, kind: 'Ticket', title: 'Item ' + x, icon: 'jira',
|
|
53
54
|
html: `<p>${x}</p>${['A', 'B', 'C', 'D', 'E'].filter((y) => y !== x).map((y) => `<button type="button" data-tgo="${y}">${y}</button>`).join('')}` });
|
|
@@ -69,7 +70,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
69
70
|
|
|
70
71
|
{
|
|
71
72
|
const { page, ctx, S } = await open();
|
|
72
|
-
ok('0 Home loads with the Viewer', S.up);
|
|
73
|
+
ok('0 Home loads with the Viewer', S.up, S.seen);
|
|
73
74
|
const len0 = await page.evaluate(() => history.length), s0 = (await st(page)).s; // the page's own entry (Home may draw its day in the Viewer)
|
|
74
75
|
let s = await press(page, 'A', false);
|
|
75
76
|
ok('N a press on the page opens a new trail: on a desk no ← at its first item', s && s.back === null && s.fwd === null && s.h === 0 && s.len === len0 + 1, JSON.stringify(s));
|