create-pmos 0.828.0 → 0.829.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 +140 -22
- 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/board-deliveries-test.js +2 -2
- package/workspace/changelog.json +139 -8
- package/workspace/guide/cli.md +34 -1
- package/workspace/guide/home.md +1 -0
- package/workspace/guide/settings-and-switches.md +1 -0
- package/workspace/lib/board-premium.js +1 -0
- package/workspace/lib/critical-needs.js +162 -0
- package/workspace/lib/deps-cli.js +102 -0
- package/workspace/lib/engine/boards.js +13 -2
- package/workspace/lib/features.json +3 -0
- package/workspace/lib/needs-providers.js +1 -0
- package/workspace/lib/page-one-answer.js +86 -0
- package/workspace/lib/pages-cli.js +6 -2
- package/workspace/lib/pmos-verbs.js +8 -0
- package/workspace/lib/prototype-cli.js +86 -0
- package/workspace/lib/report-cli.js +12 -2
- package/workspace/lib/report-readers.js +5 -3
- package/workspace/lib/review-pack.js +348 -0
- package/workspace/lib/route-modules.js +4 -0
- package/workspace/lib/routes-boards.js +25 -2
- package/workspace/lib/routes-review-pack.js +42 -0
- package/workspace/lib/routes-roadmap-ops.js +53 -1
- package/workspace/lib/routes-sim-users.js +66 -0
- package/workspace/lib/routes-team-waits.js +24 -0
- package/workspace/lib/sim-users.js +329 -0
- package/workspace/lib/task-store.js +1 -1
- package/workspace/lib/team-waits.js +167 -0
- package/workspace/lib/tradeoff-cards.js +258 -0
- package/workspace/lib/tradeoff-cli.js +83 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/bd-backlog.js +44 -6
- package/workspace/public/pm/cozy-library.css +5 -0
- package/workspace/public/pm/cozy-pop-work.js +2 -1
- package/workspace/public/pm/cozy-proto.css +5 -0
- package/workspace/public/pm/cozy-proto.js +11 -3
- package/workspace/public/pm/cozy-today-app.js +5 -2
- package/workspace/public/pm/day-time.js +8 -0
- package/workspace/public/pm/home-ini.js +3 -2
- package/workspace/public/pm/ini-links.js +2 -1
- package/workspace/public/pm/ini-tasks.js +5 -2
- package/workspace/public/pm/ini-view-model.js +14 -6
- package/workspace/public/pm/ini-view.js +12 -2
- package/workspace/public/pm/library-model.js +1 -1
- package/workspace/public/pm/page-one-answer.css +18 -0
- package/workspace/public/pm/page-one-answer.js +134 -0
- package/workspace/public/pm/pop-work-model.js +8 -6
- package/workspace/public/pm/portfolio.js +1 -1
- package/workspace/public/pm/premium-board.js +19 -6
- package/workspace/public/pm/premium-library.js +27 -3
- package/workspace/public/pm/range-pick.css +12 -0
- package/workspace/public/pm/range-pick.js +30 -6
- package/workspace/public/pm/review-pack.js +47 -0
- package/workspace/public/pm/sim-users.js +34 -0
- package/workspace/public/pm/sort-order.js +3 -0
- package/workspace/public/pm/task-card.js +10 -7
- package/workspace/public/pm/team-waits.js +56 -0
- package/workspace/public/pm/tradeoff-cards.css +27 -0
- package/workspace/public/pm/tradeoff-cards.js +183 -0
- package/workspace/public/premium-board.html +1 -0
- package/workspace/public/today.html +1 -0
- package/workspace/run-tests.js +9 -1
- package/workspace/test-lists/critical-needs.json +9 -0
- package/workspace/test-lists/page-one-answer.json +9 -0
- package/workspace/test-lists/review-pack.json +9 -0
- package/workspace/test-lists/sim-users.json +9 -0
- package/workspace/test-lists/task-time-optional.json +9 -0
- package/workspace/test-lists/team-waits.json +9 -0
- package/workspace/test-lists/tradeoff-cards.json +9 -0
- package/workspace/test-timings.json +25 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/* pm/tradeoff-cards.js — trade-off cards on Work (initiative tradeoff-cards, job #1918, idea A325; board TradeoffDS on the main canvas,
|
|
2
|
+
* In development; lib/tradeoff-cards.js, GET /api/tradeoffs). Pure apart from decorate, openCard and the move listener: Node imports it
|
|
3
|
+
* (tradeoff-cards.test.js T8, T9).
|
|
4
|
+
*
|
|
5
|
+
* lineHtml(a, b) the quiet line between two rows: "These two are close. Compare them" (a press opens the card)
|
|
6
|
+
* keptHtml(k) the kept reason under the row that went first, once: "Kept above <other>: <reason> · 25 Nov"
|
|
7
|
+
* cardHtml(card, o) the card "Which goes first?": the five rows per side, the old reason first when there is one, the ✦ line,
|
|
8
|
+
* "Why you chose (kept with the list)" and two icon-only presses: put the other first, keep this order.
|
|
9
|
+
* o.compare: the compare view is on the page (window.pmosCompare), so ⊞ opens both side by side.
|
|
10
|
+
* movedPair(before, after) a drag that put one row directly above another → [moved, below], else null
|
|
11
|
+
* shownPairs(ids, pairs, drag) the pairs to draw in one list on screen: a close pair whose two rows are next to each other, and the
|
|
12
|
+
* dragged pair. Zero is silence: no pair, no line.
|
|
13
|
+
* decorate(body) after Work draws its stage track (#ibBody, view track): reads GET /api/tradeoffs?ids=<the rows on screen>
|
|
14
|
+
* (the server finds their workspace; once per set of rows until a write) and puts the lines and the kept
|
|
15
|
+
* reasons beside the rows ([data-po-list] > [data-po-id]). Work loads this file through pm/sort-order.js, and
|
|
16
|
+
* a MutationObserver on #ibBody runs decorate after each draw, so pm/premium-board.js is left alone.
|
|
17
|
+
* Every write is the PM's press (POST /api/tradeoffs/keep, /undo), with Undo in the toast. PMOS never writes a rank or a reason by itself. */
|
|
18
|
+
|
|
19
|
+
const SCALE = 'M12 3v18M7 21h10M5 7h14M5 7l-3 7a3 3 0 0 0 6 0zM19 7l-3 7a3 3 0 0 0 6 0z';
|
|
20
|
+
const ICON = { close: 'M6 6l12 12M18 6L6 18', swap: 'M7 4v16M4 7l3-3 3 3M17 20V4M14 17l3 3 3-3', keep: 'M5 12.5l4.5 4.5L19 7.5', cols: 'M4 5h16v14H4zM12 5v14' };
|
|
21
|
+
const ROWS = [['Goal it moves', 'goal'], ['Evidence', 'evidence'], ['Cost', 'cost'], ['Risk', 'risk'], ['What waits if it goes first', 'waits']];
|
|
22
|
+
const MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
23
|
+
export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
24
|
+
const svg = (d, w = 16) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
|
|
25
|
+
const day = (at) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(at || '')); return m ? `${Number(m[3])} ${MONTHS[Number(m[2]) - 1]}` : ''; };
|
|
26
|
+
|
|
27
|
+
export function lineHtml(a, b) {
|
|
28
|
+
return `<div class="tc-line" role="presentation"><button type="button" class="tc-open" data-tc-a="${esc(a.id)}" data-tc-b="${esc(b.id)}" aria-haspopup="dialog" aria-label="${esc(`${a.title} and ${b.title} are close. Compare them`)}">${svg(SCALE, 14)}<span>These two are close. Compare them</span></button></div>`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function keptHtml(k) {
|
|
32
|
+
if (!k || !k.reason) return '';
|
|
33
|
+
return `<p class="tc-kept" role="note">${svg(SCALE, 14)}<span>Kept above ${esc(k.other_title || k.other)}: ${esc(k.reason)}${k.at ? ' · ' + esc(day(k.at)) : ''}</span></p>`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function cardHtml(c, o = {}) {
|
|
37
|
+
const head = (s) => `<div class="tc-col-h" role="columnheader">${esc(s.title)}</div>`;
|
|
38
|
+
const rows = ROWS.map(([label, k]) => `<div class="tc-r" role="row"><div class="tc-l" role="rowheader">${esc(label)}</div><div class="tc-v${c.a[k] === 'not known' ? ' tc-nk' : ''}" role="cell">${esc(c.a[k])}</div><div class="tc-v${c.b[k] === 'not known' ? ' tc-nk' : ''}" role="cell">${esc(c.b[k])}</div></div>`).join('');
|
|
39
|
+
const past = c.past ? `<p class="tc-past">${svg(SCALE, 14)}<span>Last time: ${esc(c.past.reason)} · ${esc(day(c.past.at))}</span></p>` : '';
|
|
40
|
+
const other = c.b; // the swap puts the lower one first
|
|
41
|
+
return `<div class="tc-card" role="dialog" aria-modal="true" aria-labelledby="tcTitle">`
|
|
42
|
+
+ `<div class="tc-h"><h2 id="tcTitle" class="tc-t">${svg(SCALE, 18)}Which goes first?</h2>`
|
|
43
|
+
+ (o.compare ? `<button type="button" class="pm-btn" data-tc-act="compare" aria-label="Compare in full" title="Compare in full">${svg(ICON.cols)}</button>` : '')
|
|
44
|
+
+ `<button type="button" class="pm-btn" data-tc-act="close" aria-label="Close" title="Close">${svg(ICON.close)}</button></div>`
|
|
45
|
+
+ past
|
|
46
|
+
+ `<div class="tc-grid" role="table" aria-label="The two side by side"><div class="tc-r" role="row"><div class="tc-l" role="presentation"></div>${head(c.a)}${head(c.b)}</div>${rows}</div>`
|
|
47
|
+
+ `<p class="tc-sug"><span class="tc-star" aria-label="PMOS suggests">✦</span><span>${esc(c.suggest.reason)}</span></p>`
|
|
48
|
+
+ `<label class="tc-why" for="tcWhy">Why you chose (kept with the list)</label>`
|
|
49
|
+
+ `<input id="tcWhy" class="pm-input" maxlength="200" autocomplete="off">`
|
|
50
|
+
+ `<div class="tc-foot"><button type="button" class="pm-btn outline" data-tc-act="swap" aria-label="${esc(`Put ${other.title} first and keep the reason`)}" title="${esc(`Put ${other.title} first`)}">${svg(ICON.swap)}</button>`
|
|
51
|
+
+ `<button type="button" class="pm-btn primary" data-tc-act="keep" aria-label="${esc(`Keep ${c.a.title} first and keep the reason`)}" title="Keep this order">${svg(ICON.keep)}</button></div>`
|
|
52
|
+
+ `<p class="tc-err" role="alert" hidden></p></div>`;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** A drag that put one row directly above another: [moved, the row now under it], else null. */
|
|
56
|
+
export function movedPair(before, after) {
|
|
57
|
+
if (!Array.isArray(before) || !Array.isArray(after) || before.length !== after.length) return null;
|
|
58
|
+
for (const id of after) {
|
|
59
|
+
const b = before.filter((x) => x !== id), a = after.filter((x) => x !== id);
|
|
60
|
+
if (b.join('\n') !== a.join('\n')) continue;
|
|
61
|
+
const from = before.indexOf(id), to = after.indexOf(id);
|
|
62
|
+
if (to < from && to + 1 < after.length) return [id, after[to + 1]];
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** The pairs to draw in one list: ids in the order on screen. pairs: the close ones ({ a: { id }, b: { id } }); drag: [x, y] | null. */
|
|
68
|
+
export function shownPairs(ids, pairs, drag) {
|
|
69
|
+
const next = (x, y) => { const i = ids.indexOf(x), j = ids.indexOf(y); return i >= 0 && j >= 0 && Math.abs(i - j) === 1; };
|
|
70
|
+
const out = [];
|
|
71
|
+
for (const p of pairs || []) if (next(p.a.id, p.b.id)) out.push([p.a.id, p.b.id]);
|
|
72
|
+
if (drag && next(drag[0], drag[1]) && !out.some((p) => p.includes(drag[0]) && p.includes(drag[1]))) out.push(drag);
|
|
73
|
+
return out.map((p) => (ids.indexOf(p[0]) < ids.indexOf(p[1]) ? p : [p[1], p[0]]));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* ── the page (Work) ── */
|
|
77
|
+
const CSS = new URL('./tradeoff-cards.css', import.meta.url).href;
|
|
78
|
+
let DATA = { key: '', at: 0, answer: null }, DRAG = null, LAST = {}, BODY = null, WS = '', BUSY = false;
|
|
79
|
+
const http = () => import('./http.js');
|
|
80
|
+
|
|
81
|
+
/** Work's toast (#bdToast, the page's dark pill); with `undo`, its Undo button. */
|
|
82
|
+
let toastT = null;
|
|
83
|
+
function say(msg, undo) {
|
|
84
|
+
const t = typeof document !== 'undefined' && document.getElementById('bdToast');
|
|
85
|
+
if (!t) return;
|
|
86
|
+
t.innerHTML = `<span>${esc(msg)}</span>${undo ? '<button type="button" class="bd-undo">Undo</button>' : ''}`; t.hidden = false;
|
|
87
|
+
const u = t.querySelector('.bd-undo'); if (u) u.onclick = () => { u.disabled = true; t.hidden = true; undo(); };
|
|
88
|
+
clearTimeout(toastT); toastT = setTimeout(() => { t.hidden = true; }, undo ? 10000 : 5000);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
async function answer(ids) {
|
|
92
|
+
const key = ids.slice().sort().join(',');
|
|
93
|
+
if (DATA.key === key && DATA.answer && Date.now() - DATA.at < 30000) return DATA.answer;
|
|
94
|
+
const { pmGet } = await http();
|
|
95
|
+
const r = await pmGet('/api/tradeoffs?ids=' + encodeURIComponent(ids.join(','))).catch(() => null);
|
|
96
|
+
DATA = { key, at: Date.now(), answer: r && r.ok ? r : { pairs: [], kept: {} } };
|
|
97
|
+
return DATA.answer;
|
|
98
|
+
}
|
|
99
|
+
const CSS_ESC = (s) => String(s).replace(/["\\]/g, '\\$&');
|
|
100
|
+
const titleIn = (body, id) => { const r = body.querySelector(`[data-po-id="${CSS_ESC(id)}"]`); return (r && r.textContent.trim().split('\n')[0].slice(0, 80)) || id; };
|
|
101
|
+
|
|
102
|
+
/** After Work draws its stage track: the lines between close neighbours and the kept reasons under their rows. */
|
|
103
|
+
export async function decorate(body) {
|
|
104
|
+
if (typeof document === 'undefined' || !body || body.dataset.view !== 'track') return;
|
|
105
|
+
BODY = body;
|
|
106
|
+
if (!document.querySelector(`link[href="${CSS}"]`)) { const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = CSS; document.head.appendChild(l); }
|
|
107
|
+
const lists = [...body.querySelectorAll('[data-po-list^="@"]')];
|
|
108
|
+
const ids = [...new Set(lists.flatMap((l) => [...l.children].filter((x) => x.dataset && x.dataset.poId).map((x) => x.dataset.poId)))];
|
|
109
|
+
if (!ids.length) return;
|
|
110
|
+
const A = await answer(ids);
|
|
111
|
+
if (BODY !== body || !body.isConnected) return;
|
|
112
|
+
WS = A.ws || '';
|
|
113
|
+
BUSY = true;
|
|
114
|
+
try {
|
|
115
|
+
body.querySelectorAll('.tc-line, .tc-kept').forEach((x) => x.remove());
|
|
116
|
+
const byId = {};
|
|
117
|
+
for (const p of A.pairs || []) { byId[p.a.id] = p.a; byId[p.b.id] = p.b; }
|
|
118
|
+
for (const list of lists) {
|
|
119
|
+
const rows = [...list.children].filter((x) => x.dataset && x.dataset.poId);
|
|
120
|
+
const L = rows.map((r) => r.dataset.poId);
|
|
121
|
+
LAST[list.dataset.poList] = L;
|
|
122
|
+
for (const [x, y] of shownPairs(L, A.pairs, DRAG)) {
|
|
123
|
+
rows[L.indexOf(x)].insertAdjacentHTML('afterend', lineHtml(byId[x] || { id: x, title: titleIn(body, x) }, byId[y] || { id: y, title: titleIn(body, y) }));
|
|
124
|
+
}
|
|
125
|
+
for (const r of rows) { const k = (A.kept || {})[r.dataset.poId]; if (k) r.insertAdjacentHTML('afterend', keptHtml(k)); }
|
|
126
|
+
}
|
|
127
|
+
// each line is a real <button> (keyboard and role come with it); its press opens the card
|
|
128
|
+
for (const b of body.querySelectorAll('.tc-open')) b.onclick = (e) => { e.stopPropagation(); openCard(WS, b.dataset.tcA, b.dataset.tcB, b); };
|
|
129
|
+
} finally { BUSY = false; }
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** Work only (#ibBody): each time the page draws its rows again, the cards follow. Home imports pm/sort-order.js too and has no #ibBody. */
|
|
133
|
+
function start() {
|
|
134
|
+
const body = document.getElementById('ibBody');
|
|
135
|
+
if (!body || body.dataset.tcOn) return;
|
|
136
|
+
body.dataset.tcOn = '1';
|
|
137
|
+
let T = null;
|
|
138
|
+
new MutationObserver(() => { if (BUSY) return; clearTimeout(T); T = setTimeout(() => decorate(body), 60); }).observe(body, { childList: true });
|
|
139
|
+
// pm/sort-order.js moveIn tells which list the PM reordered: a row put directly above another shows the line for that pair
|
|
140
|
+
window.addEventListener('pmos:order-moved', (e) => { const d = e.detail || {}; const p = movedPair(LAST[d.list] || [], d.ids || []); if (p) DRAG = p; });
|
|
141
|
+
decorate(body);
|
|
142
|
+
}
|
|
143
|
+
if (typeof document !== 'undefined' && typeof MutationObserver === 'function') {
|
|
144
|
+
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start); else start();
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
let OPEN = null;
|
|
148
|
+
function closeCard() { if (!OPEN) return; const f = OPEN.from; OPEN.el.remove(); OPEN = null; if (f && f.isConnected) f.focus(); }
|
|
149
|
+
|
|
150
|
+
export async function openCard(ws, a, b, from) {
|
|
151
|
+
const { pmGet, pmPost } = await http();
|
|
152
|
+
const fromPairs = ((DATA.answer && DATA.answer.pairs) || []).find((p) => p.a.id === a && p.b.id === b);
|
|
153
|
+
const c = fromPairs || await pmGet(`/api/tradeoffs/card?ws=${encodeURIComponent(ws)}&a=${encodeURIComponent(a)}&b=${encodeURIComponent(b)}`).then((r) => (r && r.ok ? r.card : null)).catch(() => null);
|
|
154
|
+
if (!c) { say('The two could not be read.'); return; }
|
|
155
|
+
closeCard();
|
|
156
|
+
const el = document.createElement('div');
|
|
157
|
+
el.className = 'tc-scrim pm-ds'; // the design system's parts (komorebi.css scopes .pm-btn and .pm-input under .pm-ds)
|
|
158
|
+
el.innerHTML = cardHtml(c, { compare: typeof window.pmosCompare === 'function' });
|
|
159
|
+
document.body.appendChild(el);
|
|
160
|
+
OPEN = { el, from };
|
|
161
|
+
const why = el.querySelector('#tcWhy');
|
|
162
|
+
why.focus();
|
|
163
|
+
const err = (t) => { const p = el.querySelector('.tc-err'); p.textContent = t; p.hidden = !t; };
|
|
164
|
+
const keep = async (first) => {
|
|
165
|
+
const reason = why.value.trim();
|
|
166
|
+
if (!reason) { err('Write why in one line: it is kept with the list.'); why.focus(); return; }
|
|
167
|
+
const r = await pmPost('/api/tradeoffs/keep', { ws, a: c.a.id, b: c.b.id, first, reason }).catch(() => null);
|
|
168
|
+
if (!r || !r.ok) { err((r && r.error) || 'The reason was not kept.'); return; }
|
|
169
|
+
closeCard();
|
|
170
|
+
DATA.at = 0; DRAG = null;
|
|
171
|
+
const n = r.note, other = n.first === c.a.id ? c.b.title : c.a.title;
|
|
172
|
+
say(`Kept above ${other}: ${n.reason}`, async () => { await pmPost('/api/tradeoffs/undo', { ws, note: n.eid }).catch(() => null); DATA.at = 0; if (BODY) decorate(BODY); });
|
|
173
|
+
if (BODY) decorate(BODY);
|
|
174
|
+
};
|
|
175
|
+
el.onclick = (e) => { if (e.target === el) closeCard(); }; // the scrim: a press outside the card closes it
|
|
176
|
+
for (const b of el.querySelectorAll('[data-tc-act]')) b.onclick = () => {
|
|
177
|
+
const act = b.dataset.tcAct;
|
|
178
|
+
if (act === 'close') closeCard();
|
|
179
|
+
else if (act === 'compare') { closeCard(); window.pmosCompare(ws, c.a.id, c.b.id); }
|
|
180
|
+
else keep(act === 'swap' ? c.b.id : c.a.id);
|
|
181
|
+
};
|
|
182
|
+
el.addEventListener('keydown', (e) => { if (e.key === 'Escape') { e.stopPropagation(); closeCard(); } else if (e.key === 'Enter' && e.target === why) keep(c.a.id); });
|
|
183
|
+
}
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
<link rel="stylesheet" href="/pm/cozy-board.css" />
|
|
25
25
|
<link rel="stylesheet" href="/pm/changed-mark.css" />
|
|
26
26
|
<link rel="stylesheet" href="/pm/load-shapes.css" />
|
|
27
|
+
<link rel="stylesheet" href="/pm/page-one-answer.css" />
|
|
27
28
|
<link rel="stylesheet" href="/pm/bd-pin-card.css" />
|
|
28
29
|
<link rel="stylesheet" href="/pm/cozy-panel.css" />
|
|
29
30
|
<link rel="stylesheet" href="/pm/bd-work.css" />
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
<link rel="stylesheet" href="/pm/cozy-panel.css" />
|
|
33
33
|
<link rel="stylesheet" href="/pm/cozy-onboard.css" />
|
|
34
34
|
<link rel="stylesheet" href="/pm/load-shapes.css" />
|
|
35
|
+
<link rel="stylesheet" href="/pm/page-one-answer.css" />
|
|
35
36
|
<link rel="stylesheet" href="/pm/brand.css" />
|
|
36
37
|
<link rel="stylesheet" href="/pm/charts.css" />
|
|
37
38
|
<link rel="stylesheet" href="/pm/komorebi.css" />
|
package/workspace/run-tests.js
CHANGED
|
@@ -119,7 +119,13 @@ const group = args.find((a) => !a.startsWith('--'));
|
|
|
119
119
|
const TIMINGS_FILE = path.join(DIR, 'test-timings.json');
|
|
120
120
|
let TIMINGS = {};
|
|
121
121
|
try { TIMINGS = JSON.parse(fs.readFileSync(TIMINGS_FILE, 'utf8')).seconds || {}; } catch { /* no CI timings yet: the seconds keys decide */ }
|
|
122
|
-
|
|
122
|
+
// A suite with no CI time yet (it landed after the last refresh) weighs the median of its own group's known times, not a flat 10 s:
|
|
123
|
+
// 10 s is ten times a typical module suite and half a typical browser suite, so a few new suites skewed the --plan shard count and
|
|
124
|
+
// the split (ci-dynamic-shards C1). The next timings refresh replaces the guess with the real time.
|
|
125
|
+
const BROWSER_SET = new Set(GROUPS.browser);
|
|
126
|
+
const medianOf = (list) => { const v = list.map((f) => Number(TIMINGS[f])).filter((n) => n > 0).sort((a, b) => a - b); return v.length ? v[v.length >> 1] : 10; };
|
|
127
|
+
const FALLBACK = { browser: medianOf(GROUPS.browser), unit: medianOf(GROUPS.unit) };
|
|
128
|
+
const secs = (f) => Number(TIMINGS[f]) || Number((FILES.seconds || {})[f]) || FALLBACK[BROWSER_SET.has(f) ? 'browser' : 'unit'];
|
|
123
129
|
// Slowest first, so a long suite never starts last and holds the run open on its own.
|
|
124
130
|
const bySlowest = (list) => list.map((f, k) => ({ f, k })).sort((a, b) => secs(b.f) - secs(a.f) || a.k - b.k).map((x) => x.f);
|
|
125
131
|
|
|
@@ -951,6 +957,8 @@ function check() {
|
|
|
951
957
|
if (problems.length) { for (const p of problems) console.error(`✗ ${p}`); process.exitCode = 1; return; }
|
|
952
958
|
const frags = fs.existsSync(FRAG_DIR) ? fs.readdirSync(FRAG_DIR).filter((n) => n.endsWith('.json')).length : 0;
|
|
953
959
|
console.log(`✓ ${listed.size} suites listed, each once, each on disk; ${onDisk.filter((f) => !ELSEWHERE[f]).length} suites on disk, all listed; shards partition every group; ${frags} fragment(s) in test-lists/.`);
|
|
960
|
+
const untimed = GROUPS.all.filter((f) => !(Number(TIMINGS[f]) > 0));
|
|
961
|
+
if (untimed.length) console.log(` ${untimed.length} suite(s) have no CI time yet and weigh their group's median (browser ${FALLBACK.browser} s, unit ${FALLBACK.unit} s) until the next timings refresh: ${untimed.join(', ')}`);
|
|
954
962
|
}
|
|
955
963
|
|
|
956
964
|
// The suites' fixtures name the PM `wawan` (pm:wawan, human:wawan). The workspace now derives its PM's name (lib/pm-slug.js), so a
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "critical-moved (bet A103): a Today row when a task on an initiative's critical path moves (lib/critical-needs.js, a needs provider). Pure; no browser, no server.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"critical-needs.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"critical-needs.test.js": 1
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Every page opens with one answer (initiative page-one-answer, done test P1-P6, N1, N2): the pure sentence, the Work/Board, initiative and Today answers, the block, the one-call check and pmos pages calls on a scratch runtime folder. No server, browser, model or network.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"page-one-answer.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"page-one-answer.test.js": 1
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "review-pack (job #1910, A343): the monthly product review pack: lib/review-pack.js drafts it from the product's records, Library › Reports shows it (pm/review-pack.js). No browser, no network.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"review-pack.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"review-pack.test.js": 2
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "initiative sim-users (job #1909, idea A20): simulated users walk each prototype version's key tasks once per persona; Findings above the design (lib/sim-users.js, lib/routes-lab.js findings and personas, lib/prototype-cli.js, pm/sim-users.js). Pure, scratch folders, the route handler with a stand-in ctx.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"test/sim-users.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"test/sim-users.test.js": 1
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Optional time on a task's start and due (Wawan 2026-11-25, initiative task-time-optional, done test planning/done-tests/task-time-optional.md T1-T7): the task-time line and its fold, the edit route's start_time and due_time, the items carrying them, the picker's time row and the date words. A scratch repository; no server, network or browser.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"task-time.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"task-time.test.js": 4
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Who waits on which team (initiative team-waits, bet A364, done test W1-W8, N1, N2): the store and the initiative notes, pmos deps, the Dependencies tab's block, the Chase draft and GET /api/team-waits. Fixture repos; no browser, model or network.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"team-waits.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"team-waits.test.js": 1
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Trade-off cards (initiative tradeoff-cards, job #1918, idea A325; done test T1-T9, N1-N3): close Roadmap pairs, the two sides, the ✦, keep and undo with the notes ledger, the routes in process on scratch repositories, pmos tradeoff, the page part's markup. No server, browser, model or network.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"tradeoff-cards.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"tradeoff-cards.test.js": 6
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -18,14 +18,19 @@
|
|
|
18
18
|
"agent-inbox.test.js": 1,
|
|
19
19
|
"agent-team.test.js": 1,
|
|
20
20
|
"ai-guard.test.js": 1,
|
|
21
|
+
"answer-cache.test.js": 4.9,
|
|
21
22
|
"anthropic-key.test.js": 1,
|
|
23
|
+
"approver-memory.test.js": 0.1,
|
|
22
24
|
"artefacts-menu.test.js": 1,
|
|
23
25
|
"artefacts.test.js": 1,
|
|
24
26
|
"ask-cards.test.js": 1,
|
|
27
|
+
"ask-here.test.js": 0.1,
|
|
25
28
|
"auto-sync.test.js": 7,
|
|
26
29
|
"autonomy.test.js": 1,
|
|
30
|
+
"away-handover.test.js": 0.3,
|
|
27
31
|
"back-place.test.js": 1,
|
|
28
32
|
"backlog.test.js": 1,
|
|
33
|
+
"balance-meter.test.js": 0.1,
|
|
29
34
|
"bg-queue.test.js": 1,
|
|
30
35
|
"blueprint.test.js": 1,
|
|
31
36
|
"board-cli.test.js": 3,
|
|
@@ -86,6 +91,8 @@
|
|
|
86
91
|
"calendar-tidy.test.js": 1,
|
|
87
92
|
"calm-timeline-test.js": 18,
|
|
88
93
|
"capacity-governor.test.js": 1,
|
|
94
|
+
"capture-file.test.js": 2.8,
|
|
95
|
+
"capture-words.test.js": 0.1,
|
|
89
96
|
"capture.test.js": 1,
|
|
90
97
|
"card-catalog-gen.test.js": 1,
|
|
91
98
|
"card-catalog.test.js": 1,
|
|
@@ -110,6 +117,8 @@
|
|
|
110
117
|
"claude-readiness.test.js": 1,
|
|
111
118
|
"claude-signin.test.js": 1,
|
|
112
119
|
"closed-not-late.test.js": 1,
|
|
120
|
+
"code-map.test.js": 2.6,
|
|
121
|
+
"connector-data.test.js": 0.1,
|
|
113
122
|
"connectors-directory.test.js": 1,
|
|
114
123
|
"context-use.test.js": 1,
|
|
115
124
|
"core-docs-server.test.js": 10,
|
|
@@ -150,6 +159,7 @@
|
|
|
150
159
|
"doc-reads.test.js": 1,
|
|
151
160
|
"doc-sync.test.js": 1,
|
|
152
161
|
"docs-cli.test.js": 5,
|
|
162
|
+
"does-alone.test.js": 0.1,
|
|
153
163
|
"draft-keep.test.js": 1,
|
|
154
164
|
"drift.test.js": 1,
|
|
155
165
|
"driver-server.test.js": 9,
|
|
@@ -160,10 +170,12 @@
|
|
|
160
170
|
"events-place.test.js": 1,
|
|
161
171
|
"events-view.test.mjs": 1,
|
|
162
172
|
"everywhere-lib.test.js": 1,
|
|
173
|
+
"experiment-power.test.js": 0.1,
|
|
163
174
|
"extension.test.js": 2,
|
|
164
175
|
"external-linking.test.js": 1,
|
|
165
176
|
"factory-checks.test.js": 9,
|
|
166
177
|
"factory-fleet.test.js": 12,
|
|
178
|
+
"factory-floor.test.js": 0.2,
|
|
167
179
|
"factory-guardrail.test.js": 2,
|
|
168
180
|
"factory-identity.test.js": 5,
|
|
169
181
|
"factory-join.test.js": 1,
|
|
@@ -171,6 +183,7 @@
|
|
|
171
183
|
"factory-real-run.test.js": 20,
|
|
172
184
|
"factory-review.test.js": 2,
|
|
173
185
|
"factory-traces.test.js": 1,
|
|
186
|
+
"features-verbs.test.js": 0.1,
|
|
174
187
|
"features.test.js": 1,
|
|
175
188
|
"find-browser.test.js": 1,
|
|
176
189
|
"first-reveal.test.js": 8,
|
|
@@ -201,7 +214,9 @@
|
|
|
201
214
|
"harness-incremental.test.js": 1,
|
|
202
215
|
"headless.test.js": 5,
|
|
203
216
|
"health.test.js": 1,
|
|
217
|
+
"hire-draft.test.js": 0.1,
|
|
204
218
|
"hold-spans.test.js": 1,
|
|
219
|
+
"hold-to-talk.test.js": 0.1,
|
|
205
220
|
"home-day.test.js": 1,
|
|
206
221
|
"home-libs.test.js": 1,
|
|
207
222
|
"home-need.test.mjs": 1,
|
|
@@ -255,6 +270,7 @@
|
|
|
255
270
|
"job-graph.test.js": 1,
|
|
256
271
|
"jobs-to-be-done.test.js": 1,
|
|
257
272
|
"kg.test.js": 2,
|
|
273
|
+
"kill-check.test.js": 0.1,
|
|
258
274
|
"kind-of-work.test.js": 1,
|
|
259
275
|
"kind-scope.test.js": 8,
|
|
260
276
|
"kind-workflows.test.js": 15,
|
|
@@ -303,6 +319,7 @@
|
|
|
303
319
|
"moments.test.js": 1,
|
|
304
320
|
"morning-goals.test.js": 1,
|
|
305
321
|
"my-work.test.js": 8,
|
|
322
|
+
"name-links.test.js": 0.1,
|
|
306
323
|
"needs-overdue.test.js": 1,
|
|
307
324
|
"never-wait.test.js": 1,
|
|
308
325
|
"news-viewers-test.js": 11,
|
|
@@ -528,6 +545,8 @@
|
|
|
528
545
|
"report-source-check-shim.test.js": 27,
|
|
529
546
|
"report-structure-server.test.js": 17,
|
|
530
547
|
"report-template-cadence.test.js": 1,
|
|
548
|
+
"report-translate.test.js": 0.1,
|
|
549
|
+
"report-variants.test.js": 0.1,
|
|
531
550
|
"rollover-reason.test.js": 1,
|
|
532
551
|
"roomier-phone-chat.test.js": 1,
|
|
533
552
|
"routes-board.test.js": 1,
|
|
@@ -583,6 +602,7 @@
|
|
|
583
602
|
"stage-card-test.js": 41,
|
|
584
603
|
"stage-everywhere.test.js": 1,
|
|
585
604
|
"stage-line.test.js": 1,
|
|
605
|
+
"stage-signoffs.test.js": 3.1,
|
|
586
606
|
"stage-tools.test.js": 1,
|
|
587
607
|
"standing-rules.test.js": 1,
|
|
588
608
|
"star-direct.test.js": 1,
|
|
@@ -622,11 +642,13 @@
|
|
|
622
642
|
"test/press-release.test.js": 1,
|
|
623
643
|
"ticket-acceptance.test.js": 1,
|
|
624
644
|
"ticket-dry-run.test.js": 1,
|
|
645
|
+
"time-box-pick.test.js": 0.1,
|
|
625
646
|
"timeline-holds-test.js": 17,
|
|
626
647
|
"tk-model.test.js": 1,
|
|
627
648
|
"tk-tasks-test.js": 24,
|
|
628
649
|
"today-goals-jobs.test.js": 1,
|
|
629
650
|
"today-log.test.js": 1,
|
|
651
|
+
"today-order.test.js": 0.1,
|
|
630
652
|
"today.test.js": 3,
|
|
631
653
|
"tour.test.js": 1,
|
|
632
654
|
"tracker-date-wait.test.js": 2,
|
|
@@ -638,6 +660,7 @@
|
|
|
638
660
|
"tracker-sync-take.test.js": 1,
|
|
639
661
|
"transcript-resumed-folder.test.js": 1,
|
|
640
662
|
"trends-review.test.js": 1,
|
|
663
|
+
"try-evidence.test.js": 0.3,
|
|
641
664
|
"try-it.test.js": 1,
|
|
642
665
|
"typesafe-local.test.js": 1,
|
|
643
666
|
"typesafe-validation.test.js": 2,
|
|
@@ -651,6 +674,7 @@
|
|
|
651
674
|
"vv-settle.test.js": 1,
|
|
652
675
|
"vw-ds.test.js": 1,
|
|
653
676
|
"waiting-on.test.js": 1,
|
|
677
|
+
"week-went.test.js": 0.1,
|
|
654
678
|
"win-hide.test.js": 1,
|
|
655
679
|
"windows-start.test.js": 1,
|
|
656
680
|
"work-agent.test.js": 5,
|
|
@@ -668,6 +692,7 @@
|
|
|
668
692
|
"workflows-model.test.js": 1,
|
|
669
693
|
"workflows-setup-test.js": 80,
|
|
670
694
|
"worktree-gc.test.js": 3,
|
|
695
|
+
"worth-it.test.js": 0.1,
|
|
671
696
|
"your-move-today.test.js": 1,
|
|
672
697
|
"your-move.test.js": 1
|
|
673
698
|
}
|