create-pmos 0.416.0 → 0.417.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.416.0",
3
+ "version": "0.417.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": {
@@ -32,6 +32,18 @@
32
32
  "audit"
33
33
  ],
34
34
  "pmosChanges": [
35
+ {
36
+ "v": "0.417.0",
37
+ "at": "2026-10-26T01:02:52.959Z",
38
+ "f": 2,
39
+ "prs": [
40
+ {
41
+ "n": 1053,
42
+ "t": "Stage moves land on the stage asked for (hotfix)",
43
+ "s": "Pmos workflow move and Board drops land on the Product feature stage you ask for, by key, by name, or by number, even when the board merges two stages into one column."
44
+ }
45
+ ]
46
+ },
35
47
  {
36
48
  "v": "0.416.0",
37
49
  "at": "2026-10-26T00:23:58.708Z",
@@ -264,18 +276,6 @@
264
276
  "s": "Rebuild Home, Viewer, Board and Insights to the Agreed design"
265
277
  }
266
278
  ]
267
- },
268
- {
269
- "v": "0.397.0",
270
- "at": "2026-10-22T20:10:19.514Z",
271
- "f": 2,
272
- "prs": [
273
- {
274
- "n": 1011,
275
- "t": "The premium pages follow the Agreed design",
276
- "s": "The premium pages follow the Agreed design"
277
- }
278
- ]
279
279
  }
280
280
  ]
281
281
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@4fe6b63d
1
+ kernel-source: pmos@4510c3e0
2
2
  assembled: 2026-10-26
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-26T00:23:55Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-26T01:02:49Z"}
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-26T00:23:55Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-26T01:02:49Z"}
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-26T00:23:55Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-26T01:02:49Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,16 @@
1
1
  [
2
+ {
3
+ "v": "0.417.0",
4
+ "at": "2026-10-26T01:02:52.959Z",
5
+ "f": 2,
6
+ "prs": [
7
+ {
8
+ "n": 1053,
9
+ "t": "Stage moves land on the stage asked for (hotfix)",
10
+ "s": "Pmos workflow move and Board drops land on the Product feature stage you ask for, by key, by name, or by number, even when the board merges two stages into one column."
11
+ }
12
+ ]
13
+ },
2
14
  {
3
15
  "v": "0.416.0",
4
16
  "at": "2026-10-26T00:23:58.708Z",
@@ -2,7 +2,7 @@
2
2
  type: Guide
3
3
  title: "Workflows: the stages each kind of initiative goes through"
4
4
  description: "Settings › Workflows: the workflow list, one numbered list of stages across To do, In progress and Done, the stage panel, Only when conditions, removing a stage in use, New workflow in the chat, and the pmos workflow commands."
5
- timestamp: 2026-10-25
5
+ timestamp: 2026-10-26
6
6
  ---
7
7
 
8
8
  # Workflows
@@ -57,7 +57,7 @@ An agent writes a draft or a reading with these commands, and moves an initiativ
57
57
  - `pmos workflow show-draft` shows the draft that is open.
58
58
  - `pmos workflow judge --board <id> --id <initiative> --stage <key> --runs yes|no|unsure --why <reason> --cite <where>` records PMOS's reading of an Only when stage. **unsure** makes PMOS ask you. `--undo` takes a reading back.
59
59
  - `pmos workflow of <initiative>` shows the workflow the initiative runs, its current stage, and each stage numbered as done, current or skipped. It reads the same row as the Board.
60
- - `pmos workflow move <initiative> --stage <key|name>` moves the initiative to a stage of its own workflow. `--why` adds the reason. The move writes the same line as a move on the Board, under the agent's name.
60
+ - `pmos workflow move <initiative> --stage <key|name|number>` moves the initiative to a stage of its own workflow. A number counts from 1 in the workflow's order, so `--stage 5` is the fifth stage. `--why` adds the reason. The move writes the same line as a move on the Board, under the agent's name. On a board whose columns join two stages, such as **Build & Deliver**, the initiative still goes to the stage you name, and the joined column name means its first stage.
61
61
  - `pmos workflow switch <initiative> --to <workflow id>` puts the initiative on another workflow. `--stage` picks the stage it lands in; without it, the stage is the one the Board's switch picks.
62
62
 
63
63
  ### Workflow stage and task state
@@ -47,13 +47,15 @@ function build(f) {
47
47
  if (!f.ladder && !missing.includes('workflow steps')) missing.push('workflow steps');
48
48
  // D99: the stages are the initiative's own workflow (row.wfStages, routes-boards workflowRowOf): the strip and the phase read them, and on a
49
49
  // library workflow so does a move (bug 2026-10-25: a Tender initiative offered the old board stages Discover, Plan, Build & Deliver,
50
- // Monitor & Evaluate). A move on Product feature still names the board's stages, which POST /api/boards/move checks. Tasks have no stage.
50
+ // Monitor & Evaluate). Tasks have no stage.
51
51
  const boardWf = (row.workflow && row.workflow.length ? row.workflow : board.workflow) || [];
52
52
  const own = Array.isArray(row.wfStages) && row.wfStages.length && row.wfStage ? row.wfStages.filter((s) => s.status !== 'skipped' || s.key === row.wfStage.key) : null;
53
53
  const ownWf = !!(own && row.wf && row.wf.id && row.wf.id !== 'product-feature');
54
54
  const names = own ? own.map((s) => s.name) : boardWf.map((s) => s.name);
55
55
  const cur = own ? own.findIndex((s) => s.key === row.wfStage.key) : names.indexOf(row.stage);
56
- const moveNames = own && !ownWf ? boardWf.map((s) => s.name) : names;
56
+ // batch 7 item 4: Product feature moves name its eight stages too, never an older board's merged columns (Build & Deliver); POST
57
+ // /api/boards/move pins the initiative to the stage a column does not name
58
+ const moveNames = names;
57
59
  const id = row.id || '';
58
60
  const key = 'init:' + id;
59
61
 
@@ -155,7 +157,7 @@ function build(f) {
155
157
  id, key, title: clip(row.title || id, 160), lane: row.lane || '', anchor: row.anchor || '',
156
158
  // the bar's presses (initiative premium-board-actions): the workflow, the lifecycle and the archive entry the row holds
157
159
  acts: {
158
- self: !!board.self, stages: moveNames, stage: (ownWf ? names[cur] : row.stage) || null,
160
+ self: !!board.self, stages: moveNames, stage: (own ? names[cur] : row.stage) || null,
159
161
  life: status === 'on hold' ? 'hold' : status === 'cancelled' ? 'cancelled' : null,
160
162
  reason: (status === 'on hold' || status === 'cancelled') && row.stopped ? clip(row.stopped.reason || '', 300) : '',
161
163
  back: status === 'on hold' && row.stopped && row.stopped.back ? shortDate(row.stopped.back) : '', backDay: status === 'on hold' && row.stopped && row.stopped.back ? String(row.stopped.back).slice(0, 10) : null,
@@ -291,6 +291,14 @@ function epicsOf(base, folded) {
291
291
  /** D99: the workflow an initiative runs and where it stands in it. Product feature unless an ini-wf line set another (the PMOS-self
292
292
  * board always runs Product feature, derived). Answers { wf, stage (key), stages (WF.stagesOf), ended }. The ONE place every surface
293
293
  * (Board, track, stage card, Viewer, program milestones) gets an initiative's stages from. */
294
+ /** The stage an older board's merged column ("Build & Deliver", "Monitor & Evaluate") names on wf: `prefer` when it is one of its parts,
295
+ * else the first part, else null. */
296
+ function mergedStage(wf, name, prefer) {
297
+ const parts = String(name || '').split(/\s*(?:&|\/|\band\b)\s*/i).filter(Boolean);
298
+ if (parts.length < 2) return null;
299
+ const st = parts.map((x) => WF.stageByRef(wf, x)).filter(Boolean);
300
+ return st.length ? (prefer && st.some((x) => x.key === prefer.key) ? prefer : st[0]) : null;
301
+ }
294
302
  function workflowRowOf(board, base, folded, lib, legacyStage) {
295
303
  const k = B.key(board.id, base.id);
296
304
  const own = !(board && board.self) && folded && folded.iniWf ? folded.iniWf.get(k) : null;
@@ -301,7 +309,10 @@ function workflowRowOf(board, base, folded, lib, legacyStage) {
301
309
  cur = (WF.stageByRef(wf, moved) || wf.stages[0]).key;
302
310
  } else {
303
311
  const byName = WF.stageByRef(wf, legacyStage);
304
- cur = byName ? byName.key : (WF.stageByRef(wf, base.reading) || wf.stages[0]).key;
312
+ const read = WF.stageByRef(wf, base.reading);
313
+ // an older board's merged column ("Build & Deliver") names two stages: the reading when it is one of them, else the first (it fell
314
+ // back to the reading, so a move to Build & Deliver showed Triage)
315
+ cur = (byName || mergedStage(wf, legacyStage, read) || read || wf.stages[0]).key;
305
316
  }
306
317
  const judged = (folded && folded.judged && folded.judged.get(k)) || {};
307
318
  const auto = (folded && folded.autoOver && folded.autoOver.get(k)) || {};
@@ -723,7 +734,8 @@ function moveOnWorkflow(ctx, res, body, g, p, own) {
723
734
  if (body.why != null && (typeof body.why !== 'string' || body.why.length > 500)) return fail(ctx, res, 400, 'why is text of at most 500 characters');
724
735
  if (!p.file) return fail(ctx, res, 409, NO_STATE);
725
736
  const wf = WF.resolve(libOf(p.fr.folded), own.wf);
726
- const t = WF.stageByRef(wf, body.to);
737
+ // a Product feature initiative pinned by a move (moveToProductStage) is still dragged to the board's merged columns ("Build & Deliver")
738
+ const t = WF.stageByRef(wf, body.to) || (wf.id === WF.PRODUCT_FEATURE_ID ? mergedStage(wf, body.to) : null);
727
739
  if (!t) return fail(ctx, res, 400, `"${body.to}" is not a stage of ${wf.name} (${wf.stages.map((s) => s.name).join(', ')})`);
728
740
  const base = needRows(ctx, res, p.w);
729
741
  if (!base) return;
@@ -740,6 +752,29 @@ function moveOnWorkflow(ctx, res, body, g, p, own) {
740
752
  ctx.json(res, { ok: true, row, warnings, ...(made ? { tasksMade: made } : {}) });
741
753
  }
742
754
 
755
+ /** A move of a Product feature initiative to one of its eight stages (pf) that the board has no column for: an ini-wf line pins it to
756
+ * Product feature at that stage, the same line a workflow switch writes, so every surface reads the stage from it (batch 7 item 2). */
757
+ function moveToProductStage(ctx, res, body, g, p, pf) {
758
+ if (body.why != null && (typeof body.why !== 'string' || body.why.length > 500)) return fail(ctx, res, 400, 'why is text of at most 500 characters');
759
+ if (typeof body.id !== 'string' || !body.id) return fail(ctx, res, 400, 'id is required');
760
+ if (!p.file) return fail(ctx, res, 409, NO_STATE);
761
+ const base = needRows(ctx, res, p.w);
762
+ if (!base) return;
763
+ const b0 = base.find((r) => r.id === body.id);
764
+ if (!b0 || boardIdOf(b0, p.fr.boards, p.fr.folded, p.w) !== p.board.id) return fail(ctx, res, 404, `no initiative ${body.id} on this board`);
765
+ const before = boardRow(p.board, b0, p.fr.folded);
766
+ if (before.wf && before.wf.id !== WF.PRODUCT_FEATURE_ID) return fail(ctx, res, 400, `"${body.to}" is not a stage of ${before.wf.name}`);
767
+ const wf = WF.PRODUCT_FEATURE;
768
+ const a = wf.stages.findIndex((s) => s.key === before.wfStage.key), b = wf.stages.findIndex((s) => s.key === pf.key);
769
+ const warnings = [];
770
+ for (let i = a + 1; i < b; i++) { const sk = before.wfStages[i]; if (sk && sk.status !== 'skipped' && (!sk.when || sk.when.mode !== 'optional')) warnings.push('Skipped ' + sk.name); }
771
+ if (!before.anchor) warnings.push('No anchor');
772
+ append(p.file, g.actor, { kind: 'ini-wf', board: p.board.id, id: body.id, wf: wf.id, from: wf.id, moved: { from: before.wfStage.key, to: pf.key }, why: body.why ? String(body.why).trim() : '' });
773
+ const f1 = foldOf(ctx, p.w), row = boardRow(p.board, b0, f1);
774
+ const made = stageTasks(p.file, f1, p.board, row, g.actor.by);
775
+ ctx.json(res, { ok: true, row, warnings, ...(made ? { tasksMade: made } : {}) });
776
+ }
777
+
743
778
  /** A breakdown item named as a task (lib/task-items.js), when its initiative is on this board; answers and returns null when not. */
744
779
  function itemOnBoard(ctx, res, p, id) {
745
780
  const it = TI.isItemId(id) ? TI.itemOf(p.w.root, id) : null;
@@ -812,6 +847,10 @@ const WRITES = {
812
847
  const own = typeof body.id === 'string' && p.fr.folded.iniWf ? p.fr.folded.iniWf.get(B.key(p.board.id, body.id)) : null;
813
848
  if (own) return moveOnWorkflow(ctx, res, body, g, p, own);
814
849
  const wfOwn = typeof body.id === 'string' ? B.workflowOf(p.board, body.id, p.fr.folded) : p.board.workflow;
850
+ // an initiative on Product feature shows its eight stages, but an older board's columns merge them ("Build & Deliver"). A Product
851
+ // feature stage that is not a column pins the initiative to Product feature at that stage, so it lands where it was sent.
852
+ const pf = typeof body.to === 'string' && !wfOwn.some((s) => s.name === body.to) ? WF.stageByRef(WF.PRODUCT_FEATURE, body.to) : null;
853
+ if (pf) return moveToProductStage(ctx, res, body, g, p, pf);
815
854
  if (typeof body.to !== 'string' || !wfOwn.some((s) => s.name === body.to)) {
816
855
  return fail(ctx, res, 400, `"${body.to}" is not a stage of this ${wfOwn === p.board.workflow ? 'board' : 'initiative'}'s workflow (${wfOwn.map((s) => s.name).join(', ')})`);
817
856
  }
@@ -11,7 +11,7 @@
11
11
  * pmos workflow judge --board <id> --id <initiative> --stage <key> --undo
12
12
  * records PMOS's reading of an Only-when stage (one stage-judge line in boards.jsonl): yes runs it, no skips it, unsure asks the PM.
13
13
  * pmos workflow of <initiative> the workflow the initiative runs, its current stage, and every stage numbered (done, current, skipped)
14
- * pmos workflow move <initiative> --stage <key|name> [--why <text>]
14
+ * pmos workflow move <initiative> --stage <key|name|number> [--why <text>]
15
15
  * pmos workflow switch <initiative> --to <workflow id> [--stage <key|name>] [--why <text>]
16
16
  * move the initiative along its workflow, or put it on another workflow, as the PM asked (bug 2026-10-25). These run the Board's own
17
17
  * write routes (lib/routes-boards.js move, switchWorkflow) outside HTTP, so the checks, the warnings and the boards.jsonl line are the
@@ -45,7 +45,7 @@ const USAGE = [
45
45
  ' pmos workflow judge --board <id> --id <initiative> --stage <key> --undo',
46
46
  ' Record PMOS\'s reading of an Only-when stage: yes runs it, no skips it, unsure asks the PM. Give the reason and where you read it.',
47
47
  ' pmos workflow of <initiative> the workflow it runs and its current stage, every stage numbered',
48
- ' pmos workflow move <initiative> --stage <key|name> [--why <text>]',
48
+ ' pmos workflow move <initiative> --stage <key|name|number> [--why <text>]',
49
49
  ' Move the initiative to a stage of its own workflow, when the PM asks. The stage card and the Board show it at once.',
50
50
  ' pmos workflow switch <initiative> --to <workflow id> [--stage <key|name>] [--why <text>]',
51
51
  ' Put the initiative on another workflow, when the PM asks. Without --stage it lands where the Board\'s switch puts it.',
@@ -186,7 +186,7 @@ const ofJson = (r) => ({ initiative: { id: r.row.id, title: r.row.title }, board
186
186
 
187
187
  function onInitiative(verb, { pos, flags, json, say, fail, root, stateDir, actor }) {
188
188
  const id = pos[0];
189
- const usage = { of: 'pmos workflow of <initiative>', move: 'pmos workflow move <initiative> --stage <key|name> [--why <text>]', switch: 'pmos workflow switch <initiative> --to <workflow id> [--stage <key|name>] [--why <text>]' }[verb];
189
+ const usage = { of: 'pmos workflow of <initiative>', move: 'pmos workflow move <initiative> --stage <key|name|number> [--why <text>]', switch: 'pmos workflow switch <initiative> --to <workflow id> [--stage <key|name>] [--why <text>]' }[verb];
190
190
  if (!id) { say('usage: ' + usage); return 2; }
191
191
  if (verb === 'move' && !flags.stage) { say('usage: ' + usage); return 2; }
192
192
  if (verb === 'switch' && !flags.to) { say('usage: ' + usage); return 2; }
@@ -205,6 +205,12 @@ function onInitiative(verb, { pos, flags, json, say, fail, root, stateDir, actor
205
205
  const g = { ok: true, actor };
206
206
  const base = { ws: w.id, board: before.board.id, id, ...(flags.why ? { why: flags.why } : {}) };
207
207
  let to = flags.stage;
208
+ // a stage by its number, as pmos workflow of numbers them (batch 7 item 2: "--stage 5" was refused)
209
+ if (/^\d+$/.test(String(to || '').trim()) && verb === 'move') {
210
+ const st = (before.row.wfStages || [])[Number(to) - 1];
211
+ if (!st) return fail(`there is no stage ${to}: ${before.row.wf.name} has ${(before.row.wfStages || []).length} stages`);
212
+ to = st.key;
213
+ }
208
214
  let r;
209
215
  if (verb === 'move') {
210
216
  // Product feature: the Board's move names the stage; a key of Product feature reads as its name
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.416.0",
3
+ "version": "0.417.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.416.0",
9
+ "version": "0.417.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.416.0",
3
+ "version": "0.417.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",
@@ -38,6 +38,10 @@ const finish = async (code) => {
38
38
  process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
39
39
 
40
40
  /** Every line of a ledger the routes append to, wherever the repository keeps it. */
41
+ // a stage move is a move line, or (batch 7 item 4) the ini-wf line that pins a Product feature initiative to a stage the board has no column for
42
+ const isMove = (l) => l.kind === 'move' || (l.kind === 'ini-wf' && !!l.moved);
43
+ const toOf = (l) => (l.kind === 'ini-wf' ? l.moved.to : l.to);
44
+ const sameStage = (a, b) => String(a).toLowerCase() === String(b).toLowerCase(); // a stored Product feature key against its name
41
45
  const lines = (name) => {
42
46
  const out = [];
43
47
  const walk = (d) => { for (const e of fs.readdirSync(d, { withFileTypes: true })) { if (e.name === '.git') continue; const p = path.join(d, e.name); if (e.isDirectory()) walk(p); else if (e.name === name) out.push(...fs.readFileSync(p, 'utf8').split('\n').filter(Boolean).map((x) => JSON.parse(x))); } };
@@ -195,10 +199,10 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
195
199
  await (async (pg) => { if (await pg.$('#czViewer [data-hi-view="stage"]')) await pg.click('#czViewer [data-hi-view="stage"]'); else await viaMore(pg, 'Stage'); })(ip);
196
200
  const bar = await until(() => ip.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); if (!v || !v.querySelector('[data-ov-move]')) return null; const cur = v.querySelector('[data-ov-move][aria-pressed="true"]'); return { moves: [...v.querySelectorAll('[data-ov-move]')].map((x) => x.dataset.ovMove), cur: cur ? cur.dataset.ovMove : '', life: [...v.querySelectorAll('[data-ov-life]')].map((x) => x.dataset.ovLife) }; }), 60000);
197
201
  ok('I1 the Overview offers the stages, the current one pressed, and the lifecycle presses', !!bar && bar.moves.length > 1 && !!bar.cur && bar.moves.indexOf(bar.cur) < bar.moves.length - 1 && bar.life.join() === 'on-hold,cancelled', JSON.stringify(bar) + ' ' + (await ip.evaluate(() => (document.querySelector('#czViewer .cz-vw-body') || {}).innerText || 'no Viewer')).slice(0, 400));
198
- const n0 = lines('boards.jsonl').filter((l) => l.kind === 'move').length;
202
+ const n0 = lines('boards.jsonl').filter(isMove).length;
199
203
  const next = bar ? bar.moves[bar.moves.indexOf(bar.cur) + 1] : '';
200
204
  await ip.click(`#czViewer [data-ov-move="${next}"]`);
201
- ok('I2 a stage press records one move line', await until(() => { const L = lines('boards.jsonl').filter((l) => l.kind === 'move'); return L.length === n0 + 1 && L[L.length - 1].id === 'pa-one' && L[L.length - 1].to === next; }), JSON.stringify(lines('boards.jsonl').filter((l) => l.kind === 'move').slice(-1)));
205
+ ok('I2 a stage press records one move line', await until(() => { const L = lines('boards.jsonl').filter(isMove); return L.length === n0 + 1 && L[L.length - 1].id === 'pa-one' && sameStage(toOf(L[L.length - 1]), next); }), JSON.stringify(lines('boards.jsonl').filter(isMove).slice(-1)));
202
206
  ok('I2 the Overview then shows the new stage pressed', await until(() => ip.evaluate((n) => !!document.querySelector(`#czViewer [data-ov-move="${n}"][aria-pressed="true"]`), next)));
203
207
  const lif0 = lines('lifecycle.jsonl').length;
204
208
  await ip.click('#czViewer [data-ov-life="on-hold"]');
@@ -212,13 +216,13 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
212
216
  const back = await openNext();
213
217
  ok('I4 the card\'s next stage opens Move to the next stage now and Back', back && await ip.evaluate(() => /^Move to .+ now$/.test(((document.querySelector('.hi-pop [data-hi-go]') || {}).textContent || '').trim())));
214
218
  if (back) {
215
- const m0 = lines('boards.jsonl').filter((l) => l.kind === 'move').length;
219
+ const m0 = lines('boards.jsonl').filter(isMove).length;
216
220
  await ip.click('.hi-pop [data-hi-goback]');
217
221
  const asked = await until(() => ip.evaluate(() => { const d = document.querySelector('.hi-pop[role="dialog"]'); return d ? { go: d.querySelector('[data-hi-go]').disabled, chips: d.querySelectorAll('[data-hi-why]').length } : null; }));
218
- ok('I4 Back asks why first: Move back waits for a reason and records nothing yet', !!asked && asked.go === true && asked.chips === 4 && lines('boards.jsonl').filter((l) => l.kind === 'move').length === m0, JSON.stringify(asked));
222
+ ok('I4 Back asks why first: Move back waits for a reason and records nothing yet', !!asked && asked.go === true && asked.chips === 4 && lines('boards.jsonl').filter(isMove).length === m0, JSON.stringify(asked));
219
223
  await ip.click('.hi-pop [data-hi-why="New research"]'); await ip.fill('.hi-pop #hiWhy', 'Interviews changed the scope');
220
224
  await ip.click('.hi-pop [data-hi-go]');
221
- ok('I4 Move back records one move line with the reason as its why', await until(() => { const L = lines('boards.jsonl').filter((l) => l.kind === 'move'); const x = L[L.length - 1]; return L.length === m0 + 1 && x.id === 'pa-one' && x.to === bar.cur && x.why === 'Back: New research. Interviews changed the scope'; }), JSON.stringify(lines('boards.jsonl').filter((l) => l.kind === 'move').slice(-1)));
225
+ ok('I4 Move back records one move line with the reason as its why', await until(() => { const L = lines('boards.jsonl').filter(isMove); const x = L[L.length - 1]; return L.length === m0 + 1 && x.id === 'pa-one' && sameStage(toOf(x), bar.cur) && x.why === 'Back: New research. Interviews changed the scope'; }), JSON.stringify(lines('boards.jsonl').filter((l) => l.kind === 'move').slice(-1)));
222
226
  ok('I4 the Undo toast shows after the move', await until(() => ip.evaluate(() => { const t = document.querySelector('#hiToast'); return !!t && !t.hidden && /moved to/.test(t.textContent) && !!t.querySelector('[data-hi-undo]'); })));
223
227
  await openNext();
224
228
  await ip.click('.hi-pop [data-hi-auto]');
@@ -486,7 +486,7 @@ $('#ibBody').addEventListener('drop', async (e) => {
486
486
  to = st.name; if (cur) from = cur.name;
487
487
  } else {
488
488
  const j = +col.dataset.step; if (r.track.k === j) return;
489
- const step = M.steps[j]; to = (r.acts.stages || []).find((n) => stepOfName(n) === step.key);
489
+ const step = M.steps[j]; to = (r.acts.stages || []).find((n) => stepOfName(n) === step.key) || (WF.isPF(WF.wfOf(r)) ? step.label : null); // batch 7 item 4
490
490
  if (!to) { say(step.label + ' is not one of this board\'s stages, so it did not move.'); return; }
491
491
  }
492
492
  const body = { ws: r.ws || M.board.ws, board: r.boardId || M.board.id, id: r.id };