create-pmos 0.568.0 → 0.570.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 (44) hide show
  1. package/package.json +27 -27
  2. package/payload/AGENTS.md +11 -0
  3. package/payload/KIT-VERSION +2 -2
  4. package/payload/planning/evals/eval-calibration.md +1 -1
  5. package/payload/planning/okrs/health-budgets.md +1 -1
  6. package/payload/planning/work-items.jsonl +0 -0
  7. package/payload/scripts/gate-initiative.sh +29 -0
  8. package/payload/scripts/lib/sink.js +321 -0
  9. package/payload/scripts/verify-work.js +149 -0
  10. package/payload/scripts/work-item.js +1460 -0
  11. package/payload/scripts/workflow-state.js +16 -0
  12. package/payload/state/discoveries.md +1 -1
  13. package/payload/state/log.md +1 -1
  14. package/workspace/changelog.json +26 -0
  15. package/workspace/guide/cli.md +27 -2
  16. package/workspace/guide/settings-and-switches.md +1 -0
  17. package/workspace/lib/agent-team.js +19 -4
  18. package/workspace/lib/artefact-mirror.js +121 -0
  19. package/workspace/lib/artefacts-cli.js +15 -1
  20. package/workspace/lib/autonomy.js +2 -1
  21. package/workspace/lib/build-cli.js +93 -0
  22. package/workspace/lib/build-engine.js +197 -0
  23. package/workspace/lib/driver-decide.js +2 -0
  24. package/workspace/lib/engine/workflow-state.js +16 -0
  25. package/workspace/lib/headless.js +3 -1
  26. package/workspace/lib/outcome-props.js +21 -1
  27. package/workspace/lib/pmos-verbs.js +3 -0
  28. package/workspace/lib/proposals.js +15 -4
  29. package/workspace/lib/rehearse-read.js +4 -2
  30. package/workspace/lib/routes-artefacts.js +4 -1
  31. package/workspace/lib/routes-boards.js +6 -0
  32. package/workspace/lib/routes-proposals.js +14 -3
  33. package/workspace/lib/team-cli.js +3 -1
  34. package/workspace/lib/team-runs.js +4 -0
  35. package/workspace/lib/today-cli.js +19 -0
  36. package/workspace/lib/vendor/scripts/workflow-state.js +16 -0
  37. package/workspace/lib/verify-work-cli.js +4 -2
  38. package/workspace/lib/work-kind.js +12 -6
  39. package/workspace/package-lock.json +2 -2
  40. package/workspace/package.json +1 -1
  41. package/workspace/public/pm/ini-props.js +3 -1
  42. package/workspace/run-tests.js +9 -0
  43. package/workspace/test-lists/build-engine.json +9 -0
  44. package/workspace/test-lists/launch-rerun-gaps.json +4 -0
@@ -8,8 +8,9 @@
8
8
  * valid(value) → bool one of the three, exactly
9
9
  * fromName(name, lane) → { kind, cue } the pre-pick from the name and the intake draft's lane; cue is the word that decided it,
10
10
  * or '' when nothing did (then the kind is 'product' and the page shows no ✦ line)
11
- * factoryRuns(root) → bool a D65 factory runs in this repository: planning/work-items.jsonl and scripts/verify-work.js are both there.
12
- * Only then may a page say "PMOS builds it". A product repository made by create-pmos has neither today.
11
+ * factoryRuns(root) → bool a D65 factory runs in this repository: planning/work-items.jsonl and scripts/verify-work.js are both there,
12
+ * at the root (PMOS-self) or under pmos/ (a kit made by create-pmos, W7). Only then may a page say "PMOS builds it".
13
+ * factoryDir(root) → dir | null the folder that holds both (root, or root/pmos)
13
14
  * executorOf(kind, factory) → 'factory' | 'team-agents' | 'team' who builds by default (lib/artefacts.js EXECUTORS): Full SDLC → PMOS
14
15
  * (the factory, D65: propose-only, the PM merges) where a factory runs, else the team's agents (PMOS writes
15
16
  * the done test and the pull request plan); Product and Project → the team
@@ -56,10 +57,15 @@ function fromName(name, lane) {
56
57
  * the PMOS repository carries; the kit does not vendor it. So the promise is made only where both files are on disk. */
57
58
  const fs = require('fs');
58
59
  const path = require('path');
59
- const factoryRuns = (root) => {
60
- if (!root || typeof root !== 'string') return false;
61
- try { return fs.statSync(path.join(root, 'planning', 'work-items.jsonl')).isFile() && fs.statSync(path.join(root, 'scripts', 'verify-work.js')).isFile(); } catch { return false; }
60
+ /* W7 (kit-factory-builder): the kit carries the factory too. A repository made by create-pmos has it under pmos/ (pmos/scripts/
61
+ * verify-work.js and pmos/planning/work-items.jsonl, kit/build-kit.sh). factoryDir names the folder that holds both, or null. */
62
+ const isFile = (f) => { try { return fs.statSync(f).isFile(); } catch { return false; } };
63
+ const factoryDir = (root) => {
64
+ if (!root || typeof root !== 'string') return null;
65
+ for (const d of [root, path.join(root, 'pmos')]) if (isFile(path.join(d, 'planning', 'work-items.jsonl')) && isFile(path.join(d, 'scripts', 'verify-work.js'))) return d;
66
+ return null;
62
67
  };
68
+ const factoryRuns = (root) => factoryDir(root) !== null;
63
69
  const executorOf = (kind, factory) => (kindOf(kind) !== 'sdlc' ? 'team' : factory ? 'factory' : 'team-agents');
64
70
 
65
71
  /** The line a kind change writes: what the kind now is and what its gate adds (WfC: "Kind changed to Project, Plan gate now needs …"). */
@@ -69,4 +75,4 @@ function switchLine(from, to) {
69
75
  return 'Kind changed to ' + SHORT[k] + (from && kindOf(from) !== k ? ' from ' + SHORT[kindOf(from)] : '') + ': ' + GATE[k] + '.';
70
76
  }
71
77
 
72
- module.exports = { KINDS, LABEL, SHORT, DEFAULT, valid, kindOf, fromName, executorOf, factoryRuns, switchLine };
78
+ module.exports = { KINDS, LABEL, SHORT, DEFAULT, valid, kindOf, fromName, executorOf, factoryRuns, factoryDir, switchLine };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.568.0",
3
+ "version": "0.570.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.568.0",
9
+ "version": "0.570.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.568.0",
3
+ "version": "0.570.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",
@@ -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 = { 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', 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) {
@@ -103,6 +103,7 @@ const titleOf = (p) => {
103
103
  if (p.group === 'status') return plural(n, 'task looks', 'tasks look') + ' done';
104
104
  if (p.group === 'names') return 'Tidy ' + plural(n, 'name', 'names');
105
105
  if (p.group === 'description') return p.type === 'enrich' ? 'A fuller description from the PRD' : 'What this initiative is';
106
+ if (p.group === 'build') return 'Open a draft pull request';
106
107
  if (p.group === 'outcome') return p.type === 'date' ? 'A date to check the outcome' : 'What should change once it ships';
107
108
  return '';
108
109
  };
@@ -120,6 +121,7 @@ function itemHtml(p, x) {
120
121
  else if (p.group === 'status') { t = x.title || taskTitle(p.ini, x.task); m = x.jira ? 'Jira: a drafted comment' : ''; }
121
122
  else if (p.group === 'outcome') { t = x.title; m = x.due ? 'Check on ' + md(x.due) : ''; }
122
123
  else if (p.group === 'description') { t = (p.data && p.data.text) || x.title; m = p.type === 'enrich' && p.data && p.data.from ? 'Now: ' + clip(p.data.from, 120) : ''; }
124
+ else if (p.group === 'build') { const d = p.data || {}; t = x.title; m = [d.branch ? d.branch + ' → ' + (d.base || 'main') : '', d.files && d.files.length ? (d.files.length === 1 ? '1 file' : d.files.length + ' files') : '', 'a draft you merge'].filter(Boolean).join(' · '); }
123
125
  else if (p.group === 'names') { t = x.to; m = 'Was: ' + (x.from || '') + (x.jira ? ' · Jira: a drafted comment' : ''); }
124
126
  return `<div class="pp-it"><span class="w"><b>${esc(clip(t, p.group === 'description' ? 700 : 90))}</b>${m ? `<small>${esc(m)}</small>` : ''}</span>${x.sig ? ib(`data-pp-dropit="${esc(x.sig)}"`, 'Leave this one out', I.x) : ''}</div>`;
125
127
  }
@@ -624,6 +624,15 @@ function traceChanges(changes, ctx) {
624
624
  if (/^lib\/routes-/.test(g)) { const w = routeModule(g); if (w) return w; continue; }
625
625
  const w = users(g); if (w) return w;
626
626
  }
627
+ // a needs provider is named by its bare stem in the PROVIDERS list of the needs providers module, which requires it by path.join(__dirname, name + '.js'):
628
+ // that list is its user (launch simulation W6: report-structure-needs.js, named nowhere else, sent every change of routes-boards.js to
629
+ // every suite)
630
+ const NP = ['lib', 'needs-providers'].join('/') + '.js'; // built, so this file does not read as a user of it
631
+ if (!n && /^lib\/[\w.-]+-needs\.js$/.test(f) && f !== NP) {
632
+ const np = sget(NP) || '';
633
+ const list = /const PROVIDERS = Object\.freeze\(\[([\s\S]*?)\]\)/.exec(np);
634
+ if (list && new RegExp(`'${reEsc(stemOf(f))}'`).test(list[1])) { n = 1; const w = users(NP); if (w) return w; }
635
+ }
627
636
  named.set(f, n);
628
637
  if (!n && /^lib\/.*\.m?js$/.test(f)) return `no file names ${f}`;
629
638
  return null;
@@ -0,0 +1,9 @@
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, ✦ and draft PR (F3), verify-work (F4). No browser, no network.",
3
+ "modules": [
4
+ "build-engine.test.js"
5
+ ],
6
+ "seconds": {
7
+ "build-engine.test.js": 4
8
+ }
9
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "modules": ["launch-rerun-gaps.test.js"],
3
+ "seconds": { "launch-rerun-gaps.test.js": 3 }
4
+ }