create-pmos 0.805.0 → 0.807.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.805.0",
3
+ "version": "0.807.0",
4
4
  "description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -33,6 +33,53 @@
33
33
  "audit"
34
34
  ],
35
35
  "pmosChanges": [
36
+ {
37
+ "v": "0.807.0",
38
+ "at": "2026-11-25T05:33:13.867Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1849,
43
+ "t": "Warn when an experiment cannot conclude by its check date (job #1840, A404)",
44
+ "s": "Warn when an experiment cannot conclude by its check date (job #1840, A404)",
45
+ "k": "new",
46
+ "try": {
47
+ "steps": [
48
+ "On Work, open an initiative whose record has baseline: 10%, min_change: 1pp, weekly_traffic: 500 and outcome_horizon a week away.",
49
+ "Look at the Overview's lines.",
50
+ "Change weekly_traffic to 50000 and open the popup again."
51
+ ],
52
+ "see": "First the Overview shows 'It cannot conclude by <date>: it needs about 30,000 people, 60 weeks at 500 a week.' from the record; with 50,000 a week the line is gone.",
53
+ "open": "/premium-board.html"
54
+ }
55
+ },
56
+ {
57
+ "n": 1848,
58
+ "t": "Rows no longer show below Today's capture box on a phone",
59
+ "s": "Rows no longer show below Today's capture box on a phone",
60
+ "k": "fix"
61
+ }
62
+ ]
63
+ },
64
+ {
65
+ "v": "0.806.0",
66
+ "at": "2026-11-25T05:20:35.133Z",
67
+ "f": 4,
68
+ "prs": [
69
+ {
70
+ "n": 1846,
71
+ "t": "No merge without a done test, and the Checker hands back the missing assert (A531, A532)",
72
+ "s": "No merge without a done test, and the Checker hands back the missing assert (A531, A532)",
73
+ "k": "new"
74
+ },
75
+ {
76
+ "n": 1847,
77
+ "t": "Steering pack — one page per program, decisions marked into the journal (job #1842, A108)",
78
+ "s": "Steering pack — one page per program, decisions marked into the journal (job #1842, A108)",
79
+ "k": "new"
80
+ }
81
+ ]
82
+ },
36
83
  {
37
84
  "v": "0.805.0",
38
85
  "at": "2026-11-25T04:31:28.431Z",
@@ -48,16 +95,7 @@
48
95
  "n": 1827,
49
96
  "t": "⋯ Change holds what the popup's four leave off (job #1821, A498)",
50
97
  "s": "⋯ Change holds what the popup's four leave off (job #1821, A498)",
51
- "k": "fix",
52
- "try": {
53
- "steps": [
54
- "On Work, open an initiative's popup and pick two tasks.",
55
- "Open ⋯ (More actions) and look at its first group.",
56
- "Press Esc to clear the pick and open ⋯ again."
57
- ],
58
- "see": "With the default four (Add, Who, Set the date, Stage) on the toolbar, ⋯ has no Change group. If your four leave out Who, Set the date or Stage, ⋯ starts with Change holding them while tasks are…",
59
- "open": "/premium-board.html"
60
- }
98
+ "k": "fix"
61
99
  }
62
100
  ]
63
101
  },
@@ -372,74 +410,6 @@
372
410
  "k": "fix"
373
411
  }
374
412
  ]
375
- },
376
- {
377
- "v": "0.785.0",
378
- "at": "2026-11-24T17:13:04.909Z",
379
- "f": 4,
380
- "prs": [
381
- {
382
- "n": 1758,
383
- "t": "A chat write moves the row on every open page at once (a2ui-live-rows, job #1750)",
384
- "s": "A chat write moves the row on every open page at once (a2ui-live-rows, job #1750)",
385
- "k": "new"
386
- },
387
- {
388
- "n": 1753,
389
- "t": "Chat rules, AGENTS.md commands and the / menu generated from the card catalog",
390
- "s": "Chat rules, AGENTS.md commands and the / menu generated from the card catalog",
391
- "k": "new"
392
- },
393
- {
394
- "n": 1782,
395
- "t": "Declined asks get a kind reply draft and an out-of-scope record",
396
- "s": "Declined asks get a kind reply draft and an out-of-scope record",
397
- "k": "new",
398
- "h": "Declined asks get a kind reply draft and an out-of-scope record",
399
- "try": {
400
- "steps": [
401
- "Open Today and ask PMOS in the chat: which asks did I decline lately?",
402
- "Ask PMOS to record one of them with its reason"
403
- ],
404
- "see": "The chat lists the Jira tickets closed as Won't Do, Declined, Duplicate or similar in the last 90 days, each with a short kind reply to the person who asked. Recording one adds it to the product's…"
405
- }
406
- },
407
- {
408
- "n": 1755,
409
- "t": "States are shapes, not words (state-glyphs, job #1675)",
410
- "s": "States are shapes, not words (state-glyphs, job #1675)",
411
- "k": "new"
412
- },
413
- {
414
- "n": 1785,
415
- "t": "Guide pages and markdown files read in the Reading layout (A334)",
416
- "s": "Guide pages and markdown files read in the Reading layout (A334)",
417
- "k": "new"
418
- }
419
- ]
420
- },
421
- {
422
- "v": "0.784.0",
423
- "at": "2026-11-24T16:59:38.052Z",
424
- "f": 4,
425
- "prs": [
426
- {
427
- "n": 1777,
428
- "t": "PMOS proposes the scope cuts that save a date",
429
- "s": "PMOS proposes the scope cuts that save a date",
430
- "k": "new",
431
- "h": "PMOS proposes the scope cuts that save a date",
432
- "try": {
433
- "steps": [
434
- "Open Work and open an initiative whose end date is still ahead but whose tasks run past it",
435
- "Press its ✦ and find Cut to keep the date",
436
- "Keep it, then press Undo"
437
- ],
438
- "see": "The ✦ lists the tasks that finish after the date, each with its forecast and the new dates after the date; Keep moves them and adds a note, and Undo puts them back",
439
- "open": "/premium-board.html"
440
- }
441
- }
442
- ]
443
413
  }
444
414
  ]
445
415
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@0b8fc5903
1
+ kernel-source: pmos@73d185ab7
2
2
  assembled: 2026-11-25
3
3
  mode: vendor
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Eval calibration log"
4
4
  description: "Append-only record of every PM override of an evaluator verdict."
5
- generated: {by: process:create-pmos, at: "2026-11-25T04:31:25Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-25T05:33:10Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Health budgets"
4
4
  description: "Closed registry of health-budget anchors (D59), edited only by the PM."
5
- generated: {by: process:create-pmos, at: "2026-11-25T04:31:25Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-25T05:33:10Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -331,20 +331,88 @@ function classify({ cwd = process.cwd(), base, head, branch = '', body = '', led
331
331
  * repository's work-item ledger can answer (scope, flag, verified, pmos-review): on this line the merge station merges on green CI.
332
332
  * It also leaves out changed tests and done tests (every build adds a done test and may fix a test; the Checker grades them) and the
333
333
  * D11 history flags (an L2 flag, not an irreversible kind).
334
- * lineVerdict({ cwd, base, head, body, job }) → { factory: true, item: job, verdict: 'auto'|'human', reasons, files } */
334
+ * A531: before any of that, the job's record and done test must be on the head; if not, the verdict is `refuse` (SEND BACK to the
335
+ * build thread) and `refuse` lists why. `reasons` still lists the irreversible kinds it will wait on afterwards.
336
+ * lineVerdict({ cwd, base, head, body, job }) → { factory: true, item: job, verdict: 'auto'|'human'|'refuse', reasons, refuse, files } */
335
337
  const LINE_SKIP = new Set(['eval-files']);
336
338
  function jobOf(body) {
337
339
  const m = /^(?:Factory-Job|Initiative):\s*([a-z0-9][a-z0-9-]*)\s*$/mi.exec(String(body || ''));
338
340
  return m ? m[1].toLowerCase() : null;
339
341
  }
342
+ /* A531 (initiative merge-needs-done-test): no merge without a done test. 6 of 159 Checker verdicts in 48 hours were NO_DONE_TEST:
343
+ * the build merged with nothing to grade it against. The job's record on the PR head must name a done_test_path, and that file
344
+ * must be on the head and not empty. Records sit in planning/initiatives (PMOS-self) or the kit layouts; the file is <id>.md, or
345
+ * any record there whose frontmatter says `id: <job>`. → null when it has one, else the reason (one sentence). */
346
+ const RECORD_DIRS = ['planning/initiatives', 'pmos/planning/initiatives', 'pmos/state/initiatives'];
347
+ function frontOf(text) {
348
+ const m = /^---\r?\n([\s\S]*?)\r?\n---/.exec(String(text || ''));
349
+ const fm = {};
350
+ if (m) for (const l of m[1].split(/\r?\n/)) { const kv = /^([A-Za-z_][\w-]*):\s*(.*)$/.exec(l); if (kv) fm[kv[1]] = kv[2].trim().replace(/^(["'])(.*)\1$/, '$2'); }
351
+ return fm;
352
+ }
353
+ function doneTestGap(cwd, head, item) {
354
+ if (!item) return 'the pull request names no job (no Initiative: or Factory-Job: line), so there is no record and no done test to grade it against';
355
+ let file = null, text = null;
356
+ for (const d of RECORD_DIRS) { const r = git(cwd, ['show', `${head}:${d}/${item}.md`]); if (r.ok) { file = `${d}/${item}.md`; text = r.out; break; } }
357
+ if (!file && /^[a-z0-9][a-z0-9_-]*$/i.test(item)) {
358
+ const g = git(cwd, ['grep', '-l', '-E', `^id:[[:space:]]*["']?${item}["']?[[:space:]]*$`, head, '--', ...RECORD_DIRS]);
359
+ const hit = g.ok && g.out.split('\n').map((l) => l.replace(/^[^:]+:/, '').trim()).filter((l) => /\.md$/.test(l))[0];
360
+ if (hit) { const r = git(cwd, ['show', `${head}:${hit}`]); if (r.ok) { file = hit; text = r.out; } }
361
+ }
362
+ if (!file) return `${item} has no record on the pull request head (looked in ${RECORD_DIRS.join(', ')})`;
363
+ const dt = frontOf(text).done_test_path;
364
+ if (!dt) return `${file} names no done_test_path`;
365
+ const t = git(cwd, ['show', `${head}:${dt.replace(/^\/+/, '')}`]);
366
+ if (!t.ok) return `${file} names the done test ${dt}, but it is not on the pull request head`;
367
+ if (!t.out.trim()) return `the done test ${dt} is empty`;
368
+ return null;
369
+ }
370
+ const isGitHubRevert = (body) => /^Reverts [\w.-]+\/[\w.-]+#\d+\s*$/m.test(String(body || ''));
371
+ /* Which job a line pull request is. Real bodies name it many ways ("Initiative: `issue-from-chat` (chore, …)", "Job: x (A334)",
372
+ * "follow-up to #1825 (initiative `page-open-200ms`)", "Done test: `planning/done-tests/x.md`"), and many name none but carry the
373
+ * record or the done test in the diff. → candidate ids, best first: --job, the strict line, the diff's records and done tests, then
374
+ * the body's mentions. The first candidate with its record and done test on the head is the job. */
375
+ const SLUG = /^[a-z0-9][a-z0-9_-]*[a-z0-9]$/;
376
+ function jobCandidates({ job, body, files = [], cwd, head }) {
377
+ const out = [], add = (x) => { const v = String(x || '').toLowerCase().replace(/^`|`$/g, ''); if (SLUG.test(v) && !out.includes(v)) out.push(v); };
378
+ const b = String(body || '');
379
+ add(job); add(jobOf(b));
380
+ const dtPaths = new Set();
381
+ for (const f of files) {
382
+ const p = f.path || f;
383
+ const m = /^(?:planning\/initiatives|pmos\/planning\/initiatives|pmos\/state\/initiatives)\/([^/]+)\.md$/.exec(p);
384
+ if (m) { const r = git(cwd, ['show', `${head}:${p}`]); add(r.ok && frontOf(r.out).id || m[1]); }
385
+ if (/(^|\/)done-tests\/[^/]+\.md$/.test(p)) dtPaths.add(p);
386
+ }
387
+ for (const m of b.matchAll(/\b((?:pmos\/)?(?:planning|state)\/done-tests\/[a-z0-9_-]+\.md)\b/gi)) dtPaths.add(m[1]);
388
+ for (const p of dtPaths) { // a done test names its initiative in its frontmatter, else by its file name
389
+ const r = git(cwd, ['show', `${head}:${p}`]);
390
+ add(r.ok && frontOf(r.out).initiative); add(path.posix.basename(p, '.md'));
391
+ }
392
+ for (const m of b.matchAll(/\b(?:initiative|factory-job|job)\b:?\s*`?([a-z0-9][a-z0-9_-]*[a-z0-9])`?/gi)) add(m[1]);
393
+ for (const m of b.matchAll(/`([a-z0-9][a-z0-9_-]*-[a-z0-9_-]*[a-z0-9])`/g)) add(m[1]);
394
+ return out.slice(0, 16);
395
+ }
396
+ // a pull request that changes only tests or prose has nothing a done test would grade: the tests are the check (A531)
397
+ const onlyTestsOrDocs = (files) => files.length > 0 && files.every((f) => { const l = String(f.path || f).toLowerCase();
398
+ return /\.(md|mdx|txt|rst|adoc)$/.test(l) || TEST_FILE.test(l) || TEST_NAME.test(l); });
399
+
340
400
  function lineVerdict({ cwd = process.cwd(), base, head, body = '', job = null } = {}) {
341
- const item = job || jobOf(body);
342
- const reasons = [];
401
+ let item = job || jobOf(body);
402
+ const reasons = [], refuse = [];
343
403
  const human = (rule, detail) => reasons.push({ rule, detail });
344
404
  if (/^PMOS-Merge:\s*human\s*$/mi.test(String(body || ''))) human('pmos-merge-human', 'the pull request asks for a person (PMOS-Merge: human)');
345
- if (!base || !head) { human('unreadable', 'no base or head to compare'); return { factory: true, line: true, item, verdict: 'human', reasons, files: [] }; }
405
+ if (!base || !head) { human('unreadable', 'no base or head to compare'); return { factory: true, line: true, item, verdict: 'human', reasons, refuse, files: [] }; }
346
406
  const d = diffOf(cwd, base, head);
347
- if (d.error) { human('unreadable', d.error); return { factory: true, line: true, item, verdict: 'human', reasons, files: [] }; }
407
+ if (d.error) { human('unreadable', d.error); return { factory: true, line: true, item, verdict: 'human', reasons, refuse, files: [] }; }
408
+ // A531: a pull request with no done test goes back to its build thread, not to Wawan. A GitHub revert removes a build, and a
409
+ // change to tests or prose only is its own check: both exempt.
410
+ if (!isGitHubRevert(body) && !onlyTestsOrDocs(d.files)) {
411
+ const cands = jobCandidates({ job, body, files: d.files, cwd, head });
412
+ const hit = cands.find((c) => !doneTestGap(cwd, head, c));
413
+ if (hit) item = item || hit;
414
+ else refuse.push({ rule: 'no-done-test', detail: doneTestGap(cwd, head, job || jobOf(body) || cands[0] || null) });
415
+ }
348
416
  const files = d.files, all = [];
349
417
  if (!files.length) human('empty', 'the pull request changes nothing');
350
418
  for (const f of files) {
@@ -372,10 +440,13 @@ function lineVerdict({ cwd = process.cwd(), base, head, body = '', job = null }
372
440
  }
373
441
  const seen = new Set();
374
442
  const uniq = reasons.filter((r) => { const k = r.rule + '|' + r.detail; if (seen.has(k)) return false; seen.add(k); return true; });
375
- return { factory: true, line: true, item, verdict: uniq.length ? 'human' : 'auto', reasons: uniq, files: files.map((f) => f.path) };
443
+ return { factory: true, line: true, item, verdict: refuse.length ? 'refuse' : uniq.length ? 'human' : 'auto', reasons: uniq, refuse, files: files.map((f) => f.path) };
376
444
  }
377
445
 
378
446
  function summaryOf(v) {
447
+ if (v.line && v.verdict === 'refuse') return [`pmos-guardrail (factory line): SEND BACK ${v.item || 'this pull request'} to its build thread. Do not merge, and do not ask Wawan:`,
448
+ ...v.refuse.map((r) => `- ${r.detail}`), ' Land the record and its done test on the pull request, then run this again.',
449
+ ...(v.reasons.length ? ['After that it will still WAIT FOR WAWAN, because:', ...v.reasons.map((r) => `- ${r.detail}`)] : [])].join('\n');
379
450
  if (v.line) return v.verdict === 'auto'
380
451
  ? `pmos-guardrail (factory line): MERGE ${v.item || 'this pull request'} when required CI is green. Nothing on the irreversible list.`
381
452
  : [`pmos-guardrail (factory line): WAIT FOR WAWAN on ${v.item || 'this pull request'}, because:`, ...v.reasons.map((r) => `- ${r.detail}`)].join('\n');
@@ -418,5 +489,5 @@ function cliMain(argv, { say = (s) => console.log(s), env = process.env, cwd = p
418
489
  return 0;
419
490
  }
420
491
 
421
- module.exports = { classify, lineVerdict, jobOf, harnessTriggers, HARNESS, summaryOf, actOnGitHub, cliMain, REVERT_DAYS, STALE_DAYS, MANIFESTS, LOCKS };
492
+ module.exports = { classify, lineVerdict, jobOf, doneTestGap, jobCandidates, harnessTriggers, HARNESS, summaryOf, actOnGitHub, cliMain, REVERT_DAYS, STALE_DAYS, MANIFESTS, LOCKS };
422
493
  if (require.main === module) process.exitCode = cliMain(process.argv.slice(2));
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Discoveries and friction log"
4
4
  description: "Append-only record of what runs discovered and where the process rubbed."
5
- generated: {by: process:create-pmos, at: "2026-11-25T04:31:25Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-25T05:33:10Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,51 @@
1
1
  [
2
+ {
3
+ "v": "0.807.0",
4
+ "at": "2026-11-25T05:33:13.867Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1849,
9
+ "t": "Warn when an experiment cannot conclude by its check date (job #1840, A404)",
10
+ "s": "Warn when an experiment cannot conclude by its check date (job #1840, A404)",
11
+ "k": "new",
12
+ "try": {
13
+ "steps": [
14
+ "On Work, open an initiative whose record has baseline: 10%, min_change: 1pp, weekly_traffic: 500 and outcome_horizon a week away.",
15
+ "Look at the Overview's lines.",
16
+ "Change weekly_traffic to 50000 and open the popup again."
17
+ ],
18
+ "see": "First the Overview shows 'It cannot conclude by <date>: it needs about 30,000 people, 60 weeks at 500 a week.' from the record; with 50,000 a week the line is gone.",
19
+ "open": "/premium-board.html"
20
+ }
21
+ },
22
+ {
23
+ "n": 1848,
24
+ "t": "Rows no longer show below Today's capture box on a phone",
25
+ "s": "Rows no longer show below Today's capture box on a phone",
26
+ "k": "fix"
27
+ }
28
+ ]
29
+ },
30
+ {
31
+ "v": "0.806.0",
32
+ "at": "2026-11-25T05:20:35.133Z",
33
+ "f": 4,
34
+ "prs": [
35
+ {
36
+ "n": 1846,
37
+ "t": "No merge without a done test, and the Checker hands back the missing assert (A531, A532)",
38
+ "s": "No merge without a done test, and the Checker hands back the missing assert (A531, A532)",
39
+ "k": "new"
40
+ },
41
+ {
42
+ "n": 1847,
43
+ "t": "Steering pack — one page per program, decisions marked into the journal (job #1842, A108)",
44
+ "s": "Steering pack — one page per program, decisions marked into the journal (job #1842, A108)",
45
+ "k": "new"
46
+ }
47
+ ]
48
+ },
2
49
  {
3
50
  "v": "0.805.0",
4
51
  "at": "2026-11-25T04:31:28.431Z",
@@ -14,16 +61,7 @@
14
61
  "n": 1827,
15
62
  "t": "⋯ Change holds what the popup's four leave off (job #1821, A498)",
16
63
  "s": "⋯ Change holds what the popup's four leave off (job #1821, A498)",
17
- "k": "fix",
18
- "try": {
19
- "steps": [
20
- "On Work, open an initiative's popup and pick two tasks.",
21
- "Open ⋯ (More actions) and look at its first group.",
22
- "Press Esc to clear the pick and open ⋯ again."
23
- ],
24
- "see": "With the default four (Add, Who, Set the date, Stage) on the toolbar, ⋯ has no Change group. If your four leave out Who, Set the date or Stage, ⋯ starts with Change holding them while tasks are…",
25
- "open": "/premium-board.html"
26
- }
64
+ "k": "fix"
27
65
  }
28
66
  ]
29
67
  },
@@ -693,6 +693,7 @@ An initiative with no plan end is "can't tell". PMOS never guesses its date.
693
693
  - `pmos program capacity <team> <n>` sets how many initiatives a team builds at once. The default is 2. An initiative's team is its record's `team:` line, else its product. It prints the command that undoes it.
694
694
  - `pmos program decide <id> --keep-target` records that you keep the target date against the forecast. A new slip asks again. `pmos program decide --team <team> --first <initiative>` records which initiative a shared team builds first.
695
695
  - `pmos program outcome <id> "<text>"` records the outcome read, the last exit of Land.
696
+ - `pmos program steering <id>` prints the steering pack: one page with the status, the dates at risk and the decisions needed, each with its options and PMOS's recommendation where there is one. It writes nothing. After the meeting, `pmos program steering <id> --mark <key> --choice <number>` writes the decision taken to the decision journal and prints the command that undoes it (`--undo <decision id>`). Ask for the steering pack in the chat on Work, and PMOS runs it.
696
697
 
697
698
  ### pmos driver: the Initiative Driver
698
699
 
@@ -94,7 +94,7 @@ The agenda lists the day's events in time order, each with its start time, and a
94
94
 
95
95
  Under the agenda, after a meeting PMOS recorded and filed in the last 3 hours, a card says what came of it and where PMOS filed it. ✓ keeps it there and the card goes. ✕ takes the recording out of that work, with Undo.
96
96
 
97
- On a phone, PMOS opens on Today. It is one page with no boxes: **Where it stands**, the next event with **Record**, the log, and the box to log a line at the bottom. Swipe a row to the right to do or accept it, and to the left to drop it or put it off. Each swipe has **Undo**.
97
+ On a phone, PMOS opens on Today. It is one page with no boxes: **Where it stands**, the next event with **Record**, the log, and the box to log a line at the bottom. A row that scrolls under the box goes behind it: no part of the row shows below the box. Swipe a row to the right to do or accept it, and to the left to drop it or put it off. Each swipe has **Undo**.
98
98
 
99
99
  ## Work
100
100
 
@@ -203,7 +203,7 @@ Press the rest of a row, or a milestone, to open it as a full popup in place of
203
203
 
204
204
  On a phone, in a shared read-only copy and in a breakdown given the whole popup, the work side keeps the three parts below. They use the full width of the popup: in a wide popup the timeline gets the extra width. A done task shows in grey text, never struck through.
205
205
 
206
- - **Overview.** Three short lines from the initiative's own records: **Problem**, **Goal** (with the goal it serves, by name) and **Done when**. A line with no record says **Not written yet.** and offers a draft with ✓ and ✕. Press a line to change it; it saves when you leave the field, with **Undo**. Then one line on where it stands, **PMOS suggests** (at most three, each with ✓ and ✕), and **Details ›** for the facts: Stage, Status, Start, Target end, Next milestone, Goal, Product, Program, Workflow and Open. A fact with no value is not shown. Goal, Product, Program and Next milestone are in the link colour and open their thing; the others are plain text. An initiative that is closed or done but has open tasks shows one suggestion: **Close them** or **Reopen**.
206
+ - **Overview.** Three short lines from the initiative's own records: **Problem**, **Goal** (with the goal it serves, by name) and **Done when**. A line with no record says **Not written yet.** and offers a draft with ✓ and ✕. Press a line to change it; it saves when you leave the field, with **Undo**. When the record names a `baseline`, a `min_change` and a `weekly_traffic`, PMOS works out how many people the experiment needs. If that takes past the check date, a fourth line, **Can it conclude?**, says so, for example "It cannot conclude by 9 Dec 2026: it needs about 30,000 people, 60 weeks at 500 a week." `min_change` in points (`2pp`) is absolute; in per cent (`10%`) it is relative to the baseline. Then one line on where it stands, **PMOS suggests** (at most three, each with ✓ and ✕), and **Details ›** for the facts: Stage, Status, Start, Target end, Next milestone, Goal, Product, Program, Workflow and Open. A fact with no value is not shown. Goal, Product, Program and Next milestone are in the link colour and open their thing; the others are plain text. An initiative that is closed or done but has open tasks shows one suggestion: **Close them** or **Reopen**.
207
207
  - **Work breakdown.** Each stage is a row that folds and says how much is done, for example "3 of 9 done". Only the stage in progress opens by itself, and a stage whose tasks are all done stays folded until you open it. In a stage, the tasks are in date order, a late task first; a done task stays in its place, in grey. In a long stage you see the late tasks, the tasks in progress and the next five, then **N more tasks**. The stages after the next one fold to one row. A task in no stage is not in the breakdown: it is in Work › Backlog, and one quiet line under the breakdown says how many, for example **2 tasks with no stage are in the Backlog ›**. A task with no date shows no date and is never late. The timeline is on the right, with **Today** on it. Drag the grip between the columns and the timeline to make the timeline wider or narrower; a double press puts it back. Choose its span (Quarter to Full) beside the tune icon, which shows or hides columns. A span shorter than the work opens on the period that holds today; scroll the timeline sideways to see the rest, with a sideways swipe on a trackpad, Shift and the mouse wheel, or by dragging its empty part. The item, status and date columns stay in place, and a thin bar under the dates shows where you are. A program's or a product's initiatives scroll the same way. The four-corners icon gives the breakdown the whole popup. Type in the last row of a stage to add a task; the **Task** choice beside it makes the next one a milestone.
208
208
  - **Status.** Press a task's status and pick the new one. **When did this happen?** shows under the list, with **Today** chosen: press the status again, or Enter, to keep today. Press **Yesterday**, or **Pick a date**, when the work moved earlier than you noted it. A day in the future, or a day before the task's previous move, cannot be picked. The toast says both days, for example "Done on 14 Nov, noted today.", with **Undo**.
209
209
  - **Open the task.** The ↗ on a row, or **Open the task** in its ⋯, opens a small popup on top: Task or Milestone, the name (press it to rename), status, dates, owner and notes. Its status asks **When did this happen?** too. ↑ and ↓ go to the task before or after it, and ⋯ has **Make it a milestone**, **Archive** and **Delete**, each with **Undo**. A change shows on the task's row at once. Escape, × or a press outside closes only the small popup, and the task's row lights for a moment.
@@ -229,7 +229,7 @@ function check(root, { id, verdict, evidence, again } = {}, { now = Date.now(),
229
229
  }
230
230
 
231
231
  /* ── logged from a press (decisions-from-approvals) ── */
232
- const FROM = Object.freeze(['approval', 'card', 'drop', 'park']);
232
+ const FROM = Object.freeze(['approval', 'card', 'drop', 'park', 'steering']); // steering: a decision marked after a steering meeting (lib/steering-pack.js, A108)
233
233
  const TAG = '[decision-log]';
234
234
 
235
235
  /** The ids an `undo` line took out. */
@@ -0,0 +1,65 @@
1
+ 'use strict';
2
+ /* experiment-power.js — can an experiment conclude by its check date? (initiative experiment-traffic-warning, job #1840, idea A404).
3
+ * PURE: maths on the record's frontmatter. No model, no read, no write.
4
+ *
5
+ * sampleSize(p, d, o) → total people (both arms) for a two-sided test of two proportions: baseline p, absolute change d.
6
+ * o: { alpha = 0.05, power = 0.8 }. null when p is not in (0, 1) or p + d is not in (0, 1) or d is 0.
7
+ * inputsOf(fm) → { metric, baseline, change, weekly, due } | null from the frontmatter keys:
8
+ * baseline 12% or 0.12
9
+ * min_change 2pp or 2 points (absolute); 10% (relative to the baseline); 0.02 (absolute)
10
+ * weekly_traffic people a week, both arms together (4,000 or 4000)
11
+ * outcome_horizon, else check_date: YYYY-MM-DD
12
+ * null when any of them is missing or not a number (zero is silence)
13
+ * warningOf(fm, today) → { n, weeks, weekly, due, ends, text } | null null when it can conclude by the check date
14
+ * The copy says PMOS, never Claude. */
15
+ const Z_A = { 0.05: 1.959964, 0.1: 1.644854, 0.01: 2.575829 };
16
+ const Z_B = { 0.8: 0.841621, 0.9: 1.281552 };
17
+ const DAY = 864e5;
18
+
19
+ function sampleSize(p, d, o = {}) {
20
+ const za = Z_A[o.alpha == null ? 0.05 : o.alpha], zb = Z_B[o.power == null ? 0.8 : o.power];
21
+ const q = p + d;
22
+ if (!(za && zb) || !(p > 0 && p < 1) || !(q > 0 && q < 1) || !d) return null;
23
+ const m = (p + q) / 2;
24
+ const a = za * Math.sqrt(2 * m * (1 - m)) + zb * Math.sqrt(p * (1 - p) + q * (1 - q));
25
+ return 2 * Math.ceil((a * a) / (d * d));
26
+ }
27
+
28
+ const num = (s) => { const n = Number(String(s).replace(/[,_\s]/g, '')); return Number.isFinite(n) ? n : NaN; };
29
+ function rate(s) {
30
+ const t = String(s == null ? '' : s).trim();
31
+ const m = /^([\d.,]+)\s*%$/.exec(t); if (m) return num(m[1]) / 100;
32
+ const n = num(t); return n > 1 ? n / 100 : n;
33
+ }
34
+ function change(s, p) {
35
+ const t = String(s == null ? '' : s).trim().replace(/^\+/, '');
36
+ let m = /^([\d.,]+)\s*(pp|points?|percentage points?)$/i.exec(t); if (m) return num(m[1]) / 100;
37
+ m = /^([\d.,]+)\s*%$/.exec(t); if (m) return p * num(m[1]) / 100;
38
+ return num(t);
39
+ }
40
+ const dateOf = (s) => { const m = /^(\d{4}-\d{2}-\d{2})/.exec(String(s || '').trim()); return m && Date.parse(m[1] + 'T00:00:00Z') > 0 ? m[1] : null; };
41
+
42
+ function inputsOf(fm) {
43
+ if (!fm || typeof fm !== 'object') return null;
44
+ if (fm.baseline == null || fm.min_change == null || fm.weekly_traffic == null) return null;
45
+ const baseline = rate(fm.baseline), d = change(fm.min_change, baseline), weekly = num(fm.weekly_traffic), due = dateOf(fm.outcome_horizon) || dateOf(fm.check_date);
46
+ if (!(baseline > 0 && baseline < 1) || !(d > 0) || !(weekly > 0) || !due) return null;
47
+ return { metric: String(fm.outcome_metric || '').trim(), baseline, change: d, weekly, due };
48
+ }
49
+
50
+ const fmtN = (n) => String(Math.round(n)).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
51
+ const fmtD = (iso) => { const d = new Date(iso + 'T00:00:00Z'); return d.getUTCDate() + ' ' + ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][d.getUTCMonth()] + ' ' + d.getUTCFullYear(); };
52
+ const about = (n) => (n >= 10000 ? Math.round(n / 1000) * 1000 : n >= 1000 ? Math.round(n / 100) * 100 : n);
53
+
54
+ function warningOf(fm, today) {
55
+ const I = inputsOf(fm); if (!I) return null;
56
+ const n = sampleSize(I.baseline, I.change); if (!n) return null;
57
+ const weeks = Math.ceil(n / I.weekly);
58
+ const from = dateOf(today) || new Date().toISOString().slice(0, 10);
59
+ const ends = new Date(Date.parse(from + 'T00:00:00Z') + weeks * 7 * DAY).toISOString().slice(0, 10);
60
+ if (ends <= I.due) return null;
61
+ const text = `It cannot conclude by ${fmtD(I.due)}: it needs about ${fmtN(about(n))} people, ${weeks} ${weeks === 1 ? 'week' : 'weeks'} at ${fmtN(I.weekly)} a week.`;
62
+ return { n, weeks, weekly: I.weekly, due: I.due, ends, text };
63
+ }
64
+
65
+ module.exports = { sampleSize, inputsOf, warningOf };
@@ -15,7 +15,7 @@ const fs = require('fs');
15
15
  const pmItems = require('./pm-items.js');
16
16
  const MS = require('./milestone-suggest.js');
17
17
 
18
- const COMMANDS = { program: ['suggest', 'charter', 'new', 'join', 'leave', 'task', 'task-done', 'check', 'milestone', 'archive', 'unarchive', 'line', 'draft', 'order', 'capacity', 'decide', 'outcome'] };
18
+ const COMMANDS = { program: ['suggest', 'charter', 'new', 'join', 'leave', 'task', 'task-done', 'check', 'milestone', 'archive', 'unarchive', 'line', 'draft', 'order', 'capacity', 'decide', 'outcome', 'steering'] };
19
19
  const USAGE = [
20
20
  'usage: pmos program suggest — PMOS\'s milestone suggestions for a program',
21
21
  ' pmos program suggest --json <file|->',
@@ -52,6 +52,9 @@ const USAGE = [
52
52
  ' Record the user\'s decision on a forecast past the target, or which initiative a shared team builds first.',
53
53
  ' pmos program outcome <id> "<what the outcome read says>"',
54
54
  ' Record the outcome read against the program\'s goal (the last exit of Land).',
55
+ ' pmos program steering <id> [--json] | --mark <key> --choice <number|words> [--why "<text>"] | --undo <decision id>',
56
+ ' The steering pack: one page with the status, the dates at risk and the decisions needed, each with its options. Writes nothing.',
57
+ ' After the meeting, --mark writes the decision taken to the decision journal and prints the Undo.',
55
58
  ];
56
59
  const MAX_PER_RUN = 8;
57
60
 
@@ -250,7 +253,7 @@ function editVerb(verb, args, { say, cwd, now = Date.now() } = {}) {
250
253
  return done(msg, back || (dropped ? `pmos program milestone ${id} add ${q(dropped.name)} --date ${dropped.date}${(dropped.waits || []).length ? ' --waits ' + dropped.waits.join(',') : ''}` : ''));
251
254
  }
252
255
 
253
- const LINE_VERBS = ['line', 'draft', 'order', 'capacity', 'decide', 'outcome'];
256
+ const LINE_VERBS = ['line', 'draft', 'order', 'capacity', 'decide', 'outcome', 'steering'];
254
257
  const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
255
258
  const short = (d) => (d ? MON[+d.slice(5, 7) - 1] + ' ' + (+d.slice(8, 10)) + ' ' + d.slice(0, 4) : '');
256
259
 
@@ -258,7 +261,7 @@ const short = (d) => (d ? MON[+d.slice(5, 7) - 1] + ' ' + (+d.slice(8, 10)) + '
258
261
  * draft → the charter workspace's milestone-reviews.jsonl (suggestions the program page shows with Keep and Decline);
259
262
  * order, decide <id>, outcome → the charter workspace's programs.jsonl; capacity and decide --team → this repository's programs.jsonl
260
263
  * (a team spans products: extrasOf reads the lines of every product). Exit 0 done, 1 refused, 2 usage. */
261
- function lineVerb(verb, args, { say, cwd, env, now = Date.now(), read: readFn } = {}) {
264
+ function lineVerb(verb, args, { say, cwd, env, now = Date.now(), read: readFn, runtimeDir } = {}) {
262
265
  const path = require('path');
263
266
  const PL = require('./program-line.js');
264
267
  const driver = require('./driver.js');
@@ -266,13 +269,13 @@ function lineVerb(verb, args, { say, cwd, env, now = Date.now(), read: readFn }
266
269
  for (let k = 0; k < args.length; k++) {
267
270
  const a = args[k];
268
271
  if (a === '--json' || a === '--keep-target' || a === '--clear') flags[a.slice(2)] = true;
269
- else if (/^--(root|team|first)$/.test(a)) { const v = args[++k]; if (a === '--root') (flags.root = flags.root || []).push(v); else flags[a.slice(2)] = v; }
272
+ else if (/^--(root|team|first|mark|choice|why|undo)$/.test(a)) { const v = args[++k]; if (a === '--root') (flags.root = flags.root || []).push(v); else flags[a.slice(2)] = v; }
270
273
  else if (a.startsWith('--')) { say(`✗ unknown flag ${a}`); return 2; }
271
274
  else pos.push(a);
272
275
  }
273
276
  const here = (flags.root && flags.root[0]) ? path.resolve(cwd, flags.root[0]) : gitTop(cwd);
274
277
  const roots = flags.root ? PL.rootsOf(flags.root.map((r) => path.resolve(cwd, r)), env, false) : PL.rootsOf([here], env, true);
275
- const R = () => (readFn || PL.read)(roots, { now, only: verb === 'line' ? pos[0] || null : null, env });
278
+ const R = () => (readFn || PL.read)(roots, { now, only: verb === 'line' || verb === 'steering' ? pos[0] || null : null, env });
276
279
  const rootOfWs = (r, ws) => (r.products.find((x) => x.ws === ws) || {}).root || null;
277
280
  const progFile = (root) => { const d = driver.stateDirOf(root); return d ? path.join(d, 'programs.jsonl') : null; };
278
281
 
@@ -325,6 +328,8 @@ function lineVerb(verb, args, { say, cwd, env, now = Date.now(), read: readFn }
325
328
  const home = rootOfWs(r, L.home);
326
329
  if (!home) { say(`✗ the charter of ${id} is in a product this computer does not have`); return 1; }
327
330
 
331
+ if (verb === 'steering') return steeringVerb(L, r, home, flags, { say, now, env, runtimeDir });
332
+
328
333
  if (verb === 'order') {
329
334
  const P = require('./programs.js');
330
335
  const list = flags.clear ? [] : pos[1] ? String(pos[1]).split(',').map((x) => x.trim()).filter(Boolean) : L.order.proposed;
@@ -390,4 +395,31 @@ function gitTop(cwd) {
390
395
  try { return require('child_process').execFileSync('git', ['rev-parse', '--show-toplevel'], { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim() || cwd; } catch { return cwd; }
391
396
  }
392
397
 
393
- module.exports = { run, COMMANDS, USAGE, charter, editVerb, lineVerb };
398
+ /** `pmos program steering` (steering-pack, job #1842, A108): print the pack, or mark one decision taken in the meeting, or undo a mark.
399
+ * A mark is one decision-journal line in the charter's repository (lib/steering-pack.js mark); nothing else is written. Each pack printed
400
+ * adds one local use-log line (control steeringPack), the count the kill reads. */
401
+ function steeringVerb(L, r, home, flags, { say, now, env, runtimeDir }) {
402
+ const SP = require('./steering-pack.js');
403
+ const who = { now, by: 'agent:cli', via: 'cli' };
404
+ if (flags.undo) {
405
+ const u = SP.unmark(home, flags.undo, who);
406
+ say(u.ok ? `[steering-pack] ✓ undone ${u.id}` : `✗ ${u.error}`);
407
+ return u.ok ? 0 : 1;
408
+ }
409
+ const pack = SP.packOf(L, r.clashes, { now });
410
+ if (flags.mark) {
411
+ if (flags.choice == null) { say('usage: pmos program steering <id> --mark <key> --choice <number|words> [--why "<text>"]'); return 2; }
412
+ const m = SP.mark(home, pack, { key: flags.mark, choice: flags.choice, why: flags.why }, who);
413
+ if (!m.ok) { say(`✗ ${m.error}`); return 1; }
414
+ say(`[steering-pack] ✓ ${m.existed ? 'already marked' : 'marked'}: ${m.decided}. Undo: pmos program steering ${L.id} --undo ${m.id}`);
415
+ return 0;
416
+ }
417
+ try {
418
+ const dir = runtimeDir || require('./state-root.js').defaultRoot({ env });
419
+ require('./use-log.js').record(dir, [{ kind: 'use', page: 'work', control: 'steeringPack', device: 'desk' }], now);
420
+ } catch { /* the use log is a count, never a reason to fail */ }
421
+ say(flags.json ? JSON.stringify({ ok: true, pack }) : SP.markdown(pack).trimEnd());
422
+ return 0;
423
+ }
424
+
425
+ module.exports = { run, COMMANDS, USAGE, charter, editVerb, lineVerb, steeringVerb };
@@ -5,7 +5,9 @@
5
5
  * factory: a D65 factory runs in this repository (lib/work-kind.js factoryRuns), so "PMOS builds it" is true
6
6
  * scope: portfolio (default), board:<id>, goal:<id>, experiment:<id> (initiative:<id> is an alias)
7
7
  * An experiment's Problem, Goal and Done test checks the ledger lacks come from the record's own sections,
8
- * carried as kind `record` (lib/case-lines.js), so the card shows what `pmos why` reads
8
+ * carried as kind `record` (lib/case-lines.js), so the card shows what `pmos why` reads. The Experiment
9
+ * carries `power` ({ n, weeks, weekly, due, ends, text, path }) only when the record's baseline, min_change
10
+ * and weekly_traffic cannot reach a conclusion by its check date (lib/experiment-power.js)
9
11
  * GET /api/artefacts/story?ws → { ok, ws, story: { scope, at, lines: [{ text, sources }] } | null, seeding? } "The story so far" on the
10
12
  * product page (board AwE): the Narrative of board:<ws>, else of the portfolio (lib/artefacts.js storyOf). A
11
13
  * shared Board carries it without the sources (lib/board-pack.js). seeding: there is no story yet and PMOS is
@@ -146,6 +148,15 @@ function withRecord(artefacts, root, id) {
146
148
  if (ex && !ex.fields.why) carry(ex, 'why', R.problem);
147
149
  if (ex && !ex.fields.hypothesis) carry(ex, 'hypothesis', R.goal);
148
150
  if (dt && !(Array.isArray(dt.fields.check) && dt.fields.check.length)) for (const c of R.checks.slice().reverse()) carry(dt, 'check', c);
151
+ // can it conclude by its check date? (experiment-traffic-warning, A404): pure maths on the record's baseline, min_change and
152
+ // weekly_traffic; only a warning is carried (zero is silence)
153
+ if (ex) {
154
+ try {
155
+ const I = require('./item-why.js'), f = I.recordPathOf(root, id);
156
+ const w = f ? require('./experiment-power.js').warningOf(I.frontOf(require('fs').readFileSync(f, 'utf8')), new Date().toISOString().slice(0, 10)) : null;
157
+ if (w) ex.power = { ...w, path: require('path').relative(root, f).split(require('path').sep).join('/') };
158
+ } catch { /* an unreadable record shows no warning */ }
159
+ }
149
160
  }
150
161
 
151
162
  module.exports = { prefixes: ['/api/artefacts'], handle, _migrated: migrated };
@@ -0,0 +1,105 @@
1
+ 'use strict';
2
+ /* steering-pack.js — the one-page steering pack of a program, and the decisions taken in the meeting (steering-pack, job #1842, idea A108).
3
+ *
4
+ * A steering meeting needs one page per program: where it stands, which dates are at risk, and the decisions to take, each with its options.
5
+ * Everything is read from the program line (lib/program-line.js lineOf, clashesOf): no model call, nothing invented. After the meeting the
6
+ * PM marks each decision; the mark is one line in the decision journal (lib/decision-journal.js logFrom, from `steering`) with an Undo.
7
+ *
8
+ * packOf(L, clashes, { now }) PURE → { id, title, today, status: [text], atRisk: [{ what, date, why }], decisions: [{ key, question, options,
9
+ * recommend }] }
10
+ * status the station and what it misses, the forecast against the target, the members (n live, n past Implementation)
11
+ * atRisk each member that slips (its date and why), each milestone that moves (from → to)
12
+ * decisions target: the forecast is past the target → Keep the target <t> · Move the target to <f> · Cut or reorder the work
13
+ * ms:<id>: a milestone moves → Accept <to> · Hold <from> and recover the work
14
+ * team:<team>: a team clash with this program's members → <first> goes first (PMOS recommends) · Another order
15
+ * None when nothing needs a decision: the page says so ("zero is silence" is for counts; the page says what to bring).
16
+ * markdown(pack) PURE → the one page, in Markdown
17
+ * choiceOf(pack, key, choice) PURE → { decision, option } | { error } choice: 1-based number or the option's words
18
+ * mark(root, pack, { key, choice, why }, { now, by, via }) → { ok, id, decided } | { ok: false, error } one journal line; ref
19
+ * steering:<program>:<key>:<today>, so the same mark on the same day is written once and another choice
20
+ * for a key marked today is refused until its Undo
21
+ * unmark(root, id, { now, by, via }) → the Undo: decision-journal undo
22
+ * The CLI is `pmos program steering <id> [--json] [--mark <key> --choice <n|words> [--why "<text>"]] [--undo <decision id>]` (lib/program-cli.js). */
23
+ const DJ = require('./decision-journal.js');
24
+
25
+ const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
26
+ const DAY_RE = /^\d{4}-\d{2}-\d{2}$/;
27
+ const short = (d) => (DAY_RE.test(String(d || '')) ? (+d.slice(8, 10)) + ' ' + MON[+d.slice(5, 7) - 1] + ' ' + d.slice(0, 4) : '');
28
+ const plural = (n, a, b) => n + ' ' + (n === 1 ? a : b);
29
+
30
+ function packOf(L, clashes, { now = Date.now() } = {}) {
31
+ const today = new Date(now).toISOString().slice(0, 10);
32
+ if (!L || !L.id) return null;
33
+ const fc = L.forecast || {}, members = Array.isArray(L.members) ? L.members : [];
34
+ const past = members.filter((m) => m.passedImpl).length;
35
+ const status = [];
36
+ status.push(L.station ? `At ${L.station.name} (${L.station.n} of ${L.station.of})` + ((L.stations[L.station.n - 1] || {}).missing || []).map((x, i) => (i ? '; ' : ': missing ') + x).join('') + '.' : 'Landed.');
37
+ if (fc.state === 'past') status.push(`Forecast ${short(fc.date)}, past the target ${short(L.target)}.`);
38
+ else if (fc.state === 'inside') status.push(`Forecast ${short(fc.date)}, inside the target ${short(L.target)}.`);
39
+ else if (fc.state === 'cant-tell') status.push(`Can't tell the forecast: ${(fc.cantTell || []).join(', ')} ${(fc.cantTell || []).length === 1 ? 'has' : 'have'} no date.`);
40
+ else if (fc.state === 'no-target') status.push(`Forecast ${short(fc.date)}; the program has no target date.`);
41
+ if (members.length) status.push(`${plural(members.length, 'initiative', 'initiatives')}, ${past} past Implementation.`);
42
+ const atRisk = [];
43
+ for (const s of fc.slips || []) atRisk.push({ what: s.id, date: s.date, why: s.why });
44
+ for (const m of fc.moves || []) atRisk.push({ what: 'Milestone ' + m.name, date: m.to, why: `moves from ${short(m.from)} to ${short(m.to)}` });
45
+ const decisions = [];
46
+ if (fc.state === 'past' && !L.decision) {
47
+ decisions.push({ key: 'target', question: `The forecast ${short(fc.date)} is past the target ${short(L.target)}. Keep the target, or move it?`,
48
+ options: [`Keep the target ${short(L.target)}`, `Move the target to ${short(fc.date)}`, 'Cut or reorder the work'], recommend: null });
49
+ }
50
+ for (const m of fc.moves || []) {
51
+ decisions.push({ key: 'ms:' + m.id, question: `Milestone ${m.name} moves from ${short(m.from)} to ${short(m.to)}. Accept the new date?`,
52
+ options: [`Accept ${short(m.to)}`, `Hold ${short(m.from)} and recover the work`], recommend: null });
53
+ }
54
+ const mine = new Set(members.map((m) => m.id));
55
+ for (const c of clashes || []) {
56
+ if (!c || c.decided || !(c.want || []).some((w) => mine.has(w.id))) continue;
57
+ decisions.push({ key: 'team:' + c.team, question: c.text, options: [`${c.recommend.first} goes first`, 'Another order'], recommend: 0, why: c.recommend.why });
58
+ }
59
+ return { id: L.id, title: L.title || L.id, today, status, atRisk, decisions };
60
+ }
61
+
62
+ function markdown(p) {
63
+ if (!p) return '';
64
+ const out = [`# Steering pack: ${p.title}`, '', `${short(p.today)}. PMOS made this page from the program's records.`, '', '## Status', ''];
65
+ for (const s of p.status) out.push('- ' + s);
66
+ out.push('', '## Dates at risk', '');
67
+ if (p.atRisk.length) for (const r of p.atRisk) out.push(`- **${r.what}**, ${short(r.date)}: ${r.why}.`);
68
+ else out.push('No date is at risk.');
69
+ out.push('', '## Decisions needed', '');
70
+ if (p.decisions.length) {
71
+ p.decisions.forEach((d, i) => {
72
+ out.push(`${i + 1}. ${d.question} (key \`${d.key}\`)`);
73
+ d.options.forEach((o, j) => out.push(` ${j + 1}. ${o}${d.recommend === j ? ' (PMOS recommends' + (d.why ? ': ' + d.why : '') + ')' : ''}`));
74
+ });
75
+ out.push('', `After the meeting, mark each one: \`pmos program steering ${p.id} --mark <key> --choice <number>\`. It goes to the decision journal, with an Undo.`);
76
+ } else out.push('Nothing needs a decision.');
77
+ return out.join('\n') + '\n';
78
+ }
79
+
80
+ function choiceOf(p, key, choice) {
81
+ const d = p && p.decisions.find((x) => x.key === key);
82
+ if (!d) return { error: `no decision ${key} in the steering pack of ${p ? p.id : 'this program'}` + (p && p.decisions.length ? ` (keys: ${p.decisions.map((x) => x.key).join(', ')})` : '') };
83
+ const c = String(choice == null ? '' : choice).trim();
84
+ const n = /^\d+$/.test(c) ? Number(c) : 0;
85
+ const option = n >= 1 && n <= d.options.length ? d.options[n - 1] : d.options.find((o) => o.toLowerCase() === c.toLowerCase());
86
+ if (!option) return { error: `the choice is a number from 1 to ${d.options.length}, or the words of one option` };
87
+ return { decision: d, option };
88
+ }
89
+
90
+ function mark(root, p, { key, choice, why } = {}, { now = Date.now(), by, via } = {}) {
91
+ const c = choiceOf(p, key, choice);
92
+ if (c.error) return { ok: false, error: c.error };
93
+ const decided = `${p.title}, steering: ${c.option}`;
94
+ const r = DJ.logFrom(root, { from: 'steering', decided, ref: `steering:${p.id}:${key}:${p.today}`, why: why || c.decision.question }, { now, by, via });
95
+ if (!r.ok) return r;
96
+ if (r.existed) { // the key was marked today already: the same choice is a no-op, another one waits for the Undo of the first
97
+ const had = (DJ.read(root).rows.find((x) => x && x.type === 'decision' && x.id === r.id) || {}).decided;
98
+ if (had && had !== decided) return { ok: false, error: `${key} is already marked today: ${had}. Undo it first: pmos program steering ${p.id} --undo ${r.id}` };
99
+ }
100
+ return { ok: true, id: r.id, decided, existed: !!r.existed };
101
+ }
102
+
103
+ function unmark(root, id, o = {}) { return DJ.undo(root, { id }, o); }
104
+
105
+ module.exports = { packOf, markdown, choiceOf, mark, unmark, short };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.805.0",
3
+ "version": "0.807.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.805.0",
9
+ "version": "0.807.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.805.0",
3
+ "version": "0.807.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",
@@ -163,7 +163,9 @@ button.td-ev:focus-visible { outline: none; box-shadow: var(--glow); }
163
163
  .tdp-f svg { right: var(--space-8); }
164
164
  .tdp-f select { color: var(--ink); min-height: 32px; padding: 0 22px 0 var(--space-8); text-align: left; }
165
165
  .tdp-none { padding: var(--space-16) 0; font-size: var(--fs-body); color: var(--muted); line-height: var(--lh-body); }
166
- body.cz-vw-on .tdp-cap { display: none; } /* the Viewer covers Today on a phone: its box goes too, so it never sits under the Viewer's own controls */
166
+ body.cz-vw-on .tdp-cap, body.cz-vw-on .tdp-capbg { display: none; }
167
+ /* the page colour from just above the box to the screen's foot: a row that scrolls under the box is covered, never seen below it (25 Nov) */
168
+ .tdp-capbg { position: fixed; left: 0; right: 0; bottom: 0; z-index: 29; height: calc(env(safe-area-inset-bottom, 0px) + var(--space-12) + 48px + var(--space-16)); background: linear-gradient(to bottom, transparent, var(--cz-card) var(--space-16)); pointer-events: none; } /* the Viewer covers Today on a phone: its box goes too, so it never sits under the Viewer's own controls */
167
169
  .tdp-cap { position: fixed; left: var(--space-12); right: var(--space-12); bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-12)); z-index: 30; display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-4) var(--space-4) var(--space-16); border-radius: var(--radius-pill); background: var(--well); box-shadow: var(--raise); }
168
170
  .tdp-in { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: var(--fs-field); color: var(--ink); padding: var(--space-8) 0; outline: none; }
169
171
  .tdp-in::placeholder { color: var(--muted); }
@@ -359,7 +359,8 @@ export function phoneSheetHtml(sg) {
359
359
  /** The capture box at the foot of Today on a phone (PhoneTodayDS): type a line, or speak where the browser can. The same form as the
360
360
  * desk's (#tdCapF, #tdCap), so the same press adds the line. o: { draft, mic } */
361
361
  export function phoneCapHtml(o = {}) {
362
- return `<form class="tdp-cap" id="tdCapF" autocomplete="off"><label class="td-vh" for="tdCap">Log a task, an event or a note</label>`
362
+ // the shade under the box: rows scroll under it and stop, so no line shows between the box and the screen's foot (25 Nov)
363
+ return `<i class="tdp-capbg" aria-hidden="true"></i><form class="tdp-cap" id="tdCapF" autocomplete="off"><label class="td-vh" for="tdCap">Log a task, an event or a note</label>`
363
364
  + `<input id="tdCap" class="tdp-in" name="line" type="text" maxlength="240" enterkeyhint="send" placeholder="Log a task, an event or a note" value="${esc(o.draft || '')}" title="Start with o for an event, a dash for a note, ! for first" />`
364
365
  + (o.mic ? `<button type="button" class="tdp-mic" data-td="cap-mic" aria-label="Speak a line" title="Speak">${svg(PI.mic, 18, 1.8)}</button>` : '')
365
366
  + `<button type="submit" class="tdp-go pm-btn primary" aria-label="Log it" title="Log it">${svg(PI.up, 18, 2)}</button></form>`;
@@ -301,6 +301,8 @@ export function overviewOf(r, v, o = {}) {
301
301
  if (ck.length) lines.push({ id: 'done', k: 'Done when', text: ck[0].text + more(ck.length), src: 'the Done test', edit: null });
302
302
  else if (cc.length) lines.push({ id: 'done', k: 'Done when', text: String(cc[0].text) + more(cc.length), src: cc[0].title || 'the record', path: cc[0].path || '', edit: null });
303
303
  else lines.push({ id: 'done', k: 'Done when', text: '', edit: { to: 'artefact', artefact: 'done-test', field: 'check' }, ...offer('Done when', 'the done test (how we will know it worked, and when we check)', 'done-test', 'check') });
304
+ // too little traffic to conclude by the check date (experiment-traffic-warning, A404): GET /api/artefacts carries it only when it is so
305
+ if (ex.power && ex.power.text) lines.push({ id: 'power', k: 'Can it conclude?', text: String(ex.power.text), src: 'the record', path: ex.power.path || '', edit: null });
304
306
  const sm = summaryOf(r, v, o);
305
307
  const status = sm.status.replace(/^It is in /, 'In ');
306
308
  // status in one line (status-line, A505): the record's line of at most 12 words; the item header shows it before PMOS's own words
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "Warn when an experiment cannot conclude by its check date (experiment-traffic-warning, idea A404, done test planning/done-tests/experiment-traffic-warning.md P1-P3, N1-N2): the sample size, the frontmatter inputs, the route's power field and the Overview line. No server, network, model or browser.",
3
+ "modules": [
4
+ "experiment-power.test.js"
5
+ ],
6
+ "seconds": {
7
+ "experiment-power.test.js": 1
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "steering-pack (job #1842, A108): the one-page steering pack of a program and the decisions marked into the journal. No browser, no network.",
3
+ "modules": [
4
+ "steering-pack.test.js"
5
+ ],
6
+ "seconds": {
7
+ "steering-pack.test.js": 2
8
+ }
9
+ }