create-pmos 0.557.0 → 0.559.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.
Files changed (52) hide show
  1. package/package.json +27 -81
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-adddoc-test.js +8 -6
  7. package/workspace/changelog.json +26 -0
  8. package/workspace/fixtures/board-premium-facts.js +2 -12
  9. package/workspace/guide/initiatives-and-next-steps.md +18 -2
  10. package/workspace/guide/programs.md +2 -2
  11. package/workspace/lib/board-premium.js +5 -23
  12. package/workspace/lib/core-docs-needs.js +12 -16
  13. package/workspace/lib/core-docs.js +27 -214
  14. package/workspace/lib/coredoc-cli.js +6 -6
  15. package/workspace/lib/custom-docs.js +3 -1
  16. package/workspace/lib/initiative-cli.js +4 -4
  17. package/workspace/lib/initiative-premium.js +1 -1
  18. package/workspace/lib/initiative-writer.js +28 -4
  19. package/workspace/lib/job-graph.js +2 -2
  20. package/workspace/lib/refresh.js +2 -2
  21. package/workspace/lib/route-modules.js +0 -1
  22. package/workspace/lib/routes-board-premium.js +5 -11
  23. package/workspace/lib/routes-boards.js +5 -4
  24. package/workspace/lib/routes-core-docs.js +23 -113
  25. package/workspace/lib/routes-custom-docs.js +8 -6
  26. package/workspace/lib/routes-initiatives.js +12 -0
  27. package/workspace/lib/routes-intake.js +6 -2
  28. package/workspace/lib/work-kind.js +48 -0
  29. package/workspace/package-lock.json +2 -2
  30. package/workspace/package.json +1 -1
  31. package/workspace/premium-core-doc-issue-test.js +11 -18
  32. package/workspace/public/pm/bd-acts.js +5 -77
  33. package/workspace/public/pm/bd-asks.js +16 -10
  34. package/workspace/public/pm/bd-ini-panel.js +11 -1
  35. package/workspace/public/pm/bd-next.js +14 -4
  36. package/workspace/public/pm/bd-prog.js +4 -5
  37. package/workspace/public/pm/bd-views.js +7 -58
  38. package/workspace/public/pm/cozy-board.css +12 -24
  39. package/workspace/public/pm/cozy-viewer.js +11 -5
  40. package/workspace/public/pm/home-app.js +2 -3
  41. package/workspace/public/pm/home-ini.js +10 -1
  42. package/workspace/public/pm/ini-agent.js +40 -8
  43. package/workspace/public/pm/ini-view-model.js +1 -1
  44. package/workspace/public/pm/premium-board.js +9 -26
  45. package/workspace/public/pm/premium-shell.js +3 -33
  46. package/workspace/public/pm/prog-page.js +1 -1
  47. package/workspace/public/pm/work-kind.js +82 -0
  48. package/workspace/ready-dash-ui-test.js +1 -1
  49. package/workspace/server.js +3 -12
  50. package/workspace/test-files.json +1 -1
  51. package/workspace/test-lists/uncovered-board.json +1 -1
  52. package/workspace/lib/routes-board-docs.js +0 -46
@@ -1,5 +1,5 @@
1
1
  /* pm/bd-acts.js — the Board's presses and the panels and popovers around them (initiative premium-uncovered-features, Board: BdActions, BdFilter,
2
- * BdSprint, BdPanel, BdDocs; built on premium-agreed-design's plain versions, whose function each designed one keeps). The routes are the ones the
2
+ * BdSprint, BdPanel; built on premium-agreed-design's plain versions, whose function each designed one keeps). The routes are the ones the
3
3
  * console presses, behind the launch nonce:
4
4
  * a row's actions (BdActions) the stage presses of the initiative's ⋯ (pm/ini-more.js, batch 14 item 5; open.more): Move to a stage (the next
5
5
  * with how much of the step is ready), Back to <prev> (asks why), Hold, Resume, Cancel (asks why, the same chips as
@@ -12,12 +12,10 @@
12
12
  * Sprints and releases (BdSprint) the chip's popover: the Jira sprints, the releases, the backlog; a release opens its panel (work-items done, days
13
13
  * left, the initiatives it carries, your sign-off, the backlog preview). Sprint moves are proposals that go to Home.
14
14
  * A metric's trend (BdPanel) a chip's popover: the count week by week where the records allow it, "Show only …" and Insights
15
- * Documents (BdDocs) a document's panel: kind and initiative, who changed it and when, its health, a PRD that changed after the push,
16
- * its edit log (GET /api/board-docs), Open in Home, Compare with Jira, Issue it for a draft (POST /api/core-docs/issue),
17
- * and its text (GET /api/doc). Add a document POST /api/custom-docs/add; Draft it POST /api/core-docs/draft.
15
+ * (The document panel, BdDocs, with Add a document, Issue it and Draft it on a board document, is gone: board documents are retired,
16
+ * feedback batch 29 item 8.)
18
17
  * Metrics, Notifications the board's measures (GET /api/board-metrics-premium) and what waits on you here
19
18
  * Nothing here invents a value: what a record does not hold is not drawn. */
20
- import { followDoc } from './doc-follow.js';
21
19
  import { pmPost } from './http.js';
22
20
  import { $, $$, esc } from './premium-shell.js';
23
21
  import * as Pop from './bd-pop.js';
@@ -44,7 +42,7 @@ const dayIso = (n) => { const t = new Date(Date.now() + n * 86400000); return t.
44
42
  const plural = (n, a, b) => (n === 1 ? a : b);
45
43
  const cap = (s) => (s ? s.charAt(0).toUpperCase() + s.slice(1) : '');
46
44
 
47
- let A = null; // the page: { M(), load(), say(msg, undo?), panel(html, from, cls), close(), redraw(), F, rowOf(key), statusOf(r), openIni(r), openTicket(ini, tk), askHref(r, q), pageHref(r), trail(r), docMeta(path, ws), loadDocMeta([{ path, ws }]), viewDoc(path) }
45
+ let A = null; // the page: { M(), load(), say(msg, undo?), panel(html, from, cls), close(), redraw(), F, rowOf(key), statusOf(r), openIni(r), openTicket(ini, tk), askHref(r, q), pageHref(r), trail(r), viewDoc(path) }
48
46
  export function init(api) { A = api; Pins.init(api); }
49
47
  const M = () => A.M();
50
48
  const post = (p, body) => pmPost(p, { ws: M().board.ws, ...body });
@@ -274,55 +272,6 @@ function trendHtml(k) {
274
272
  }
275
273
  function openTrend(k, from) { if (TREND[k]) Pop.open(trendHtml(k), from, { label: TREND[k][1] + ' trend', width: 330, cls: 'bd-trend' }); }
276
274
 
277
- /* ── Documents (BdDocs) ───────────────────────────────────────────────────────────────────────────────────────── */
278
- let docOpen = null;
279
- export const docSel = () => docOpen;
280
- function docById(id) { return V.docRows().find((x) => V.docId(x) === id) || null; }
281
- async function openDocPanel(id, from) {
282
- const x = docById(id); if (!x) return;
283
- docOpen = id;
284
- const meta = x.path ? A.docMeta(x.path, x.ws) : null, h = V.healthOf(x), d = x.d || {};
285
- const eye = (x.src === 'core' ? 'Board document' : x.kind) + ' · ' + (x.src === 'core' ? d.product || M().board.name || 'Board' : x.ini.title);
286
- const sub = x.src === 'core' ? [d.by, d.cadence].filter(Boolean).join(' · ') : meta ? [meta.by, meta.changed].filter(Boolean).join(' · ') : '';
287
- const home = x.src === 'ini' ? A.pageHref(x.ini) : null;
288
- const tools = home ? `<a class="bd-ib" href="${esc(home)}" aria-label="Open in Home" title="Open in Home">${SV(I.ext)}</a>` : '';
289
- let box = '';
290
- if (x.parts) { const dn = x.parts.filter((p) => p.done), miss = x.parts.filter((p) => !p.done).map((p) => cap(p.name)); box = `<div class="bd-box"><div class="bd-boxh"><b>${dn.length} of ${x.parts.length} parts</b><span class="bd-amut">Health</span></div>${V.barHtml({ pct: Math.round((dn.length / x.parts.length) * 100), count: true, label: dn.length + ' of ' + x.parts.length + ' parts' })}${miss.length ? `<p class="sm">Missing: ${esc(miss.join(' · '))}</p>` : ''}</div>`; }
291
- else box = `<div class="bd-box"><div class="bd-boxh"><b>${esc(h.text)}</b><span class="bd-amut">Health</span></div>${x.src === 'core' && d.what ? `<p class="sm">${esc(d.what)}</p>` : ''}</div>`;
292
- const drift = x.drift && x.drift.length ? `<div class="bd-warn sm">The PRD changed after the tickets were pushed. ${esc(x.drift.join(', '))} may not match.</div>` : '';
293
- const draft = x.src === 'core' && d.st === 'draft' && d.slot;
294
- const issue = x.src === 'core' && d.path ? (draft ? `<div class="bd-issue" data-issue-bar="draft"><span>A draft. Nothing is sent: issuing marks it issued and sends nothing to anyone.</span><button type="button" class="bd-btn solid" data-act="issue" data-key="${esc(d.key)}"${d.ws ? ` data-ws="${esc(d.ws)}"` : ''}>Issue it</button></div>` : `<div class="bd-issue done" data-issue-bar="done"><span>${esc(d.state || 'Issued')}. Nothing was sent to anyone.</span></div>`) : '';
295
- const log = meta && meta.log && meta.log.length ? `<p class="bd-lbl">Edit log</p>${meta.log.map((l) => `<div class="bd-trow sm">${V.avatar(l.by, 'b')}<span class="bd-push0">${esc(l.subject)}</span><span class="bd-amut">${esc(l.at)}</span></div>`).join('')}` : x.path ? '<p class="bd-amut" id="dlogW">Reading the edit log…</p>' : '';
296
- const cmp = x.drift && x.drift.length ? `<a class="bd-btn" href="${esc(A.askHref(x.ini, 'What changed in the PRD after ' + x.drift.join(', ') + ' ' + (x.drift.length === 1 ? 'was' : 'were') + ' pushed? Compare it with Jira.'))}">Compare with Jira</a>` : '';
297
- const foot = home || cmp ? `<div class="bd-arow bd-pfoot">${home ? `<a class="bd-btn solid" href="${esc(home)}">Open in Home</a>` : ''}${cmp}</div>` : '';
298
- const text = x.path ? `<details class="bd-read"${x.src === 'core' ? ' open' : ''}><summary>Read it</summary><p class="bd-amut">${esc(x.path)}</p><pre class="bd-doc" id="cdText">Reading the document…</pre></details>` : '';
299
- panel(x.title, `${issue}${msg('formM')}${box}${drift}${log}${text}${foot}`, from, { eye, sub, tools, cls: 'pk-doc' });
300
- A.redraw();
301
- if (x.path) {
302
- if (!meta) { await A.loadDocMeta([{ path: x.path, ws: x.ws }]); const m2 = A.docMeta(x.path, x.ws), w = $('#dlogW'); if (w && docOpen === id) w.outerHTML = m2 && m2.log ? `<p class="bd-lbl">Edit log</p>${m2.log.map((l) => `<div class="bd-trow sm">${V.avatar(l.by, 'b')}<span class="bd-push0">${esc(l.subject)}</span><span class="bd-amut">${esc(l.at)}</span></div>`).join('')}` : '<p class="bd-amut">No edit is in the git history yet.</p>'; }
303
- // the text follows the file: a chat's edit shows within a few seconds, uncommitted, from the initiative's worktree (pm/doc-follow.js)
304
- const shown = () => { const el = $('#cdText'); return !!el && el.isConnected && docOpen === id; };
305
- followDoc({ ws: x.ws || M().board.ws || '', ini: x.src === 'ini' && x.ini ? x.ini.id : '', path: x.path, alive: shown,
306
- onText: (t) => { const el = $('#cdText'); if (el && docOpen === id) el.textContent = t == null ? x.path + ' could not be read.' : t; } });
307
- }
308
- }
309
- /** A board document by its key; with All products, by its key and its product's workspace (two products can hold the same key). */
310
- const coreDoc = (key, ws) => { const D = M().docs || {}; return (D.rows || []).find((x) => x.key === key && (!ws || x.ws === ws)) || null; };
311
- async function issueDoc(key, btn) {
312
- const D = M().docs || {}, d = coreDoc(key, btn.dataset.ws); if (!d) return;
313
- const r = await press(btn, $('#formM'), () => post('/api/core-docs/issue', { ...(d.ws ? { ws: d.ws } : {}), scope: d.scope || D.scope, key: d.key, slot: d.slot }));
314
- if (!r) return;
315
- A.say('Issued. Nothing was sent to anyone.'); await A.load(); openDocPanel(V.docId({ src: 'core', d }), null);
316
- }
317
- /** Add a document: a board document written by you or drafted by PMOS, kept in PMOS or linked to a page elsewhere (POST /api/custom-docs/add).
318
- * PMOS saves the title and the address on the board's record; it does not read or sync the linked page. */
319
- const DKINDS = ['In PMOS', 'Confluence', 'Google Docs', 'Google Slides'];
320
- const radios = (name, L, cur) => `<div class="bd-rad" role="radiogroup">${L.map(([v, l]) => `<label><input type="radio" name="${name}" value="${esc(v)}"${v === cur ? ' checked' : ''}><span>${esc(l)}</span></label>`).join('')}</div>`;
321
- function openAddDoc(from) {
322
- panel('Add a document', `<form class="bd-form" data-form="adddoc"><label>Title<input name="title" maxlength="80" placeholder="For example: UAT plan"></label><p class="bd-albl">Who writes it</p>${radios('writer', [['drafts', 'PMOS drafts it'], ['you', 'I write it']], 'drafts')}<label>Where it lives<select name="kind">${DKINDS.map((k) => `<option>${k}</option>`).join('')}</select></label><label>Address<input name="url" maxlength="300" placeholder="https://" disabled></label><p class="bd-amut">It is saved on the board's record. PMOS does not read or sync a linked page.</p>${msg('formM')}<div class="bd-arow"><button type="submit" class="bd-btn solid">Add</button><button type="button" class="bd-btn" data-pk="close">Not now</button></div></form>`, from, { eye: 'Documents' });
323
- const f = $('#czViewer form[data-form="adddoc"]'); if (f) f.kind.onchange = () => { f.url.disabled = f.kind.value === 'In PMOS'; };
324
- }
325
-
326
275
  /** The Next cell's arrow (pm/bd-next.js): Move to the next stage, as the ⋯ menu's Move to does, with its Undo. */
327
276
  export function moveNext(r, btn) { const a = r.acts || {}, cur = (a.stages || []).indexOf(a.stage); if (cur >= 0 && a.stages[cur + 1]) runRow(r, 'mv:' + (cur + 1), btn); }
328
277
  /* ── a hold on the timeline (feedback batch 9 item 8, XtiA2Hold): the ⏸ press ─────────────────────────────────────────────── */
@@ -366,8 +315,7 @@ async function setBack(r, input) {
366
315
  await done(res, 'On hold · ' + r.title + ' · back ' + md(day(v)), async () => { const u = await lifeBack(r, p); A.say(u && u.ok ? r.title + ' is back as it was.' : errOf(u)); await A.load(); });
367
316
  }
368
317
 
369
- export const open = { more: moreAct, hold: openHold, new: (from) => Asks.openNew(from), asks: (from) => Asks.openAsks(from), sprint: openSprint, find: openFind, filter: openFilter, gone: (from) => openGone(from, 'all'), trend: openTrend, release: openRelease, doc: openDocPanel };
370
- export const closeDoc = () => { docOpen = null; };
318
+ export const open = { more: moreAct, hold: openHold, new: (from) => Asks.openNew(from), asks: (from) => Asks.openAsks(from), sprint: openSprint, find: openFind, filter: openFilter, gone: (from) => openGone(from, 'all'), trend: openTrend, release: openRelease };
371
319
 
372
320
  /* ── the presses ─────────────────────────────────────────────────────────────────────────────────────────────── */
373
321
  document.addEventListener('change', (e) => { const f = e.target.closest && e.target.closest('[data-holdback]'); if (!f || !A || !M()) return; const r = A.rowOf(f.dataset.holdback); if (r) setBack(r, f); });
@@ -391,29 +339,9 @@ document.addEventListener('click', async (e) => {
391
339
  const hz = t.closest('[data-hold]'); if (hz) { const r = A.rowOf(hz.dataset.hold); if (r) openHold(r, +hz.dataset.i, hz); return; }
392
340
  const hg = t.closest('[data-holdgo]'); if (hg) { const r = A.rowOf(hg.dataset.id); if (r) runHold(r, hg.dataset.holdgo, hg); return; }
393
341
  const ra = t.closest('[data-rowact]'); if (ra) { const r = A.rowOf(ra.dataset.id); if (r) runRow(r, ra.dataset.rowact, ra); return; }
394
- const od = t.closest('[data-opendoc]'); if (od) { openDocPanel(od.dataset.opendoc, od); return; }
395
342
  const b = t.closest('[data-act]'); if (!b) return;
396
343
  const k = b.dataset.act;
397
344
  if (k === 'gone') { openGone(b, 'all'); return; }
398
345
  if (k === 'ini') { const r = A.rowOf(b.dataset.id); Pop.close(false); if (r && A.openIni) A.openIni(r); return; }
399
346
  if (k === 'asks') { Pop.close(false); Asks.openAsks($('#chAsks') || b); return; }
400
- if (k === 'adddoc') { openAddDoc(b); return; }
401
- if (k === 'issue') { issueDoc(b.dataset.key, b); return; }
402
- if (k === 'draft') {
403
- b.disabled = true;
404
- const d = coreDoc(b.dataset.key, b.dataset.ws);
405
- const r = await pmPost('/api/core-docs/draft', { ws: (d && d.ws) || M().board.ws, scope: (d && d.scope) || M().docs.scope, key: b.dataset.key }).catch(() => null);
406
- if (r && r.ok) { A.say('The agent is drafting it. It lands as a draft for you to review; nothing is sent.'); await A.load(); } else { b.disabled = false; A.say(errOf(r)); }
407
- }
408
- });
409
- document.addEventListener('submit', async (e) => {
410
- const f = e.target.closest('form[data-form="adddoc"]'); if (!f || !A) return;
411
- e.preventDefault();
412
- const m = $('#formM'), go = f.querySelector('[type="submit"]'), val = (n) => (f.elements[n] ? String(f.elements[n].value || '').trim() : '');
413
- const title = val('title'), kd = val('kind'), url = val('url'), writer = (f.querySelector('input[name="writer"]:checked') || {}).value || 'drafts';
414
- if (!title) { m.textContent = 'Give the document a title.'; return; }
415
- if (kd !== 'In PMOS' && !url) { m.textContent = 'Paste the address of the ' + kd + ' page, or choose In PMOS.'; return; }
416
- const body = { scope: M().docs.scope, title, writer, ...(kd !== 'In PMOS' ? { kind: kd, url } : {}) };
417
- const res = await press(go, m, () => post('/api/custom-docs/add', body));
418
- if (res) { A.close(); A.say('“' + title + '” is added to the board\'s documents.'); await A.load(); }
419
347
  });
@@ -3,8 +3,9 @@
3
3
  * the kind PMOS suggests, its anchor, the initiative it is close to and an earlier rejection. Accept to Triage
4
4
  * POST /api/boards/asks/accept (Undo archives what it made); Add to <initiative> and Decline POST /api/boards/asks/decline
5
5
  * with the reason. An ask the record gives two products for sits under "Not sure which product".
6
- * New initiative (BdNew) the side panel: name, why, material (links and files), no lane field (PMOS leans on the intake draft and names the
7
- * kind in Triage), what it counts toward, the product. A name close to an earlier rejection or to an open initiative
6
+ * New initiative (BdNew) the side panel: name, why, material (links and files), the kind of work (batch 29 item 11: Product, Full SDLC or
7
+ * Project; PMOS pre-picks it from the name until the PM taps one), no lane field (PMOS leans on the intake draft), what it
8
+ * counts toward, the product. A name close to an earlier rejection or to an open initiative
8
9
  * says so. Create: POST /api/boards/asks/add then /asks/accept (it starts in the first stage), then POST /api/board-grill/start
9
10
  * and POST /api/proposals/look (Claude looks for it elsewhere; batch 12 item 4)
10
11
  * and /file for the material.
@@ -15,7 +16,8 @@ import { pmPost } from './http.js';
15
16
  import { $, $$, esc } from './premium-shell.js';
16
17
  import * as Pop from './bd-pop.js';
17
18
  import { avatar } from './bd-views.js';
18
- import { adler } from './cozy-adler.js'; // Adler heads the New asks (batch 17 item 4-A, canvas AdM2 New asks)
19
+ import { adler } from './cozy-adler.js';
20
+ import * as WK from './work-kind.js'; // the kind of work on New initiative (batch 29 item 11) // Adler heads the New asks (batch 17 item 4-A, canvas AdM2 New asks)
19
21
 
20
22
  let A = null; // the page: { M(), load(), say(msg, undo?), panel(html, from, cls), close(), rowOf(key), openIni(r), openDoc(path), anchors(ws, board), programs(), reloadPrograms() }
21
23
  export function init(api) { A = api; }
@@ -122,10 +124,8 @@ function materialChips() {
122
124
  return N.links.map((k, i) => `<span class="bd-chip sm">${SV(I.link)}${esc(k.label)}<button type="button" class="bd-x0" data-rmlink="${i}" aria-label="Remove ${esc(k.label)}">${SV(I.x)}</button></span>`).join('')
123
125
  + N.files.map((f, i) => `<span class="bd-chip sm">${SV(I.file)}${esc(f.name)}<button type="button" class="bd-x0" data-rmfile="${i}" aria-label="Remove ${esc(f.name)}">${SV(I.x)}</button></span>`).join('');
124
126
  }
125
- function kindBox() {
126
- // D99: Kind becomes Workflow. Every workflow starts in Triage, and PMOS names the workflow from the BRD (WfTriage)
127
- return `<b>Workflow · PMOS works it out</b><span>No need to choose now. It starts in ${esc(firstStage())}, and PMOS names the workflow (Product feature, or one you made) once the BRD makes it clear. It tells you why, and you can change it.</span><span class="bd-amut">Now: Product feature, until the BRD says otherwise</span>`;
128
- }
127
+ /** Kind of work (batch 29 item 11, KdA/KdAP): the pill switch with its caption, and the ✦ line while the pick is PMOS's from the name. */
128
+ const kindBox = () => WK.segHtml(N.kind, N.kindBy === 'pmos');
129
129
  function hintsHtml() {
130
130
  const p = N.prior && N.prior[0] && !N.ack ? `<div class="bd-warn"><b>Close to something you declined</b><span>“${esc(N.prior[0].title)}” was set aside in ${esc(N.prior[0].file)}.</span><div class="bd-arow"><button type="button" class="bd-btn sm" data-newact="seewhy">See why</button><button type="button" class="bd-btn sm ghost" data-newact="ack">It is different</button></div></div>` : '';
131
131
  const c = N.close ? `<div class="bd-need">${SV(I.info)}<span>Also close to <button type="button" class="bd-dlink" data-newact="close">${esc(N.close.title)}</button> in ${esc(N.close.stage || 'its stage')}. Add to it instead?</span></div>` : '';
@@ -160,14 +160,16 @@ async function fillAnchors(ws, board, want) {
160
160
  document.addEventListener('change', (e) => { if (N && e.target.matches('form[data-form="new2"] select[name="product"]')) { const B = boardOfForm(e.target.form); if (B) fillAnchors(B.ws, B.board, ''); } });
161
161
  export async function openNew(from, ask) {
162
162
  const d = ask ? ask.draft || {} : {};
163
- N = { ask: ask || null, links: [], files: [], lean: d.lane || null, prior: ask ? ask.prior || [] : [], ack: false, close: null };
163
+ // kind: the one picked; kindBy: 'pmos' while PMOS's pre-pick from the name stands, 'you' once the PM taps one (then it never changes)
164
+ const dk = d.kind && WK.KINDS.includes(d.kind) && d.kind_cue ? d.kind : null;
165
+ N = { ask: ask || null, links: [], files: [], lean: d.lane || null, prior: ask ? ask.prior || [] : [], ack: false, close: null, kind: dk || 'product', kindBy: dk ? 'pmos' : null };
164
166
  const body = `<form class="bd-form bd-new" data-form="new2"${ask ? ` data-ask="${esc(ask.id)}"` : ''} novalidate>`
165
167
  + (ask ? `<p class="bd-quote">“${esc(ask.line)}”</p>` : '')
166
168
  + `<label class="bd-field">Name<input class="bd-inp" name="title" maxlength="120" value="${esc(d.title || '')}" placeholder="For example: Partner SSO audit trail" autocomplete="off"></label>`
167
169
  + `<label class="bd-field">Why<textarea class="bd-inp ta" name="why" rows="3" maxlength="400" placeholder="Who asks for it, and what it changes for them">${esc(ask ? ask.line : '')}</textarea></label>`
168
170
  + `<div class="bd-field"><span class="bd-flbl">Material · links or files</span><div class="bd-drop" id="nwDrop"><span class="bd-mchips" id="nwMat"></span><span class="bd-sp"></span><button type="button" class="bd-ib sm" data-newact="link" aria-label="Paste a link" title="Paste a link">${SV(I.link)}</button><button type="button" class="bd-ib sm" data-newact="file" aria-label="Upload a file" title="Upload a file">${SV(I.up)}</button><input type="file" id="nwFile" multiple hidden></div>`
169
171
  + `<div class="bd-linkin" id="nwLink" hidden><input class="bd-inp sm" name="link" maxlength="600" placeholder="https://" aria-label="A link"><button type="button" class="bd-btn sm" data-newact="addlink">Add</button></div><p class="bd-amut">Drop files here. PMOS reads them before it asks you anything.</p></div>`
170
- + `<div class="bd-box sm" id="nwKind">${kindBox()}</div>`
172
+ + `<div class="bd-field" id="nwKind">${kindBox()}</div>`
171
173
  + `<label class="bd-field">Counts toward<span id="anW"><select class="bd-inp" name="anchor" disabled><option>Reading the goals</option></select></span><span class="bd-amut">A goal, or a health budget for upkeep work.</span></label>`
172
174
  + productField(ask)
173
175
  + `<div id="nwHints">${hintsHtml()}</div><p class="bd-amsg" id="formM" role="status"></p>`
@@ -188,6 +190,8 @@ function lean(text) {
188
190
  const r = text.trim().length > 3 ? await pmPost('/api/intake/draft', { line: text.trim() }).catch(() => null) : null;
189
191
  if (!N) return;
190
192
  if (r && r.ok && r.draft) { N.lean = r.draft.lane || N.lean; if (!N.ask) N.prior = r.draft.prior_rejections || []; }
193
+ // PMOS's pre-pick follows the name until the PM taps a kind; a name that tells nothing goes back to Product with no ✦ line
194
+ if (N.kindBy !== 'you') { const cue = r && r.ok && r.draft && r.draft.kind_cue && WK.KINDS.includes(r.draft.kind); N.kind = cue ? r.draft.kind : 'product'; N.kindBy = cue ? 'pmos' : null; }
191
195
  const k = $('#nwKind'), h = $('#nwHints'); if (k) k.innerHTML = kindBox(); if (h) h.innerHTML = hintsHtml();
192
196
  }, 350);
193
197
  }
@@ -202,6 +206,8 @@ document.addEventListener('click', (e) => {
202
206
  if (!N) return;
203
207
  const rl = e.target.closest('[data-rmlink]'); if (rl) { N.links.splice(+rl.dataset.rmlink, 1); drawMat(); return; }
204
208
  const rf = e.target.closest('[data-rmfile]'); if (rf) { N.files.splice(+rf.dataset.rmfile, 1); drawMat(); return; }
209
+ const kb = e.target.closest('#nwKind [data-kind]');
210
+ if (kb) { N.kind = kb.dataset.kind; N.kindBy = 'you'; const k0 = $('#nwKind'); if (k0) { k0.innerHTML = kindBox(); const f = k0.querySelector(`[data-kind="${N.kind}"]`); if (f) f.focus(); } return; }
205
211
  const b = e.target.closest('[data-newact]'); if (!b) return;
206
212
  const k = b.dataset.newact;
207
213
  if (k === 'file') $('#nwFile').click();
@@ -229,7 +235,7 @@ document.addEventListener('submit', async (e) => {
229
235
  go.disabled = true; m.textContent = '';
230
236
  let ask = askId;
231
237
  if (!ask) { const r0 = await post('/api/boards/asks/add', { ws: B.ws, board: B.board, line: title, source: 'New initiative, typed by you' }).catch(() => null); if (!r0 || r0.ok !== true) { go.disabled = false; m.textContent = errOf(r0); return; } ask = r0.ask && r0.ask.id; }
232
- const res = await post('/api/boards/asks/accept', { ws: B.ws, board: B.board, ask, title, lane: N.lean || 'feature', anchor, ...(why ? { intent: why } : {}) }).catch(() => null);
238
+ const res = await post('/api/boards/asks/accept', { ws: B.ws, board: B.board, ask, title, lane: N.lean || 'feature', anchor, kind: WK.kindOf(N.kind), ...(why ? { intent: why } : {}) }).catch(() => null);
233
239
  if (!res || res.ok !== true) { go.disabled = false; m.textContent = errOf(res); return; }
234
240
  const id = res.initiative && res.initiative.id, stage = res.stage || firstStage(B);
235
241
  if (id) {
@@ -22,6 +22,7 @@
22
22
  * The rest sits on the thing it changes: the stage chip's picker moves the stage with the row menu's own presses (moreAct(r, k, btn), bd-acts.js);
23
23
  * Change workflow, Won't do and Archive are Home's (ini-wf.js). Discuss in chat takes the question to Home. */
24
24
  import * as TL from './ini-tail.js'; // the parts under Linked, Home's page draws them too (UI grill U1): drafted tickets, the PRD drift, Your impact
25
+ import * as WK from './work-kind.js'; // the kind of work in the header (batch 29 item 11, KdV1-3)
25
26
  import * as VW from './cozy-viewer.js';
26
27
  import * as SV from './small-vw.js'; // the one stakeholder form, Home's too (batch 18 item 2-C)
27
28
  import { esc } from './premium-shell.js';
@@ -260,7 +261,16 @@ export function openIni(r, from, o = {}) {
260
261
  // the same tile as Home's initiative page; no "Open in full": the header's expand already opens it wide (batch 14 item 5)
261
262
  VW.open({ kind: 'Initiative', title: r.title, icon: 'goal', wrap: true, id: vidOf(r),
262
263
  discuss: r.id ? true : () => location.assign(O.askHref(r, '')), more: () => iniMore(O.rowOf(r.key) || r), rename: O.rename ? O.rename(r) : null,
263
- presses: dashFor(r) ? dashFor(r).presses() : null, onPress: (a) => { const h = dashFor(O.rowOf(r.key) || r); if (a === 'dash' && h) h.toggle(); },
264
+ // the kind of work (batch 29 item 11, KdV1-3): its glyph stands before Discuss; a tap opens the three kinds. A published copy
265
+ // (pm/readonly.js) cannot change it, so it has no press: the Board's icon still names the kind
266
+ presses: (window.PMOS_READONLY ? [] : [WK.pressOf(r.kind)]).concat(dashFor(r) ? dashFor(r).presses() : []), onPress: (a, b) => {
267
+ const x = O.rowOf(r.key) || r, h = dashFor(x);
268
+ if (a === 'dash' && h) h.toggle();
269
+ else if (a === 'kind' && x.id) WK.pick(b, x.kind, (to) => WK.change({ pmPost, ws: where(x).ws, id: x.id, from: x.kind, to, toast: (t, u) => O.toast(t, u),
270
+ // the row shows the new kind at once (its icon, the Next words, the Experiment); the Board's read catches up in the background
271
+ apply: (k) => { const y = O.rowOf(r.key) || x; y.kind = k; VW.setPresses(vidOf(y), [WK.pressOf(k)].concat(dashFor(y) ? dashFor(y).presses() : [])); if (O.redraw) O.redraw(); refresh(true); },
272
+ reload: async () => { if (O.reload) await O.reload(); } }));
273
+ },
264
274
  render: (body) => { const x = O.rowOf(r.key) || r; cur = { key: x.key, tk: null }; O.onShow(x.key, from); body.innerHTML = iniBody(x); wire(body, x.key); { const h = dashFor(x); if (h) h.wire(body); } if (adding === x.key) { const f = body.querySelector('#ivAddTask'); if (f && document.activeElement !== f) f.focus(); } },
265
275
  onClose: () => { if (cur && cur.key === r.key && !cur.tk) { cur = null; O.onHide(); } } });
266
276
  }
@@ -6,12 +6,14 @@
6
6
  * machinery, not the PM's. Ticket and task counts stay: they are the team's work, read from Jira and the tasks.
7
7
  *
8
8
  * nextOf(r, ctx) → { who: claude | you | team, words, when, count, tone, title, act } | null PURE. ctx: { self (a PMOS-self board) }
9
+ * r.kind (batch 29 item 11) words PMOS's own steps: Product as below, Project as dates and chasing, Full SDLC's Build as its pull request
9
10
  * nextHtml(r, o) → the cell's markup. o: { self, icon (false on the phone), due (false in the List: Finish says the date) }
10
11
  *
11
12
  * The icon action stays only where PMOS does the step from the page (move the stage, add a stage task, link the epic, read Jira): a button with
12
13
  * data-nx (move | add | epic | jira) and data-nxrow (the row key); the page runs it. Nothing is invented: a step with no record behind it draws
13
14
  * nothing (zero is silence). */
14
- import { esc } from './premium-shell.js';
15
+ // its own esc (not premium-shell's): this file stays pure, so Node imports it (kind-of-work.test.js)
16
+ const esc = (v) => String(v == null ? '' : v).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
15
17
  import { sectionOf } from './ini-view-model.js';
16
18
 
17
19
  const PF = 'product-feature';
@@ -24,6 +26,12 @@ const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct
24
26
  const dm = (iso) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(iso || '')); return m ? +m[3] + ' ' + MON[+m[2] - 1] : ''; };
25
27
  // what Claude does with the parts of a step: the documents became the seven artefacts (D107); Claude writes them by itself
26
28
  const CLAUDE = { triage: 'PMOS writes the experiment', discover: 'PMOS writes the experiment', plan: 'PMOS writes the done test', prioritize: 'PMOS ranks it against its goal' };
29
+ // the kind of work (batch 29 item 11, KdBd): Product reads as above; Project's steps are dates and chasing; Full SDLC's Build is PMOS's pull request
30
+ const KIND_WORDS = {
31
+ project: { triage: 'PMOS writes the plan and its dates', discover: 'PMOS writes the plan and its dates', plan: 'PMOS sets the dates with the team', build: 'PMOS chases the team for the first update', monitor: 'PMOS writes the status line' },
32
+ sdlc: { build: 'PMOS builds the first pull request' },
33
+ };
34
+ const kindWords = (r, key) => { const w = KIND_WORDS[r && r.kind]; return (w && w[key]) || null; };
27
35
  const ANCHOR = 'PMOS anchors it to a goal';
28
36
  const OPEN_TK = ['In review', 'In progress', 'To do'];
29
37
  const CLOSED = new Set(['Done', "Won't do", 'Archived']);
@@ -74,16 +82,18 @@ export function nextOf(r, ctx = {}) {
74
82
  return moveLine(r, ctx, count);
75
83
  }
76
84
  const epic = (it.links && it.links.epic) || (r.epics || [])[0] || null;
85
+ // Full SDLC builds with PMOS's own pull requests (no Jira epic needed); Project chases the team until there are tickets
86
+ if (key === 'build' && !epic && kindWords(r, 'build')) return claude(kindWords(r, 'build'));
77
87
  return epic ? claude('PMOS reads Jira', { act: { kind: 'jira', label: 'Read Jira again for ' + epic } }) : claude('PMOS finds the Jira epic', { act: { kind: 'epic', label: 'Link the Jira epic' } });
78
88
  }
79
89
  const past = r.end && /^\d{4}-\d{2}-\d{2}/.test(r.end) && String(r.end).slice(0, 10) < new Date().toISOString().slice(0, 10);
80
90
  const due = (key === 'monitor' || key === 'evaluate') && r.end ? (past ? 'was due ' : 'due ') + dm(r.end) : '';
81
- if (key === 'monitor') return claude('PMOS reads the outcome', { when: due });
91
+ if (key === 'monitor') return claude(kindWords(r, 'monitor') || 'PMOS reads the outcome', { when: due });
82
92
  // the parts of the step: the trail's (the documents' headings, the tickets drafted), else what the model counts (Prioritize's anchor and rank)
83
93
  let parts = Array.isArray(it.parts) && it.parts.length ? it.parts : null;
84
94
  if (!parts && (key === 'plan' || key === 'prioritize')) parts = (t.segs || []).filter((s) => s.st === 'done' || s.st === 'to do').map((s) => ({ name: key === 'prioritize' && /^kr/i.test(s.name) ? 'KR or health budget' : s.name.toLowerCase(), done: s.st === 'done' }));
85
95
  if (key === 'evaluate' && (!parts || !parts.length || parts.some((p) => !p.done && isVerdict(p)) || parts.every((p) => p.done))) return yours('did it work?', { when: due });
86
- if (!parts || !parts.length) return CLAUDE[key] ? claude(CLAUDE[key]) : null;
96
+ if (!parts || !parts.length) return kindWords(r, key) ? claude(kindWords(r, key)) : CLAUDE[key] ? claude(CLAUDE[key]) : null;
87
97
  const open = parts.filter((p) => !p.done);
88
98
  if (!open.length) return moveLine(r, ctx, '');
89
99
  if (open.some(isVerdict)) return yours('did it work?', { when: due });
@@ -93,7 +103,7 @@ export function nextOf(r, ctx = {}) {
93
103
  if (open.some((p) => /^kr or health budget$/i.test(p.name))) return claude(ANCHOR);
94
104
  if (open[0] && /tickets/.test(open[0].name)) return claude('PMOS drafts the tickets');
95
105
  if (key === 'evaluate') return claude('PMOS writes the lessons', { when: due });
96
- return claude(CLAUDE[key] || 'PMOS writes the experiment');
106
+ return claude(kindWords(r, key) || CLAUDE[key] || 'PMOS writes the experiment');
97
107
  }
98
108
 
99
109
  const SPARK = 'M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z';
@@ -73,16 +73,15 @@ export function mergeBoards(list) {
73
73
  const m = b.model, product = (m.board && (m.board.product || m.board.name)) || b.name || b.ws;
74
74
  return (r) => ({ ...r, key: b.ws + '/' + r.key, ws: b.ws, boardId: b.id, product });
75
75
  };
76
- const rows = [], list2 = [], gone = { cancelled: [], archived: [] }, docs = [], asks = [];
76
+ const rows = [], list2 = [], gone = { cancelled: [], archived: [] }, asks = [];
77
77
  const sum = (f) => list.reduce((n, b) => n + (Number(f(b.model)) || 0), 0);
78
78
  for (const b of list) {
79
79
  const m = b.model, tag = tagged(b), I = m.initiatives || {}, G = I.gone || {};
80
80
  for (const r of m.rows || []) if (r.id) rows.push(tag(r));
81
81
  for (const r of (I.list && I.list.rows) || []) list2.push(tag(r));
82
82
  gone.cancelled.push(...(G.cancelled || []).map(tag)); gone.archived.push(...(G.archived || []).map(tag));
83
- // each product's core documents and new asks, tagged with their product so a press goes to that product's board
84
- const pn = (m.board && (m.board.product || m.board.name)) || b.name || b.ws, own = { ws: b.ws, boardId: b.id, product: pn };
85
- for (const d of (m.docs && m.docs.rows) || []) docs.push({ ...d, ...own, scope: m.docs.scope || null });
83
+ // each product's new asks, tagged with their product so a press goes to that product's board
84
+ const pn = (m.board && (m.board.product || m.board.name)) || b.name || b.ws;
86
85
  for (const a of (m.asks && m.asks.rows) || []) asks.push({ ...a, ws: b.ws, boardId: b.id, forProduct: pn, stages: (m.board && m.board.stages) || [] });
87
86
  }
88
87
  // Jira: the oldest read of any product, so the chip never says fresher than the stalest board; unread while any product is unread
@@ -98,7 +97,7 @@ export function mergeBoards(list) {
98
97
  header: { ...home.header, missing },
99
98
  board: { ...home.board, all: true, name: 'All products', product: '', self: false, id: null, ws: null, products: list.map((b) => ({ ws: b.ws, id: b.id, name: (b.model.board && (b.model.board.product || b.model.board.name)) || b.name, self: !!(b.model.board && b.model.board.self), stages: (b.model.board && b.model.board.stages) || [], readAt: (b.model.jira || {}).readAt || null })) },
100
99
  initiatives: { ...I, open: n('open'), on: n('on'), risk: n('risk'), late: n('late'), hold: n('hold'), total: n('total'), cap: null, note: '', list: { rows: list2, total: list2.length }, gone, stages: [], timeline: I.timeline },
101
- sprint: null, release: null, docs: { cap: '', rows: docs, counts: { all: docs.length, none: 0, draft: 0, ok: 0 }, scope: null, missing: list.some((b) => b.model.docs && b.model.docs.missing) },
100
+ sprint: null, release: null,
102
101
  steps: steps.map((st, i) => ({ ...st, count: sum((m) => m.steps && m.steps[i] && m.steps[i].count) })),
103
102
  workflows: mergeWorkflows(list.map((b) => b.model.workflows || [])),
104
103
  jira: { ...(home.jira || {}), readAt, sprint: null, release: null, sprints: [], backlog: [] },
@@ -1,14 +1,14 @@
1
- /* pm/bd-views.js — the Board's List and By stage views, the phone list and the Documents tab (initiative premium-uncovered-features, Board:
2
- * BdList, BdByStage, BdPhone, BdDocs). Markup from the page's model; the presses go back to the page (premium-board.js) through data- attributes.
1
+ /* pm/bd-views.js — the Board's List and By stage views and the phone list (initiative premium-uncovered-features, Board:
2
+ * BdList, BdByStage, BdPhone). Markup from the page's model; the presses go back to the page (premium-board.js) through data- attributes.
3
3
  * · List (BdList): one table, sorted by need (your turn, blocked, late, at risk, then by stage); a column title sorts by that column.
4
4
  * Monitor and Evaluate sit folded at the foot until "Show them". Each row has ⋯ for its actions (BdActions).
5
5
  * · By stage (BdByStage): one column per stage, a card per initiative; Monitor and Evaluate fold into strips when nothing in them needs
6
6
  * you, and a strip opens its column. A card is dragged to another column to move its stage (POST /api/boards/move, with Undo).
7
7
  * · the phone list (BdPhone): Your turn, At risk or late, On track.
8
- * · Documents (BdDocs): the board's core documents and the documents its initiatives link (PRD, rubric, evaluation, release notes), with
9
- * kind chips, health, when it changed and who changed it (GET /api/board-docs), and a row opens the document's panel.
8
+ * The Documents tab (BdDocs) is gone: batch 24 took it off the Board, and batch 29 item 8 retired the board documents it listed.
10
9
  * Nothing here invents a value: what no record holds is shown as "—" or not drawn. */
11
10
  import { nameHtml } from './split-merge.js'; // Claude suggests a split or a merge: the purple dot after the name (batch 11 item 14)
11
+ import * as WK from './work-kind.js'; // the kind of work before each title (batch 29 item 11, KdBd)
12
12
  import { esc } from './premium-shell.js';
13
13
  import * as WF from './bd-wf.js';
14
14
  import * as GL from './bd-goal.js'; // By goal in every view (batch 29 item 4): a goal's head over its rows
@@ -16,14 +16,13 @@ import { nextHtml } from './bd-next.js';
16
16
  import { stageName, stageChip } from './stage-chip.js'; // W1: the one stage
17
17
  import { provenStatus, NO_SIGNAL } from './status-proof.js'; // T3: a status renders only with its source and read time
18
18
 
19
- let A = null; // the page: { M(), statusOf(r), usual(t), trail(r), docMeta(path, ws), sel(), groups(L), folded(key), laneHead(g), subTile(name), memberIcon(id), programOf(r), programs(),
19
+ let A = null; // the page: { M(), statusOf(r), usual(t), trail(r), sel(), groups(L), folded(key), laneHead(g), subTile(name), memberIcon(id), programOf(r), programs(),
20
20
  // wf() → { list, cur, ended } the workflows on the board, the picked one (null for All) and the rows that ended (pm/bd-wf.js) }
21
21
  export function init(api) { A = api; }
22
22
  const M = () => A.M();
23
23
  const SV = (d) => `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
24
24
  const MORE = 'M5 12h.01M12 12h.01M19 12h.01';
25
25
  const cap = (s) => (s ? s.charAt(0).toUpperCase() + s.slice(1) : '');
26
- const plural = (n, a, b) => (n === 1 ? a : b);
27
26
  /** Two letters for an avatar: "Mei" stays "Mei", "Rizky" becomes "Ri", "you" becomes "W"-style initials of the name. */
28
27
  export const initials = (name) => { const s = String(name || '').trim(); if (!s) return ''; const p = s.split(/\s+/); return p.length > 1 ? (p[0][0] + p[1][0]).toUpperCase() : s.length <= 3 ? s : s.slice(0, 2); };
29
28
  export const avatar = (name, cls = '') => (name ? `<span class="bd-av${cls ? ' ' + cls : ''}" title="${esc(name)}" aria-label="${esc(name)}">${esc(initials(name))}</span>` : '<span class="bd-amut">—</span>');
@@ -84,7 +83,7 @@ function listRow(r, pg) {
84
83
  const p = pg ? progOf(r) : null, prod = pg ? r.product || A.product() : '';
85
84
  const pcells = pg ? `<span role="cell" class="bd-pt">${A.tileHtml(prod, 'bd-ti s')}<span class="bd-ell">${esc(prod)}</span></span><span role="cell" class="bd-pt">${p ? A.progTile('bd-pti s') + `<span class="bd-ell">${esc(p.title)}</span>` : ''}</span>` : '';
86
85
  return `<div class="bd-lt${sel ? ' sel' : ''}${r.acts && r.acts.life === 'hold' ? ' held' : ''}" role="row" data-row="${esc(r.key)}">`
87
- + `<button type="button" class="bd-ltn ini2" data-key="${esc(r.key)}" role="rowheader" aria-haspopup="dialog"><b>${nameHtml(r)}</b></button>${pcells}`
86
+ + `<button type="button" class="bd-ltn ini2" data-key="${esc(r.key)}" role="rowheader" aria-haspopup="dialog"><b>${WK.iconHtml(r.kind)}${nameHtml(r)}</b></button>${pcells}`
88
87
  + `<span role="cell" class="bd-wfn">${WF.wfIcon(WF.wfOf(r), 18)}<span class="bd-ell">${esc(WF.wfOf(r).name)}</span></span><span role="cell">${stageChip(r, { ms: (r.track || {}).ms })}${(r.track || {}).days ? ' <span class="bd-ell">' + (r.track || {}).days + 'd</span>' : ''}</span><span role="cell">${catPill(r)}</span>`
89
88
  + `<span role="cell" class="cs s-${s.tone}"><i class="cz-dot ${s.tone} ${s.mo || ''}"></i>${esc(s.text)}</span>`
90
89
  + `<span role="cell">${avatar(r.owner)}</span><span role="cell" class="bd-nxc">${nextHtml(r, { self: M().board.self, due: false })}</span>`
@@ -265,7 +264,7 @@ export function stagesHtml(L, o = {}) {
265
264
  function phoneRow(r) {
266
265
  const s = statusLine(r), t = r.track || {}, w = WF.stageOfRow(r);
267
266
  const sub = [stageName(r) || (w && w.name), t.you ? t.you.replace(/^Your /, 'your ') : s.tone !== 'ok' && s.tone !== 'q' ? s.text.toLowerCase() : '', r.owner].filter(Boolean).join(' · ');
268
- return `<button type="button" class="bd-lrow ini2${A.sel && A.sel() === r.key ? ' sel' : ''}" data-key="${esc(r.key)}" aria-haspopup="dialog"><i class="cz-dot ${s.tone} ${s.mo || ''}"></i><span class="tx"><span class="t">${nameHtml(r)}</span><span class="s${t.you ? '' : ' q'}">${esc(sub)}</span></span>${t.you && t.days != null ? `<span class="r">${t.days}d</span>` : ''}${many() ? WF.wfIcon(WF.wfOf(r), 18) : ''}</button>`;
267
+ return `<button type="button" class="bd-lrow ini2${A.sel && A.sel() === r.key ? ' sel' : ''}" data-key="${esc(r.key)}" aria-haspopup="dialog"><i class="cz-dot ${s.tone} ${s.mo || ''}"></i><span class="tx"><span class="t">${WK.iconHtml(r.kind)}${nameHtml(r)}</span><span class="s${t.you ? '' : ' q'}">${esc(sub)}</span></span>${t.you && t.days != null ? `<span class="r">${t.days}d</span>` : ''}${many() ? WF.wfIcon(WF.wfOf(r), 18) : ''}</button>`;
269
268
  }
270
269
  export function phoneListHtml(L) {
271
270
  const you = L.filter((r) => r.track && r.track.you), bad = L.filter((r) => !you.includes(r) && needOf(r) <= 3), left = L.filter((r) => !you.includes(r) && !bad.includes(r));
@@ -276,53 +275,3 @@ export function phoneListHtml(L) {
276
275
  if (!L.length) return '<p class="bt-empty">No initiative matches the chips or the filter.</p>';
277
276
  return `<div class="bd-plist">${grp('Your turn', you)}${grp('At risk or late', bad)}${grp('On track', rest)}${grp('No signal', none)}</div>`;
278
277
  }
279
-
280
- /* ── Documents (BdDocs) ───────────────────────────────────────────────────────────────────────────────────────── */
281
- let docKind = 'all';
282
- export function setDocKind(k) { docKind = k || 'all'; }
283
- const DOC_IC = { PRD: 'M7 3h7l5 5v13H7zM14 3v5h5', BRD: 'M7 3h7l5 5v13H7zM14 3v5h5', Rubric: 'M5 12l5 5 9-10', Evaluation: 'M5 20V11M12 20V5M19 20v-6', 'Release notes': 'M4 5h16v14H4zM8 9h8M8 13h5', Board: 'M4 4h16v16H4zM4 9h16M9 9v11' };
284
- const ST_TONE = { ok: 'ok', draft: 'y', stale: 'w', due: 'w', missing: '', linked: '' };
285
- /** Every document the tab lists: the initiatives' own (from the trail's links) and the board's core documents. */
286
- export function docRows() {
287
- const out = [], seen = new Set(), m = M();
288
- for (const r of m.initiatives.list.rows) {
289
- const T = A.trail(r), L = (T && T.links) || {};
290
- const add = (kind, label, path, extra = {}) => { const id = (r.ws ? r.ws + ':' : '') + path; if (!path || seen.has(id)) return; seen.add(id); out.push({ src: 'ini', kind, title: label, path, ini: r, ws, ...extra }); };
291
- const drift = (T && T.drift) || [];
292
- const parts = r.track && r.track.key === 'discover' && T && Array.isArray(T.parts) ? T.parts : null;
293
- const ws = r.ws || m.board.ws || '';
294
- add('PRD', L.prdVersion ? 'PRD v' + String(L.prdVersion).replace(/^v/i, '') : 'PRD', L.prd, { drift, parts });
295
- add('Rubric', 'Rubric', L.rubric); add('Evaluation', 'Evaluation', L.evaluation); add('Release notes', 'Release notes' + (r.release ? ' ' + r.release.name : ''), L.notes, { you: !!(r.track && r.track.you && r.track.key === 'deliver') });
296
- }
297
- for (const d of (m.docs && m.docs.rows) || []) out.push({ src: 'core', kind: 'Board', title: d.title, path: d.path || null, ws: d.ws || m.board.ws || '', d });
298
- return out;
299
- }
300
- /** A row's id: a core document by its key (its path appears only once drafted), an initiative's by its path. */
301
- export const docId = (x) => (x.src === 'core' ? 'core:' + (x.d.ws ? x.d.ws + '/' : '') + x.d.key : (x.ini && x.ini.ws ? x.ini.ws + ':' : '') + x.path);
302
- export function healthOf(x) {
303
- if (x.src === 'core') return { tone: ST_TONE[x.d.st] || '', text: x.d.state || '—' };
304
- if (x.drift && x.drift.length) return { tone: 'w', text: 'Changed after the push' };
305
- if (x.parts) { const d = x.parts.filter((p) => p.done).length; return { tone: d === x.parts.length ? 'ok' : '', text: d === x.parts.length ? 'Complete' : d + ' of ' + x.parts.length + ' parts' }; }
306
- if (x.you) return { tone: 'y', text: 'Waits on your sign-off' };
307
- return { tone: '', text: 'Linked' };
308
- }
309
- export function docsHtml() {
310
- const m = M(), D = m.docs || { rows: [] }, rows = docRows();
311
- const kinds = [...new Set(rows.map((x) => x.kind))];
312
- if (docKind !== 'all' && !kinds.includes(docKind)) docKind = 'all';
313
- const chips = `<div class="bd-dchips" role="group" aria-label="Kind">${[['all', 'All', rows.length]].concat(kinds.map((k) => [k, k, rows.filter((x) => x.kind === k).length])).map(([k, n, c]) => `<button type="button" class="bd-chip${docKind === k ? ' on' : ''}" data-dkind="${esc(k)}" aria-pressed="${docKind === k}">${esc(n)} ${c}</button>`).join('')}<span class="bd-sp"></span>${D.scope ? '<button type="button" class="bd-btn" id="addDoc" data-act="adddoc">Add a document</button>' : ''}</div>`;
314
- const shown = rows.filter((x) => docKind === 'all' || x.kind === docKind);
315
- if (!rows.length) return chips + `<p class="bd-amut">${D.missing ? 'The core documents could not be read, so none is shown.' : 'No document is on this board yet.'}</p>`;
316
- const sel = A.docSel ? A.docSel() : null;
317
- const row = (x) => {
318
- const h = healthOf(x), meta = x.path ? A.docMeta(x.path, x.ws) : null, d = x.d || {};
319
- const changed = x.src === 'core' ? d.when || d.added || '—' : meta && meta.changed ? meta.changed + (x.drift && x.drift.length ? ' · after the push' : '') : '—';
320
- const by = x.src === 'core' ? `<span class="bd-amut">${esc(d.by || '—')}</span>` : meta && meta.by ? avatar(meta.by, 'b') : '<span class="bd-amut">—</span>';
321
- const act = x.src === 'core' && d.act && d.act.kind === 'draft' ? `<button type="button" class="bd-btn sm" data-act="draft" data-key="${esc(d.key)}"${d.ws ? ` data-ws="${esc(d.ws)}"` : ''}${d.running ? ' disabled' : ''}>${d.running ? 'Drafting' : esc(d.act.label || 'Draft it')}</button>` : '';
322
- const id = docId(x);
323
- return `<div class="bd-dt${sel === id ? ' sel' : ''}" role="row" data-docrow="${esc(id)}"><span class="bd-dic" aria-hidden="true">${SV(DOC_IC[x.kind] || DOC_IC.PRD)}</span>`
324
- + `<button type="button" class="bd-dlink" role="rowheader" data-opendoc="${esc(id)}">${esc(x.title)}</button><span role="cell">${esc(x.src === 'core' ? d.product || m.board.name || 'Board' : x.ini.title)}</span>`
325
- + `<span role="cell"><span class="bd-pill${h.tone ? ' ' + h.tone : ''}">${esc(h.text)}</span></span><span role="cell" class="bd-amut">${esc(changed)}</span><span role="cell" class="bd-dby">${by}${act}</span></div>`;
326
- };
327
- return chips + `<div class="bd-dtw" role="table" aria-label="Documents"><div class="bd-dt h" role="row"><span></span><span role="columnheader">Document</span><span role="columnheader">Initiative</span><span role="columnheader">Health</span><span role="columnheader">Changed</span><span role="columnheader">By</span></div>${shown.map(row).join('')}</div>`;
328
- }
@@ -694,7 +694,6 @@ span.tg-end { left: var(--tl-x); cursor: default; } /* a shared board's milest
694
694
  .bd-amut { margin: 0; font-size: var(--fs-meta); color: var(--cz-ink3); line-height: var(--lh-meta); }
695
695
  .bd-amsg { margin: 0; min-height: 1em; font-size: var(--fs-meta); color: var(--cz-red); line-height: var(--lh-meta); }
696
696
  .bd-amsg:empty { display: none; }
697
- .bd-albl { margin: 6px 0 4px; font-size: var(--fs-label); font-weight: var(--fw-strong); color: var(--cz-ink3); line-height: var(--lh-label); }
698
697
  .bd-asub { margin: 0; font-size: var(--fs-label); font-weight: var(--fw-strong); color: var(--cz-ink2); line-height: var(--lh-label); }
699
698
  .bd-quote { margin: 0; font-size: var(--fs-body); color: var(--cz-ink); background: var(--cz-well); border-radius: 12px; padding: 10px 12px; line-height: var(--lh-body); }
700
699
  .bd-pl { display: flex; flex-direction: column; gap: 10px; }
@@ -710,8 +709,7 @@ span.tg-end { left: var(--tl-x); cursor: default; } /* a shared board's milest
710
709
  .bd-form label em { font-style: normal; font-weight: var(--fw-strong); }
711
710
  .bd-form input:not([type="radio"]):not([type="checkbox"]), .bd-form select, .bd-form textarea { font: var(--fw-regular) var(--fs-meta)/var(--lh-meta) var(--cz-sans); color: var(--cz-ink); background: var(--cz-card); border: 1px solid var(--cz-hair); border-radius: 12px; padding: 8px 10px; min-height: 36px; width: 100%; }
712
711
  .bd-form input:focus-visible, .bd-form select:focus-visible, .bd-form textarea:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 1px; }
713
- .bd-rad, .bd-chks { display: flex; flex-direction: column; gap: 4px; }
714
- .bd-form .bd-rad label, .bd-chk { flex-direction: row; align-items: center; gap: 8px; font-size: var(--fs-label); font-weight: var(--fw-strong); color: var(--cz-ink2); cursor: pointer; display: flex; min-height: 28px; line-height: var(--lh-label); }
712
+ .bd-chk { flex-direction: row; align-items: center; gap: 8px; font-size: var(--fs-label); font-weight: var(--fw-strong); color: var(--cz-ink2); cursor: pointer; display: flex; min-height: 28px; line-height: var(--lh-label); }
715
713
  .bd-alist { display: flex; flex-direction: column; border-top: 1px solid var(--cz-hair); }
716
714
  .bd-ai { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 10px 4px; border-bottom: 1px solid var(--cz-hair); }
717
715
  .bd-ai:hover b { color: var(--cz-blueink); }
@@ -735,9 +733,6 @@ button.bd-lr:hover { background: var(--bd-row); }
735
733
  .bd-dlink { all: unset; cursor: pointer; font-weight: var(--fw-strong); color: var(--cz-ink); }
736
734
  .bd-dlink:hover { color: var(--cz-blueink); }
737
735
  .bd-dlink:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; border-radius: 4px; }
738
- .bd-issue { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 10px 12px; border-radius: 14px; background: var(--cz-bluebg); color: var(--cz-blueink); font-size: var(--fs-label); font-weight: var(--fw-strong); line-height: var(--lh-label); }
739
- .bd-issue.done { background: var(--cz-okbg); color: var(--cz-ok); }
740
- @media (max-width: 720px) { .bd-issue .bd-btn { min-height: 44px; } }
741
736
  .bd-dochd { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 10px; }
742
737
  .bd-dochd .bd-whead { margin: 0; }
743
738
  @media (max-width: 720px) { .bd-dochd .bd-btn { min-height: 44px; } }
@@ -776,7 +771,7 @@ button.bd-lr:hover { background: var(--bd-row); }
776
771
  .bd-lr, .bd-lr.doc { grid-template-columns: minmax(0, 1fr) auto; }
777
772
  .bd-dlink { min-height: 44px; display: inline-flex; align-items: center; }
778
773
  .bd-lr .st, .bd-lr .fin, .bd-lr .pth { display: none; }
779
- .bd-btn, .bd-ai, .bd-chk, .bd-form .bd-rad label { min-height: 44px; }
774
+ .bd-btn, .bd-ai, .bd-chk { min-height: 44px; }
780
775
  .bt-qt { margin-left: 0; }
781
776
  }
782
777
 
@@ -1015,17 +1010,6 @@ button.pk-jt:focus-visible { outline: 2px solid var(--cz-blue); outline-offset:
1015
1010
  .bd-strip span { writing-mode: vertical-rl; font-size: var(--fs-label); font-weight: var(--fw-strong); color: var(--cz-ink2); white-space: nowrap; line-height: var(--lh-label); }
1016
1011
  .bd-strip:hover { background: var(--cz-well2); }
1017
1012
  .bd-strip:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
1018
- /* Documents (BdDocs) */
1019
- .bd-dchips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
1020
- .bd-dtw { border: 1px solid var(--cz-hair); border-radius: 18px; overflow: hidden; background: var(--cz-card); }
1021
- .bd-dt { display: grid; grid-template-columns: 30px minmax(0, 1.5fr) minmax(0, 1.2fr) 170px 120px minmax(0, 160px); gap: 0 12px; align-items: center; min-height: 52px; padding: 0 14px; border-top: 1px solid var(--cz-hair); font-size: var(--fs-body); line-height: var(--lh-body); }
1022
- .bd-dt.h { border-top: 0; min-height: 40px; background: var(--cz-well); font-size: var(--fs-label); font-weight: var(--fw-strong); color: var(--cz-ink3); line-height: var(--lh-label); }
1023
- .bd-dt.sel { background: var(--cz-bluebg); }
1024
- .bd-dt > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1025
- .bd-dic { width: 30px; height: 30px; border-radius: 10px; background: var(--cz-well); display: inline-flex; align-items: center; justify-content: center; color: var(--cz-ink2); }
1026
- .bd-dic svg { width: 15px; height: 15px; }
1027
- .bd-dby { display: flex; align-items: center; gap: 8px; }
1028
- .bd-read summary { cursor: pointer; font: var(--fw-strong) var(--fs-label)/var(--lh-label) var(--cz-sans); color: var(--cz-ink2); padding: 4px 0; }
1029
1013
  /* the Sprint span (BdSpans) */
1030
1014
  .sp-cap { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: var(--fs-meta); color: var(--cz-ink3); line-height: var(--lh-meta); }
1031
1015
  .sp { border: 1px solid var(--cz-hair); border-radius: 18px; overflow: hidden; background: var(--cz-card); }
@@ -1075,8 +1059,6 @@ button.sp-n:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: -
1075
1059
  @media (max-width: 1200px) and (min-width: 721px) {
1076
1060
  .bd-lt { grid-template-columns: minmax(160px, 1.6fr) 120px minmax(100px, .9fr) minmax(120px, 1fr) 44px minmax(140px, 1.4fr) 70px 36px; }
1077
1061
  .bd-lt > :nth-child(4) { display: none; }
1078
- .bd-dt { grid-template-columns: 30px minmax(0, 1.5fr) minmax(0, 1fr) 150px 90px; }
1079
- .bd-dt > :nth-child(6) { display: none; }
1080
1062
  }
1081
1063
  @media (max-width: 720px) {
1082
1064
  .bd-pp.sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto !important; max-height: 82vh; border-radius: 28px 28px 0 0; padding: 10px 12px 24px; box-shadow: 0 -20px 50px -20px rgba(42,46,53,.35); }
@@ -1085,10 +1067,6 @@ button.sp-n:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: -
1085
1067
  .bd-scols.ph { flex-direction: column; overflow: visible; }
1086
1068
  .bd-scols.ph .bd-scol { min-height: 0; min-width: 0; }
1087
1069
  .bd-bc { min-height: 44px; }
1088
- .bd-dt { grid-template-columns: 30px minmax(0, 1fr) auto; min-height: 56px; }
1089
- .bd-dt > :nth-child(3), .bd-dt > :nth-child(5), .bd-dt > :nth-child(6) { display: none; }
1090
- .bd-dt.h { display: none; }
1091
- .bd-dchips { flex-wrap: nowrap; overflow-x: auto; }
1092
1070
  .bd-bk { grid-template-columns: 70px minmax(0, 1fr) auto; }
1093
1071
  .bd-bk > :nth-child(3), .bd-bk > :nth-child(4) { display: none; }
1094
1072
  .pk-dg { grid-template-columns: 1fr 1fr; }
@@ -1580,3 +1558,13 @@ span.tg-ng { cursor: default; }
1580
1558
  .bd-lt.gh { grid-template-columns: minmax(0, 1fr) auto; min-height: 50px; background: var(--bd-row); }
1581
1559
  .bd-ltw.pg .bd-lt.gh { grid-template-columns: minmax(0, 1fr) auto; }
1582
1560
  .bd-gln .bd-pti, .bd-glb .bd-pti { background: var(--bd-progbg); }
1561
+
1562
+ /* the kind of work (batch 29 item 11, KdA, KdAP, KdBd; pm/work-kind.js): New initiative's switch, its caption and ✦ line, and the Board's icon */
1563
+ .kd-cap { margin: 8px 2px 0; font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--cz-ink2); }
1564
+ .kd-cap b { font-weight: var(--fw-strong); color: var(--cz-ink); }
1565
+ .kd-lean { display: flex; gap: 6px; align-items: flex-start; margin: 8px 2px 0; font-size: var(--fs-label); line-height: var(--lh-label); color: var(--cz-blueink); }
1566
+ .kd-lean svg { flex: 0 0 auto; margin-top: 2px; }
1567
+ .kd-seg { display: flex; width: 100%; }
1568
+ .kd-seg > button:not(.bd-ib) { flex: 1 1 0%; justify-content: center; gap: 6px; height: 38px; }
1569
+ .kd-seg > button svg { flex: 0 0 auto; }
1570
+ .kd-g { display: inline-grid; vertical-align: -3px; margin-right: 6px; color: var(--cz-ink3); }