create-pmos 0.665.0 → 0.667.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 (33) hide show
  1. package/package.json +28 -22
  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/changelog.json +27 -2
  7. package/workspace/guide/cli.md +13 -0
  8. package/workspace/guide/jira.md +19 -0
  9. package/workspace/guide/layout.md +1 -1
  10. package/workspace/lib/forecast.js +5 -2
  11. package/workspace/lib/headless.js +4 -1
  12. package/workspace/lib/jira-cli.js +36 -2
  13. package/workspace/lib/jira-status.js +32 -10
  14. package/workspace/lib/jira-tickets.js +101 -0
  15. package/workspace/lib/kind-control.js +10 -0
  16. package/workspace/lib/pmos-verbs.js +3 -0
  17. package/workspace/lib/question-batch.js +22 -8
  18. package/workspace/lib/refresh-run.js +9 -3
  19. package/workspace/lib/routes-boards.js +37 -2
  20. package/workspace/lib/routes-kind-control.js +7 -1
  21. package/workspace/lib/routes-your-move.js +23 -4
  22. package/workspace/lib/signoff-cli.js +87 -0
  23. package/workspace/lib/signoffs.js +112 -0
  24. package/workspace/lib/task-jira.js +138 -0
  25. package/workspace/lib/ticket-dry-run.js +164 -0
  26. package/workspace/package-lock.json +2 -2
  27. package/workspace/package.json +1 -1
  28. package/workspace/public/pm/cozy-library.css +1 -0
  29. package/workspace/public/pm/premium-library.js +9 -3
  30. package/workspace/run-tests.js +43 -1
  31. package/workspace/skills/initiative-drive.skill +8 -1
  32. package/workspace/skills/jira-sync.skill +1 -1
  33. package/workspace/test-lists/dry-run-tickets-before-build.json +11 -0
@@ -0,0 +1,164 @@
1
+ 'use strict';
2
+ /* ticket-dry-run.js — the dry run of a drafted ticket (initiative dry-run-tickets-before-build; bet 1e, A194 in pmos-ideas/proofs).
3
+ *
4
+ * Before a ticket is built, an agent that sees only the ticket pretends to build it and lists every point where it would have to
5
+ * guess. For each guess it quotes the lines of the PRD (or the record, or the done test) that answer it. PMOS keeps only the quotes it
6
+ * finds word for word in those documents, copies them into the ticket, and sends what no document answers to the owner's daily
7
+ * question list (lib/question-batch.js). On three PSLE launch tickets, 36 guesses: 86% were answered at least partly by the PRD, and
8
+ * 5 were real gaps.
9
+ *
10
+ * parse(raw) → { ok, tickets: [{ id, guesses: [{ q, said, quotes }] }] } | { ok: false, error } PURE
11
+ * check(parsed, { ids, sourceOf, haystack }) → { tickets: { [id]: entry }, unknown, unverified } PURE
12
+ * merge(old, checked, now) → the dry-run file, with the PM's earlier answers kept for the same questions PURE
13
+ * blockOf(entry) → the text that goes into the ticket's Additional Context, or '' PURE
14
+ * withBlock(text, block) → the section text with the old block replaced PURE
15
+ * gapsOf(file, sourceOf) → [{ ticket, n, q }] the guesses no document answers and nobody answered yet PURE
16
+ * countsOf(entry) → { guesses, answered, partly, gaps, open } PURE
17
+ * read(file) · write(file, data)
18
+ *
19
+ * A guess is 'answered' (a quote found, and the agent did not say partly), 'partly' (a quote found, the agent said partly) or 'gap'
20
+ * (no quote found). A quote PMOS cannot find in the documents is dropped, never kept: an agent cannot make a gap look answered.
21
+ * An entry carries the ticket's `source` hash: when the PRD item changes, the entry is stale and its gaps leave the list until the
22
+ * dry run is run again. Nothing here sends anything.
23
+ */
24
+ const fs = require('fs');
25
+ const path = require('path');
26
+
27
+ const MARK = '**From the PRD (dry run)**';
28
+ const MAX_GUESSES = 40;
29
+ const MAX_QUOTES = 3;
30
+ const MAX_Q = 300;
31
+ const MAX_QUOTE = 400;
32
+ const MAX_ANSWER = 1000;
33
+ const MIN_QUOTE = 12;
34
+
35
+ const isObj = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
36
+ const one = (v, n) => String(v == null ? '' : v).replace(/\s+/g, ' ').trim().slice(0, n);
37
+ /** Text for matching: no markdown marks, plain quotes and dashes, one space, lower case. */
38
+ const plain = (s) => String(s == null ? '' : s)
39
+ .replace(/[‘’]/g, "'").replace(/[“”]/g, '"').replace(/[–—]/g, '-')
40
+ .replace(/[*_`>#|]/g, ' ').replace(/\[([^\]]*)\]\([^)]*\)/g, '$1').replace(/\s+/g, ' ').trim().toLowerCase();
41
+ const qKey = (s) => plain(s).replace(/[^a-z0-9 ]/g, '').replace(/\s+/g, ' ').trim();
42
+
43
+ /** True when the quote is in the documents. A quote cut with "…" or "..." matches when each long part is there. */
44
+ function found(quote, haystack) {
45
+ const parts = plain(quote).split(/\s*(?:…|\.\.\.)\s*/).map((p) => p.replace(/^["']|["']$/g, '').trim()).filter(Boolean);
46
+ if (!parts.length || !parts.some((p) => p.length >= MIN_QUOTE)) return false;
47
+ return parts.every((p) => p.length < 4 || haystack.includes(p));
48
+ }
49
+
50
+ /** The agent's list: { tickets: [{ id, guesses: [{ question, prd: [quote] | quote, answered: yes|partly|no }] }] }, or the array alone. */
51
+ function parse(raw) {
52
+ let v = raw;
53
+ if (typeof v === 'string') { try { v = JSON.parse(v); } catch { return { ok: false, error: 'the dry run is not JSON' }; } }
54
+ const list = Array.isArray(v) ? v : isObj(v) && Array.isArray(v.tickets) ? v.tickets : null;
55
+ if (!list) return { ok: false, error: 'the dry run needs "tickets": [{ "id", "guesses": [{ "question", "prd": ["<a line quoted from the PRD>"] }] }]' };
56
+ const tickets = [];
57
+ for (const t of list) {
58
+ if (!isObj(t) || !one(t.id, 41)) continue;
59
+ const guesses = [];
60
+ for (const g of Array.isArray(t.guesses) ? t.guesses : []) {
61
+ const q = isObj(g) ? one(g.question || g.q, MAX_Q) : one(g, MAX_Q);
62
+ if (!q) continue;
63
+ const rawQ = isObj(g) ? (g.prd != null ? g.prd : g.quotes != null ? g.quotes : g.quote) : null;
64
+ const quotes = (Array.isArray(rawQ) ? rawQ : rawQ != null ? [rawQ] : []).map((x) => one(x, MAX_QUOTE)).filter(Boolean).slice(0, MAX_QUOTES);
65
+ const s = isObj(g) ? String(g.answered != null ? g.answered : g.status || '').toLowerCase() : '';
66
+ guesses.push({ q, said: /part/.test(s) ? 'partly' : /^(no|gap|none|false)$/.test(s) ? 'no' : 'yes', quotes });
67
+ if (guesses.length >= MAX_GUESSES) break;
68
+ }
69
+ tickets.push({ id: one(t.id, 41), guesses });
70
+ }
71
+ if (!tickets.length) return { ok: false, error: 'the dry run names no ticket' };
72
+ return { ok: true, tickets };
73
+ }
74
+
75
+ /** Keep only quotes found in the documents, and give each guess its status. ids: the draft's ticket ids; sourceOf: id → source hash. */
76
+ function check(parsed, { ids, sourceOf = () => null, haystack = '', now } = {}) {
77
+ const hay = plain(haystack);
78
+ const at = new Date(now == null ? Date.now() : now).toISOString();
79
+ const out = {}, unknown = [];
80
+ let unverified = 0;
81
+ for (const t of (parsed && parsed.tickets) || []) {
82
+ if (ids && !ids.has(t.id)) { unknown.push(t.id); continue; }
83
+ const guesses = t.guesses.map((g, i) => {
84
+ const prd = g.quotes.filter((x) => found(x, hay));
85
+ unverified += g.quotes.length - prd.length;
86
+ const status = !prd.length ? 'gap' : g.said === 'partly' || g.said === 'no' ? 'partly' : 'answered';
87
+ return { n: i + 1, q: g.q, status, prd };
88
+ });
89
+ out[t.id] = { source: sourceOf(t.id) || null, at, guesses };
90
+ }
91
+ return { tickets: out, unknown, unverified };
92
+ }
93
+
94
+ /** The new dry-run file: the checked tickets replace their old entries; an answer the PM gave to the same question is kept. */
95
+ function merge(old, checked, { initiative, now } = {}) {
96
+ const prev = isObj(old) && isObj(old.tickets) ? old.tickets : {};
97
+ const tickets = { ...prev };
98
+ for (const [id, e] of Object.entries(checked.tickets || {})) {
99
+ const answers = new Map(((prev[id] && prev[id].guesses) || []).filter((g) => g.answer).map((g) => [qKey(g.q), g]));
100
+ tickets[id] = { ...e, guesses: e.guesses.map((g) => { const a = answers.get(qKey(g.q)); return a ? { ...g, answer: a.answer, answeredAt: a.answeredAt } : g; }) };
101
+ }
102
+ return { initiative: initiative || (old && old.initiative) || null, at: new Date(now == null ? Date.now() : now).toISOString(), tickets };
103
+ }
104
+
105
+ /** What the ticket carries: each guess a document answers, with its lines, and each gap the PM answered. '' when there is nothing. */
106
+ function blockOf(entry) {
107
+ const lines = [];
108
+ for (const g of (entry && entry.guesses) || []) {
109
+ if (g.prd && g.prd.length) lines.push(`- ${g.q} PRD: ${g.prd.map((x) => `"${x}"`).join(' · ')}${g.status === 'partly' && !g.answer ? ' (partly)' : ''}`);
110
+ if (g.answer) lines.push(`- ${g.q} PM: ${g.answer}`);
111
+ }
112
+ return lines.length ? [MARK, '', ...lines].join('\n') : '';
113
+ }
114
+
115
+ /** The section text with the old dry-run block taken out and the new one put at its end. */
116
+ function withBlock(text, block) {
117
+ const s = String(text || '');
118
+ const i = s.indexOf(MARK);
119
+ const base = (i >= 0 ? s.slice(0, i) : s).replace(/\s+$/, '');
120
+ const clean = /^[\s—–-]*$/.test(base) ? '' : base;
121
+ return [clean, block].filter(Boolean).join('\n\n');
122
+ }
123
+
124
+ function countsOf(entry) {
125
+ const g = (entry && entry.guesses) || [];
126
+ const n = (s) => g.filter((x) => x.status === s).length;
127
+ return { guesses: g.length, answered: n('answered'), partly: n('partly'), gaps: n('gap'), open: g.filter((x) => x.status === 'gap' && !x.answer).length };
128
+ }
129
+
130
+ /** The gaps nobody answered, on tickets whose PRD item has not changed since the dry run. */
131
+ function gapsOf(file, sourceOf = () => null) {
132
+ const out = [];
133
+ for (const [id, e] of Object.entries((file && file.tickets) || {})) {
134
+ if (!isObj(e) || !Array.isArray(e.guesses)) continue;
135
+ const cur = sourceOf(id);
136
+ if (cur === undefined || (e.source && cur && cur !== e.source)) continue; // the ticket is gone, or its PRD item changed: stale
137
+ for (const g of e.guesses) if (g.status === 'gap' && !g.answer) out.push({ ticket: id, n: g.n, q: g.q });
138
+ }
139
+ return out;
140
+ }
141
+
142
+ /** Set the PM's answer to guess n of a ticket. → { ok, guess } | { ok: false, error } */
143
+ function answer(file, ticket, n, text, now) {
144
+ const e = file && file.tickets && file.tickets[ticket];
145
+ if (!e) return { ok: false, error: `no dry run for ticket ${ticket}` };
146
+ const g = e.guesses.find((x) => x.n === Number(n));
147
+ if (!g) return { ok: false, error: `ticket ${ticket} has no guess ${n}` };
148
+ const a = one(text, MAX_ANSWER);
149
+ if (!a) return { ok: false, error: 'an answer needs some text' };
150
+ g.answer = a; g.answeredAt = new Date(now == null ? Date.now() : now).toISOString();
151
+ return { ok: true, guess: g };
152
+ }
153
+
154
+ function read(file) {
155
+ try { const v = JSON.parse(fs.readFileSync(file, 'utf8')); return isObj(v) && isObj(v.tickets) ? v : null; } catch { return null; }
156
+ }
157
+ function write(file, data) {
158
+ fs.mkdirSync(path.dirname(file), { recursive: true });
159
+ const tmp = `${file}.${process.pid}.tmp`;
160
+ fs.writeFileSync(tmp, JSON.stringify(data, null, 2) + '\n');
161
+ fs.renameSync(tmp, file);
162
+ }
163
+
164
+ module.exports = { MARK, parse, check, merge, blockOf, withBlock, gapsOf, countsOf, answer, found, plain, read, write };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.665.0",
3
+ "version": "0.667.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.665.0",
9
+ "version": "0.667.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@anthropic-ai/sdk": "^1.3.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.665.0",
3
+ "version": "0.667.0",
4
4
  "private": true,
5
5
  "description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
6
6
  "license": "MIT",
@@ -107,3 +107,4 @@
107
107
  .lb-find .pm-kbd { display: none; }
108
108
  .lb-menu, .lb-cwr .lb-menu { position: fixed; left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 80vh; border-radius: var(--radius-panel) var(--radius-panel) 0 0; padding: 18px 12px 28px; }
109
109
  }
110
+ .lb .lb-more { margin: var(--space-4) 0 0 var(--space-4); }
@@ -42,11 +42,12 @@ const CHEV_D = 'M6 9l6 6 6-6', CHEV_R = 'M9 6l6 6-6 6', TICK = 'M5 12.5l4.5 4.5L
42
42
  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', OPEN = 'M14 4h6v6M20 4l-9 9M18 14v5H5V6h5';
43
43
  const store = { get(k) { try { return JSON.parse(localStorage.getItem(k) || 'null'); } catch { return null; } }, set(k, v) { try { localStorage.setItem(k, JSON.stringify(v)); } catch { /* a private window */ } } };
44
44
  const saved = store.get('pmos.lib.view') || {};
45
+ const CAP = 40; // rows a group draws before Show more (A435)
45
46
  const S = {
46
47
  items: null, programs: [], error: '', at: 0, q: '', P: null, sel: { programs: [], projects: [] },
47
48
  kinds: Array.isArray(saved.kinds) ? saved.kinds : [], states: Array.isArray(saved.states) ? saved.states : [],
48
49
  group: GROUPS.some(([k]) => k === saved.group) ? saved.group : 'new',
49
- open: new Set(), shut: new Set(), ed: new Set(), ck: new Set(), naming: null, pick: null, peek: new Map(),
50
+ open: new Set(), shut: new Set(), ed: new Set(), ck: new Set(), more: new Map(), naming: null, pick: null, peek: new Map(),
50
51
  meaning: null, // { q, results, ranked, why, busy }
51
52
  shown: [],
52
53
  };
@@ -182,7 +183,7 @@ function groupPress(b) { if (!b.dataset.lg) return false; S.group = b.dataset.lg
182
183
  const multi = () => new Set((S.items || []).map((x) => x.product).filter(Boolean)).size > 1;
183
184
  function badge(r) {
184
185
  const x = r.x, t = stateText(r);
185
- if (!t || (x.state === 'Final' && t === 'Final')) return ''; // Final is the usual state: zero is silence
186
+ if (!t || x.state === 'Final') return ''; // Final is the usual state, whatever its edition: zero is silence (the editions fold under the row)
186
187
  return `<span class="pm-badge${x.state === 'Issued' ? ' blue' : ''}">${esc(t)}</span>`;
187
188
  }
188
189
  function whyOf(x, shelf) {
@@ -240,12 +241,16 @@ function rowsHtml(groups) {
240
241
  if (g.folded) continue;
241
242
  } else if (!flat) h += `<div class="pm-group" role="presentation">${esc(g.label)}${S.group === 'work' ? ` <em>${g.n}</em>` : ''}</div>`;
242
243
  const shelf = g.level === 2 && g.key !== 'w:none' ? g.label : '';
243
- let rows = '';
244
+ let rows = '', n = 0;
245
+ const key = g.key || g.label, cap = S.more.get(key) || CAP, all = g.rows.filter((r) => !r.checks).length;
244
246
  for (const r of g.rows) {
245
247
  if (r.checks) { rows += checksHtml(r); continue; }
248
+ if (n++ >= cap) continue; // a long shelf draws its first rows; Show more draws the next ones (the real Library holds 1,000+ rows)
246
249
  rows += rowHtml(r, S.shown.length, false, shelf); S.shown.push(r.x);
247
250
  if (r.older.length && S.ed.has(r.x.id)) for (const o of r.older) { rows += rowHtml({ x: o, older: [] }, S.shown.length, true, shelf); S.shown.push(o); }
248
251
  }
252
+ const left = all - cap;
253
+ if (left > 0) rows += `<button type="button" class="pm-chip lb-more" data-lb-more="${esc(key)}">${esc(left > CAP ? 'Show ' + CAP + ' more of ' + left : 'Show the other ' + left)}</button>`;
249
254
  h += `<div class="rows" role="list">${rows}</div>`;
250
255
  }
251
256
  return h;
@@ -419,6 +424,7 @@ body.onclick = async (e) => {
419
424
  if (folded) { S.open.add(k); S.shut.delete(k); } else { S.shut.add(k); S.open.delete(k); }
420
425
  draw(); return;
421
426
  }
427
+ if ((b = t.closest('[data-lb-more]'))) { const k = b.dataset.lbMore; S.more.set(k, (S.more.get(k) || CAP) + CAP); draw(); return; }
422
428
  if ((b = t.closest('[data-lb-ed]'))) { const k = b.dataset.lbEd; if (S.ed.has(k)) S.ed.delete(k); else S.ed.add(k); draw(); return; }
423
429
  if ((b = t.closest('[data-lb-ck]'))) { const k = b.dataset.lbCk; if (S.ck.has(k)) S.ck.delete(k); else S.ck.add(k); draw(); return; }
424
430
  if ((b = t.closest('[data-lb-name]'))) { S.naming = b.dataset.lbName; draw(); return; }
@@ -485,8 +485,20 @@ function traceChanges(changes, ctx) {
485
485
  return undefined;
486
486
  };
487
487
  const touched = new Set();
488
+ // dry-run-tickets-before-build: the lines of a multi-line `module.exports = {` … `};` block. A changed line there names the exports it
489
+ // holds: each counts as touched, as if its declaration had changed (a new export reaches only the code that names it).
490
+ const exA = C.findIndex((l) => /^module\.exports\s*=\s*\{\s*$/.test(l));
491
+ let exB = exA; if (exA >= 0) while (exB < C.length && !/^\}\s*;?\s*$/.test(C[exB])) exB++;
488
492
  for (const n of ch.lines) {
489
493
  if (n > C.length || !(C[n - 1] || '').trim()) continue; // a comment, a blank line or past the end
494
+ if (exA >= 0 && n - 1 > exA && n - 1 < exB) {
495
+ for (const part of C[n - 1].split(',').map((x) => x.trim()).filter(Boolean)) {
496
+ const [k, v] = part.split(':').map((x) => x.trim());
497
+ if (!/^[\w$]+$/.test(k) || (v !== undefined && !/^[\w$]+$/.test(v))) return null;
498
+ touched.add(v || k);
499
+ }
500
+ continue;
501
+ }
490
502
  const d = declAt(n);
491
503
  if (!d) return null;
492
504
  touched.add(d);
@@ -703,6 +715,11 @@ function traceChanges(changes, ctx) {
703
715
  for (const s of list) if (s === 'headless.test.js' || rk.some((x) => (get(s) || '').includes(x))) picked.add(s);
704
716
  continue;
705
717
  }
718
+ const tk = f === 'lib/headless.js' ? toolsOnly(sget(f), lines) : null;
719
+ if (tk) { // only the tool list of existing kinds changed: only runs of those kinds see it, so the suites that name a kind's tools or origin
720
+ for (const s of list) if (s === 'headless.test.js' || tk.some((x) => (get(s) || '').includes(x))) picked.add(s);
721
+ continue;
722
+ }
706
723
  const nv = f === VERBS_FILE ? newVerbOnly(sget(f), lines) : null;
707
724
  if (nv) { // a new verb: only `pmos <verb>` calls reach it, so the suites that name the table or the verb's module
708
725
  for (const s of list) { const t = get(s) || ''; if (t.includes('pmos-verbs') || nv.some((m) => t.includes(m))) picked.add(s); }
@@ -779,6 +796,31 @@ function newKindOnly(src, lines) {
779
796
  return [...[...consts.values()].flat(), ...kinds].map((x) => `'${x}`);
780
797
  }
781
798
 
799
+ /* dry-run-tickets-before-build: lib/headless.js TOOLS gives each kind its fixed tool list. A change whose every line sits inside one or more
800
+ * entries of TOOLS and is only quoted tool names (or blank, as a comment is once stripped) changes what runs of those kinds may call, not how
801
+ * any run is spawned: it reaches headless.test.js and the suites that name `TOOLS.<kind>`, `TOOLS['<kind>']` or an origin `'<kind>:`.
802
+ * Returns those markers, or null when any changed line is something else. `src` is without comments. */
803
+ function toolsOnly(src, lines) {
804
+ if (src == null || !Array.isArray(lines) || !lines.length) return null;
805
+ const C = src.split('\n');
806
+ const start = C.findIndex((l) => /^const TOOLS = Object\.freeze\(\{\s*$/.test(l.trim()));
807
+ if (start < 0) return null;
808
+ let end = start + 1; while (end < C.length && !/^\}\);\s*$/.test(C[end].trim())) end++;
809
+ const kinds = new Set();
810
+ for (const n of lines) {
811
+ const i = n - 1, l = (C[i] || '').trim();
812
+ if (i <= start || i >= end) return null;
813
+ if (!l) continue;
814
+ if (!/^(?:'?[\w-]+'?: Object\.freeze\(\[)?(?:\s*'[^'\n]*',?)*\s*(?:\]\),)?$/.test(l)) return null;
815
+ let k = null;
816
+ for (let j = i; j > start && !k; j--) { const m = /^\s*'?([\w-]+)'?: Object\.freeze\(\[/.exec(C[j]); if (m) k = m[1]; }
817
+ if (!k) return null;
818
+ kinds.add(k);
819
+ }
820
+ if (!kinds.size) return null;
821
+ return [...kinds].flatMap((k) => [`TOOLS.${k}`, `TOOLS['${k}']`, `'${k}:`]);
822
+ }
823
+
782
824
  /* lib/headless.js RUN_ENV lists the variables a background run's spawn spec may set. A change whose every line sits inside that list and
783
825
  * holds only quoted PMOS_ names changes what one kind of run is pinned with, not how any run is spawned: it reaches the suites that name
784
826
  * one of the names on those lines. Returns those names, or null when any changed line is something else. `src` is without comments. */
@@ -1020,4 +1062,4 @@ async function main() {
1020
1062
  }
1021
1063
 
1022
1064
  if (require.main === module) main().catch((e) => { console.error(e); process.exitCode = 1; });
1023
- else module.exports = { traceChanges, runEnvOnly, diffLines, strip, changedDeps, WIDE };
1065
+ else module.exports = { traceChanges, runEnvOnly, toolsOnly, diffLines, strip, changedDeps, WIDE };
@@ -15,7 +15,7 @@ output:
15
15
  The prompt that starts this run names the target, the reason the run started, the stage category and what the PM already kept. Work on that target only.
16
16
 
17
17
  Rules that always hold:
18
- 1. THE ONLY WRITES are `pmos driver propose` and `pmos coredoc write` (a draft of a core document of this initiative, nothing else). You have no Write and no Edit tool. Do not change a repository file, do not commit, do not push, and do not move the initiative to another stage. Keeping a proposal is the PM's act, not yours.
18
+ 1. THE ONLY WRITES are `pmos driver propose`, `pmos coredoc write` (a draft of a core document of this initiative, nothing else), `pmos jira guesses` (the dry run of its drafted tickets, step 9) and `pmos signoff ask|answer` (its outside sign-offs, step 10). You have no Write and no Edit tool. Do not change a repository file, do not commit, do not push, and do not move the initiative to another stage. Keeping a proposal is the PM's act, not yours.
19
19
  2. SEND NOTHING. Never send, reply, forward, post, comment, react, create, transition or label anything in mail, Slack, Jira, Confluence, GitHub, Drive, Figma or any other source. Read a connector only where it is already allowed. If a tool is refused, say so in your answer and go on without it.
20
20
  3. EVERY CLAIM CARRIES A POINTER. A pointer is a Jira key, a Slack link, a meeting note path, a requirement note path or a document path. Give it with `--source label=ref`. A claim you cannot point at is not a claim: leave it out. An evidence line with no pointer is not evidence: leave it out.
21
21
  4. NOTHING INVENTED. Write only what you read. Say "not known" and name who could tell you. A run that finds nothing new is a correct run: file nothing.
@@ -44,6 +44,7 @@ Procedure:
44
44
  - Do: no ticket moved, or a ticket is blocked. File a `note` with the ticket keys, how long they have not moved and who could unblock them.
45
45
  - Learn: the check-by date passed with no outcome check, or a kill condition tripped. File a `note` that names the date or the condition and the evidence you read.
46
46
  - Any stage, stalled: File a `note` with the last change you can find and the one question whose answer would restart the work.
47
+ In Plan and Do, also do steps 9 and 10.
47
48
  6. File each proposal like this, with one `--source` for each pointer:
48
49
  `pmos driver propose initiative <id> --what artefact --file /tmp/kill.json --why "<one line: why the PM needs this>" --source "Jira DISC-12=https://…" --source "Meeting note=notes/2026-10-08.md"`
49
50
  Write the JSON or text file in the scratch folder of this session. If `pmos driver propose` refuses, read the reason, fix the proposal and file it once more. Do not work around a refusal.
@@ -54,6 +55,12 @@ Procedure:
54
55
  `pmos driver propose initiative <id> --what doc --data '{"key":"<key>","slot":"<the slot it printed>"}' --why "<one line>"`.
55
56
  The PM's Keep issues the draft. While a document of this stage is due, do not propose a stage move: `pmos driver propose` refuses it.
56
57
 
58
+ 9. Dry-run the drafted tickets (Plan and Do). Run `pmos jira guesses <id>`. When it says the initiative has a ticket draft and some tickets are not dry-run yet, or a dry run is out of date because the PRD changed, dry-run those tickets:
59
+ a. Read the draft file (`pmos jira show <id>` names it). For each ticket, read ONLY the ticket and pretend to build it. List every point where you would have to guess: an error or failure state, an empty or loading state, who may see it, a limit, a screen size, what happens on Back or cancel, a number or a word the ticket does not give. One plain question each, at most 12 per ticket.
60
+ b. Then read the PRD, the done test and the record. For each question, copy the lines that answer it word for word (at most 3). Mark it `"answered": "yes"`, `"partly"` or `"no"`. Never change a line you quote: PMOS drops a quote it cannot find word for word, and the question then counts as a gap.
61
+ c. Write `{"tickets": [{"id": "<ticket id>", "guesses": [{"question": "…", "prd": ["<quoted line>"], "answered": "yes|partly|no"}]}]}` to a file in your scratch folder and run `pmos jira guesses <id> --from <file>`. PMOS copies the quoted lines into the tickets and puts the gaps on the PM's question list. Never answer a gap yourself: the PM answers with `pmos jira answer`.
62
+ 10. Outside sign-offs (Plan and Do). Run `pmos signoff list <id>`. Read the PRD, the record and the notes for each yes the work waits on from someone outside the team (a scope, a price, wording, a go or no-go). For each one not listed, run `pmos signoff ask <id> --who "<name or team>" --what "<what they must say yes to>" --asked <date> [--due <date>] --source "<pointer>"`. When a source you read shows the answer, run `pmos signoff answer <signoff id> --answer "<what they said>" --source "<pointer>"`. Never record an answer you cannot point at. PMOS puts the open ones on the PM's question list.
63
+
57
64
  Output contract — produce EXACTLY these sections in your final message:
58
65
  - Filed (the proposal ids and their kinds, or "nothing new")
59
66
  - Skipped (what you did not file and why: already kept, no pointer, nothing found)
@@ -24,7 +24,7 @@ Rules that always hold:
24
24
  Procedure:
25
25
  0. Ask first, when the task names no initiative. Run `pmos refresh since jira`. If it says "read in full", go to step 1. If it says "ask first", note the number of minutes it prints. Run `pmos jira query` and `pmos jira query --sprints`, and run each search they print with ` AND updated >= -<minutes>m` added (put the search in brackets first), asking only for the key field and one result. If no search returns an issue, run `pmos refresh same jira`, finish with "Checked: no change in Jira in the last <minutes> minutes", and stop. If any search returns an issue, or a search fails, go to step 1 and read in full.
26
26
  0a. One sprint, when the task names it ("This check: sprint …"): the PM asked PMOS to read a closed sprint it never saw. Run `pmos jira query --sprint "<the sprint's name>"`, run that search with the fields of step 2, fetch every page, save the result in the scratch folder in the shape of step 3, run `pmos jira sync --sprint "<the sprint's name>" --from <the file>`, finish with "Checked: <the sprint's name>, <N> tickets kept", and stop. Do nothing else in that run.
27
- 1. If the task names one initiative ("This check: initiative …"), check that one only: run `pmos jira query <initiative>`. Otherwise run `pmos jira query`: each line is an initiative id, a tab and the Jira search (JQL) to run for it. An initiative PMOS pushed no ticket for, but which is linked to Jira epics, gets a search for those epics and the issues under them. If no initiative has a ticket or an epic in Jira, say so in one line and stop.
27
+ 1. If the task names one initiative ("This check: initiative …"), check that one only: run `pmos jira query <initiative>`. Otherwise run `pmos jira query`: each line is an initiative id, a tab and the Jira search (JQL) to run for it. An initiative PMOS pushed no ticket for, but which is linked to Jira epics, gets a search for those epics and the issues under them. An initiative whose tasks start with a Jira key (tasks imported from Jira, such as "IDPF-2746 · Send verification email") gets those tickets in its search too: PMOS sets each task's state from what you read. If no initiative has a ticket or an epic in Jira, say so in one line and stop.
28
28
  2. For each initiative, run its search with the Jira search tool and the fields in rule 3, at most 50 issues per page. The sprint is a custom field named "Sprint" whose id differs per site (often `customfield_10020`, on some sites `customfield_10004`). If the first page comes back with no Sprint field, ask once for every field of one issue (`*all`), find the field whose value is a list of sprints (each with a name and a state), and ask for that id from then on. Story points are also a custom field, named "Story Points" or "Story point estimate" (often `customfield_10016`); ask for it by name. Fetch every page.
29
29
  3. Save the result as JSON in the scratch folder, for example `<scratch>/jira-<initiative>.json`, as a list with one object per issue:
30
30
  `{"key", "summary", "status", "category", "type", "parent", "sprint", "subtasks", "points", "resolved", "flagged", "reason", "url"}`
@@ -0,0 +1,11 @@
1
+ {
2
+ "_comment": "Dry-run tickets before they're built (initiative dry-run-tickets-before-build, done test D1-D12): a ticket dry run keeps only the PRD lines it finds word for word and copies them into the ticket; gaps and open outside sign-offs go on the day's question list. Synthetic kit-layout repositories. No connector, model or network.",
3
+ "modules": [
4
+ "ticket-dry-run.test.js",
5
+ "signoffs.test.js"
6
+ ],
7
+ "seconds": {
8
+ "ticket-dry-run.test.js": 5,
9
+ "signoffs.test.js": 5
10
+ }
11
+ }