create-pmos 0.802.0 → 0.803.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.802.0",
3
+ "version": "0.803.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": {
@@ -34,8 +34,8 @@
34
34
  ],
35
35
  "pmosChanges": [
36
36
  {
37
- "v": "0.802.0",
38
- "at": "2026-11-25T02:04:50.325Z",
37
+ "v": "0.803.0",
38
+ "at": "2026-11-25T02:11:48.085Z",
39
39
  "f": 4,
40
40
  "prs": [
41
41
  {
@@ -43,6 +43,12 @@
43
43
  "t": "Chat input text spans the full width, controls row under it",
44
44
  "s": "Chat input text spans the full width, controls row under it",
45
45
  "k": "fix"
46
+ },
47
+ {
48
+ "n": 1828,
49
+ "t": "Every new task gets a stage; tasks with none are placed on the next read",
50
+ "s": "Every new task gets a stage; tasks with none are placed on the next read",
51
+ "k": "fix"
46
52
  }
47
53
  ]
48
54
  },
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@0d66b644e
1
+ kernel-source: pmos@97d8fb03f
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-25T02:04:46Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-25T02:11:44Z"}
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-25T02:04:46Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-25T02:11:44Z"}
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-11-25T02:04:46Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-25T02:11:44Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,7 +1,7 @@
1
1
  [
2
2
  {
3
- "v": "0.802.0",
4
- "at": "2026-11-25T02:04:50.325Z",
3
+ "v": "0.803.0",
4
+ "at": "2026-11-25T02:11:48.085Z",
5
5
  "f": 4,
6
6
  "prs": [
7
7
  {
@@ -9,6 +9,12 @@
9
9
  "t": "Chat input text spans the full width, controls row under it",
10
10
  "s": "Chat input text spans the full width, controls row under it",
11
11
  "k": "fix"
12
+ },
13
+ {
14
+ "n": 1828,
15
+ "t": "Every new task gets a stage; tasks with none are placed on the next read",
16
+ "s": "Every new task gets a stage; tasks with none are placed on the next read",
17
+ "k": "fix"
12
18
  }
13
19
  ]
14
20
  },
@@ -744,6 +744,42 @@ function rowsOfBoard(fr, board, base) {
744
744
  }
745
745
  return rows;
746
746
  }
747
+ /** The stage a task sits in, as the breakdown reads it: its last task-section line, else the stage whose To finish entry made it. '' or null = none. */
748
+ function sectionOf(folded, t) {
749
+ if (!t) return null;
750
+ const S = folded.sections || new Map();
751
+ return S.has(t.id) ? S.get(t.id) : (t.from && t.from.stage) || null;
752
+ }
753
+ /** The stage a new task with no section named goes under: its parent's stage, else the initiative's stage in progress; null when the
754
+ * initiative has no workflow stage to name (the task then has no place, as before). */
755
+ function defaultSection(folded, row, parent) {
756
+ const st = (row && row.wfStages) || [];
757
+ const ok = (k) => typeof k === 'string' && k && st.some((x) => x.key === k);
758
+ if (parent) { const ps = sectionOf(folded, folded.tasks && folded.tasks.get(parent)); if (ok(ps)) return ps; }
759
+ const cur = row && row.wfStage && row.wfStage.key;
760
+ return ok(cur) ? cur : null;
761
+ }
762
+ const CLOSED_TASK = new Set(['Done', "Won't do", 'Archived']);
763
+ /** The repair of tasks with no place (data reliability, 2026-11-25): an open task of a live initiative that has NO task-section line and no
764
+ * To finish stage was hidden by the Work breakdown (it draws tasks by stage; the ones in no stage only count in a footer). Each such task
765
+ * is placed under its parent's stage, else the stage in progress, once: the line it writes makes it placed, so the next read finds nothing.
766
+ * A task the PM put in "Not in a stage" has a line ('') and is never touched. `pmos task set <task> --stage none` takes one back out.
767
+ * → the number placed. */
768
+ function placeLoose(file, folded, board, row) {
769
+ if (!file || !row || board.self || row.ended || row.archived || !row.wfStage) return 0;
770
+ const S = folded.sections || new Map();
771
+ let n = 0;
772
+ for (const t of tasksOfIni(folded, row.id)) {
773
+ if (!t || t.kind === 'Epic' || CLOSED_TASK.has(t.state) || S.has(t.id) || (t.from && t.from.stage)) continue;
774
+ const parent = folded.parents ? folded.parents.get(t.id) : null;
775
+ const sec = defaultSection(folded, row, parent || null);
776
+ if (!sec) continue;
777
+ append(file, { by: 'agent:repair' }, { kind: 'task-section', board: board.id, task: t.id, section: sec, repair: true,
778
+ why: 'placed under ' + sec + ': it had no stage, so Work did not show it' });
779
+ n++;
780
+ }
781
+ return n;
782
+ }
747
783
  /** A stage's To finish entries are tasks of the initiative (feedback batch 5: "Also there is workflow tasks, confusing"). Each entry of the
748
784
  * current stage becomes one Board task, once: its `from` marker names the stage and the entry, so a move back and forth makes no second
749
785
  * one. It runs on a move, a switch and the first read that finds none, so closing one (on the stage card, in the Tasks section or with
@@ -780,6 +816,9 @@ function seedRows(ctx, w, fr, board, rows) {
780
816
  let n = 0;
781
817
  for (const r of rows) if (r.wf && r.wf.id !== 'product-feature') n += stageTasks(file, fr.folded, board, r, stagedBy(fr.folded, board.id, r.id));
782
818
  if (n) fr.folded = foldOf(ctx, w);
819
+ let m = 0;
820
+ for (const r of rows) m += placeLoose(file, fr.folded, board, r);
821
+ if (m) fr.folded = foldOf(ctx, w);
783
822
  return n;
784
823
  }
785
824
 
@@ -1580,21 +1619,26 @@ const WRITES = {
1580
1619
  const b0 = base.find((r) => r.id === body.initiative);
1581
1620
  if (!b0 || boardIdOf(b0, p.fr.boards, p.fr.folded, p.w) !== p.board.id) return fail(ctx, res, 404, `no initiative ${body.initiative} on this board`);
1582
1621
  // the + on a stage of the Tasks list (batch 18 item 16): the task goes under that stage
1622
+ const row0 = boardRow(p.board, b0, p.fr.folded);
1583
1623
  if (body.section != null) {
1584
1624
  if (typeof body.section !== 'string' || body.section.length > 80) return fail(ctx, res, 400, "section is a stage key of the initiative's workflow, or '' for Not in a stage");
1585
- const st = boardRow(p.board, b0, p.fr.folded).wfStages || [];
1625
+ const st = row0.wfStages || [];
1586
1626
  if (body.section && !st.some((x) => x.key === body.section)) return fail(ctx, res, 400, `"${body.section}" is not a stage of this initiative's workflow: one of ${st.map((x) => x.key).join(', ')}, or ''`);
1587
1627
  }
1588
1628
  const id = `task-${crypto.randomBytes(5).toString('hex')}`;
1589
1629
  // "under Batch 2: …" in the add box (initiative work-subtasks): the new task is a subtask from its first line
1590
1630
  if (body.parent != null && body.parent !== '') { const pe = parentError(p, id, body.parent, body.initiative); if (pe) return fail(ctx, res, 400, pe); }
1631
+ // every new task gets a place (data reliability, 2026-11-25): a caller that names no section (the chat, \`pmos task add\`, a kept ✦,
1632
+ // an outcome's next step) used to write no task-section line, so the Work breakdown had no stage to draw the task under and hid it.
1633
+ // No section named: the parent's stage for a subtask, else the stage in progress. '' stays the PM's own "Not in a stage".
1634
+ const sec = typeof body.section === 'string' ? body.section : defaultSection(p.fr.folded, row0, body.parent || null);
1591
1635
  // a milestone has one date, the due day, and no start (the ◇ of the Viewer's add field, batch 25 item 5)
1592
1636
  const ms = body.milestone === true;
1593
1637
  const start = ms ? '' : body.start || (body.due && body.due < B.shiftDay(today(), 1) ? body.due : B.shiftDay(today(), 1));
1594
1638
  const due = body.due || (ms ? body.start || B.shiftDay(today(), 8) : B.shiftDay(start, 7));
1595
1639
  append(p.file, g.actor, { kind: 'task', board: p.board.id, task: id, type: body.type || 'Task', initiative: body.initiative, title: body.title.trim(), epic: body.epic ? String(body.epic).trim() : null,
1596
1640
  owner: body.owner ? String(body.owner).trim() : actorLib.pageName(g.actor.by), state: 'To do', start, due, ...(body.notes && body.notes.trim() ? { notes: body.notes.replace(/\s+$/, '') } : {}), ...(body.parent ? { parent: body.parent } : {}) });
1597
- if (typeof body.section === 'string') append(p.file, g.actor, { kind: 'task-section', board: p.board.id, task: id, section: body.section, why: body.section ? 'placed under ' + body.section : 'placed under no stage' });
1641
+ if (typeof sec === 'string') append(p.file, g.actor, { kind: 'task-section', board: p.board.id, task: id, section: sec, why: sec ? 'placed under ' + sec + (typeof body.section === 'string' ? '' : ', the ' + (body.parent ? "parent's stage" : 'stage in progress')) : 'placed under no stage' });
1598
1642
  if (ms) append(p.file, g.actor, { kind: 'task-milestone', board: p.board.id, task: id, milestone: true, why: 'added as a milestone' });
1599
1643
  const t = B.taskOf(B.fold(readLedger(ctx, p.w)), id);
1600
1644
  ctx.json(res, { ok: true, item: B.rollupItems([B.taskItem(t)])[0] });
@@ -2313,9 +2357,13 @@ function initiativeWorkflow(ctx, w, id) {
2313
2357
  /** stageTasks for one initiative outside HTTP (`pmos task list|state`): its current stage's To finish entries made tasks once. → the number made, or 0. */
2314
2358
  function seedInitiative(ctx, w, id) {
2315
2359
  const r = initiativeWorkflow(ctx, w, id);
2316
- if (!r.ok || !r.row.wf || r.row.wf.id === 'product-feature') return 0;
2317
- const folded = foldOf(ctx, w);
2318
- return stageTasks(ledgerFile(ctx, w), folded, r.board, r.row, stagedBy(folded, r.board.id, id));
2360
+ if (!r.ok || !r.row.wf) return 0;
2361
+ const file = ledgerFile(ctx, w);
2362
+ let folded = foldOf(ctx, w);
2363
+ const n = r.row.wf.id === 'product-feature' ? 0 : stageTasks(file, folded, r.board, r.row, stagedBy(folded, r.board.id, id));
2364
+ if (n) folded = foldOf(ctx, w);
2365
+ placeLoose(file, folded, r.board, r.row); // a task with no place is placed before it is listed (data reliability, 2026-11-25)
2366
+ return n;
2319
2367
  }
2320
2368
 
2321
2369
  /** The board of each initiative of a workspace, for other routes (Reports): { boards: [{ id, title }], of(id) → board id }.
@@ -2382,4 +2430,4 @@ function meetingBoards(ctx) {
2382
2430
  return { list, detail };
2383
2431
  }
2384
2432
 
2385
- module.exports = { prefixes: ['/api/boards'], handle, jiraFacts, tasksOfIni, postFrame, needRows, itemsOf, readLedger, foldOf, epicsOf, rowsOfBoard, invalidateRows: (w) => { rowsLib.invalidate(w.root); rowCache.delete(w.root); }, move, switchWorkflow, taskState, taskAdd, taskEdit, taskComment, describeDraft, writeAs, taskDelete, taskRestore, initiativeWorkflow, seedInitiative, stageTasks, boardIndex, appendScanAsk, scanDeclineSignal, createAndPlace, startOnDefault, kindSwitch, kindFollowsWorkflow, recordKind, ledgerFile, append, frameFor, boardIdOf, meetingBoards, boardsOf, baseRows, boardRow, taskSpanOf, workflowRowOf, closedOf, foldOf, portfolio, SELF_REFUSAL, NO_STATE };
2433
+ module.exports = { prefixes: ['/api/boards'], handle, jiraFacts, tasksOfIni, defaultSection, placeLoose, postFrame, needRows, itemsOf, readLedger, foldOf, epicsOf, rowsOfBoard, invalidateRows: (w) => { rowsLib.invalidate(w.root); rowCache.delete(w.root); }, move, switchWorkflow, taskState, taskAdd, taskEdit, taskComment, describeDraft, writeAs, taskDelete, taskRestore, initiativeWorkflow, seedInitiative, stageTasks, boardIndex, appendScanAsk, scanDeclineSignal, createAndPlace, startOnDefault, kindSwitch, kindFollowsWorkflow, recordKind, ledgerFile, append, frameFor, boardIdOf, meetingBoards, boardsOf, baseRows, boardRow, taskSpanOf, workflowRowOf, closedOf, foldOf, portfolio, SELF_REFUSAL, NO_STATE };
@@ -331,14 +331,12 @@ function applyOne(ctx, p, g, f, ini, x, choices, outbox) {
331
331
  for (const it of items) {
332
332
  if (it.jira) { epics.push(it.jira.toUpperCase()); continue; }
333
333
  const title = (it.wbs && !String(it.title).startsWith(it.wbs) ? it.wbs + ' ' : '') + it.title;
334
+ // the stage the source names goes with the add; none named: the add places it under the stage in progress (routes-boards defaultSection)
335
+ const st = it.stage ? stagesOf(ctx, p, ini).find((s) => s.key === it.stage || s.name.toLowerCase() === String(it.stage).toLowerCase()) : null;
334
336
  const r = RB.taskAdd(ctx, { ws: p.w.id, board: p.board.id, initiative: ini, title: title.slice(0, 200), ...(it.start ? { start: it.start } : {}), ...(it.due ? { due: it.due } : {}), ...(it.owner ? { owner: it.owner } : {}),
335
- notes: ['From ' + (it.source || source || 'your sources') + (it.ref ? ': ' + it.ref : ''), it.notes || ''].filter(Boolean).join('\n').slice(0, 1900) }, g);
337
+ ...(st ? { section: st.key } : {}), notes: ['From ' + (it.source || source || 'your sources') + (it.ref ? ': ' + it.ref : ''), it.notes || ''].filter(Boolean).join('\n').slice(0, 1900) }, g);
336
338
  if (!W.ok(r)) continue;
337
339
  const uid = r.body.item && (r.body.item.uid || r.body.item.id);
338
- if (uid && it.stage) {
339
- const st = stagesOf(ctx, p, ini).find((s) => s.key === it.stage || s.name.toLowerCase() === String(it.stage).toLowerCase());
340
- if (st) RB.taskEdit(ctx, { ws: p.w.id, board: p.board.id, task: uid, section: st.key }, g);
341
- }
342
340
  add({ op: 'add', task: uid, title, to: { start: it.start || '', due: it.due || '' } });
343
341
  }
344
342
  if (epics.length) {
@@ -89,11 +89,14 @@ function nameFor(F, ini, fromLive) {
89
89
  function applyLive(ctx, p, row, d, g) {
90
90
  const live = liveOf(p, row), S = TP.stepsOf(d, live), undo = { added: [], changed: [], dropped: [], unchosen: [] };
91
91
  const file = p.file, by = g.actor;
92
+ let dk; // the stage in progress, read once: where a new task with no stage named goes
93
+ const dflt = () => { if (dk === undefined) { try { dk = RB.defaultSection(p.fr.folded, RB.boardRow(p.board, row, p.fr.folded), null); } catch { dk = null; } } return dk; };
92
94
  for (const x of S.add) {
93
95
  const id = `task-${require('crypto').randomBytes(5).toString('hex')}`;
94
96
  RB.append(file, by, { kind: 'task', board: p.board.id, task: id, type: 'Task', initiative: row.id, title: x.title || 'Task', epic: null, owner: x.owner || actorLib.pageName(by.by),
95
97
  state: 'To do', start: x.start || null, due: x.due || null, ...(x.milestone ? { milestone: true } : {}), why: 'made live from ' + d.name });
96
- const sec = x.section || (x.from && x.from.stage) || '';
98
+ // no stage named: the stage in progress, so the task shows in the Work breakdown (data reliability, 2026-11-25)
99
+ const sec = x.section || (x.from && x.from.stage) || dflt() || '';
97
100
  if (sec) RB.append(file, by, { kind: 'task-section', board: p.board.id, task: id, section: sec, why: 'placed under ' + sec });
98
101
  undo.added.push(id);
99
102
  }
@@ -39,6 +39,7 @@ const USAGE = [
39
39
  'usage: pmos task add|list|state|set|remove — an initiative\'s tasks, the ones the PM sees in its Tasks section',
40
40
  ' pmos task add <initiative> "<title>" [--stage <stage>] [--due YYYY-MM-DD] [--start YYYY-MM-DD] [--owner <who>] [--notes <text>] [--parent <task>]',
41
41
  ' Add a task. Every new task goes here; pmos item add is the older breakdown record. --parent adds it as a subtask of that task.',
42
+ ' With no --stage it goes under the parent\'s stage, else the stage in progress, so Work shows it. --stage none keeps it in no stage.',
42
43
  ' pmos task set <task> [<task> …] [--stage <stage>|none] [--due YYYY-MM-DD|none] [--start YYYY-MM-DD|none] [--owner <who>] [--notes <text>]',
43
44
  ' [--milestone|--no-milestone] [--pin|--no-pin|--pin-default] [--parent <task>|none]',
44
45
  ' --parent puts the task under another task of the same initiative as a subtask; none takes it back to the top level. Set it only when the PM asks.',
@@ -180,17 +181,18 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
180
181
  const body = { ws: w.id, board: r.board.id, initiative: id, title };
181
182
  for (const k of ['due', 'start', 'owner', 'notes']) if (flags[k] !== undefined) body[k] = flags[k];
182
183
  if (flags.parent !== undefined && String(flags.parent).toLowerCase() !== 'none') body.parent = String(flags.parent); // a subtask (initiative chat-subtasks)
184
+ // the place goes with the add, in one write: no --stage places it under the parent's stage or the stage in progress (routes-boards
185
+ // defaultSection), so a task the chat adds always shows in the Work breakdown; --stage none keeps it in no stage
186
+ if (sec != null) body.section = sec;
183
187
  const a = boards.taskAdd(ctx, body, g);
184
188
  if (!a.body || a.body.ok !== true) return fail((a.body && a.body.error) || 'the write was refused');
185
189
  const t = a.body.item;
186
- if (sec) {
187
- const e = boards.taskEdit(ctx, { ws: w.id, board: r.board.id, task: t.uid, section: sec }, g);
188
- if (!e.body || e.body.ok !== true) return fail(`added ${t.uid}, but it was not placed under ${sec}: ${(e.body && e.body.error) || 'the write was refused'}`);
189
- }
190
+ let placedAt = sec;
191
+ if (placedAt == null) { try { placedAt = (boards.foldOf(ctx, w).sections || new Map()).get(t.uid) || null; } catch { placedAt = null; } }
190
192
  if (body.parent) console.error('[task-parent]', 'add', 1);
191
- LIVE.emit(stateDir, { id: t.uid, field: 'added', value: { initiative: id, title: t.title, status: t.status, owner: t.owner || '', start: t.start || '', end: t.end || '', ...(sec ? { section: sec } : {}), ...(body.parent ? { parent: body.parent } : {}) } });
192
- if (json) say(JSON.stringify({ ok: true, task: { id: t.uid, board: t.board, title: t.title, state: t.status, owner: t.owner, start: t.start, due: t.end, ...(sec ? { stage: sec } : {}), ...(body.parent ? { parent: body.parent } : {}) } }));
193
- else say(`✓ added ${t.uid} · ${t.status} · ${t.title}${body.parent ? ' · a subtask of ' + body.parent : ''}${sec ? ' · under ' + sec : ''}${t.end ? ' · due ' + t.end : ''}. The initiative's Tasks section shows it. Nothing was sent.`);
193
+ LIVE.emit(stateDir, { id: t.uid, field: 'added', value: { initiative: id, title: t.title, status: t.status, owner: t.owner || '', start: t.start || '', end: t.end || '', ...(placedAt ? { section: placedAt } : {}), ...(body.parent ? { parent: body.parent } : {}) } });
194
+ if (json) say(JSON.stringify({ ok: true, task: { id: t.uid, board: t.board, title: t.title, state: t.status, owner: t.owner, start: t.start, due: t.end, ...(placedAt ? { stage: placedAt } : {}), ...(body.parent ? { parent: body.parent } : {}) } }));
195
+ else say(`✓ added ${t.uid} · ${t.status} · ${t.title}${body.parent ? ' · a subtask of ' + body.parent : ''}${placedAt ? ' · under ' + placedAt : ''}${t.end ? ' · due ' + t.end : ''}. The initiative's Tasks section shows it. Nothing was sent.`);
194
196
  return 0;
195
197
  }
196
198
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.802.0",
3
+ "version": "0.803.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.802.0",
9
+ "version": "0.803.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.802.0",
3
+ "version": "0.803.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",