dsh-ris-ide 1.7.2 → 1.7.3

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": "dsh-ris-ide",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "license": "MIT",
5
5
  "description": "RIS-IDE local dev panel for the DSH web GUI: live log tail, one-click start/stop of workspace programs, JDWP debugging, file tree + editor, and a standalone IDE window that carries no session history. · DSH 右侧栏本地开发面板:日志实时跟随、一键启停本地程序、Java 断点调试、文件树与编辑器、独立 IDE 窗口。",
6
6
  "keywords": [
@@ -43,7 +43,9 @@
43
43
  "README.md",
44
44
  "skills",
45
45
  "lib",
46
- "LICENSE"
46
+ "LICENSE",
47
+ "bin",
48
+ "lib/janitor.js"
47
49
  ],
48
50
  "engines": {
49
51
  "dsh": ">=0.2.0-rc.2"
@@ -17,7 +17,39 @@ description: "用 ris_dev_* 工具操作本机 RIS-IDE/侧边栏开发面板:
17
17
  5. 调试能力边界:**没有表达式求值(evaluate)、无条件断点/日志断点、无热替换**。能看线程、栈、局部变量、字段、数组、String。
18
18
  6. 宿主重启后调试会话与断点都丢失;重新 `start` + `breakpoint_add` 即可。
19
19
  7. `suspend: true` 会真的把 JVM 停在启动处(Spring 卡住),记得 `resume`。
20
- 8. 自定义 `startCommand` 的条目必须在 `java` 后带 `${JDWP_ARGS}` 占位符,否则调试启动直接报错(错误信息会说明)。
20
+ 8. 自定义 `startCommand` 的条目必须在 `java` 后带 `${JDWP_ARGS}` 占位符,否则调试启动直接报错(错误信息会说明);并且这类条目**会绕过 `jvmArgs`**,内存参数必须内联(见 §0.1)。
21
+ 9. 本机 8 GiB、常驻服务已占 ~3.5 GiB:**同时开多个 Java 服务前先读 §0.2**(低内存/多开预算),别把机器顶到 oom-killer。
22
+
23
+ ## 0.1 自定义 `startCommand` 与变量约束(改配置前必读)
24
+
25
+ 宿主拼启动命令时只做两件事:按程序类型套模板、替换**一个**占位符。规则:
26
+
27
+ - **唯一的占位符是 `${JDWP_ARGS}`**:普通启动替换成空串;调试启动替换成 `-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:<随机端口>`。它必须出现在 `java` 之后、`-cp` 之前(模板里就在那个位置)。
28
+ - 其它 `${...}` **不会被宿主替换**,原样进 bash;`$(cat target/cp.txt)`、`$HOME` 这类是**故意交给 shell** 的,不是占位符。宿主用 `bash -lc` 执行,所以 shell 展开/二次解析都会发生——别在里面堆多层引号,路径优先写绝对路径。
29
+ - **自定义 `startCommand` 会完全绕过程序的 `jvmArgs`**:host 对 custom 条目原样执行命令(`lib/index.js` 的 `buildStartSpec` 在 custom 分支直接 return),面板里配的 `jvmArgs` 对它无效。内存 / GC / 编码 / `-D` 参数必须**内联在 `exec java` 那一行**。
30
+ - 本机 4 个 custom 条目(`ris-gateway` / `ris-model-biz` / `ris-am-biz` / `ris-upms-biz`)已在命令里内联档位参数并保留 `${JDWP_ARGS}`(2026-11-04)。改它们只改 `startCommand`;改 `jvmArgs` 不会有任何效果。
31
+ - 保留 `-DJM.LOG.PATH=…` 与 `-Dcsp.sentinel.log.dir=…`:`ris_dev_logs` / 侧栏日志 / Sentinel 日志靠它。
32
+ - **改完自检**(30 秒,别跳过):
33
+ - `tr '\0' ' ' < /proc/<pid>/cmdline`:应看到真实生效的 `-Xmx…` 等参数;
34
+ - **不应**看到字面量 `${JDWP_ARGS}`;
35
+ - 调试启动时应看到 `-agentlib:jdwp=…address=127.0.0.1:<port>`,`ris_dev_debug {action:"state"}` 显示 `attached <port>`。
36
+
37
+ ## 0.2 低内存处理(多开 Java 服务 / 本机 8 GiB)
38
+
39
+ - **启动护栏**:宿主在 `MemAvailable < 1 GiB` 时直接拒绝启动(`MIN_FREE_MEMORY_BYTES = 1024*1024*1024`),错误信息带当前可用值。别反复重试——先 `free -h`,停点东西再起。
40
+ - **JVM 默认堆 = 物理内存 / 4**:本机 8 GiB ⇒ 没配 `jvmArgs` 的程序每个 ~2 GiB,两三个就把机器顶死。本机已在 `<工作区>/.dsh-ris-ide/config.json` 配档(明细见工作区 `AGENTS.local.md` §2):
41
+ - 默认(多数服务):`-Xms64m -Xmx512m -XX:MaxMetaspaceSize=320m -XX:+UseSerialGC -XX:+ExitOnOutOfMemoryError`;
42
+ - 重档(register / ai / am / upms / rm / wf / onlinesale):`-Xms96m -Xmx768m -XX:MaxMetaspaceSize=448m`;
43
+ - `ris-model-biz`:`-Xms128m -Xmx1g -XX:MaxMetaspaceSize=512m`。
44
+ - **多开实测(2026-11-04,4 个服务同时运行)**:model-biz 709 MB RSS / 689 MB PSS、upms-biz 801 / 780、auth 451 / 431、gateway 448 / 428 ⇒ **合计 ~2.3 GiB PSS**;空闲堆只用了 87–229 MB/个,其余是 Metaspace(~100–160 MB committed)+ 代码缓存 + 线程栈 + 共享 jar 页。常驻非 Java(hindsight 1.8G + dsh web 0.65G + billion-context 0.43G + postgres 0.38G + vite 0.3G)约 3.5 GiB。
45
+ - **容量口径(8 GiB)**:5–6 个 Java 服务可行(≈2.8–3.4 GiB);再往上必须先释放别的:
46
+ - ego 浏览器(`ego-browser.mjs --stop`,0.2–1 GiB);
47
+ - vite dev server(~0.3 GiB);
48
+ - **`vue-tsc`(峰值 2.5 GiB,绝不能和多开并发跑)**;
49
+ - 或把 `.wslconfig` 的 `memory` 提到 10–12 GiB(需 `wsl --shutdown` 生效,宿主机内存要够)。
50
+ - `ps` 的 RSS 会重复计共享的 jar 页;多开时用 PSS 或 `free -h` 判断更准。
51
+ - **症状 → 处理**:`OutOfMemoryError: Java heap space` ⇒ 该程序 `-Xmx` 升一档;`Metaspace` ⇒ 升 `MaxMetaspaceSize`;`Direct buffer memory` ⇒ 加 `-XX:MaxDirectMemorySize`;服务起来后无声消失 / 变超时 ⇒ `dmesg | tail -20` 看是否 oom-killer,减并发或降档;`-XX:+ExitOnOutOfMemoryError` 已配 ⇒ OOM 时该 JVM 会自己退出(不再拖垮整机)。
52
+ - **调档**:改 `config.json` 的 `defaults.jvmArgs`(对所有非 custom 程序生效)或单程序 `jvmArgs` → `ris_dev_restart <name>`;custom 程序改 `startCommand` 内联 flags。查现状:`jcmd <pid> GC.heap_info`、`jcmd <pid> VM.metaspace`、`ris_dev_status`(带 pid)。
21
53
 
22
54
  ## 1. 发现与生命周期
23
55
 
@@ -151,7 +183,10 @@ ris_dev_skill { "action": "show" } # 只读内容,
151
183
  | 现象 | 先查 |
152
184
  |---|---|
153
185
  | `start` 秒退 | `ris_dev_logs { lines: 120 }` 的尾巴(编译错/端口占用/缺环境) |
154
- | 调试启动报「缺占位符」 | 该程序的 `startCommand` 要带 `${JDWP_ARGS}` |
186
+ | `start` 报「内存不足 / not enough memory」 | `MemAvailable < 1 GiB` 被护栏拒绝:先 `free -h`,停服务或降并发(§0.2) |
187
+ | 多开后变慢 / 服务无声消失 | 疑似 oom-killer:`dmesg \| tail -20`;减并发、停 ego/vite,或按 §0.2 降档 |
188
+ | 调试启动报「缺占位符」 | 该程序的 `startCommand` 要带 `${JDWP_ARGS}`(§0.1) |
189
+ | 改了 `jvmArgs` 但内存没变 | 该程序有自定义 `startCommand`:`jvmArgs` 被绕过,要改命令内联 flags(§0.1) |
155
190
  | `not-attached` | 先 `status`;`start` 没完成就调 step/poll 会这样 |
156
191
  | 断点不命中 | 类名是否全限定、行号是否可执行行、类是否已加载(未加载会等 `ClassPrepare` 30 s) |
157
192
  | 端口被占 | 用 `ris_dev_restart`(整组进程信号),不要手 `kill` |
@@ -14,6 +14,7 @@ import { createServer } from 'node:http'
14
14
  import { createRequire } from 'node:module'
15
15
  import { execFileSync } from 'node:child_process'
16
16
  import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
17
+ import { readFileSync as readSync } from 'node:fs'
17
18
  import { tmpdir } from 'node:os'
18
19
  import { join } from 'node:path'
19
20
  import { fileURLToPath } from 'node:url'
@@ -183,6 +184,72 @@ test('double-clicking a title-bar control does not maximise the pane', () => {
183
184
  assert.equal(T.headerDoubleClickIsTitle(input), false)
184
185
  })
185
186
 
187
+ test('the dialog marks exactly one of start/stop as the live action', async () => {
188
+ const { readFile } = await import('node:fs/promises')
189
+ const source = await readFile(new URL('../lib/client.js', import.meta.url), 'utf8')
190
+ // `S.buttonOff` is the DISABLED skin, so painting an enabled action with it made
191
+ // 启动/停止 look equally dead. One shared factory fixes the box, and only the
192
+ // actionable button is filled.
193
+ assert.ok(source.includes('function dialogButton(spec)'), 'start/stop/save must share one button shape')
194
+ assert.ok(source.includes('minWidth: 84, height: 28'), 'all three must share one box so the row lines up')
195
+ assert.ok(source.includes('var filled = spec.primary === true && spec.disabled !== true'),
196
+ 'grey is reserved for "nothing to do here"')
197
+ assert.ok(source.includes("primary: !running,"), '启动 is the filled one while stopped')
198
+ assert.ok(source.includes("primary: running,"), '停止 is the filled one while running')
199
+ assert.ok(source.includes("'data-proxy-action': spec.action"), 'the three actions stay addressable')
200
+ // Enabled controls must not borrow the disabled skin.
201
+ assert.equal(source.includes("style: S.buttonOff, 'data-proxy-add'"), false, '+ 添加规则 is enabled, not inert')
202
+ assert.equal(source.includes("style: S.buttonOff, 'data-proxy-close'"), false, 'the close ✕ is enabled, not inert')
203
+ })
204
+
205
+ test('one proxy control governs engine, interception and git together', async () => {
206
+ const { readFile } = await import('node:fs/promises')
207
+ const client = await readFile(new URL('../lib/client.js', import.meta.url), 'utf8')
208
+ const host = await readFile(new URL('../lib/index.js', import.meta.url), 'utf8')
209
+ // No separate git buttons: git follows the tunnel it belongs to.
210
+ assert.equal(client.includes('data-proxy-git-on'), false, 'the git-on button is gone')
211
+ assert.equal(client.includes('data-proxy-git-off'), false, 'the git-off button is gone')
212
+ assert.ok(client.includes('启动同时写入 git 代理,停止同时清除'), 'the footer has to say what start/stop do')
213
+ // Start/stop drive all three layers, and so does the host exit hook.
214
+ assert.ok(host.includes('const redirector = await startRedirectors()'), 'start brings the interception up')
215
+ assert.ok(host.includes('syncGitProxy({ cwd, host: gitHost, enabled: true })'), 'start writes the git entry')
216
+ assert.ok(host.includes('syncGitProxy({ cwd, host: gitHost, enabled: false })'), 'stop clears the git entry')
217
+ assert.ok(host.includes('const redirector = await stopRedirector()'), 'stop brings the interception down')
218
+ assert.ok(host.includes('clearGitProxySync()'), 'the exit hook undoes the git entry too')
219
+ // The route reports each layer's outcome so a dismissed UAC prompt is visible.
220
+ assert.ok(client.includes("' · 系统层拦截已启动('"), 'the note reports the interception start')
221
+ assert.ok(client.includes("' · git 代理已写入 '"), 'the note reports the git entry')
222
+ })
223
+
224
+ test('the console follows the live sidebar session, not the one it opened in', async () => {
225
+ const { readFile } = await import('node:fs/promises')
226
+ const source = await readFile(new URL('../lib/client.js', import.meta.url), 'utf8')
227
+ // `keepMounted` keeps the body alive across Session switches, so the session id
228
+ // it was opened with goes stale — the panel has to read the sidebar's live one.
229
+ assert.ok(source.includes('data-sidebar-right-session'), 'the live marker must be read')
230
+ assert.ok(source.includes("attributeFilter: ['data-sidebar-right-session', 'data-sidebar-right-panel', 'hidden']"),
231
+ 'switch must be observed, including retained wrappers being shown')
232
+ assert.ok(source.includes('data-sidebar-right-panel'), 'the panel element outranks a retained SessionView wrapper')
233
+ assert.ok(source.includes("node.closest('[hidden]') !== null"), 'a wrapper inside a hidden tree must not win')
234
+ assert.ok(source.includes('getClientRects().length === 0'), 'an unrendered wrapper must not win')
235
+ assert.ok(source.includes('if (nearestId !== undefined && shown(nearest)) return nearestId'),
236
+ 'the nearest marker only wins while it is on screen')
237
+ assert.ok(source.includes('setInterval(sync, 1500)'), 'a repaint-only switch still needs a fallback')
238
+ assert.ok(source.includes("window.addEventListener('focus', sync)"), 'returning to the window re-checks the session')
239
+ assert.ok(source.includes("if (typeof liveSessionId === 'string' && liveSessionId !== '') sessionId = liveSessionId"),
240
+ 'the live id must win over the injected one')
241
+ assert.ok(source.includes('}, [sessionIdentity])'), 'another workspace must drop the followed program')
242
+ // Both console shapes share one dialog, so it must not inherit either font.
243
+ assert.ok(source.includes("fontFamily: CHROME_FAMILY, fontSize: DEFAULT_FONT_SIZE + 'px'"),
244
+ 'the proxy dialog pins the IDE chrome font so the narrow console does not wrap rows')
245
+ assert.ok(source.includes("'Microsoft YaHei', sans-serif)"),
246
+ 'the chrome stack must match what the IDE theme resolves to, not a mono list')
247
+ // Form controls do not inherit the page font: the dialog has to say so, twice.
248
+ assert.ok(source.includes("fontFamily: 'inherit'"), 'the field style must inherit the dialog font')
249
+ assert.ok(source.includes('[data-proxy-dialog] input, [data-proxy-dialog] button, [data-proxy-dialog] select, [data-proxy-dialog] textarea { font-family: inherit; font-size: inherit; }'),
250
+ 'every control inside the dialog must inherit the card font')
251
+ })
252
+
186
253
  test('only invisible outcomes and failures raise a toast', async () => {
187
254
  const { readFile } = await import('node:fs/promises')
188
255
  const source = await readFile(new URL('../lib/client.js', import.meta.url), 'utf8')
@@ -448,6 +515,32 @@ test('apply adds a Session-header button immediately right of DSH\'s open-in-app
448
515
  }
449
516
  })
450
517
 
518
+ test('the header button opens THIS session\'s workspace, not the remembered one', async () => {
519
+ // The slot hands every entry the session store (`useSessions`) and the
520
+ // session id, so the window's cwd comes from the session itself. Passing only
521
+ // the id let the window fall back to `dsh-ris-ide:last-cwd` — the workspace of
522
+ // the previous session, which is what the button then reopened.
523
+ assert.equal(T.sessionWorkspaceCwd(undefined, 's1'), undefined, 'no store hook: the caller keeps its own fallback')
524
+ assert.equal(T.sessionWorkspaceCwd(() => undefined, ''), undefined, 'no session id: nothing to look up')
525
+ const store = (state) => (selector) => selector(state)
526
+ assert.equal(T.sessionWorkspaceCwd(store({ byId: { s1: { cwd: '/w/current' } } }), 's1'), '/w/current')
527
+ assert.equal(T.sessionWorkspaceCwd(store({ byId: { s1: {} } }), 's1'), undefined, 'a session row without a cwd')
528
+ assert.equal(T.sessionWorkspaceCwd(store({ byId: { s1: { cwd: '' } } }), 's1'), undefined, 'an empty cwd is not a workspace')
529
+ assert.equal(T.sessionWorkspaceCwd(store({}), 's1'), undefined, 'a store that has not listed the session yet')
530
+ assert.equal(T.sessionWorkspaceCwd(store(undefined), 's1'), undefined, 'a missing store snapshot')
531
+ const source = await readFile(new URL('../lib/client.js', import.meta.url), 'utf8')
532
+ assert.match(
533
+ source,
534
+ /var sessionCwd = sessionWorkspaceCwd\(props !== null && props !== undefined \? props\.useSessions : undefined, sessionId\)/,
535
+ 'the button reads the session store',
536
+ )
537
+ assert.match(
538
+ source,
539
+ /openStandaloneWindow\(\{ sessionId: sessionId, cwd: sessionCwd, windowCwd: sessionCwd \}\)/,
540
+ 'both the panel cwd and the single-window name follow the session workspace',
541
+ )
542
+ })
543
+
451
544
  test('openStandaloneWindow hands the scope to the plugin\'s own page', async () => {
452
545
  const previousWindow = globalThis.window
453
546
  const previousDocument = globalThis.document
@@ -2095,7 +2188,9 @@ test('the title-bar controls share one 20px row height', { skip: !reactIsReal ?
2095
2188
  const sourceTags = buttonsOf(sourceHead)
2096
2189
  const consoleTags = buttonsOf(consoleHead)
2097
2190
  assert.ok(sourceTags.length >= 3, 'the source toolbar carries the font scale, the theme switch and reset')
2098
- assert.equal(consoleTags.length, 2, 'the console title bar carries 📄 open-config and ⚙ config-generate')
2191
+ const consoleActions = consoleTags.map((tag) => /data-action="([^"]+)"/.exec(tag)[1])
2192
+ assert.deepEqual(consoleActions, ['config-open', 'config-generate', 'proxy-open'],
2193
+ 'the console title bar carries 📄 open-config, ⚙ config-generate and 🌐 proxy')
2099
2194
  for (const tag of sourceTags.concat(consoleTags)) {
2100
2195
  const action = /data-action="([^"]+)"/.exec(tag)[1]
2101
2196
  assert.match(tag, /height:20px/, `${action} must sit on the shared 20px row`)
@@ -4371,7 +4466,7 @@ test('Ctrl+F searches what the editor, log or fallback editor has highlighted',
4371
4466
  // next one after a caret parked deep in the document.
4372
4467
  assert.match(chunkSource, /function findFirstFromStart\(view\) \{\n\s*view\.dispatch\(\{ selection: \{ anchor: 0 \} \}\)\n\s*findNext\(view\)/)
4373
4468
  assert.match(chunkSource, /if \(jump\) findFirstFromStart\(view\)/)
4374
- assert.match(chunkSource, /const seeded = searchSelectedText\(instance\); openSearchPanel\(instance\); if \(seeded\) findFirstFromStart\(instance\)/)
4469
+ assert.match(chunkSource, /const seeded = searchSelectedText\(instance\); openSearchPanel\(instance\); if \(seeded\) findFirstFromStart\(instance\); caretToEndOfFindField\(instance\)/)
4375
4470
  assert.match(chunk, /function findFirstFromStart\(view\)/)
4376
4471
  assert.match(chunk, /if \(jump\) findFirstFromStart\(view\)/)
4377
4472
  // A handed-over hit still starts at ITS line (that is the point of clicking it).
@@ -4418,13 +4513,66 @@ test('Ctrl+F with the search panel ALREADY open puts the caret back in the find
4418
4513
  // reach CodeMirror's keymap, so the browser's own find bar opened instead. The
4419
4514
  // workbench claims the chord in the standalone window and hands it to the open
4420
4515
  // file's editor handle, which opens/focuses the panel.
4421
- assert.match(chunkSource, /find\(\) \{\n\s*openSearchPanel\(view\)\n\s*\},/)
4422
- assert.match(chunk, /find\(\) \{\s*openSearchPanel\(view\);\s*\}/)
4516
+ assert.match(chunkSource, /find\(\) \{\n\s*openSearchPanel\(view\)[\s\S]{0,400}?caretToEndOfFindField\(view\)\n\s*\},/)
4517
+ assert.match(chunk, /find\(\) \{\s*openSearchPanel\(view\);[\s\S]{0,400}?caretToEndOfFindField\(view\);\s*\}/)
4423
4518
  assert.match(source, /function onFindKey\(event\) \{\n\s*if \(event\.defaultPrevented === true\) return/)
4424
4519
  assert.match(source, /if \(!ownsKeyTarget\(event\.target\)\) return[\s\S]{0,900}?typeof controls\.find === 'function'/)
4425
4520
  assert.match(source, /window\.addEventListener\('keydown', onFindKey\)/)
4426
4521
  })
4427
4522
 
4523
+ test('the find box accepts more than one character while it has matches', async () => {
4524
+ const chunkSource = await readFile(new URL('../src/chunks/codemirror.js', import.meta.url), 'utf8')
4525
+ const chunk = await readFile(new URL('../lib/client-codemirror.js', import.meta.url), 'utf8')
4526
+
4527
+ // Root cause: @codemirror/search's `selectSearchInput` selects the whole query
4528
+ // when the panel's [main-field] has focus, so the second keystroke replaced the
4529
+ // first and a term could never exceed one character (only once there was a hit:
4530
+ // with no match `findNext` returns before selecting).
4531
+ assert.match(chunkSource, /const end = searchInput\.value\.length\n\s*searchInput\.setSelectionRange\(end, end\)/)
4532
+ assert.ok(!chunkSource.includes('searchInput.select()'), 'focusing the field must never select the query')
4533
+ // Every path that runs findNext/findPrevious from the box restores the caret.
4534
+ assert.match(chunkSource, /const restoreSearchCaret = \(range\) => \{[\s\S]{0,600}?searchInput\.setSelectionRange\(start, stop\)/)
4535
+ assert.match(chunkSource, /const caret = \{ start: searchInput\.selectionStart, end: searchInput\.selectionEnd \}\n\s*apply\(\{ search: searchInput\.value \}, true\)\n\s*restoreSearchCaret\(caret\)/)
4536
+ assert.match(chunkSource, /restoreSearchCaret\(caret\)\n\s*sync\(\)/)
4537
+ // Programmatic opens (Ctrl+F keymap, editor handle, content-search hand-off) too.
4538
+ assert.match(chunkSource, /function caretToEndOfFindField\(view\) \{/)
4539
+ assert.match(chunkSource, /caretToEndOfFindField\(view\)\n\s*return true/)
4540
+ assert.match(chunkSource, /findNext\(view\)\n\s*caretToEndOfFindField\(view\)/)
4541
+ // The built chunk carries all of it (the runtime loads this file, not the source).
4542
+ assert.match(chunk, /function caretToEndOfFindField\(view\)/)
4543
+ assert.match(chunk, /restoreSearchCaret = \(range\) => \{/)
4544
+ assert.match(chunk, /setSelectionRange\(end, end\)/)
4545
+ })
4546
+
4547
+ test('Ctrl+R re-reads the workspace instead of replaying the search cache', async () => {
4548
+ const source = await readFile(new URL('../lib/client.js', import.meta.url), 'utf8')
4549
+
4550
+ // The cache is keyed by the query TEXT only, so an explicit re-search must drop
4551
+ // the entries and make both streaming effects run again.
4552
+ assert.match(source, /var \[searchReload, setSearchReload\] = useState\(0\)/)
4553
+ assert.match(source, /function reloadWorkspaceSearch\(text\) \{/)
4554
+ assert.match(source, /searchCacheRef\.current\.delete\('content:' \+ query\)/)
4555
+ assert.match(source, /searchCacheRef\.current\.delete\('name:' \+ query\)/)
4556
+ const effects = source.split("var cached = searchCacheRef.current.get('name:' + text)")
4557
+ assert.equal(effects.length, 2)
4558
+ const contentStart = effects[1].indexOf("var cached = searchCacheRef.current.get('content:' + text)")
4559
+ assert.ok(contentStart !== -1)
4560
+ assert.match(effects[1].slice(contentStart, contentStart + 5000), /\}, \[treeQuery, cwd, searchReload\]\)/)
4561
+
4562
+ // Ctrl+R (Ctrl+Shift+R / F3) in the standalone window focuses the box through the
4563
+ // nonce effect; that same effect is where the stale cache is thrown away.
4564
+ const nonceGuard = "if (searchFocusPendingRef.current !== true) return"
4565
+ const nonceStart = source.indexOf(nonceGuard)
4566
+ assert.ok(nonceStart !== -1)
4567
+ const nonceEffect = source.slice(nonceStart, nonceStart + 1200)
4568
+ assert.match(nonceEffect, /input\.select\(\)\n\s*reloadWorkspaceSearch\(treeQuery\)/)
4569
+
4570
+ // Saving a file changes what `git grep` would return, so it invalidates too.
4571
+ const writeStart = source.indexOf('return fsWrite(scopeRef.current, path, docTextForDisk(doc)).then(function () {')
4572
+ assert.ok(writeStart !== -1)
4573
+ assert.match(source.slice(writeStart, writeStart + 500), /reloadWorkspaceSearch\(treeQuery\)/)
4574
+ })
4575
+
4428
4576
  test('an oversized text file opens a read-only windowed preview', async () => {
4429
4577
  const source = await readFile(new URL('../lib/client.js', import.meta.url), 'utf8')
4430
4578
  assert.match(source, /function fsWindowRead\(scope, path, offset, length\)/)
@@ -4576,6 +4724,19 @@ test('the sidebar console opens the config as a sidebar file resource', async ()
4576
4724
  assert.match(source, /已在右侧栏打开 /, 'the console reports where the config went')
4577
4725
  })
4578
4726
 
4727
+ test('the config note names the file without a helper nested in another component', async () => {
4728
+ const source = await readFile(new URL('../lib/client.js', import.meta.url), 'utf8')
4729
+ // `shortName` used to be declared INSIDE ProgramWorkbench. The SIDEBAR
4730
+ // ProgramsPanel is a sibling component, so its openConfig threw
4731
+ // "shortName is not defined" right after the config file had already opened:
4732
+ // the file appeared, but the note showed 打开配置失败 instead. The basename
4733
+ // helper is module scope (like the stop square), so both halves share it.
4734
+ assert.doesNotMatch(source, /function shortName\(/, 'no basename helper nested in one component')
4735
+ assert.match(source, /^ {4}function fileBaseName\(path\) \{/m, 'the basename helper is declared at module scope')
4736
+ assert.match(source, /'已在右侧栏打开 ' \+ fileBaseName\(path\)/, 'the sidebar config note names the file through it')
4737
+ assert.match(source, /pendingBulk\.dirty\.slice\(0, 2\)\.map\(fileBaseName\)/, 'the workbench prompt uses the same helper')
4738
+ })
4739
+
4579
4740
  test('the mask names the action and a window opened on a program auto-debugs it', async () => {
4580
4741
  const source = await readFile(new URL('../lib/client.js', import.meta.url), 'utf8')
4581
4742
 
@@ -4743,6 +4904,19 @@ test('content hits render in the same dropdown, with line numbers and the conten
4743
4904
  assert.match(markup, /data-search-hit-icon="content"/, 'content rows have their own icon')
4744
4905
  })
4745
4906
 
4907
+ test('editing the query ends the dropdown state Escape left behind', async () => {
4908
+ const { readFile } = await import('node:fs/promises')
4909
+ const source = await readFile(new URL('../lib/client.js', import.meta.url), 'utf8')
4910
+ const box = source.slice(source.indexOf("'data-action': 'tree-search'"), source.indexOf('// The dropdown belongs to FOCUS'))
4911
+ assert.match(box, /onChange: function \(event\) \{\n\s*var value = event\.target\.value\n\s*setTreeQuery\(value\)/, 'the edit is still applied verbatim')
4912
+ assert.match(box, /if \(value\.trim\(\) !== ''\) setSearchFocused\(true\)/, 'a non-empty edit re-opens the dropdown')
4913
+ // Escape is "leave the box", not "throw my query away": it blurs, and the focus
4914
+ // handler hides the dropdown while the query (and its cached hits) stay.
4915
+ const escape = box.slice(box.indexOf("if (event.key === 'Escape')"), box.indexOf('// Whichever dropdown is open'))
4916
+ assert.match(escape, /searchInputRef\.current\.blur\(\)/, 'Escape gives the caret back')
4917
+ assert.doesNotMatch(escape, /setTreeQuery\(''\)/, 'Escape no longer clears the query')
4918
+ })
4919
+
4746
4920
  test('a dialog keeps the anchor it opened at when the pointer moves or clicks again', async () => {
4747
4921
  const source = await readFile(new URL('../lib/client.js', import.meta.url), 'utf8')
4748
4922
  // The point is frozen on open, not read live on every render: a second
@@ -4775,3 +4949,157 @@ test('a folder row only expands; the context menu\'s 进入 re-roots with an 上
4775
4949
  assert.match(region, /if \(locateRequest\.kind === 'dir'\) openDirRoot\(locateRequest\.path\)/, 'picking a folder search hit re-roots too')
4776
4950
  assert.match(region, /walk\(activeRoot, 0, \{\}\)/, 'Ctrl+A walks the active root')
4777
4951
  })
4952
+
4953
+ // ── proxy dialog: both consoles offer it, and it renders standalone ──────────
4954
+ test('the console title bar carries the proxy button', { skip: !reactIsReal }, () => {
4955
+ const { renderToStaticMarkup } = require(`${REACT_ROOT}/react-dom/server`)
4956
+ const markup = renderToStaticMarkup(React.createElement(T.ProgramsPanel, { sessionId: 's1', cwd: '/w/project', visible: true, compact: true }))
4957
+ assert.match(markup, /data-action="compact-proxy"/, 'the sidebar console opens the proxy dialog')
4958
+ })
4959
+
4960
+ test('the proxy dialog mounts with its address section and actions', { skip: !reactIsReal }, () => {
4961
+ const { renderToStaticMarkup } = require(`${REACT_ROOT}/react-dom/server`)
4962
+ const markup = renderToStaticMarkup(React.createElement(T.ProxyDialog, { scope: { sessionId: 's1', cwd: '/w/project' }, onClose: () => {} }))
4963
+ assert.match(markup, /data-proxy-dialog="1"/, 'the overlay is rendered')
4964
+ assert.match(markup, /data-proxy-close="1"/)
4965
+ // SSR runs no effect, so the form is still loading — the shell must exist anyway.
4966
+ assert.match(markup, /读取中/)
4967
+ })
4968
+
4969
+ test('the proxy dialog has no per-row launch or mapping switch', async () => {
4970
+ const { readFile } = await import('node:fs/promises')
4971
+ const source = await readFile(new URL('../lib/client.js', import.meta.url), 'utf8')
4972
+ // Launching programs from the dialog was dropped: ProxyBridge intercepts by
4973
+ // process name, so a program started anywhere is covered and a ▶ button only
4974
+ // ever covered the one instance we spawned.
4975
+ assert.equal(source.includes('data-proxy-run'), false, 'no row-level start button')
4976
+ assert.equal(source.includes('runButton('), false, 'the button builder is gone')
4977
+ // The mapping is decided by the program's capabilities, not by a checkbox: the
4978
+ // row reports the outcome instead.
4979
+ assert.equal(source.includes('checked: rule.shadow'), false, 'no mapping checkbox bound to the rule')
4980
+ assert.ok(source.includes("'data-proxy-map'"), 'the row still reports the mapping')
4981
+ assert.ok(source.includes("? '127.0.0.1' + portSuffix(rule)"), 'and names where it landed')
4982
+ // The state is machine-wide, so the row label is provenance, not a boundary.
4983
+ assert.ok(source.includes("'来源 '"))
4984
+ assert.ok(source.includes('data-proxy-redirector'), 'ProxyBridge block exists in the dialog')
4985
+ })
4986
+
4987
+ test('an adopted leftover engine is reported with a stop action', async () => {
4988
+ const { readFile } = await import('node:fs/promises')
4989
+ const source = await readFile(new URL('../lib/client.js', import.meta.url), 'utf8')
4990
+ const region = source.slice(source.indexOf('function ProxyDialog('), source.indexOf('function viewerFontCss('))
4991
+ // A previous dsh left its engine behind (the pre-fix Ctrl+C leak). The host adopts
4992
+ // it so the tunnel keeps working, and the dialog must say who started it instead
4993
+ // of pretending this session did — plus a stop that does not touch the rule table.
4994
+ assert.match(region, /view\.inherited === true/, 'the banner is driven by the host flag')
4995
+ assert.match(region, /'data-proxy-inherited': '1'/, 'the banner is addressable in the DOM')
4996
+ assert.match(region, /原 dsh pid/, 'it names the dsh that started the engine')
4997
+ assert.match(region, /action: 'stop-inherited',/, 'it offers its own action id')
4998
+ assert.match(region, /onClick: function \(\) \{ act\('stop'\) \}/, 'the stop goes through the normal action path')
4999
+ })
5000
+
5001
+ test('auto-save is versioned, flushed before it can be lost, and the host decides "applies"', () => {
5002
+ const source = readSync(new URL('../lib/client.js', import.meta.url), 'utf8')
5003
+ // C-M1: the whole table is posted, so the payload names the table it came from.
5004
+ // Without that, two windows save and the loser's row disappears without an error.
5005
+ assert.ok(source.includes('revision: revisionRef.current'), 'the save names its base table')
5006
+ assert.ok(source.includes("answer.status === 409 && payload.conflict === true"), 'a stale save is detected')
5007
+ assert.ok(source.includes('规则表已在别处被修改,已重新载入(本次改动未写入)'), 'and reported in words')
5008
+ // C-M2: a 700 ms debounce is a window in which an edit exists only in memory; both
5009
+ // paths that reload the view must write it out first.
5010
+ assert.ok(source.includes('function flushSave()'), 'there is a flush')
5011
+ assert.ok(source.includes('flushSave().catch(function () {}).then(function () { actNow(action, ruleId, side) })'),
5012
+ 'start/stop writes the pending edit first')
5013
+ assert.ok(source.includes('flushSave().catch(function () {}).then(function () { onClose() })'),
5014
+ 'closing the dialog writes the pending edit first')
5015
+ // C-M3: local parsing is a preview; once the host has seen the exact row, its
5016
+ // verdict wins, so the form cannot claim a row applies when the engine skipped it.
5017
+ assert.ok(source.includes('function hostVerdictFor(rule)'), 'the host verdict is looked up')
5018
+ assert.ok(source.includes('var hostRow = hostVerdictFor(rule)'), 'and used by the row')
5019
+ // P2: the placeholder used to promise the opposite of what the engine does.
5020
+ assert.equal(source.includes('(空=不限)'), false, 'no placeholder advertises the old meaning')
5021
+ assert.ok(source.includes('(全部写 *;空=本行不生效)'))
5022
+ })
5023
+
5024
+ test('the program cell is typed, and the picker offers three tabs and one tree', () => {
5025
+ const source = readSync(new URL('../lib/client.js', import.meta.url), 'utf8')
5026
+ // Typing `java` (any path) or `D:\…\java.exe` (exact) is the primary way to set a
5027
+ // rule; the picker is a helper, not the only door.
5028
+ assert.ok(source.includes("'data-proxy-program': rule.id"))
5029
+ assert.ok(source.includes("placeholder: '程序名或路径:java / D:\\\\…\\\\java.exe'"))
5030
+ assert.ok(source.includes("'data-proxy-pick': rule.id"))
5031
+ // Exactly two tabs: running processes, and ONE file tree. On WSL the Windows
5032
+ // disks are ordinary folders under /mnt, so a separate "Windows 文件" tab would
5033
+ // be the same tree with another spelling.
5034
+ assert.ok(source.includes("tabButton('running', '运行中的程序')"))
5035
+ assert.ok(source.includes("tabButton('local', '选择文件')"))
5036
+ assert.equal(source.includes("tabButton('windows'"), false, 'one file tree, not two')
5037
+ // `/` is prepended client-side too: the roots list comes from the host half,
5038
+ // which only reloads with dsh web, and a refresh must not drop the entry that
5039
+ // reaches every path.
5040
+ assert.ok(source.includes('function withFilesystemRoot(roots, posix)'))
5041
+ assert.ok(source.includes('withFilesystemRoot(tree.roots, hostIsPosix)'))
5042
+ // …and the shortcuts in front of it are dropped, so the first thing the user sees
5043
+ // is the start of the filesystem, not a pile of convenience roots.
5044
+ assert.ok(source.includes("root.path === '/' || /^\\/mnt\\/[A-Za-z](\\/|$)/.test(root.path)"))
5045
+ // A pick under /mnt is written as a Windows path: that is the spelling the
5046
+ // program's own OS uses, and what a Windows-side interceptor matches.
5047
+ assert.ok(source.includes('function pickedPath(value)'))
5048
+ assert.ok(source.includes('program: pickedPath(value)'))
5049
+ assert.ok(source.includes("url.searchParams.set('side', side)"))
5050
+ // The picker is a dialog of its own, opened from the row: a two-root tree does
5051
+ // not fit in a rule row.
5052
+ assert.ok(source.includes("'data-proxy-picker-dialog': '1'"), 'the picker renders as a nested dialog')
5053
+ assert.ok(source.includes('void loadPrograms()'), 'the process list is fetched when the picker opens')
5054
+ // Expanding a folder must grow the tree IN PLACE — no "enter directory" stepping,
5055
+ // no breadcrumb, and no re-reading what is already on screen.
5056
+ assert.ok(source.includes('data-proxy-tree-dir'), 'folders are rows in the tree')
5057
+ assert.ok(source.includes('data-proxy-tree-file'), 'files are rows in the tree')
5058
+ assert.ok(source.includes('function toggleDir(dir)'), 'a folder toggles instead of navigating')
5059
+ assert.ok(source.includes("if (open !== true && tree.nodes[key] === undefined) void loadTreeDir(key)"),
5060
+ 'a folder is read the first time it is expanded')
5061
+ assert.equal(source.includes("'data-proxy-browse-up'"), false, 'the stepwise browser is gone')
5062
+ // The program cell is typed, the picker is a helper: choosing a file must call
5063
+ // the chooser that belongs to the dialog (passing it into the tree, not closing
5064
+ // over a name that is not in scope).
5065
+ assert.ok(source.includes('function dirRow(dir, depth, chooser)'), 'the tree rows take the chooser')
5066
+ assert.ok(source.includes('rows = rows.concat(treeRows(dir.path, depth + 1, chooser))'))
5067
+ assert.ok(source.includes('rows = rows.concat(dirRow(dir, depth, chooser))'))
5068
+ // A file is not a folder: it gets no caret in that slot (only a placeholder span),
5069
+ // otherwise the arrow reads as "expand me" on something that cannot expand.
5070
+ assert.equal(source.includes("'▶ ' + file.name"), false, 'no caret in front of files')
5071
+ assert.ok(source.includes("h('span', null, '📄 ' + file.name)"))
5072
+ // A folder whose listing came back empty is a leaf: caret becomes `·`, no click.
5073
+ assert.ok(source.includes("'data-proxy-tree-leaf': leaf ? '1' : '0'"))
5074
+ assert.ok(source.includes("leaf ? '·' : open ? '▾' : '▸'"))
5075
+ // The old "choose from list only" button is gone.
5076
+ assert.equal(source.includes("rule.program === '' ? '选择程序…'"), false)
5077
+ })
5078
+
5079
+ test('edits save themselves, and adding a row adds a row', () => {
5080
+ const source = readSync(new URL('../lib/client.js', import.meta.url), 'utf8')
5081
+ // No 保存 button: every edit is written 700ms after the last keystroke, so a
5082
+ // half-typed IP never becomes a half-written rule on disk.
5083
+ assert.equal(source.includes("action: 'save'"), false, 'the save button is gone')
5084
+ assert.ok(source.includes('function draftSignature(draft)'))
5085
+ assert.ok(source.includes('savedSignature.current = draftSignature(draft)'),
5086
+ 'what the host confirmed is remembered, so a reload is not an edit')
5087
+ // The timer lives in a ref so a button press or a close can flush it first.
5088
+ assert.ok(source.includes('saveTimer.current = setTimeout(function () { saveTimer.current = null; void save() }, 700)'))
5089
+ assert.ok(source.includes('data-proxy-autosave'))
5090
+ // Half-typed rows are not written: auto-save fires mid-typing, and a rule with no
5091
+ // program/ip/port would come back as a row that silently does nothing.
5092
+ assert.ok(source.includes('function storableRule(rule)'))
5093
+ assert.ok(source.includes('var mode = writeMode(rule)'))
5094
+ assert.ok(source.includes("if (storable.length === 0 && skipped > 0)"),
5095
+ 'never blank the file while every row is still being typed')
5096
+ // A row that is already on disk must not silently keep its OLD content when it is
5097
+ // edited into an incomplete state: it is written as disabled instead.
5098
+ assert.ok(source.includes('function writeMode(rule)'))
5099
+ assert.ok(source.includes("return savedIds.current[rule.id] === true ? 'disable' : 'skip'"))
5100
+ assert.ok(source.includes("storable.push(Object.assign({}, rule, { enabled: false }))"))
5101
+ assert.ok(source.includes('savedIds.current = ids'))
5102
+ // "+ 添加规则" appends an empty row and does NOT pop the picker over the table.
5103
+ const addRule = source.slice(source.indexOf('function addRule()'), source.indexOf('function addRule()') + 900)
5104
+ assert.equal(addRule.includes('pickFor'), false, 'adding a row must not open the picker')
5105
+ })
@@ -0,0 +1,65 @@
1
+ // The two plugins must stay usable standalone, so the companion hint is a
2
+ // RECOMMENDATION that only appears when the workspace really looks like a
3
+ // YonBIP/YMS project — never on an ordinary Java/Vue repo.
4
+ import assert from 'node:assert/strict'
5
+ import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'
6
+ import { tmpdir } from 'node:os'
7
+ import { join } from 'node:path'
8
+ import test from 'node:test'
9
+
10
+ import { __test } from '../lib/index.js'
11
+
12
+ const { detectCompanionPlugin, renderProgramList } = __test
13
+
14
+ function workspace() {
15
+ return mkdtempSync(join(tmpdir(), 'ris-companion-'))
16
+ }
17
+
18
+ test('a plain workspace gets no companion hint', () => {
19
+ const dir = workspace()
20
+ try {
21
+ writeFileSync(join(dir, 'pom.xml'), '<project/>')
22
+ assert.equal(detectCompanionPlugin(dir), null)
23
+ assert.doesNotMatch(renderProgramList({ root: dir, dir, programs: [] }), /dsh-ris-yds/)
24
+ } finally {
25
+ rmSync(dir, { recursive: true, force: true })
26
+ }
27
+ })
28
+
29
+ test('yms-home marks the workspace as YonBIP/YMS', () => {
30
+ const dir = workspace()
31
+ try {
32
+ mkdirSync(join(dir, 'yms-home'))
33
+ const found = detectCompanionPlugin(dir)
34
+ assert.equal(found.plugin, 'dsh-ris-yds')
35
+ assert.match(found.detected, /yms-home/)
36
+ assert.match(found.hint, /YMS/)
37
+ } finally {
38
+ rmSync(dir, { recursive: true, force: true })
39
+ }
40
+ })
41
+
42
+ test('.vscode/settings.json with yds.* marks it too', () => {
43
+ const dir = workspace()
44
+ try {
45
+ mkdirSync(join(dir, '.vscode'))
46
+ writeFileSync(join(dir, '.vscode', 'settings.json'), JSON.stringify({ 'yds.module': 'c-ass-kk-hans' }))
47
+ assert.equal(detectCompanionPlugin(dir).plugin, 'dsh-ris-yds')
48
+ } finally {
49
+ rmSync(dir, { recursive: true, force: true })
50
+ }
51
+ })
52
+
53
+ test('the program list renders the hint as an optional extra line', () => {
54
+ const dir = workspace()
55
+ try {
56
+ mkdirSync(join(dir, 'yms-home'))
57
+ const text = renderProgramList({ root: dir, dir: join(dir, 'logs'), programs: [], companion: detectCompanionPlugin(dir) })
58
+ assert.match(text, /No runnable programs/)
59
+ assert.match(text, /Optional companion plugin: dsh-ris-yds/)
60
+ // Null companion keeps the rendered list exactly as before.
61
+ assert.doesNotMatch(renderProgramList({ root: dir, dir, programs: [], companion: null }), /Optional companion plugin/)
62
+ } finally {
63
+ rmSync(dir, { recursive: true, force: true })
64
+ }
65
+ })
@@ -406,7 +406,9 @@ test('the stop route terminates a real run-with-log.sh service end to end', asyn
406
406
  // The wrapper writes its exit banner just before it exits; under a loaded
407
407
  // parallel test run the read can win the race, so poll briefly.
408
408
  let banner = ''
409
- for (let attempt = 0; attempt < 40; attempt += 1) {
409
+ // Generous budget: the wrapper is bash that has to reap `sleep`, trap TERM
410
+ // and write the banner, and the full test run keeps several files in flight.
411
+ for (let attempt = 0; attempt < 400; attempt += 1) {
410
412
  banner = await readFile(log, 'utf8')
411
413
  if (/stoptest exited/.test(banner)) break
412
414
  await new Promise((resolve) => setTimeout(resolve, 50))
@@ -529,6 +531,19 @@ async function makeStartableFixture() {
529
531
  return { root }
530
532
  }
531
533
 
534
+ test('a frontend row is named after module.xml, not the package.json domainKey', async () => {
535
+ const root = await mkdtemp(join(tmpdir(), 'dsh-ris-ide-fe-'))
536
+ const dir = join(root, 'my-fe')
537
+ await mkdir(dir, { recursive: true })
538
+ // MDF projects keep the backend domainKey in package.json — that is the collision.
539
+ await writeFile(join(dir, 'package.json'), JSON.stringify({ name: 'c-ass-kk-hans', scripts: { dev: 'vite' } }))
540
+ await writeFile(join(dir, 'module.xml'), '<module name="c-ass-kk-hans-fe" description="前端"><nginx_mode>mdf</nginx_mode></module>')
541
+ const programs = await scanPrograms(root, join(root, 'logs'), true)
542
+ const frontend = programs.filter((p) => p.kind === 'frontend')
543
+ assert.equal(frontend.length, 1)
544
+ assert.equal(frontend[0].name, 'c-ass-kk-hans-fe')
545
+ })
546
+
532
547
  test('scanPrograms finds Spring Boot entries and frontend manifests, and skips node_modules', async () => {
533
548
  const { root, moduleDir, uiDir } = await makeProgramFixture()
534
549
  const logsDir = join(root, 'logs')
@@ -551,6 +566,7 @@ test('scanPrograms finds Spring Boot entries and frontend manifests, and skips n
551
566
  `--spring.config.additional-location=file:${join(root, 'local.yml')}`,
552
567
  ])
553
568
  assert.equal(frontend[0].dir, uiDir)
569
+ // No module.xml: a plain npm project keeps its package.json name.
554
570
  assert.equal(frontend[0].name, 'demo-ui')
555
571
  assert.equal(frontend[0].script, 'dev')
556
572
  assert.equal(frontend[0].packageManager, 'pnpm', 'inferred from pnpm-lock.yaml')
@@ -3021,3 +3037,19 @@ test('fs/window pages a large file and never splits a multi-byte character', asy
3021
3037
  assert.equal(__test.utf8CompleteLength(Buffer.from('ab中', 'utf8')), 5)
3022
3038
  assert.equal(__test.utf8CompleteLength(Buffer.alloc(0)), 0)
3023
3039
  })
3040
+
3041
+ test('a same-named row of another kind is not taken over by an update', () => {
3042
+ // A yds project: the launcher row is `spring`, the discovered frontend row carries
3043
+ // the package.json name — an update must not move the launcher's startCommand onto
3044
+ // the frontend row (that would delete the only way to start the backend).
3045
+ const next = { version: 1, defaults: { jvmArgs: [] }, programs: [
3046
+ { id: 'frontend:fe#start', name: 'c-ass-kk-hans', kind: 'frontend', dir: 'fe', script: 'start' },
3047
+ ] }
3048
+ const oldEntries = [
3049
+ { name: 'c-ass-kk-hans', kind: 'spring', dir: '.', startCommand: 'node x/bin/yds.js start' },
3050
+ ]
3051
+ const merged = mergeConfigDocuments(next, oldEntries, '/ws')
3052
+ assert.equal(merged.programs.length, 2, 'the launcher stays a separate row')
3053
+ assert.equal(merged.programs[0].startCommand, undefined, 'the frontend row keeps its own launch path')
3054
+ assert.equal(merged.programs[1].startCommand, 'node x/bin/yds.js start')
3055
+ })