create-pmos 0.767.0 → 0.769.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 +33 -51
  2. package/payload/AGENTS.md +3 -1
  3. package/payload/KIT-VERSION +1 -1
  4. package/payload/planning/evals/eval-calibration.md +1 -1
  5. package/payload/planning/okrs/health-budgets.md +1 -1
  6. package/payload/scripts/kind-sync.js +112 -0
  7. package/payload/scripts/workflow-state.js +20 -2
  8. package/payload/scripts/workflows.js +374 -0
  9. package/payload/state/discoveries.md +1 -1
  10. package/workspace/changelog.json +32 -0
  11. package/workspace/guide/breakdown.md +5 -3
  12. package/workspace/guide/cli.md +1 -0
  13. package/workspace/lib/engine/boards.js +11 -3
  14. package/workspace/lib/engine/workflow-state.js +20 -2
  15. package/workspace/lib/engine/workflows.js +27 -3
  16. package/workspace/lib/initiative-chat.js +1 -1
  17. package/workspace/lib/initiative-writer.js +12 -1
  18. package/workspace/lib/routes-boards.js +49 -2
  19. package/workspace/lib/task-cli.js +25 -2
  20. package/workspace/lib/task-store.js +1 -1
  21. package/workspace/lib/vendor/scripts/workflow-state.js +20 -2
  22. package/workspace/lib/vendor/scripts/workflows.js +374 -0
  23. package/workspace/package-lock.json +2 -2
  24. package/workspace/package.json +1 -1
  25. package/workspace/public/pm/cozy-pop-work.css +7 -0
  26. package/workspace/public/pm/cozy-pop-work.js +27 -12
  27. package/workspace/public/pm/cozy-task-pop.css +57 -17
  28. package/workspace/public/pm/cozy-task-pop.js +161 -20
  29. package/workspace/public/pm/task-card.js +113 -5
  30. package/workspace/public/pm/vw-ds.js +112 -38
  31. package/workspace/public/pm/work-select.js +27 -5
  32. package/workspace/test-lists/gantt-drag-nest.json +9 -0
  33. package/workspace/test-lists/task-detail-one-column.json +9 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.767.0",
3
+ "version": "0.769.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,38 @@
33
33
  "audit"
34
34
  ],
35
35
  "pmosChanges": [
36
+ {
37
+ "v": "0.769.0",
38
+ "at": "2026-11-24T08:04:34.713Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1729,
43
+ "t": "The task detail is one column, with its fields as chips",
44
+ "s": "The task detail is one column, with its fields as chips",
45
+ "k": "new"
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "v": "0.768.0",
51
+ "at": "2026-11-24T07:49:37.442Z",
52
+ "f": 4,
53
+ "prs": [
54
+ {
55
+ "n": 1731,
56
+ "t": "The workflow decides the kind of work, not a legacy type: feature",
57
+ "s": "The workflow decides the kind of work, not a legacy type: feature",
58
+ "k": "fix"
59
+ },
60
+ {
61
+ "n": 1730,
62
+ "t": "Drag to nest, take out and reorder in the Gantt, like the List",
63
+ "s": "Drag to nest, take out and reorder in the Gantt, like the List",
64
+ "k": "new"
65
+ }
66
+ ]
67
+ },
36
68
  {
37
69
  "v": "0.767.0",
38
70
  "at": "2026-11-24T07:34:38.820Z",
@@ -320,56 +352,6 @@
320
352
  "k": "new"
321
353
  }
322
354
  ]
323
- },
324
- {
325
- "v": "0.749.0",
326
- "at": "2026-11-23T17:01:32.549Z",
327
- "f": 4,
328
- "prs": [
329
- {
330
- "n": 1680,
331
- "t": "Date fields take dates typed in words (A488)",
332
- "s": "Date fields take dates typed in words (A488)",
333
- "k": "new"
334
- },
335
- {
336
- "n": 1684,
337
- "t": "One ranked Your move leads Today's log (A468)",
338
- "s": "One ranked Your move leads Today's log (A468)",
339
- "k": "new"
340
- },
341
- {
342
- "n": 1683,
343
- "t": "Draft the next sprint from team capacity, carry-over first (A471)",
344
- "s": "Draft the next sprint from team capacity, carry-over first (A471)",
345
- "k": "new"
346
- },
347
- {
348
- "n": 1682,
349
- "t": "Standing rules list — see, edit and retire the rules PMOS learned (A470)",
350
- "s": "Standing rules list — see, edit and retire the rules PMOS learned (A470)",
351
- "k": "new"
352
- },
353
- {
354
- "n": 1681,
355
- "t": "Ask for the smallest test before building a ranked bet",
356
- "s": "Ask for the smallest test before building a ranked bet",
357
- "k": "new"
358
- }
359
- ]
360
- },
361
- {
362
- "v": "0.748.0",
363
- "at": "2026-11-23T14:27:01.777Z",
364
- "f": 4,
365
- "prs": [
366
- {
367
- "n": 1677,
368
- "t": "The work popup's date press opens the range picker; keep its focus",
369
- "s": "The work popup's date press opens the range picker; keep its focus",
370
- "k": "x"
371
- }
372
- ]
373
355
  }
374
356
  ]
375
357
  }
package/payload/AGENTS.md CHANGED
@@ -48,7 +48,7 @@ It refuses frontmatter, fenced and indented code, table rows, headings, delibera
48
48
  | `log_friction` / `log_discovery` | append to `pmos/state/discoveries.md` (ISO date, `#friction` tag where applicable) |
49
49
  | `get_agent_runs` / `get_friction` | read those same files (your episodic memory — consult before contracting) |
50
50
 
51
- **Programs** (the level above initiatives, across products) are not an initiative key. A program is a line in `pmos/state/programs.jsonl`: `{"kind":"program",…}` is the charter and `{"kind":"member","program":"<id>","initiative":"<id>"}` puts an initiative in it. Never add `kind`, `program`, `programme`, `parent_program` or `parent_programme` to an initiative record: nothing reads them. Never write `programs.jsonl` by hand. When the PM asks for a program change, or says yes to one you drafted, make it with `pmos program` (`new`, `charter`, `join`, `leave`, `milestone`, `check`, `task`, `order`, `archive`; `pmos program help`) and give the Undo it prints. The Board shows it when your turn ends.
51
+ **Programs** (the level above initiatives, across products) are not an initiative key. A program is a line in `pmos/state/programs.jsonl`: `{"kind":"program",…}` is the charter and `{"kind":"member","program":"<id>","initiative":"<id>"}` puts an initiative in it. Never add `program`, `programme`, `parent_program` or `parent_programme` to an initiative record: nothing reads them. (`kind:` is different: it is the kind of work, and the gate reads it. See below.) Never write `programs.jsonl` by hand. When the PM asks for a program change, or says yes to one you drafted, make it with `pmos program` (`new`, `charter`, `join`, `leave`, `milestone`, `check`, `task`, `order`, `archive`; `pmos program help`) and give the Undo it prints. The Board shows it when your turn ends.
52
52
 
53
53
  State files are **append-only**: never rewrite or delete an existing line or initiative record; correct by appending. When a vendored skill names a hosted tool, apply this table — the skill bodies are single-sourced from the PMOS kernel and are not forked for file mode.
54
54
 
@@ -58,6 +58,8 @@ State files are **append-only**: never rewrite or delete an existing line or ini
58
58
 
59
59
  ## Work-type lanes (D56)
60
60
 
61
+ **The kind of work comes first.** Read `kind:` before `type:`. `kind:` is `product`, `project` or `sdlc`, and it follows the initiative's workflow: when the PM puts an initiative on a workflow, PMOS writes the workflow's kind on the record (a Migration, Decommission, Tender or Project workflow is `project`; Full SDLC is `sdlc`; Product feature and other product workflows are `product`). `kind: project` needs a dated plan (dated tasks with a ◇ milestone, or `plan_path`), never a PRD or a rubric. `kind: sdlc` needs a done test and a kill condition, never a PRD. Only `kind: product` (or no kind line) uses the lane rules below. A record with `done_test_path` and `kill:` passes in every kind (D107). Many older records carry `type: feature` only because it was the default before workflows existed: on a `project` or `sdlc` record it decides nothing. Never ask for a PRD or rubric because of it, and never suggest another lane (such as `chore`) to get round a PRD. When a record's kind does not match its workflow, run `node pmos/scripts/kind-sync.js --root .` to list it, and with the PM's yes `--fix --backup <dir>` to correct it (the backup holds an UNDO.sh).
62
+
61
63
  Every initiative carries a `type` — the lane picks what the gate requires **before** work; the kernel (anchor — a KR **or** `health:<id>` from `planning/okrs/health-budgets.md` (D59) — eval-before-work in lane-appropriate form, human Acceptance, append-only state) holds in every lane. Unknown/missing type = `feature`, the strictest lane. The enum is closed — never invent a lane; a work shape with no lane escalates to the PM.
62
64
 
63
65
  **A lane is not a workflow (D99).** A lane sets what the gate requires before work. A workflow is the list of stages an initiative goes through on the PM's page (Triage, Discover, Plan…), and the PM picks it per initiative. Read workflows only through pmos: `pmos workflow of <initiative>` gives the initiative's workflow and its stages, `pmos workflow show <id>` gives one workflow's stages, and `pmos workflow list` names every workflow the PM can pick. The workflow library is not in this repository's files (Settings › Workflows saves it in the PM's home workspace), so never search the files for a workflow. When pmos cannot find a workflow, tell the PM so. Never use a lane in place of a workflow.
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@33c3874f
1
+ kernel-source: pmos@db205228
2
2
  assembled: 2026-11-24
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-24T07:34:35Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-24T08:04:31Z"}
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-24T07:34:35Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-24T08:04:31Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -0,0 +1,112 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /*
4
+ * kind-sync.js — make each initiative record's `kind:` follow the workflow it runs.
5
+ *
6
+ * node scripts/kind-sync.js --root <repo> list the records whose kind contradicts their workflow
7
+ * node scripts/kind-sync.js --root <repo> --fix --backup <dir> correct them; the originals and an UNDO.sh go to <dir>
8
+ * add --json for machine-readable output
9
+ *
10
+ * WHY (bug 2026-11-24, "Migration from Okta to Descope"): records written before workflows existed carry the old default
11
+ * `type: feature` and no `kind:` line, so they read as Product management and the gate asks them for a PRD and a rubric, even when
12
+ * the PM later put them on a Migration or Decommission workflow. The workflow is the PM's later, more specific choice. The
13
+ * workspace now writes `kind:` when an initiative starts on or switches workflow (lib/routes-boards.js kindFollowsWorkflow); this
14
+ * tool corrects the records written before that.
15
+ *
16
+ * What it changes: the `kind:` line only (added at the end of the front matter, or replaced). It never touches `type:`, `lane:`,
17
+ * paths or the body. A record on Product feature, or on no recorded workflow, is never changed. --fix without --backup refuses.
18
+ */
19
+ const fs = require('fs');
20
+ const path = require('path');
21
+ const WS = require('./workflow-state');
22
+ const WF = require('./workflows');
23
+ const jsonl = require('./read-jsonl');
24
+
25
+ function stateFile(root, name) {
26
+ return [['pmos', 'state'], ['state'], ['.pmos']].map((rel) => path.join(root, ...rel, name)).find((x) => fs.existsSync(x)) || null;
27
+ }
28
+
29
+ /** Every record and the workflow it runs → [{ id, file, kind, has, wf, wfName, want }]; `want` differs from `kind` on a mismatch. */
30
+ function scan(root) {
31
+ const L = WS.layout(root);
32
+ const boards = stateFile(root, 'boards.jsonl');
33
+ if (!boards) return { ok: false, error: `no boards.jsonl under ${root} — this repository does not run initiatives on workflows` };
34
+ const wfOf = new Map();
35
+ for (const l of jsonl.readJsonl(boards).rows) if (l && l.kind === 'ini-wf' && typeof l.id === 'string' && typeof l.wf === 'string' && l.wf) wfOf.set(l.id, l.wf);
36
+ const wfFile = stateFile(root, 'workflows.jsonl');
37
+ const lib = WF.fold(wfFile ? jsonl.readJsonl(wfFile).rows : []);
38
+ const rows = [];
39
+ let names = [];
40
+ try { names = fs.readdirSync(L.initiatives).filter((n) => n.endsWith('.md') && n !== 'index.md' && n !== 'log.md' && n !== 'README.md'); } catch { /* none */ }
41
+ for (const n of names.sort()) {
42
+ const file = path.join(L.initiatives, n);
43
+ const text = fs.readFileSync(file, 'utf8');
44
+ const m = /^---\r?\n([\s\S]*?)\r?\n---/.exec(text);
45
+ if (!m) continue;
46
+ const line = m[1].split(/\r?\n/).find((l) => /^kind:/.test(l));
47
+ const raw = line ? line.slice(5).trim().replace(/^["']|["']$/g, '') : '';
48
+ const kind = WF.WORK_KINDS.includes(raw) ? raw : 'product';
49
+ const id = n.slice(0, -3);
50
+ const wf = wfOf.has(id) ? WF.resolve(lib, wfOf.get(id)) : WF.defaultOf(lib);
51
+ rows.push({ id, file, kind, has: !!line, wf: wf.id, wfName: wf.name, want: WF.kindOf(wf) });
52
+ }
53
+ return { ok: true, rows, mismatches: rows.filter((r) => r.want !== r.kind) };
54
+ }
55
+
56
+ function setKindLine(file, kind) {
57
+ const text = fs.readFileSync(file, 'utf8');
58
+ const m = /^---\r?\n([\s\S]*?)\r?\n---(\r?\n|$)/.exec(text);
59
+ if (!m) return false;
60
+ const lines = m[1].split(/\r?\n/);
61
+ const at = lines.findIndex((l) => /^kind:/.test(l));
62
+ if (at >= 0) lines[at] = 'kind: ' + kind; else lines.push('kind: ' + kind);
63
+ fs.writeFileSync(file, '---\n' + lines.join('\n') + '\n---' + m[2] + text.slice(m[0].length));
64
+ return true;
65
+ }
66
+
67
+ const q = (s) => "'" + String(s).replace(/'/g, "'\\''") + "'";
68
+
69
+ function fix(root, backup) {
70
+ const s = scan(root);
71
+ if (!s.ok) return s;
72
+ if (!s.mismatches.length) return { ok: true, changed: [] };
73
+ const recDir = path.join(backup, 'initiatives');
74
+ fs.mkdirSync(recDir, { recursive: true });
75
+ const undo = ['#!/usr/bin/env bash', `# Puts back the ${s.mismatches.length} initiative record(s) kind-sync.js changed on ${new Date().toISOString()}.`, 'set -euo pipefail', `cd "$(dirname "$0")"`];
76
+ const changed = [];
77
+ for (const r of s.mismatches) {
78
+ fs.copyFileSync(r.file, path.join(recDir, path.basename(r.file)));
79
+ if (!setKindLine(r.file, r.want)) continue;
80
+ undo.push(`cp initiatives/${q(path.basename(r.file))} ${q(r.file)}`);
81
+ changed.push({ id: r.id, from: r.kind, to: r.want, workflow: r.wfName });
82
+ }
83
+ fs.writeFileSync(path.join(backup, 'UNDO.sh'), undo.join('\n') + '\n', { mode: 0o755 });
84
+ fs.writeFileSync(path.join(backup, 'changes.json'), JSON.stringify({ root, at: new Date().toISOString(), changed }, null, 2) + '\n');
85
+ return { ok: true, changed, backup };
86
+ }
87
+
88
+ function main(argv) {
89
+ const a = argv.slice(2);
90
+ const val = (k) => { const i = a.indexOf(k); return i >= 0 ? a[i + 1] : null; };
91
+ const root = path.resolve(val('--root') || process.cwd());
92
+ const json = a.includes('--json');
93
+ let out;
94
+ if (a.includes('--fix')) {
95
+ const b = val('--backup');
96
+ if (!b) { console.error('kind-sync: --fix needs --backup <dir> (the originals and UNDO.sh go there)'); return 2; }
97
+ out = fix(root, path.resolve(b));
98
+ } else out = scan(root);
99
+ if (!out.ok) { console.error('kind-sync: ' + out.error); return 1; }
100
+ if (json) { console.log(JSON.stringify(out.changed ? out : { ok: true, mismatches: out.mismatches.map(({ file: _f, ...r }) => r) }, null, 2)); return 0; }
101
+ if (out.changed) {
102
+ for (const c of out.changed) console.log(`${c.id}: ${c.from} → ${c.to} (runs ${c.workflow})`);
103
+ console.log(out.changed.length ? `${out.changed.length} changed. Undo: bash ${path.join(out.backup, 'UNDO.sh')}` : 'Nothing to change.');
104
+ } else {
105
+ for (const r of out.mismatches) console.log(`${r.id}: record reads ${r.kind}${r.has ? '' : ' (no kind line)'}, runs ${r.wfName} → ${r.want}`);
106
+ console.log(out.mismatches.length ? `${out.mismatches.length} to correct. Run again with --fix --backup <dir>.` : `All ${out.rows.length} records match their workflow.`);
107
+ }
108
+ return 0;
109
+ }
110
+
111
+ module.exports = { scan, fix };
112
+ if (require.main === module) process.exitCode = main(process.argv);
@@ -640,6 +640,24 @@ function workflowOf(root, id) {
640
640
  }
641
641
  return m.wf.get(id) || '';
642
642
  }
643
+ /*
644
+ * workKindOf(root, id, fm) — the kind of work that sets the gate: the record's `kind:` line when it has one, else the kind of the workflow
645
+ * the initiative runs (scripts/workflows.js kindOf). Bug 2026-11-24: a Migration initiative kept the `type: feature` its record was born
646
+ * with before workflows existed, and the gate asked it for a PRD and a rubric. The workflow is the later, more specific choice, so it
647
+ * decides. No workflow (PMOS itself, a repository without boards) or Product feature keeps 'product', the lane rules.
648
+ */
649
+ function workKindOf(root, id, fm) {
650
+ const k = String((fm && fm.kind) || '').trim().replace(/^["']|["']$/g, '');
651
+ if (k === 'sdlc' || k === 'project' || k === 'product') return k;
652
+ try {
653
+ const wfId = workflowOf(root, id);
654
+ if (wfId === null) return 'product';
655
+ const WF = require('./workflows');
656
+ const f = [['pmos', 'state'], ['state'], ['.pmos']].map((rel) => path.join(root, ...rel, 'workflows.jsonl')).find((x) => fs.existsSync(x));
657
+ const lib = WF.fold(f ? jsonl.readJsonl(f).rows : []);
658
+ return WF.kindOf(wfId ? WF.resolve(lib, wfId) : WF.defaultOf(lib));
659
+ } catch { return 'product'; }
660
+ }
643
661
  /** The lanes a repository's initiatives may declare — what the lane picker offers and the lane write accepts. */
644
662
  function laneNames(profile) { return laneDefs.laneNames(profile === 'pm-artifacts' ? 'pm-artifacts' : 'product-code'); }
645
663
  function lanesFor(root) {
@@ -1019,7 +1037,7 @@ function computeWorkflowDerived(id, opts) {
1019
1037
  // W5 (boards WfA/WfB/WfC, agreed 2026-11-12): the kind of work sets the gate. Full SDLC: a done test and a kill condition before the first
1020
1038
  // pull request. Project: a dated plan (plan_path), never a PRD. Product management (and a record with no kind:) keeps the rules below. A
1021
1039
  // PRD already on the record still satisfies the spec rung after a kind change: a gate already passed stays passed.
1022
- const workKind = (() => { const k = String(fm.kind || '').trim().replace(/^["']|["']$/g, ''); return k === 'sdlc' || k === 'project' ? k : 'product'; })();
1040
+ const workKind = workKindOf(root, id, fm);
1023
1041
  const planPath = String(fm.plan_path || '').trim();
1024
1042
  const agentMode = agentEvalSet.isAgent(fm);
1025
1043
  if (agentMode && !doneTest) {
@@ -1667,7 +1685,7 @@ function pmLadder({ id, fm, lane, effLane, knownLane, legacy, steps, root, L, re
1667
1685
  // W6 (launch simulation rerun, 2026-11-15): the kind of work sets this ladder too, as it sets the product-code gate (W5) and the kit gate.
1668
1686
  // Full SDLC: a done test and a kill condition, never a brief. Project: a dated plan (plan_path), never a brief. A brief already on the
1669
1687
  // record still passes (a gate passed stays passed). Their deliverable is not a document: the pull requests, or the plan's milestones.
1670
- const workKind = (() => { const k = String(fm.kind || '').trim().replace(/^["']|["']$/g, ''); return k === 'sdlc' || k === 'project' ? k : 'product'; })();
1688
+ const workKind = workKindOf(root, id, fm);
1671
1689
  const planPath = String(fm.plan_path || '').trim();
1672
1690
  const kindSpec = !doneTest && !exists(briefPath) && !foundBrief && (workKind === 'sdlc' || (workKind === 'project'));
1673
1691
  const tasksPlan = kindSpec && workKind === 'project' && !planPath ? taskPlanOf(root, id) : null;