create-pmos 0.574.0 → 0.576.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 (69) hide show
  1. package/package.json +27 -27
  2. package/payload/AGENTS.md +35 -2
  3. package/payload/KIT-VERSION +1 -1
  4. package/payload/okf/core/templates/agent-eval-set-template.md +65 -0
  5. package/payload/okf/core/templates/index.md +1 -0
  6. package/payload/planning/evals/eval-calibration.md +1 -1
  7. package/payload/planning/okrs/health-budgets.md +1 -1
  8. package/payload/scripts/agent-eval-set.js +85 -0
  9. package/payload/scripts/factory-guardrail.js +50 -8
  10. package/payload/scripts/work-item.js +49 -3
  11. package/payload/scripts/workflow-state.js +28 -3
  12. package/payload/state/discoveries.md +1 -1
  13. package/payload/templates/pmos-guardrail.yml +38 -10
  14. package/payload/templates/pmos-review-check.yml +59 -0
  15. package/workspace/briefing-premium-calendar-3-test.js +3 -10
  16. package/workspace/changelog.json +26 -0
  17. package/workspace/fixtures/agenda/invites.json +73 -0
  18. package/workspace/fixtures/builder-bench.json +121 -0
  19. package/workspace/guide/cli.md +71 -4
  20. package/workspace/guide/notes.md +1 -1
  21. package/workspace/guide/settings-and-switches.md +6 -0
  22. package/workspace/lib/agenda-topics.js +401 -0
  23. package/workspace/lib/agent-team.js +5 -2
  24. package/workspace/lib/build-cli.js +119 -7
  25. package/workspace/lib/build-engine.js +106 -25
  26. package/workspace/lib/builder-bench.js +267 -0
  27. package/workspace/lib/engine/agent-eval-set.js +85 -0
  28. package/workspace/lib/engine/workflow-state.js +28 -3
  29. package/workspace/lib/factory-checks.js +117 -0
  30. package/workspace/lib/factory-ci.js +151 -0
  31. package/workspace/lib/factory-fleet.js +263 -0
  32. package/workspace/lib/factory-identity.js +182 -0
  33. package/workspace/lib/factory-lessons.js +183 -0
  34. package/workspace/lib/factory-needs.js +48 -0
  35. package/workspace/lib/factory-review.js +241 -0
  36. package/workspace/lib/factory-rollout.js +56 -10
  37. package/workspace/lib/factory-traces.js +229 -0
  38. package/workspace/lib/headless.js +11 -2
  39. package/workspace/lib/meeting-focus.js +26 -13
  40. package/workspace/lib/needs-providers.js +1 -0
  41. package/workspace/lib/pmos-verbs.js +1 -1
  42. package/workspace/lib/project-onboard.js +1 -1
  43. package/workspace/lib/proposals.js +3 -1
  44. package/workspace/lib/route-modules.js +1 -0
  45. package/workspace/lib/routes-factory-metrics.js +41 -0
  46. package/workspace/lib/routes-meeting-focus.js +79 -10
  47. package/workspace/lib/routes-proposals.js +9 -1
  48. package/workspace/lib/team-cli.js +2 -2
  49. package/workspace/lib/team-runs.js +13 -3
  50. package/workspace/lib/vendor/scripts/agent-eval-set.js +85 -0
  51. package/workspace/lib/vendor/scripts/workflow-state.js +28 -3
  52. package/workspace/lib/verify-runs.js +62 -1
  53. package/workspace/package-lock.json +2 -2
  54. package/workspace/package.json +1 -1
  55. package/workspace/public/pm/agenda-live.css +44 -0
  56. package/workspace/public/pm/agenda-live.js +100 -0
  57. package/workspace/public/pm/cozy-rec-now.js +20 -2
  58. package/workspace/public/pm/ini-props.js +1 -1
  59. package/workspace/public/pm/premium-vw-mtg.js +20 -21
  60. package/workspace/server.js +4 -0
  61. package/workspace/test-lists/adlc-identity.json +9 -0
  62. package/workspace/test-lists/build-engine.json +5 -3
  63. package/workspace/test-lists/builder-bench.json +9 -0
  64. package/workspace/test-lists/factory-checks.json +9 -0
  65. package/workspace/test-lists/factory-fleet.json +9 -0
  66. package/workspace/test-lists/factory-lessons.json +9 -0
  67. package/workspace/test-lists/factory-real-run.json +9 -0
  68. package/workspace/test-lists/factory-run-traces.json +9 -0
  69. package/workspace/test-lists/live-agenda-topics.json +7 -0
@@ -0,0 +1,100 @@
1
+ /* pm/agenda-live.js — a meeting's agenda as 3 to 5 topics (initiative live-agenda-topics, batch 30 item 3; boards MgD and MgRD).
2
+ *
3
+ * agendaHtml(A, { now? }) → string the agenda GET /api/meeting-focus answers as `agenda` (lib/agenda-topics.js liveModel): the end time and
4
+ * minutes left, "PMOS merged …" with Undo, then each topic. The open topic holds the Now card and its lines.
5
+ * nowSummary(A) → string "Add-on eligibility, in Subscribers and add-on" for a one-line summary; '' with no line on
6
+ * press(el, A, { ws? }) → Promise<{ ok, error?, said? } | null> a press inside the agenda: Undo (POST /api/meeting-focus/agenda) or Not this one
7
+ * (POST /api/meeting-focus/topic, action back). null when the press was not the agenda's.
8
+ * ensureCss() loads agenda-live.css once
9
+ *
10
+ * The Viewer's Agenda (premium-vw-mtg.js) and the recording tab's To cover (cozy-rec-now.js) both draw it, so they say the same minutes the same
11
+ * way: minutes used of minutes planned, amber when over, nothing at zero. There is no Change topic: PMOS follows the talk and the PM corrects it. */
12
+ import { pmPost } from './http.js';
13
+
14
+ const esc = (v) => String(v == null ? '' : v).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
15
+ const pad = (n) => String(n).padStart(2, '0');
16
+ const hm = (ms) => { const d = new Date(ms); return Number.isFinite(d.getTime()) ? pad(d.getHours()) + ':' + pad(d.getMinutes()) : ''; };
17
+ const svg = (d, n = 16, w = 1.9) => `<svg width="${n}" height="${n}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${w}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${d}"/></svg>`;
18
+ const P = { check: 'M5 12.5l4.5 4.5L19 7.5', undo: 'M9 14L4 9l5-5M4 9h10.5a5.5 5.5 0 0 1 0 11H11',
19
+ spark: 'M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z' };
20
+
21
+ export function ensureCss() {
22
+ if (typeof document === 'undefined' || document.querySelector('link[data-ag-css]')) return;
23
+ const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = new URL('./agenda-live.css', import.meta.url).href; l.setAttribute('data-ag-css', '');
24
+ document.head.appendChild(l);
25
+ }
26
+
27
+ const MARK = { now: '<i class="ndot"></i>', settled: svg(P.check, 16), open: '<i class="odot"></i>', notyet: '<i class="pdot"></i>', skipped: '<i class="pdot"></i>' };
28
+ const markHtml = (k, cls = '') => `<span class="mk${k === 'settled' ? ' ok' : ''}${cls}" aria-hidden="true">${MARK[k] || MARK.notyet}</span>`;
29
+ const WORD = { now: 'Now', settled: 'Settled', open: 'Talked, still open', notyet: 'Not yet', skipped: 'Skipped' };
30
+
31
+ function lineHtml(l) {
32
+ const small = l.mark === 'skipped' ? 'Skipped' : l.note;
33
+ return `<div class="mg-r ${l.mark === 'notyet' || l.mark === 'skipped' ? 'pl' : 'dn'}" data-mark="${esc(l.mark)}">${markHtml(l.mark)}`
34
+ + `<span class="tx"><span class="sr">${esc(WORD[l.mark] || '')}: </span>${esc(l.text)}${small ? `<small class="${l.mark === 'settled' ? 'ok' : ''}">${esc(small)}</small>` : ''}</span>`
35
+ + (l.say ? `<span class="t4${l.over ? ' ov' : ''}">${esc(l.say)}</span>` : '') + '</div>';
36
+ }
37
+ function nowCard(A) {
38
+ const N = A.now;
39
+ if (!N) return '';
40
+ const on = Math.round(N.onIt || 0);
41
+ const who = N.at ? (N.by === 'you' ? 'You moved here at ' : 'PMOS moved here at ') + hm(N.at) : '';
42
+ const ft = [N.onIt > 0 ? (on < 1 ? '<1' : on) + ' min on it' : '', who].filter(Boolean).join(' · ');
43
+ return `<div class="mg-now" aria-live="polite"><small>Now · line ${N.n} of ${N.of}</small><h4>${esc(N.text)}</h4>`
44
+ + (N.question ? `<p>${esc('Open: ' + N.question)}</p>` : '')
45
+ + `<div class="ft"><span>${esc(ft)}</span><span class="sp"></span><button type="button" class="mg-lk" data-ag="back">Not this one</button></div></div>`;
46
+ }
47
+ function topicHtml(A, t) {
48
+ const head = `<summary class="hr">${markHtml(t.mark)}<span class="tx"><b>${esc(t.title)}</b>${t.sub ? `<small>${esc(t.sub)}</small>` : ''}</span>`
49
+ + (t.say ? `<span class="t4${t.over ? ' ov' : ''}">${esc(t.say)}</span>` : '') + '</summary>';
50
+ const lines = t.lines.filter((l) => !l.now);
51
+ // a topic of one line is that line: nothing to unfold unless it is the open one
52
+ const body = (t.now ? nowCard(A) : '') + (t.lines.length > 1 || t.now ? lines.map(lineHtml).join('') : '');
53
+ return `<details class="mg-th${t.now ? ' now' : ''}" data-mark="${esc(t.mark)}"${t.now ? ' open' : ''}${body ? '' : ' data-one=""'}>${head}${body}</details>`;
54
+ }
55
+
56
+ /** The agenda's html. Silent at zero: no topics → ''. */
57
+ export function agendaHtml(A) {
58
+ if (!A || !Array.isArray(A.topics) || !A.topics.length) return '';
59
+ const h = ['<div class="mg" data-ag-root="">'];
60
+ const tm = [];
61
+ if (A.ends) tm.push(`<span>Ends <b>${esc(hm(A.ends))}</b>${A.live && A.left != null ? ` · <b>${A.left} min</b> left` : ''}</span>`);
62
+ if (A.live && A.plannedLeft != null) tm.push('<span class="sp"></span>', `<span>${A.plannedLeft} min planned for what is left</span>`);
63
+ if (tm.length) h.push(`<div class="mg-tm">${tm.join('')}</div>`);
64
+ if (A.merge) {
65
+ const M = A.merge;
66
+ h.push(`<div class="mg-pr"><span class="st">${svg(P.spark, 16, 1.7)}</span><div class="tx">PMOS merged the invite’s ${M.lines} lines into ${M.topics} topics${M.length ? ' for a ' + M.length + ' min meeting' : ''}. The lines stay under their topic.`
67
+ + (M.length ? '<small>Minutes are shared out by how many lines each topic holds</small>' : '')
68
+ + `</div><button type="button" data-ag="undo" aria-label="Undo the merge" title="Undo the merge">${svg(P.undo, 16)}</button></div>`);
69
+ }
70
+ for (const t of A.topics) h.push(topicHtml(A, t));
71
+ h.push('</div>');
72
+ return h.join('');
73
+ }
74
+
75
+ export function nowSummary(A) {
76
+ if (!A || !A.now) return '';
77
+ const t = A.topics[A.now.topic];
78
+ return A.now.text + (t && t.title !== A.now.text ? ', in ' + t.title : '');
79
+ }
80
+
81
+ /** A press inside the agenda. el = the pressed element (or one inside it). */
82
+ export async function press(el, A, { ws } = {}) {
83
+ const b = el && el.closest ? el.closest('[data-ag]') : null;
84
+ if (!b || !A) return null;
85
+ const ref = A.ref || {};
86
+ const where = ref.note ? { note: ref.note } : ref.event ? { event: ref.event, date: ref.date || '' } : null;
87
+ b.disabled = true;
88
+ try {
89
+ if (b.dataset.ag === 'undo') {
90
+ const r = await pmPost('/api/meeting-focus/agenda', { sig: A.sig, action: 'undo', ...(ws ? { ws } : {}) });
91
+ return r && r.ok ? { ok: true, said: 'Undone. Every line of the invite is its own topic again.' } : { ok: false, error: (r && r.error) || 'no answer' };
92
+ }
93
+ if (b.dataset.ag === 'back') {
94
+ if (!where || !A.now) return { ok: false, error: 'this meeting has no line on now' };
95
+ const r = await pmPost('/api/meeting-focus/topic', { ...where, action: 'back', topic: A.now.text, ...(ws ? { ws } : {}) });
96
+ return r && r.ok ? { ok: true, said: 'Moved back. PMOS keeps off that line for 5 minutes.' } : { ok: false, error: (r && r.error) || 'no answer' };
97
+ }
98
+ } finally { b.disabled = false; }
99
+ return null;
100
+ }
@@ -2,7 +2,8 @@
2
2
  * XrtA7Transcript, XrtA5PhoneRec on the main canvas).
3
3
  *
4
4
  * nowModel(F, one, { now? }) → Model pure: what the Now panel shows, from GET /api/meeting-focus (F) and GET /api/notes/one (one)
5
- * nowHtml(m, { room? }) → string To cover (or, in the room, the topic now big with chips), Raise now, Caught so far, the last answer
5
+ * nowHtml(m, { room? }) → string To cover (or, in the room, the topic now big with chips), Raise now, Caught so far, the last answer.
6
+ * To cover is the meeting's agenda in 3 to 5 topics (pm/agenda-live.js), the same as the Viewer's Agenda.
6
7
  * transcriptModel(one, { max? }) → [Line] pure: the live transcript, oldest first, with the highlight and decision marks
7
8
  * transcriptHtml(lines) → string the 420px card's feed
8
9
  * kindOf(text) → 'ask' | 'note' a line that ends with "?" asks Claude; anything else is kept as a note
@@ -15,6 +16,7 @@
15
16
  * redrawn on the tab's 'note', 'mode' and 'tick'. After a press, and every 3 s while Claude answers a question, it reads GET /api/meeting-focus itself. Writes, each on a press: POST /api/meeting-focus/raise (✓ raised, ✗ not now), POST /api/notes/save
16
17
  * (a note, or an answer kept with +), POST /api/meeting-focus/ask (a question; the answer comes back on the next read). */
17
18
  import { pmGet, pmPost } from './http.js';
19
+ import { agendaHtml, ensureCss as agendaCss, press as agendaPress } from './agenda-live.js';
18
20
 
19
21
  const esc = (v) => String(v == null ? '' : v).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
20
22
  const P = {
@@ -87,6 +89,8 @@ export function nowModel(F, one, { now = Date.now() } = {}) {
87
89
  left, raise, counts: parts.join(' · '), answer,
88
90
  // Caught so far (batch 23 item 1): the companion's gist of the talk, as the Viewer's meeting card shows it
89
91
  gist: typeof f.gist === 'string' ? f.gist.trim().slice(0, 400) : '',
92
+ // the agenda in 3 to 5 topics (lib/agenda-topics.js liveModel), drawn the same as the Viewer's Agenda
93
+ agenda: f.agenda && Array.isArray(f.agenda.topics) && f.agenda.topics.length ? f.agenda : null,
90
94
  };
91
95
  }
92
96
 
@@ -122,6 +126,8 @@ export function nowHtml(m, { room = false } = {}) {
122
126
  if (m.next) chips.push(`<span role="listitem"><b></b>Next: ${esc(m.next.text)}</span>`);
123
127
  if (!m.current && !chips.length && m.topics.length) m.topics.forEach((t) => chips.push(`<span role="listitem"><b></b>${esc(t.text)}</span>`));
124
128
  if (chips.length) h += `<div class="rn-stp" role="list" aria-label="To cover">${chips.join('')}</div>`;
129
+ } else if (m.agenda) {
130
+ h += `<section class="rn-sec" aria-label="To cover"><h5>To cover</h5>${agendaHtml(m.agenda)}</section>`;
125
131
  } else if (m.topics.length) {
126
132
  h += `<section class="rn-sec" aria-label="To cover"><h5>To cover${m.left != null ? `<span class="r">${m.left} min left</span>` : ''}</h5><div class="rn-ag">`
127
133
  + m.topics.map((t) => `<div class="rn-ai ${t.state === 'done' ? 'dn' : t.state === 'now' ? 'now' : ''}"${t.state === 'now' ? ' aria-current="true"' : ''}><span class="m" aria-hidden="true">${mark(t.state)}</span><span class="tx">${esc(t.text)}</span>${t.state === 'done' && t.spent >= 30000 ? `<span class="t4">${mmss(t.spent)}</span>` : ''}</div>`).join('')
@@ -191,6 +197,7 @@ export function mountNow(slots, ctx) {
191
197
  const noteId = () => { const o = oneNow(); return o && o.note ? o.note.id : ''; };
192
198
  const modeNow = () => { try { return typeof ctx.mode === 'function' ? ctx.mode() : 'screen'; } catch { return 'screen'; } };
193
199
 
200
+ agendaCss();
194
201
  if (!document.querySelector('link[data-rn-css]')) {
195
202
  const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = new URL('./cozy-rec-now.css', import.meta.url).href; l.setAttribute('data-rn-css', '');
196
203
  document.head.appendChild(l);
@@ -253,7 +260,12 @@ export function mountNow(slots, ctx) {
253
260
  place();
254
261
  const one = oneNow();
255
262
  const h = nowHtml(nowModel(focusNow(), one), { room });
256
- if (h !== last) { body.innerHTML = h; last = h; }
263
+ if (h !== last) {
264
+ // a topic the PM unfolded stays unfolded when the minutes change
265
+ const opened = new Set([...body.querySelectorAll('details.mg-th[open] > summary b')].map((x) => x.textContent));
266
+ body.innerHTML = h; last = h;
267
+ body.querySelectorAll('details.mg-th > summary b').forEach((x) => { if (opened.has(x.textContent)) x.closest('details').open = true; });
268
+ }
257
269
  if (open) {
258
270
  const t = transcriptHtml(transcriptModel(one));
259
271
  if (t !== lastT) {
@@ -320,6 +332,12 @@ export function mountNow(slots, ctx) {
320
332
  });
321
333
 
322
334
  body.addEventListener('click', async (e) => {
335
+ if (e.target.closest('[data-ag]')) {
336
+ const f = focusNow();
337
+ const r = await agendaPress(e.target, f && f.agenda, { ws: ctx.ws });
338
+ if (r) { say(r.ok ? '' : 'Not changed: ' + r.error); read(); }
339
+ return;
340
+ }
323
341
  const b = e.target.closest('[data-rn]'); if (!b) return;
324
342
  const act = b.getAttribute('data-rn');
325
343
  if (act === 'raised' || act === 'skip') {
@@ -40,7 +40,7 @@ const md = (iso) => { const m = DAY.exec(String(iso || '')); return m ? MON[+m[2
40
40
  const span = (a, b) => (a && b && a !== b ? md(a) + ' – ' + md(b) : md(a || b));
41
41
  const plural = (n, a, b) => n + ' ' + (n === 1 ? a : b);
42
42
  const clip = (s, n) => { s = String(s || ''); return s.length > n ? s.slice(0, n - 1) + '…' : s; };
43
- const GROUP = { build: 'Pull request', description: 'Description', outcome: 'Expected outcome', prototyped: 'PMOS prototyped it', improved: 'PMOS improved it', scanned: 'PMOS scanned for it', found: 'Found elsewhere', dates: 'Dates', status: 'Looks done', names: 'Names', links: 'Links', grill: 'PMOS grilled it' };
43
+ const GROUP = { build: 'Pull request', harness: 'Change the factory harness', description: 'Description', outcome: 'Expected outcome', prototyped: 'PMOS prototyped it', improved: 'PMOS improved it', scanned: 'PMOS scanned for it', found: 'Found elsewhere', dates: 'Dates', status: 'Looks done', names: 'Names', links: 'Links', grill: 'PMOS grilled it' };
44
44
 
45
45
  /* ── the chip and the live look ── */
46
46
  export function chipOf(p) {
@@ -25,7 +25,7 @@
25
25
  * WRITES (each a press): Record, Pause, Resume, Stop and Highlight through the page's recorder (premium-meeting.js recCore); POST
26
26
  * /api/notes/save (Your notes), /api/notes/private, /api/notes/speaker (naming a speaker), /api/notes/series-member, /api/notes/link or
27
27
  * /api/calendar-links (About), /api/viewer-meeting/agenda|capture|work-item, /api/plan-items (Make task), /api/meeting-material (Add material,
28
- * Remove), /api/meeting-material/file (Upload a file), /api/meeting-focus/topic (Change topic), /api/meeting-points (Confirm, Not right),
28
+ * Remove), /api/meeting-material/file (Upload a file), /api/meeting-focus/topic (Not this one) and /api/meeting-focus/agenda (Undo the merge) through pm/agenda-live.js, /api/meeting-points (Confirm, Not right),
29
29
  * /api/meeting-points/edit (a correction, and what PMOS learns from it).
30
30
  *
31
31
  * meetModel(D, now) → the view model (pure; for the unit suite)
@@ -36,6 +36,7 @@
36
36
  import * as IM from './impact.js'; // Your impact's meeting moment (batch 16 item 7)
37
37
  import { open as vOpen, current as vCur, back as vBack, czSummary, czSections, wide as vWide } from './cozy-viewer.js';
38
38
  import { pmGet, pmPost, pressFetch } from './http.js';
39
+ import { agendaHtml as mergedAgendaHtml, nowSummary, ensureCss as agendaCss, press as agendaPress } from './agenda-live.js'; // the agenda in 3 to 5 topics (live-agenda-topics)
39
40
  import { ownTab, bring, tabUrl } from './rec-tab-core.js';
40
41
  import { noteSheet, aboutChoices, aboutBody, aboutNow } from './premium-vw-meet.js';
41
42
  import { weekView, noteOfRow, sameMeeting, recordable, prevOf, taskEvent, linkBody, mmss, focusView, replayModel, RECORD_LINE, FOCUS_LINE, STOP_LINE, CONSENT_LINE, recCore } from './premium-meeting.js';
@@ -214,7 +215,9 @@ export function meetModel(D, now = Date.now()) {
214
215
  return { n: t.n || i + 1, text: t.text, k, used, plan, fill: plan ? Math.min(1, used / plan) : t.state === 'done' ? 1 : 0,
215
216
  say: t.state === 'plan' ? (plan ? plan + ' min' : 'planned') : plan ? used + ' of ' + plan : used + ' min' };
216
217
  });
217
- const focus = { now: cur >= 0 ? topics[cur].text : '', nowLine: topics.length ? (cur >= 0 ? 'Now · topic ' + (cur + 1) + ' of ' + topics.length : plural(topics.length, 'topic') + ' planned') : 'No topics yet',
218
+ // the agenda in 3 to 5 topics (lib/agenda-topics.js liveModel): one model with the recording tab's To cover
219
+ const A = F && F.agenda && Array.isArray(F.agenda.topics) && F.agenda.topics.length ? F.agenda : null;
220
+ const focus = { model: A, nowText: nowSummary(A), now: cur >= 0 ? topics[cur].text : '', nowLine: topics.length ? (cur >= 0 ? 'Now · topic ' + (cur + 1) + ' of ' + topics.length : plural(topics.length, 'topic') + ' planned') : 'No topics yet',
218
221
  gist: fv && fv.state === 'ok' ? fv.gist : '', topics: topics.map((t) => ({ text: t.text, now: t.state === 'now' })), agenda: fAgenda,
219
222
  agendaSub: ag.total ? ag.total + ' min' : '', material: mats, error: fv && fv.state !== 'ok' ? fv.reason : '' };
220
223
  /* after */
@@ -336,7 +339,7 @@ export function summaryHtml(m, ui = {}) {
336
339
  // a recording in its own tab (rec-tab-core.js) is live, not stale: this page shows it, and its one press brings that tab forward
337
340
  const away = m.liveK === 'stale' && ownTab();
338
341
  const line = m.liveK === 'rec' || away ? 'Recording · ' + mmss(m.liveMs || 0) : m.liveK === 'paused' ? 'Paused at ' + mmss(m.liveMs || 0) : 'Recording, but not on this page';
339
- const now = Fo.now ? 'Now on: ' + Fo.now + (Fo.topics.length > 1 ? ', topic ' + (Fo.topics.findIndex((t) => t.now) + 1) + ' of ' + Fo.topics.length + '.' : '.')
342
+ const now = Fo.nowText ? 'Now on: ' + Fo.nowText + '.' : Fo.now ? 'Now on: ' + Fo.now + (Fo.topics.length > 1 ? ', topic ' + (Fo.topics.findIndex((t) => t.now) + 1) + ' of ' + Fo.topics.length + '.' : '.')
340
343
  : Fo.error ? 'Focus could not read this meeting: ' + String(Fo.error).replace(/\.$/, '') + '.' : ''; // honest: a refused read says why
341
344
  const text = m.liveK === 'paused' ? 'Nothing is kept while paused. ' + now : m.liveK === 'stale' && !away ? 'Nothing is kept until you resume here. ' + now : now;
342
345
  const acts = away ? roundBtn('rectab', 'Go to the recording tab', 'tab', 'dark') : m.liveK === 'rec' ? roundBtn('stop', 'Stop the recording', 'stop', 'red') + roundBtn('hl', 'Highlight the last 30 seconds', 'star') + roundBtn('pause', 'Pause', 'pause')
@@ -384,11 +387,11 @@ function caughtHtml(m) {
384
387
  if (L.topics.length) h.push(weightBar('vz-stretch', L.topics.map((t) => ({ w: +t.flex || 1, attrs: ` data-k="${t.k}"` }))));
385
388
  return h.join('') || '<p class="vz-empty">What was said shows here while the note records.</p>';
386
389
  }
387
- function liveAgendaHtml(m, ui) {
390
+ /** The live Agenda: the 3 to 5 topics (pm/agenda-live.js) when the read has them. No Change topic: PMOS follows the talk, the PM says Not this one. */
391
+ function liveAgendaHtml(m) {
388
392
  const Fo = m.focus;
389
- const change = Fo.topics.length ? `<div class="vzm-r"><span class="vzm-grow"></span><button type="button" class="vzm-btn vzm-soft" data-a="topic" aria-expanded="${ui.pop === 'topic'}">Change topic</button></div>`
390
- + (ui.pop === 'topic' ? `<div class="vzm-topics" role="group" aria-label="Make it the topic">${Fo.topics.map((t, i) => `<button type="button" class="vzm-chip${t.now ? ' on' : ''}" data-a="topicgo" data-i="${i}"${t.now ? ' aria-current="true"' : ''}>${esc(t.text)}</button>`).join('')}</div>` : '') : '';
391
- return change + (Fo.agenda.length ? Fo.agenda.map((a) => `<div class="vzm-ag" data-k="${a.k}"><span>${a.k === 'now' || a.k === 'late' ? `<b>${a.n} ${esc(a.text)}</b>` : esc(a.n + ' ' + a.text)}</span>${fillBar(a.fill, a.k)}<small>${esc(a.say)}</small></div>`).join('') : '<p class="vz-empty">The invite lists no topics yet.</p>');
393
+ if (Fo.model) return mergedAgendaHtml(Fo.model);
394
+ return (Fo.agenda.length ? Fo.agenda.map((a) => `<div class="vzm-ag" data-k="${a.k}"><span>${a.k === 'now' || a.k === 'late' ? `<b>${a.n} ${esc(a.text)}</b>` : esc(a.n + ' ' + a.text)}</span>${fillBar(a.fill, a.k)}<small>${esc(a.say)}</small></div>`).join('') : '<p class="vz-empty">The invite lists no topics yet.</p>');
392
395
  }
393
396
  function transcriptHtml(m, ui, lines, seek) {
394
397
  const W = m.notes && m.notes.replay ? m.notes.replay.W : null; // the word fixes (MvF) show in the transcript too
@@ -441,7 +444,8 @@ export function sectionsOf(m, ui = {}) {
441
444
  const lastT = P.prev.length ? { id: 'last', title: 'Last time', count: P.prev[0].date, html: prevHtml(P) } : null;
442
445
  if (m.mk === 'prep') {
443
446
  return [
444
- { id: 'agenda', title: 'Agenda', count: P.agendaSub, open: true, html: agendaHtml(P) },
447
+ // a merged invite shows its topics before the meeting too, with Undo; else the lines with their minutes to change
448
+ Fo.model && Fo.model.merge ? { id: 'agenda', title: 'Agenda', count: Fo.model.sub, open: true, html: mergedAgendaHtml(Fo.model) } : { id: 'agenda', title: 'Agenda', count: P.agendaSub, open: true, html: agendaHtml(P) },
445
449
  P.matters.length ? { id: 'matters', title: 'What matters today', count: P.matters.length, html: tagRows(P.matters) } : null,
446
450
  { id: 'ready', title: 'To be ready', count: P.ready.filter((r) => !r.ok).length || '', html: readyHtml(P) },
447
451
  mat, lastT,
@@ -453,7 +457,7 @@ export function sectionsOf(m, ui = {}) {
453
457
  { id: 'caught', title: 'Caught so far', count: L.caught === 'nothing yet' ? '' : L.caught.replace(/, /g, ' · '), html: caughtHtml(m) },
454
458
  mat,
455
459
  L.hl.length ? { id: 'hl', title: 'Highlights', count: L.hl.length, html: hlHtml(L) } : null,
456
- { id: 'agenda', title: 'Agenda', count: L.nowSub, html: liveAgendaHtml(m, ui) },
460
+ { id: 'agenda', title: 'Agenda', count: Fo.model ? Fo.model.sub : L.nowSub, html: liveAgendaHtml(m) },
457
461
  { id: 'tr', title: 'Transcript', count: L.total ? 'live · ' + plural(L.total, 'line') : '', html: transcriptHtml(m, ui, N.lines, false) },
458
462
  ];
459
463
  }
@@ -576,6 +580,7 @@ export async function openMeeting(ref, o = {}) {
576
580
  me.vid = id;
577
581
  vOpen({ id, kind: 'Meeting', title: R.title || 'Meeting', icon: CLOCK_ICON, url: meetingUrl({ ...R, ws: me.ws }), render: draw0, onClose: () => closed(me) });
578
582
  widen('mtg');
583
+ agendaCss();
579
584
  await load(me);
580
585
  if (MT !== me) return;
581
586
  if (o.about) await openAbout(me);
@@ -777,6 +782,11 @@ function tick(me) {
777
782
 
778
783
  /* the presses */
779
784
  async function press(me, e) {
785
+ if (e.target.closest('[data-ag]')) { // Undo the merge, Not this one (pm/agenda-live.js)
786
+ const r = await agendaPress(e.target, me.model && me.model.focus.model, { ws: me.ws });
787
+ if (r) { say(me, r.ok ? r.said : 'Not changed: ' + r.error, r.ok ? '' : 'bad'); return load(me, true); }
788
+ return;
789
+ }
780
790
  const pa = e.target.closest('[data-czs-act]'); // the summary's one primary
781
791
  const t = pa || e.target.closest('[data-a]');
782
792
  if (me.ui.wpop && !e.target.closest('.vzr-wpop')) { me.ui.wpop = null; repaint(me); if (!t || t.dataset.a === 'psel') return; } // a press outside the word fix closes it
@@ -784,7 +794,7 @@ async function press(me, e) {
784
794
  if (!t) { if (me.ui.pop && !e.target.closest('.vzm-pop')) { me.ui.pop = ''; repaint(me); } return; }
785
795
  if (t.disabled) return;
786
796
  const a = pa ? pa.dataset.czsAct : t.dataset.a, ui = me.ui, m = me.model, C = rec();
787
- if (ui.pop && !t.closest('.vzm-pop') && !['addmat', 'm-about', 'topic'].includes(a)) ui.pop = '';
797
+ if (ui.pop && !t.closest('.vzm-pop') && !['addmat', 'm-about'].includes(a)) ui.pop = '';
788
798
  switch (a) {
789
799
  case 'popx': ui.pop = ''; return repaint(me);
790
800
  case 'askno': ui.ask = null; return repaint(me);
@@ -823,8 +833,6 @@ async function press(me, e) {
823
833
  case 'present': return presentIt(me, +t.dataset.i);
824
834
  case 'addmat': if (ui.pop === 'mat') { ui.pop = ''; return repaint(me); } return openMat(me);
825
835
  case 'matadd': { const P = me.mat; const it = P && (P.q ? P.found : P.sug)[+t.dataset.i]; if (it) return addMat(me, it.url && !it.ref ? { url: it.url, title: it.title } : { kind: it.kind, ref: it.ref, title: it.title, ...(it.ws ? { ws: it.ws } : {}) }); return; }
826
- case 'topic': ui.pop = ui.pop === 'topic' ? '' : 'topic'; return repaint(me);
827
- case 'topicgo': return changeTopic(me, m.focus.topics[+t.dataset.i]);
828
836
  case 'maketask': return makeTask(me, +t.dataset.i);
829
837
  case 'makewi': return makeWorkItem(me, +t.dataset.i);
830
838
  case 'madeundo': { const md = ui.made[+t.dataset.i]; delete ui.made[+t.dataset.i]; repaint(me); if (md && md.undo) await md.undo(); return; }
@@ -1099,15 +1107,6 @@ async function setMin(me, i, v) {
1099
1107
  if (!r || !r.ok) say(me, 'The minutes were not saved: ' + ((r && r.error) || 'no answer'), 'bad');
1100
1108
  return load(me, true);
1101
1109
  }
1102
- /** Change topic (Focus): the topic now, for this meeting (POST /api/meeting-focus/topic). */
1103
- async function changeTopic(me, tp) {
1104
- me.ui.pop = '';
1105
- const ev = me.row ? me.row.id : me.n && me.n.meeting && me.n.meeting.event_id;
1106
- if (!tp || !ev) { say(me, 'The topic can be changed on a calendar meeting only.', 'bad'); return; }
1107
- const r = await pmPost('/api/meeting-focus/topic', { event: ev, date: me.fq ? me.fq.date : '', action: 'set', topic: tp.text });
1108
- say(me, r && r.ok ? 'The topic now is “' + clip(tp.text, 60) + '”.' : 'Not changed: ' + ((r && r.error) || 'no answer'), r && r.ok ? '' : 'bad');
1109
- return load(me, true);
1110
- }
1111
1110
  /** Make task: the step goes into the first stage of the note's initiative (POST /api/plan-items); the made line has Undo, which withdraws it. */
1112
1111
  async function makeTask(me, i, quiet) {
1113
1112
  const S = me.D.S, step = S && S.actions[i]; if (!step) return { ok: false };
@@ -4647,8 +4647,11 @@ function startHeadless(base, workdir, kind, launchArgs, env, initialInput, addDi
4647
4647
  const dim = (t) => `\x1b[38;5;244m${t}\x1b[0m`;
4648
4648
  // A run that calls a refused tool a second time is stopped: in dontAsk mode the answer will not change (lib/headless.js denialGuard).
4649
4649
  const guard = headlessLib.denialGuard();
4650
+ // The factory trace (lib/factory-traces.js): a team run that names a work item leaves one trace in the product's state folder.
4651
+ const ftrace = kind === 'team' && env && env.PMOS_TEAM_ROOT ? require('./lib/factory-traces.js').tracker() : null;
4650
4652
  const feed = (line) => {
4651
4653
  const ev = headlessLib.streamLines(line);
4654
+ if (ftrace) ftrace.see(line);
4652
4655
  if (ev.result) resultLine = line;
4653
4656
  if (ev.log.length) say(ev.log.map((l) => (/^›/.test(l) ? dim(l) : l)).join('\n') + '\n');
4654
4657
  const seen = headlessLib.initTools(line);
@@ -4690,6 +4693,7 @@ function startHeadless(base, workdir, kind, launchArgs, env, initialInput, addDi
4690
4693
  const r = headlessLib.parseResult(resultLine || out);
4691
4694
  // The token log (lib/run-tokens.js): one line per finished run, for `pmos ai status`.
4692
4695
  require('./lib/run-tokens.js').record(STATE, { kind, origin: s.origin, lean, result: { ...r, ...headlessLib.usageOf(resultLine || out) }, ok: code === 0 && r.ok && !r.isError });
4696
+ if (ftrace) { try { require('./lib/factory-traces.js').recordRun(env.PMOS_TEAM_ROOT, { role: env.PMOS_TEAM_ROLE, tracker: ftrace, result: { ...r, ...headlessLib.usageOf(resultLine || out) }, ok: code === 0 && r.ok && !r.isError }); } catch (e) { warnWriteFail('factory trace', e); } }
4693
4697
  if (r.ok) say('\n' + headlessLib.logLines(r, code).join('\n') + '\n');
4694
4698
  else if (out.trim() && !resultLine) say(r.text.split('\n').slice(-20).join('\n') + '\n');
4695
4699
  if (err.trim()) say(dim(err.trim().split('\n').slice(-20).join('\n')) + '\n');
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "ADLC gap P1 (factory-bot-identity-sandbox, done test I1-I7): the factory's own git identity and token from pmos/factory.json, and the Builder's check in a container with no network (lib/factory-identity.js, lib/build-engine.js). Stub gh and docker; no real GitHub or container.",
3
+ "modules": [
4
+ "factory-identity.test.js"
5
+ ],
6
+ "seconds": {
7
+ "factory-identity.test.js": 4
8
+ }
9
+ }
@@ -1,11 +1,13 @@
1
1
  {
2
- "_comment": "Launch simulation W7 (kit-factory-builder): the D65 factory in a product repository. One sandbox run against a kit built by kit/build-kit.sh and a local bare remote: vendoring (F1), the kit (F2), the Builder's claim, propose, \u2726 and draft PR (F3), verify-work (F4). No browser, no network. D108 (factory-guardrail-merge): the merge guardrail, one case per rule (factory-guardrail.test.js), and G1\u2013G6 in the same sandbox.",
2
+ "_comment": "Launch simulation W7 (kit-factory-builder): the D65 factory in a product repository. One sandbox run against a kit built by kit/build-kit.sh and a local bare remote: vendoring (F1), the kit (F2), the Builder's claim, propose, \u2726 and draft PR (F3), verify-work (F4). No browser, no network. D108 (factory-guardrail-merge): the merge guardrail, one case per rule (factory-guardrail.test.js), and G1\u2013G6 in the same sandbox. factory-premerge-reviewer: the independent pre-merge review (factory-review.test.js).",
3
3
  "modules": [
4
4
  "build-engine.test.js",
5
- "factory-guardrail.test.js"
5
+ "factory-guardrail.test.js",
6
+ "factory-review.test.js"
6
7
  ],
7
8
  "seconds": {
8
9
  "build-engine.test.js": 8,
9
- "factory-guardrail.test.js": 3
10
+ "factory-guardrail.test.js": 3,
11
+ "factory-review.test.js": 3
10
12
  }
11
13
  }
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "ADLC gap P2 (factory-builder-benchmark): the golden benchmark of the Builder. The golden set's checks against its solutions (B1), the sandbox (B2), a stub Builder through the real pmos build claim and propose (B3), the append-only record (B4), the rollup per model and harness (B5), the command and the default runner's tools (B6). No model call, no browser, no network.",
3
+ "modules": [
4
+ "builder-bench.test.js"
5
+ ],
6
+ "seconds": {
7
+ "builder-bench.test.js": 13
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "factory-builder-inner-loop: the product's declared checks run by PMOS in the Builder's worktree with no network, the CI-fix rounds and the blocked state (lib/factory-checks.js, lib/factory-ci.js, lib/factory-needs.js). One sandbox repository, a stub gh.",
3
+ "modules": [
4
+ "factory-checks.test.js"
5
+ ],
6
+ "seconds": {
7
+ "factory-checks.test.js": 8
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "ADLC gap P2 (factory-fleet-scale): work items in dependency order (depends_on), the Builder's concurrency from pmos/factory.json builders, and the integrator that rebases an overlapping factory pull request in PMOS's own process. One sandbox against a kit built by kit/build-kit.sh, a local bare remote and a stub gh. No browser, no network.",
3
+ "modules": [
4
+ "factory-fleet.test.js"
5
+ ],
6
+ "seconds": {
7
+ "factory-fleet.test.js": 6
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "factory-learning-loop (ADLC gap P2): factory setbacks become Builder lessons; a repeated one files Change the factory harness (lib/factory-lessons.js).",
3
+ "modules": [
4
+ "factory-lessons.test.js"
5
+ ],
6
+ "seconds": {
7
+ "factory-lessons.test.js": 1
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "ADLC gap P0 (factory-real-run-kit): scripts/factory-real-run.js seeds a product into a repository and rehearses the whole factory path against a local bare remote with a fake gh. No browser, no network, no model.",
3
+ "modules": [
4
+ "factory-real-run.test.js"
5
+ ],
6
+ "seconds": {
7
+ "factory-real-run.test.js": 8
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "ADLC gap P1 (factory-run-traces): one trace per factory run and the factory's numbers over a window (lib/factory-traces.js, lib/routes-factory-metrics.js). Pure folds and a temporary state folder; no git, no server, no browser. The sandbox case T3/T6 is in build-engine.test.js.",
3
+ "modules": [
4
+ "factory-traces.test.js"
5
+ ],
6
+ "seconds": {
7
+ "factory-traces.test.js": 1
8
+ }
9
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "_comment": "Batch 30 item 3, initiative live-agenda-topics: a meeting's agenda as 3 to 5 topics. The merge (rules and the AI answer) on the 26-line sample and real invite shapes, Undo, lines added in the meeting, the one live model, the routes, and the html the Viewer's Agenda and the recording tab's To cover both draw (lib/agenda-topics.js, public/pm/agenda-live.js).",
3
+ "modules": [
4
+ "agenda-topics.test.js"
5
+ ],
6
+ "seconds": { "agenda-topics.test.js": 2 }
7
+ }