Repository navigation
[PR] fix: dsh web boot — give the compaction gate its own package identity (#4627) - #4631
ranxianglei wants to merge 10 commits into
Conversation
…0.2 boots (#4627) Every dsh carrier mounted two Loader rows (bili-native + bili-compaction-gate) that both resolved into the billion-context package, which declares dsh.client.platform: web. dsh >= 0.2.0-rc.x (ClientModuleRegistry. reconcilePackage) refuses to boot when one client package has more than one active Loader source, bricking 'bili dsh web' and profile-bundle installs ('1 required plugin did not activate'). The gate now ships under its own package identity declaring NO dsh.client: nested dist/agent/dsh-gate/ (bundle + manifest written by scripts/write-build-info.mjs, build fails loud when missing), a sibling billion-context-dsh-gate shim package in the launcher lane, and the billion-context/dsh-gate subpath in the bundle layer. The old billion-context/dsh-compaction-gate subpath stays as a compat alias.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9450-pr.4631.92ee955This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4631.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重:根因不属于本 PR—— 标签:拟打 CI 自动修复车道 attempt 1 交付报告: 八问
CI 状态(新 head
|
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 本 PR 是 #4627 的唯一修复入口(Closes #4627);检索 open/closed PR 无其他条目触碰 dsh loader package identity。唯一相关项 #4606(修 master CI 红门)与本 PR 文件零交集,不构成并行。 标签: 独立审核(非复读 issue 结论)① 方向:正确。缺陷的制造者是 bili 自己:#3662(v0.1.204)之后三个 carrier(launcher URL lane / bare lane / profile-bundle lane)都把 bili-native 与 bili-compaction-gate 两行 Loader 挂进声明了 ② 回归清点(逐路径):
③ 代码:launcher.ts 三个函数 + 五个构建侧文件全读。命名达意,注释讲为什么(#4627/#3662 因果),错误路径完整(返回 false 且不动既有状态),无死代码。 ④ 测试有效性:新 ⑤ diff 整洁度:10 文件 +350/-40,每行都服务于本修复,无 lockfile/生成物噪音。 本地定向验证(worktree @ ee24493):npm ci + 全量 build 绿(含新 gate manifest CI 红不是本 PR 的问题(证据链)head ee24493 上主 CI workflow 红,fail job = 失败签名
按 #4599 协调政策:不新开 issue、不在本 PR 里重复修这条继承红。 八问
判定:代码审核通过,建议合并。 当前唯一阻塞是 master 继承红门(#4602/#4604,#4606 在修):请待 #4606 合入后 rebase 本分支重跑 CI 拿到 full-suite 绿,即可合并。 |
…t rebase) Resolve the single conflict in tsup.config.ts: keep the PR's structure (gate bundle built by its own third defineConfig, so dsh-compaction-gate.ts is NOT in the main entry) while adopting master's independent addition of src/claude-subagent-hook.ts to the main entry. All other files auto-merged cleanly; the PR's changes to launcher.ts, package.json exports, write-build-info.mjs, check-dist-thin-install.mjs, dsh.bundle.patch.yml and the issue4627 test all survived.
(ai: vllm-qwen/qwen3.8-27b) Conflict resolved and pushed. I merged What I did this run:
Note on the redundant commit: the branch still carries 八问(中文,供人工 reviewer):
判定:冲突已解决,PR 可干净合并进当前 master(merge-tree 验证通过),本地 build + 372/372 测试 + typecheck 全绿,已推送至 |
[ework] CI fix verified green ✓ |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Conflict already resolved (prior run); this run brought the PR up to date with master and re-verified. New PR head: What I found and did this run:
Bottom line: the merge conflict is fully resolved (it was resolved in the prior run; the "dirty" flag was stale). The PR is now current with master and will merge cleanly. CI is running with zero failures so far; the remaining red/green is the standard test matrix completing. No further branch action needed from this lane. 八问(中文,供人工 reviewer):
判定:合并冲突已解决(上一 run 完成,本次 stale 标记已澄清);PR 已更新到最新 master(不再 behind),可干净合并;本地 build + 372/372 测试 + typecheck 全绿,已推送至 |
[ework] CI fix verified green ✓ |
(ai: vllm-qwen/qwen3.8-27b) APPROVE — clean root-cause fix, verified locally; no kernel/config change. (Posting as a comment: GitHub rejects a formal APPROVE review on the author's own PR, so the verdict is carried here.) Correctness. #4627: since #3662 (v0.1.204) every dsh carrier mounted two Loader rows ( Tests. New Regression walk (existing behavior the diff touches). Old dsh (<0.2): URL lane loads the same code via the nested path; bare lane via the sibling shim (both resolver semantics tested); bundle lane via the new subpath with the old subpath kept as an alias (pre-existing profile bundles resolve through the upgrade window). Shim writers Local verification (worktree @ 7e0147c, node v22.23.2). CI (mirror cache, head 7e0147c). 0 failed / 0 pending across 30 checks — all test shards (ubuntu/windows × node 22/24) + static gates (unused-exports, lane-guard, version-guard, pi-subagents-guard, static-gates, mysql-contract) green; E2E lanes skipped (gated). 八问(中文,供人工 reviewer)
判定:代码审核通过,建议合并。 |
(ai: vllm/qwen3.8-27b)
Closes #4627
What & why
Since #3662 (shipped v0.1.204), every dsh carrier mounted TWO Loader rows (
bili-native+bili-compaction-gate) that both resolve into thebillion-contextpackage, which declaresdsh.client.platform: web. dsh >= 0.2.0-rc.x (@deepseek-ai/dsh-client-modules,ClientModuleRegistry.reconcilePackage) refuses to boot when one client package has more than one active Loader source, sobili dsh weband profile-bundle installs die withstartup failed: 1 required plugin did not activate.Fix: the compaction gate gets its OWN package identity that declares NO
dsh.client, so each client package keeps exactly one active Loader row:dist/agent/dsh-gate/index.js(own tsup config — tsup's array entry path cannot mix string/object entries), accompanied bydist/agent/dsh-gate/package.json(namebillion-context-dsh-gate, nodsh.client) written byscripts/write-build-info.mjs; the build now FAILS if that pair is missing, so a tarball can never silently re-trigger [dsh] bili dsh web fails to boot: "package billion-context resolves from multiple active Loader sources" (bili-native + bili-compaction-gate rows) #4627;file://…/dist/agent/dsh-gate/index.js(URL lane) or the new sibling shim packagebillion-context-dsh-gatewritten beside the existing billion-context shim (bare lane);dsh.bundle.patch.yml): the gate row targetsbillion-context/dsh-gate, resolving through the nested manifest;billion-context/dsh-compaction-gatesubpath stays as a compat alias pointing at the same nested file.#3662's separation is preserved: the gate remains its own always-on entry — disabling/kill-switching bili-native still leaves the preset service alive.
Behavior changes (old → new)
file://…/dist/agent/dsh-compaction-gate.jsfile://…/dist/agent/dsh-gate/index.jsbillion-context/dsh-compaction-gatebillion-context-dsh-gatebillion-context/dsh-compaction-gatebillion-context/dsh-gate./dsh-compaction-gate+gate.jssymlinkbillion-context-dsh-gateshim package written beside itdist/agent/dsh-compaction-gate.jsdist/agent/dsh-gate/{index.js,package.json}(flat file removed)./dsh-compaction-gate→ flat file./dsh-gate;./dsh-compaction-gatekept as alias to the nested filewrite-build-info.mjsReason for every change: the dsh >= 0.2.0-rc.x reconcilePackage guard (
resolves from multiple active Loader sources … remove one entry). Older dsh versions accept the new layout unchanged — each row is just a resolvable module, and both resolution semantics are covered (a scanner walking literal paths lands on the shim/nested package.json; one that realpaths symlinks lands on the nested dist manifest).Tests
tests/issue4627-dsh-loader-package-identity.test.ts— replays dsh's nearest-package.json walk per Loader row across all three carriers (built artifact, overlay URL lane, overlay bare lane under BOTH resolver semantics, bundle layer); asserts distinct package identities and exactly one dsh.client declaration.tests/launcher.test.ts,tests/issue3354-dsh-compaction-disable.test.ts,tests/issue3662-dsh-gate-fallback.test.tsto the new layout (carrier-agreement constants split per carrier).npm run buildgreen incl. both dist gates;npm run check:dist-thingreen (the gate bundle is import-probed in the installed tarball). Full-suite verdict: CI.No config-surface change (no new env/config/CLI fields). No
kernel/change.Local real-binary verification (owner request, 2026-10-25)
All cases boot a real
@deepseek-ai/dshbinary with a scratchDSH_HOME; "boots" = the requiredmodulesplugin activates (both Loader rows load and register theirapply()) and the web app reaches its listen line — #4627's failure point is before any model request, so no model endpoint is needed.package billion-context resolves from multiple active Loader sources … remove one entry(ClientModuleRegistry.reconcilePackage)writeDshAcpPatchoutput)dsh web: http://127.0.0.1:<port>dsh.profile.bundlespointing at the fixed tree;--dump-configcontrol confirms the mounted rowsbillion-context+billion-context/dsh-gate)