create-pmos 0.198.0 → 0.199.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.198.0",
3
+ "version": "0.199.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": {
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@94c2b4f
1
+ kernel-source: pmos@0ede922
2
2
  assembled: 2026-10-13
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-10-13T10:14:18Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-13T10:19:39Z"}
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-10-13T10:14:18Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-13T10:19:39Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -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-10-13T10:14:18Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-13T10:19:39Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -45,7 +45,7 @@ A row that is not started always has a next step:
45
45
  ## How PMOS drafts a document
46
46
 
47
47
  - **When you ask.** Press **Draft it** on a row, or **Ask PMOS to change it** on a draft. PMOS starts one background run. The run reads the sources of that document and writes one draft. It has no tool that sends, posts or edits.
48
- - **On a schedule.** Every 30 minutes inside your working hours, PMOS drafts each portfolio and board document whose cadence has passed and that has no draft. It drafts a document at most once a day, and it runs at most 3 drafts at once. It never drafts a document that you write (the product strategy).
48
+ - **On a schedule.** Every 30 minutes inside your working hours, PMOS drafts each portfolio and board document that has no draft and is due, out of date or not started yet. Due documents go first, then out-of-date ones, then the first draft of documents not started. While no OKR files exist, it also proposes the OKRs. It drafts a document at most once a day, and it runs at most 3 drafts at once. It never drafts a document that you write (the product strategy).
49
49
  - **The Initiative Driver.** When the current stage of an initiative needs a document that is not there or is stale, the driver drafts it and files a proposal. **Keep** issues the draft. The driver does not propose a stage move while a document of the current stage is due.
50
50
 
51
51
  ## Issue a draft
@@ -77,7 +77,7 @@ function startRun(ctx, w, scope, entry, { label, now } = {}) {
77
77
  const labelOf = (facts) => (facts.level === 'board' && facts.board ? facts.board.name : facts.level === 'initiative' && facts.row ? `${facts.row.id} ${facts.row.title || ''}`.trim() : null);
78
78
 
79
79
  // ── the tick ─────────────────────────────────────────────────────────────────────────────────────────
80
- /** Draft each due doc entry of the portfolio and the boards. → [{ ws, scope, key, ok, error? }] */
80
+ /** Draft the doc entries of the portfolio and the boards that are due, out of date or not started (due first). → [{ ws, scope, key, ok, error? }] */
81
81
  function tick(ctx, { now = Date.now(), force = false } = {}) {
82
82
  if (!ctx || typeof ctx.getWs !== 'function') return [];
83
83
  if (!force && lastTick != null && now - lastTick < TICK_EVERY_MS) return [];
@@ -85,35 +85,42 @@ function tick(ctx, { now = Date.now(), force = false } = {}) {
85
85
  const open = require('./driver-run.js').dayCheckOpen(settings || {}, now, ctx.inQuiet || (() => false));
86
86
  if (!open) return [];
87
87
  lastTick = now;
88
- if (headless.switchedOff(process.env)) return [];
88
+ if (headless.switchedOff(process.env) || /^(off|0|false|no)$/i.test(String(process.env.PMOS_CORE_DOCS || ''))) return []; // PMOS_CORE_DOCS=off: no scheduled drafts
89
89
  const day = CD.localDay(now);
90
90
  const out = [];
91
91
  const list = typeof ctx.workspaceList === 'function' ? ctx.workspaceList() : [ctx.getWs(null)].filter(Boolean);
92
+ // Every candidate first, then the most pressing: due (issued, cadence passed), out of date, then not started (the first draft, and the
93
+ // proposed OKRs while no OKR files exist). At most RUN_CAP runs at once; each entry at most once a day.
94
+ const RANK = { due: 0, stale: 1, missing: 2 };
95
+ const todo = [];
92
96
  for (const w of list) {
93
97
  if (!w || !w.root) continue;
94
98
  if (typeof ctx.isLead === 'function' && !ctx.isLead(w)) continue;
95
99
  const levels = [{ level: 'portfolio' }];
96
100
  try { for (const b of require('./routes-boards.js').frameFor(ctx, w).boards) levels.push({ level: 'board', board: b.id }); } catch { /* the portfolio still drafts */ }
97
- for (const lv of levels) {
98
- if (runs.size >= RUN_CAP) return out;
101
+ for (const [li, lv] of levels.entries()) {
99
102
  let g;
100
103
  try { g = CD.gather(ctx, w, { ...lv, now }); } catch { continue; }
101
104
  if (!g.ok) continue;
102
- for (const entry of g.facts.entries) {
103
- if (runs.size >= RUN_CAP) return out;
104
- if (!CD.draftable(entry)) continue;
105
+ for (const [ei, entry] of g.facts.entries.entries()) {
106
+ if (!CD.draftable(entry) && !(entry.store && entry.by !== 'you')) continue;
105
107
  const st = CD.stateOf(entry, g.facts);
106
- if (st.st !== 'due' || st.draft) continue;
108
+ if (!(st.st in RANK) || st.draft) continue;
107
109
  const k = runKey(w.id, g.facts.scope, entry.key);
108
110
  if (runs.has(k) || tried.get(k) === day) continue;
109
111
  const x = g.facts.store.get(`${g.facts.scope}|${entry.key}`);
110
112
  if (x && x.drafts.some((d) => CD.localDay(Date.parse(d.at)) === day)) continue; // drafted today already (by a press, or before a restart)
111
- tried.set(k, day);
112
- const r = startRun(ctx, w, g.facts.scope, entry, { label: labelOf(g.facts), now });
113
- out.push({ ws: w.id, scope: g.facts.scope, key: entry.key, ok: r.ok, ...(r.ok ? { run: r.run } : { error: r.error }) });
113
+ todo.push({ w, g, entry, k, order: [RANK[st.st], li, ei] });
114
114
  }
115
115
  }
116
116
  }
117
+ todo.sort((a, b) => a.order[0] - b.order[0] || a.order[1] - b.order[1] || a.order[2] - b.order[2]);
118
+ for (const t of todo) {
119
+ if (runs.size >= RUN_CAP) break;
120
+ tried.set(t.k, day);
121
+ const r = startRun(ctx, t.w, t.g.facts.scope, t.entry, { label: labelOf(t.g.facts), now });
122
+ out.push({ ws: t.w.id, scope: t.g.facts.scope, key: t.entry.key, ok: r.ok, ...(r.ok ? { run: r.run } : { error: r.error }) });
123
+ }
117
124
  return out;
118
125
  }
119
126
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.198.0",
3
+ "version": "0.199.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.198.0",
9
+ "version": "0.199.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.198.0",
3
+ "version": "0.199.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",