create-pmos 0.538.0 → 0.540.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 (53) hide show
  1. package/package.json +39 -39
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/changelog.json +38 -0
  7. package/workspace/guide/agent-capabilities.md +9 -5
  8. package/workspace/guide/agents-act.md +68 -0
  9. package/workspace/guide/index.md +2 -1
  10. package/workspace/guide/initiative-driver.md +16 -7
  11. package/workspace/guide/settings.md +1 -1
  12. package/workspace/guide/today.md +8 -4
  13. package/workspace/guide/workflows.md +14 -12
  14. package/workspace/ini-workflow-test.js +1 -1
  15. package/workspace/lib/agent-inbox.js +2 -2
  16. package/workspace/lib/ai-cli.js +12 -1
  17. package/workspace/lib/ai-guard.js +16 -6
  18. package/workspace/lib/auto-keep.js +33 -0
  19. package/workspace/lib/autonomy-cli.js +53 -0
  20. package/workspace/lib/autonomy.js +234 -0
  21. package/workspace/lib/bg-queue.js +2 -1
  22. package/workspace/lib/driver-cli.js +26 -10
  23. package/workspace/lib/driver-decide.js +76 -8
  24. package/workspace/lib/driver.js +15 -4
  25. package/workspace/lib/goal-loop.js +221 -0
  26. package/workspace/lib/headless.js +75 -1
  27. package/workspace/lib/job-graph.js +5 -0
  28. package/workspace/lib/loop-cli.js +84 -0
  29. package/workspace/lib/pm-lines-needs.js +3 -0
  30. package/workspace/lib/pmos-verbs.js +6 -1
  31. package/workspace/lib/route-modules.js +1 -0
  32. package/workspace/lib/routes-autonomy.js +95 -0
  33. package/workspace/lib/routes-proposals.js +101 -46
  34. package/workspace/lib/run-tokens.js +70 -0
  35. package/workspace/lib/stage-tools.js +11 -1
  36. package/workspace/lib/today-cli.js +57 -4
  37. package/workspace/lib/today.js +2 -8
  38. package/workspace/package-lock.json +2 -2
  39. package/workspace/package.json +1 -1
  40. package/workspace/public/pm/cozy-news.js +1 -1
  41. package/workspace/public/pm/cozy-onboard.js +2 -2
  42. package/workspace/public/pm/cozy-settings.js +42 -11
  43. package/workspace/public/pm/home-app.js +10 -1
  44. package/workspace/public/pm/home-around.js +2 -2
  45. package/workspace/public/pm/ini-wf.js +3 -3
  46. package/workspace/public/pm/wf-page.css +26 -15
  47. package/workspace/public/pm/wf-page.js +96 -72
  48. package/workspace/public/premium-workflows.html +8 -23
  49. package/workspace/replaced-tests.json +17 -0
  50. package/workspace/server.js +33 -16
  51. package/workspace/test-lists/full-autonomy.json +11 -0
  52. package/workspace/test-run.js +3 -0
  53. package/workspace/workflows-setup-test.js +50 -50
@@ -1,16 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
- /* workflows-setup-test.js — Settings › Workflows (D99; canvas WfAModel, WfAStage, WfACond, WfARemove, WfANew, WfADraft). Serves the real page
4
- * from the real server; /api/workflows and its writes answer from an in-memory list (fixtures/workflows-facts.js), so every press is captured.
3
+ /* workflows-setup-test.js — Settings › Workflows (D99; canvas WfAModel, WfAStage, WfACond, WfARemove, WfANew, WfADraft). A sub-panel of
4
+ * Settings › Workspaces since UI grill U1: the old address /premium-workflows.html redirects to Home with ?settings=workflows, and Home
5
+ * opens Settings on it. Serves the real pages from the real server; /api/workflows and its writes answer from an in-memory list (fixtures/workflows-facts.js), so every press is captured.
5
6
  * M the list and the picked workflow: counts, one numbered list across To do / In progress / Done, Optional and Only-when pills, ◆,
6
7
  * the dashed Won't do · Archived column; Product feature is read-only with Copy
7
8
  * S a stage opens in the Viewer: its name is the title (rename), category, output kind, template, To finish, Then with the fallback, Unless,
8
9
  * Milestone, Moves on by itself; each change saves the whole workflow
9
10
  * C Only when: plain words, How it reads today from the Board rows, Who decides; Save writes the condition
10
11
  * D drag a stage into another column; A add a stage; R remove a stage in use asks where its initiatives go; W rename the workflow
11
- * N New workflow: the chat scoped "New workflow", blank or from a copy, the draft in the Viewer, Create workflow, Edit by hand
12
- * P a phone: the list is the page, a workflow opens with ←, the columns stack
13
- * G the Settings dialog has a Workflows row that opens this page
12
+ * N New workflow: + closes Settings and opens Home's own chat scoped "New workflow" (no second chat column); the draft waits as the
13
+ * list's draft row and shows in the Viewer; Create workflow, Edit by hand; blank or from a copy under the list
14
+ * P a phone: the list is the panel, a workflow opens with ←, the columns stack
15
+ * G Settings › Workspaces has a Workflows row that opens the sub-panel; ← goes back to Workspaces
14
16
  * WF_SHOTS=<dir> also writes the screenshots at 1440 and 390. */
15
17
  const fs = require('fs');
16
18
  const path = require('path');
@@ -82,9 +84,16 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
82
84
  await page.route('**/api/board-premium*', (r) => json(r, { ok: true, state: 'ready', model: { rows: F.rows() } }));
83
85
  await page.route('**/api/briefing-premium/thread*', (r) => json(r, { ok: true, title: '', subject: '', turns: [], session: null, history: { messages: [] } }));
84
86
  await page.route('**/api/briefing-premium/ask*', (r) => { posts.push({ path: '/api/briefing-premium/ask', body: JSON.parse(r.request().postData() || '{}') }); return json(r, { ok: true, session: 's1', started: true }); });
85
- await page.goto(BASE + '/premium-workflows.html' + qs);
87
+ await page.goto(BASE + '/premium-workflows.html' + qs); // redirects to Home, which opens Settings › Workspaces › Workflows
88
+ await page.waitForSelector('#evSettings #wfMain', { timeout: 15000 }).catch(() => {});
86
89
  return { page, ctx: c, errors, posts, db };
87
90
  };
91
+ // Settings › Workspaces › Workflows the PM's way: the menu, Settings, Workspaces, the Workflows row
92
+ const openWf = async (pg) => {
93
+ await pg.click('#czFab'); await pg.click('[data-cz-settings]');
94
+ await pg.click('#evSettings [data-ev-sec="workspaces"]'); await pg.click('#evSettings [data-ev-sub="workflows"]');
95
+ await pg.waitForSelector('#evSettings #wfMain', { timeout: 8000 }).catch(() => {});
96
+ };
88
97
  const shot = async (p, name) => { if (SHOTS) await p.screenshot({ path: path.join(SHOTS, name + '.png') }); };
89
98
  const saves = (posts) => posts.filter((x) => x.path === '/api/workflows/save');
90
99
  const lastWf = (posts) => { const s = saves(posts); return s.length ? s[s.length - 1].body.wf : null; };
@@ -105,14 +114,14 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
105
114
  opt: !!document.querySelector('.wf-card.opt .wf-pill.dash'), only: (document.querySelector('.wf-pill.y') || {}).textContent || '',
106
115
  adds: document.querySelectorAll('[data-add]').length, drag: document.querySelectorAll('.wf-card[draggable="true"]').length,
107
116
  triageDrag: document.querySelector('.wf-card[data-stage="triage"]').getAttribute('draggable'),
108
- nav: (document.querySelector('#czFab') || {}).getAttribute && document.querySelector('#czFab').getAttribute('aria-label'),
117
+ where: [location.pathname, location.search, !document.querySelector('#evSettings').hidden, document.querySelector('#evSettings').classList.contains('ev-wide'), (document.querySelector('#evSettings [aria-current="page"]') || {}).textContent, (document.querySelector('#evSettings .ev-dr-hd h4') || {}).textContent],
109
118
  }));
110
119
  ok('M the list names each workflow with its count; Tender is picked', M.rows.join('|') === 'Product feature:12|Tender:4|Procurement:3|Migration:2' && M.sel === 'Tender', JSON.stringify(M.rows));
111
120
  ok('M the header: the name, "10 stages · used by 4 initiatives"', M.title === 'Tender' && M.meta === '10 stages · used by 4 initiatives', JSON.stringify([M.title, M.meta]));
112
121
  ok('M one numbered list across To do, In progress, Done and the dashed Won\'t do · Archived column', M.cols.join('|') === "To do|In progress|Done|Won't do · Archived" && M.nums === '1,2,3,4,5,6,7,8,9,10' && M.todo.join() === 'Triage' && M.done.join() === '◆ Review', JSON.stringify(M));
113
122
  ok('M Optional is dashed, Only when names its words, ◆ marks a milestone', M.opt && /Only when value over \$50k/.test(M.only), M.only);
114
123
  ok('M Add a stage per column; every stage but Triage drags', M.adds === 3 && M.drag === 9 && M.triageDrag === null, JSON.stringify([M.adds, M.drag]));
115
- ok('M the menu button says you are in Settings', /You are in Settings/.test(M.nav || ''), M.nav);
124
+ ok('M the old address lands on Home with Settings › Workspaces › Workflows open, wide; the address forgets ?settings and ?wf', M.where[0] === '/premium.html' && !/settings=|wf=/.test(M.where[1]) && M.where[2] && M.where[3] && /^Workspaces/.test(M.where[4] || '') && M.where[5] === 'Workflows', JSON.stringify(M.where));
116
125
  await shot(p, 'wf-model-1440');
117
126
 
118
127
  /* ── S a stage in the Viewer (WfAStage) ── */
@@ -126,7 +135,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
126
135
  unless: (b.querySelector('[data-st-ut]') || {}).value, uto: (b.querySelector('[data-st-uto]') || {}).value, ms: b.querySelector('[data-st-sw="milestone"]').getAttribute('aria-checked'), auto: b.querySelector('[data-st-sw="auto"]').getAttribute('aria-checked'),
127
136
  rn: !!document.querySelector('#czViewer [data-cz-vw-rn]'), cols: getComputedStyle(b.querySelector('.wf-sgrid')).gridTemplateColumns.split(' ').length };
128
137
  });
129
- ok('S the stage opens in the Viewer, its name the title and the rename press: "Tender · stage 6 of 10"', v && S1.rn && S1.lbl === 'Tender · stage 6 of 10' && v.w >= 760, JSON.stringify([S1.lbl, v && v.w]));
138
+ ok('S the stage opens in the Viewer, its name the title and the rename press: "Tender · stage 6 of 10"', v && S1.rn && S1.lbl === 'Tender · stage 6 of 10' && v.w >= 640, JSON.stringify([S1.lbl, v && v.w])); // inside Settings: the room beside the workflow
130
139
  ok('S two columns: category, output kind, template, To finish; When it runs, Then, Unless, Milestone, Moves on by itself', S1.cols === 2 && S1.cat.join() === 'In progress' && S1.kind.join() === 'Document' && S1.when.join() === 'Always' && S1.tpl === 'Bid scoring sheet'
131
140
  && S1.fin.length === 2 && S1.then === '' && S1.unless === 'no bid scores above 60' && S1.uto === 'bids' && S1.ms === 'false' && S1.auto === 'true', JSON.stringify(S1));
132
141
  ok('S Then shows the fallback when the next stage runs only sometimes', /Legal review runs only when its condition holds; otherwise it goes on to 8 · ◆ Award/.test(S1.note), S1.note);
@@ -196,7 +205,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
196
205
 
197
206
  /* ── D drag a stage into another column ── */
198
207
  await p.click('#czViewer [data-cz-vw="close"], #czViewer [aria-label="Close"]').catch(() => {});
199
- await p.keyboard.press('Escape');
208
+ if (await viewer(p)) await p.keyboard.press('Escape'); // with no stage open, Escape would close Settings
200
209
  await until(() => viewer(p).then((x) => !x));
201
210
  const n1 = saves(D.posts).length;
202
211
  await p.dragAndDrop('.wf-card[data-stage="contract"]', '.wf-drop[data-cat="done"]', { targetPosition: { x: 40, y: 4 } });
@@ -236,7 +245,8 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
236
245
  await R.ctx.close();
237
246
 
238
247
  /* ── W rename the workflow (RnA*) and ⋯ ── */
239
- await p.keyboard.press('Escape'); await until(() => viewer(p).then((x) => !x));
248
+ if (await viewer(p)) { await p.keyboard.press('Escape'); await until(() => viewer(p).then((x) => !x)); }
249
+ ok('W Escape closed the stage first; Settings stays open', await p.evaluate(() => !document.querySelector('#evSettings').hidden));
240
250
  await p.click('[data-wf-rn]');
241
251
  await p.fill('#wfName', 'Public tender');
242
252
  await p.press('#wfName', 'Enter');
@@ -264,50 +274,38 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
264
274
  ok('M no page error on the editor', D.errors.length === 0, D.errors.join(' | '));
265
275
  await D.ctx.close();
266
276
 
267
- /* ── N New workflow (WfANew, WfADraft) ── */
277
+ /* ── N New workflow (WfANew, WfADraft): Home's own chat, the draft in Settings ── */
268
278
  const N = await open({ qs: '' });
269
279
  const q = N.page;
270
280
  await until(() => q.evaluate(() => document.querySelectorAll('#wfList .wfl').length === 4));
281
+ ok('N blank and from a copy sit under the list', await q.evaluate(() => /Or start one blank or from a copy/.test(document.querySelector('#wfList').innerText)));
271
282
  await q.click('[data-wf-new]');
272
- const NW = await until(() => q.evaluate(() => { const c = document.querySelector('#wfChat'); if (!c || c.hidden) return null; return { text: c.innerText, sel: (document.querySelector('#wfList .wfl.sel') || {}).innerText || '', main: document.querySelector('#wfMain').hidden }; }).then((x) => (x && /Tell me how this work goes/.test(x.text) ? x : null)));
273
- ok('N + opens the normal chat scoped "New workflow", with the opening ask and "start blank or from a copy"', NW && NW.main && /New workflow/.test(NW.sel) && /draft/.test(NW.sel) && /You can also start blank or from a copy/.test(NW.text), JSON.stringify(NW));
283
+ const NW = await until(() => q.evaluate(() => { const c = document.querySelector('#hmChat') || document.querySelector('.hm-chat'); if (!c) return null; return { text: c.innerText, scope: (document.querySelector('.hm-chip') || {}).textContent || '', settings: !document.querySelector('#evSettings').hidden, second: !!document.querySelector('#wfChat') }; }).then((x) => (x && /Tell me how this work goes/.test(x.text) ? x : null)));
284
+ ok('N + closes Settings and opens Home\'s own chat scoped "New workflow", with the opening ask; no second chat column', NW && !NW.settings && /New workflow/.test(NW.scope) && !NW.second, JSON.stringify(NW));
274
285
  await shot(q, 'wf-new-1440');
275
- // bug 2026-10-25: #wfMain kept display:flex under [hidden], so the chat was a sliver beside the workflow and the composer's buttons overlapped
276
- const geo = () => q.evaluate(() => {
277
- const r = (e) => e.getBoundingClientRect(), c = document.querySelector('#wfChat');
278
- const btns = [...c.querySelectorAll('#hmFoot button, #hmFoot .hm-scope, #hmFoot [class*="chip"]')].filter((b) => r(b).width > 0).map(r);
279
- const hit = btns.some((a, i) => btns.some((b, j) => j > i && a.left < b.right - 1 && b.left < a.right - 1 && a.top < b.bottom - 1 && b.top < a.bottom - 1));
280
- return { main: getComputedStyle(document.querySelector('#wfMain')).display, w: Math.round(r(c).width), hit, out: btns.some((b) => b.right > r(c).right + 1) };
281
- });
282
- const G1 = await geo();
283
- ok('N the workflow is gone while New workflow shows; the chat has the column; the composer buttons do not overlap', G1.main === 'none' && G1.w >= 400 && !G1.hit && !G1.out, JSON.stringify(G1));
284
- await q.fill('#wfChatIn textarea', 'We onboard a new supplier. Procurement checks the contract and the insurance first.');
286
+ await q.fill('#hmIn', 'We onboard a new supplier. Procurement checks the contract and the insurance first.');
285
287
  await q.keyboard.press('Enter');
286
288
  const ask = await until(() => N.posts.find((x) => x.path === '/api/briefing-premium/ask'));
287
- ok('N a message goes to the chat under a pop:workflow key, with the New workflow context', ask && /^pop:workflow:new-/.test(ask.body.key) && ask.body.context && ask.body.context.title === 'New workflow' && /workflow-setup skill/.test(ask.body.context.say), JSON.stringify(ask && ask.body));
289
+ ok('N a message goes to the chat under a pop:workflow key, with the New workflow context', ask && /^pop:workflow:new-/.test(ask.body.key) && /workflow-setup skill/.test(JSON.stringify(ask.body.context || '')), JSON.stringify(ask && ask.body));
288
290
  N.db.draft = F.draft();
291
+ await openWf(q);
292
+ await until(() => q.evaluate(() => /Vendor onboarding/.test((document.querySelector('#wfList [data-wf="new"]') || {}).innerText || '')));
293
+ ok('N the draft waits in Settings › Workflows as its row, by its name', await q.evaluate(() => /Vendor onboarding\s*draft/.test(document.querySelector('#wfList [data-wf="new"]').innerText)));
294
+ await q.click('#wfList [data-wf="new"]');
289
295
  v = await until(() => viewer(q).then((x) => (x && x.title === 'Vendor onboarding' ? x : null)), 8000);
290
296
  ok('N the draft shows in the Viewer as numbered stages per category, with Create workflow and Edit by hand', v && /To do\s*1\s*Triage/.test(v.text) && /In progress/.test(v.text) && /3\s*Security review/.test(v.text) && /Only when they touch customer data/.test(v.text) && /Done\s*6\s*◆ 90-day review/.test(v.text) && /Create workflow/.test(v.text) && /Edit by hand/.test(v.text), v && v.text);
291
- ok('N the list row takes the draft\'s name', await q.evaluate(() => /Vendor onboarding/.test(document.querySelector('#wfList .wfl.sel').innerText)));
297
+ ok('N beside it, the way back to its chat', await q.evaluate(() => !!document.querySelector('#wfMain [data-wf-new]') && /Continue in the chat/.test(document.querySelector('#wfMain').innerText)));
292
298
  await shot(q, 'wf-draft-1440');
293
- const G2 = await geo();
294
- ok('N with the draft open beside it, the chat keeps a usable column and the composer does not overlap', G2.main === 'none' && G2.w >= 360 && !G2.hit && !G2.out, JSON.stringify(G2));
295
- await q.setViewportSize({ width: 1180, height: 820 });
296
- await q.waitForTimeout(200);
297
- const G3 = await geo();
298
- ok('N at 1180 wide with the draft open, the composer still does not overlap', G3.main === 'none' && G3.w >= 300 && !G3.hit && !G3.out, JSON.stringify(G3));
299
- await shot(q, 'wf-draft-1180');
300
- await q.setViewportSize({ width: 1440, height: 900 });
301
299
  await q.click('#czViewer [data-wf-dcreate]');
302
300
  await until(() => saves(N.posts).length);
303
301
  const cw = lastWf(N.posts);
304
- ok('N Create workflow saves the draft and opens it', cw && cw.id === 'vendor-onboarding' && cw.stages.length === 6 && await until(() => q.evaluate(() => (document.querySelector('.wf-h1') || {}).textContent === 'Vendor onboarding' && !document.querySelector('#wfMain').hidden)), JSON.stringify(cw && cw.id));
305
- ok('N the next New workflow starts a new conversation', await q.evaluate(() => !localStorage.getItem('pmos.wf.chat')));
302
+ ok('N Create workflow saves the draft and opens it', cw && cw.id === 'vendor-onboarding' && cw.stages.length === 6 && await until(() => q.evaluate(() => (document.querySelector('.wf-h1') || {}).textContent === 'Vendor onboarding')), JSON.stringify(cw && cw.id));
303
+ ok('N the next New workflow starts a new conversation', await until(() => q.evaluate(() => !localStorage.getItem('pmos.wf.chat'))), await q.evaluate(() => localStorage.getItem('pmos.wf.chat')));
306
304
  await N.ctx.close();
307
305
 
308
306
  const E2 = await open({ qs: '', draft: F.draft() });
309
- await until(() => E2.page.evaluate(() => document.querySelectorAll('#wfList .wfl').length === 4));
310
- await E2.page.click('[data-wf-new]');
307
+ await until(() => E2.page.evaluate(() => document.querySelectorAll('#wfList .wfl').length === 5));
308
+ await E2.page.click('#wfList [data-wf="new"]');
311
309
  await until(() => viewer(E2.page).then((x) => x && x.title === 'Vendor onboarding'));
312
310
  await E2.page.click('#czViewer [data-wf-dedit]');
313
311
  await until(() => E2.page.evaluate(() => document.querySelectorAll('.wf-card').length === 6));
@@ -316,15 +314,15 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
316
314
  await until(() => E2.posts.some((x) => x.path === '/api/workflows/draft'));
317
315
  ok('N an edit by hand saves to the draft, not to the workflows', saves(E2.posts).length === 0 && E2.posts.find((x) => x.path === '/api/workflows/draft').body.draft.stages.length === 7);
318
316
  await until(() => E2.page.evaluate(() => !!document.querySelector('#czViewer .cz-vw-ren input')));
319
- await E2.page.keyboard.press('Escape'); await E2.page.keyboard.press('Escape');
317
+ await E2.page.keyboard.press('Escape'); // the name field first, then the stage; with no stage open, Escape would close Settings
318
+ await until(() => E2.page.evaluate(() => !document.querySelector('#czViewer .cz-vw-ren input')), 2000);
319
+ if (await viewer(E2.page)) await E2.page.keyboard.press('Escape');
320
320
  await until(() => viewer(E2.page).then((x) => !x), 2000);
321
321
  await E2.page.click('[data-wf-create]');
322
322
  await until(() => saves(E2.posts).length);
323
323
  ok('N Create workflow from the editor saves it', lastWf(E2.posts).id === 'vendor-onboarding' && lastWf(E2.posts).stages.length === 7);
324
- await E2.page.click('[data-wf-new]');
325
- await until(() => E2.page.evaluate(() => !!document.querySelector('[data-wf-blank]')));
326
324
  const nb = saves(E2.posts).length;
327
- await E2.page.click('[data-wf-blank]');
325
+ await E2.page.click('#wfList [data-wf-blank]');
328
326
  await until(() => saves(E2.posts).length > nb);
329
327
  ok('N Start blank makes a workflow with only Triage and opens its name field', lastWf(E2.posts).stages.length === 1 && lastWf(E2.posts).stages[0].key === 'triage' && await until(() => E2.page.evaluate(() => !!document.querySelector('#wfName'))));
330
328
  ok('N no page error in New workflow', N.errors.length === 0 && E2.errors.length === 0, N.errors.concat(E2.errors).join(' | '));
@@ -335,7 +333,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
335
333
  const r = P.page;
336
334
  await until(() => r.evaluate(() => document.querySelectorAll('#wfList .wfl').length === 4));
337
335
  const P1 = await r.evaluate(() => ({ list: getComputedStyle(document.querySelector('#wfList')).display, main: getComputedStyle(document.querySelector('#wfMain')).display, sw: document.documentElement.scrollWidth }));
338
- ok('P on a phone the list is the page', P1.list !== 'none' && P1.main === 'none' && P1.sw <= 390, JSON.stringify(P1));
336
+ ok('P on a phone the list is the panel', P1.list !== 'none' && P1.main === 'none' && P1.sw <= 390, JSON.stringify(P1));
339
337
  await shot(r, 'wf-list-390');
340
338
  await r.click('#wfList [data-wf="tender"]');
341
339
  await until(() => r.evaluate(() => document.querySelectorAll('.wf-card').length === 10));
@@ -353,13 +351,15 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
353
351
  await P.ctx.close();
354
352
  if (SHOTS) { const K = await open({ dark: true }); await until(() => K.page.evaluate(() => document.querySelectorAll('.wf-card').length === 10)); await K.page.evaluate(() => { document.documentElement.dataset.theme = 'dark'; }); await shot(K.page, 'wf-model-1440-dark'); await K.ctx.close(); }
355
353
 
356
- /* ── G Settings › Workflows ── */
357
- const G = await open();
358
- await G.page.click('#czFab');
359
- await G.page.click('[data-cz-settings]');
360
- await G.page.click('#evSettings [data-ev-sec="workspaces"]'); // U4: Workflows is a row in Settings › Workspaces, not a section
361
- const link = await until(() => G.page.evaluate(() => { const a = document.querySelector('#evSettings .ev-st-main [data-ev-wf]'); return a ? a.getAttribute('href') : null; }));
362
- ok('G Settings › Workspaces has a Workflows row that opens this page', link === '/premium-workflows.html', link);
354
+ /* ── G Settings › Workspaces › Workflows ── */
355
+ const G = await open({ qs: '' });
356
+ const g = G.page;
357
+ await g.click('#evSettings [data-ev-sub=""]');
358
+ ok('G ← goes back to Workspaces, the dialog its usual size, and the row "Workflows ›" is there', await until(() => g.evaluate(() => !document.querySelector('#evSettings #wfMain') && !document.querySelector('#evSettings').classList.contains('ev-wide') && !!document.querySelector('#evSettings [data-ev-sub="workflows"]'))));
359
+ await g.click('#evSettings [data-ev-sub="workflows"]');
360
+ ok('G the row opens the sub-panel in place, not a page', await until(() => g.evaluate(() => document.querySelectorAll('#evSettings .wf-card').length > 0 && location.pathname === '/premium.html')));
361
+ await g.click('#evSettings [data-ev-close]');
362
+ ok('G no page error in Settings', G.errors.length === 0, G.errors.join(' | '));
363
363
  await G.ctx.close();
364
364
  finish();
365
365
  })();