Repository navigation
test: name dsh launcher fixture agent/dsh-native.js so the shim test is hermetic (#1889) - #1890
Conversation
… assertion holds without a build (#1889)
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.1886-pr.1890.82e2683This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr1890.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 审查结论:PR #1890(dsh launcher fixture 改名 → hermetic)方向正确、改动最小、无回归。已按「审核先于实现」独立核验(代码路径追踪 + CI 证据),未重做实现。查重:全仓无其他 open/closed issue/PR 针对此 flaky-test 的 fixture 命名修复;本 PR 关闭 #1889,与并行 launcher PR(#1888 node-wrapper、#1861/#1581 dsh lanes)不同函数不同区域。 ① 是什么问题 ② 什么原因导致的(因果分层)
③ 怎么修复的 ④ 是否有回归问题 —— 无。逐条核过既有行为:
⑤ 是否破坏缓存:不涉及。未触碰任何缓存 / 重试 / 增量游标 / 去重键。 ⑥ 是否改了设计方向:不涉及架构 / 边界 / 数据流转向;恰恰是恢复 4f8cd37 既有的 hermetic 意图。 ⑦ 是否引入新配置:不涉及。无新 env / config / CLI flag / 默认值。 证据与 CI(对 PR head
判定:可合并。 改动正确、最小、边界清晰(纯测试,单文件 +7/-3,每行都在目的内)。等剩余三条 CI 测试腿(windows 24/22、ubuntu 22)转绿即可合。我不执行合并——PR 合并仅限人工,请 owner 自行合并:#1890 |
Closes #1889
What
The
runLaunch dsh: non-loopback upstreams ride proxy envstest (tests/launcher.test.ts) asserts the #1590 bare-specifier patch entry (name: billion-context), which only holds when the pre-seeded fixture shim satisfiesdshPluginEntry's identity check. On a clean tree (nodist/) it failed deterministically; afternpm run buildit passed. CI runsnpm testBEFOREnpm run build(.github/workflows/ci.yml: install → typecheck → test → build; no pretest hook), so a fresh runner goes red — flaky only when stale dist lingers.Root cause (refined vs the issue)
Not a dangling symlink: the pre-seeded fixtures (
<home>/host-bundle.js,<home>/client-bundle.js, added by 4f8cd37) resolve fine, but 3e838ab (#1590/#1816) tighteneddshPluginEntry(src/launcher.ts) to requirerealpath.endsWith("agent/dsh-native.js"). The old fixture names fail that check → fallback to the legacy file-URL entry → the bare-entry assertion fails. The dedicated unit test (tests/launcher.test.ts, "writeDshClientShimFiles + dshPluginEntry") already uses the correctagent/dsh-native.jsshape and stays green; only this integration test kept the stale names. Classic incomplete first pass: the check got stricter without updating the existing consumer of the hermetic fixture contract.Fix (issue option A, refined)
Rename the pre-seeded fixtures to
agent/dsh-native.js/agent/dsh-native-client.js(+ mkdir of the dirname) and document the naming obligation in the existing comment. This restores the hermetic design 4f8cd37 intended: the bare-entry assertion now holds WITHOUT a build, and with a build present, runLaunch's ownwriteDshClientShimoverwrites the fixture with real dist symlinks exactly as before. Deliberately NOT skip-gated: skipping would drop CI coverage of the #1590 bare-specifier mechanism on every clean runner. Option B (build before test in CI) rejected: costs a build per matrix leg (2 OS × 2 Node) and still leaves fresh-checkout local runs red.Verification (rebased onto master 6cab41b)
npm run typecheckclean;npm run buildclean (dist-import-annotations OK)Test-only change: no production code, no config surface, no wire behavior touched. Disjoint from open launcher PRs (#1888 node-wrapper resolution, #1861/#1581 dsh lanes) — different functions/regions.