Skip to content

[PR] fix: dsh web boot — give the compaction gate its own package identity (#4627) - #4631

Open
ranxianglei wants to merge 10 commits into
masterfrom
2026-10-25_dsh-gate-package-identity
Open

ranxianglei wants to merge 10 commits into
masterfrom
2026-10-25_dsh-gate-package-identity

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

(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 the billion-context package, which declares dsh.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, so bili dsh web and profile-bundle installs die with startup 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:

  • the gate bundle moves to dist/agent/dsh-gate/index.js (own tsup config — tsup's array entry path cannot mix string/object entries), accompanied by dist/agent/dsh-gate/package.json (name billion-context-dsh-gate, no dsh.client) written by scripts/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;
  • launcher overlay: the gate row targets file://…/dist/agent/dsh-gate/index.js (URL lane) or the new sibling shim package billion-context-dsh-gate written beside the existing billion-context shim (bare lane);
  • bundle layer (dsh.bundle.patch.yml): the gate row targets billion-context/dsh-gate, resolving through the nested manifest;
  • the old billion-context/dsh-compaction-gate subpath 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)

surface old new
overlay gate row (URL lane) file://…/dist/agent/dsh-compaction-gate.js file://…/dist/agent/dsh-gate/index.js
overlay gate row (bare lane) billion-context/dsh-compaction-gate billion-context-dsh-gate
bundle yml gate row billion-context/dsh-compaction-gate billion-context/dsh-gate
host shim exports included ./dsh-compaction-gate + gate.js symlink dropped; separate billion-context-dsh-gate shim package written beside it
tarball layout dist/agent/dsh-compaction-gate.js dist/agent/dsh-gate/{index.js,package.json} (flat file removed)
npm exports ./dsh-compaction-gate → flat file adds ./dsh-gate; ./dsh-compaction-gate kept as alias to the nested file
write-build-info.mjs display-only, never fails also writes the gate manifest; fails the build when the gate bundle is missing

Reason 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

  • NEW 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.
  • Updated tests/launcher.test.ts, tests/issue3354-dsh-compaction-disable.test.ts, tests/issue3662-dsh-gate-fallback.test.ts to the new layout (carrier-agreement constants split per carrier).
  • Local evidence: typecheck clean; targeted suites green (362/362 across the four files post-build); npm run build green incl. both dist gates; npm run check:dist-thin green (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/dsh binary with a scratch DSH_HOME; "boots" = the required modules plugin activates (both Loader rows load and register their apply()) and the web app reaches its listen line — #4627's failure point is before any model request, so no model endpoint is needed.

case dsh version lane result
repro: OLD layout, two rows resolving into one package 0.2.1-rc.2 file-URL fails exactly as reported: package billion-context resolves from multiple active Loader sources … remove one entry (ClientModuleRegistry.reconcilePackage)
A: new layout 0.2.1-rc.2 launcher overlay, file-URL lane (writeDshAcpPatch output) boots: dsh web: http://127.0.0.1:<port>
B: new layout 0.2.1-rc.2 launcher overlay, bare lane (sibling shims + NODE_PATH seed, as the launcher does) boots
C: new layout 0.2.1-rc.2 profile-bundle lane (dsh.profile.bundles pointing at the fixed tree; --dump-config control confirms the mounted rows billion-context + billion-context/dsh-gate) boots
D: back-compat 0.1.1-rc.2 (pre-guard) new layout, file-URL lane boots — older dsh unaffected by the layout change

…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.
@ranxianglei ranxianglei changed the title fix: dsh web boot — give the compaction gate its own package identity (#4627) [PR] fix: dsh web boot — give the compaction gate its own package identity (#4627) Oct 25, 2026
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-25_dsh-gate-package-identity (7e0147c)

Latest build — install this exact version

npm install -g billion-context@0.0.9450-pr.4631.92ee955

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
7e0147c billion-context@0.0.9450-pr.4631.92ee955 build
786e85e billion-context@0.0.9440-pr.4631.98b0279 build
1792ae7 billion-context@0.0.6164-pr.4631.5d18eed build
ffdcac9 billion-context@0.0.6077-pr.4631.70a3784 build
123ed73 billion-context@0.0.5979-pr.4631.7097ca6 build
ac36b0f billion-context@0.0.5882-pr.4631.87489b1 build
ba3a88d billion-context@0.0.5815-pr.4631.16a0eee build
b8fc871 billion-context@0.0.5663-pr.4631.6563adc build
66e8745 billion-context@0.0.5630-pr.4631.adcebdc build
ee24493 billion-context@0.0.5629-pr.4631.6b414b3 build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr4631.tgz
npm install -g package

Install instructions are refreshed on each push.

…ed master red, #4599 盘点 item 1; same one-liner as #4606 c1 — discard this commit on rebase after #4606 lands)
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重:根因不属于本 PR——unused-exports 的报错行与 master 常红逐字节相同(#4599 总控盘点第 1 条:ClientBuildCheck INTERNAL_ONLY),master 侧根治已在途(#4606,Fixes #4602);本 PR diff 未新增/改动任何 export,src/agent/client-build-note.ts 在 master 与本分支间字节完全相同。

标签:拟打 bug + scope/ci + p3(门禁检出的代码卫生缺陷、无用户侧影响)——镜像端 label API 创建报 500,未能打上,请 owner 手动补。

CI 自动修复车道 attempt 1 交付报告:

八问

  1. 是什么问题:本 PR 的 unused-exports 门禁红——src/agent/client-build-note.ts 里的 ClientBuildCheck 只在本文件内使用却带 export,被门禁判为 INTERNAL_ONLY。这不是本 PR 引入的缺陷:干净 master 上跑同一门禁得到同一报错。
  2. 什么原因导致的:tier-5 train 落 master(head 146b34f)后,[PR] dsh lane: note in-session when running an unverified @deepseek-ai/dsh client build (soft, exact-match) #4545 新增的这个 type-only 类型漏在 de-export 清扫之外,成为僵尸导出;凡 base 在该 master 上的 PR 全部继承此红(CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 已逐一核实十余个在途 PR 同签名)。
  3. 影响范围与严重程度:仅检查矩阵信号级问题——每个继承 PR 少一个绿灯,无用户侧功能影响;p3。
  4. 怎么修复的:按几行级小修纪律(政策明确允许多个 PR 各自重复修同样的几行),直接在本 PR 分支以独立标注 commit 66e874573 去掉前导 export(1 文件 1 行,type-only,零运行时影响);与 [PR] fix(ci): clear the two master-red gates in one branch — unused-exports (#4602) + the #3890 LIVE_FILES tripwire (#4604) #4606 commit 1 同一修法,[PR] fix(ci): clear the two master-red gates in one branch — unused-exports (#4602) + the #3890 LIVE_FILES tripwire (#4604) #4606 合入后 rebase 时丢弃此重复 commit。
  5. 是否有回归问题:无。审过的既有行为:ClientBuildCheck 全仓零外部引用(仅本文件 45/81/93/115 行内部使用)、非 tsup 入口面、类型擦除后不进 bundle——去 export 不改变任何运行时字节;未触碰阈值/时序/输出格式/错误处理路径。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:没有。
  8. 是否引入新配置:没有。

CI 状态(新 head 66e874573)

结论:auto-fix 车道目标检查(unused-exports)已修复并经 CI 确认;剩余红全部为继承性、归 #4606 所有。

@ranxianglei ranxianglei added bug Something isn't working dsh p1 scope/wiring labels Oct 25, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重: 不重复。 本 PR 是 #4627 的唯一修复入口(Closes #4627);检索 open/closed PR 无其他条目触碰 dsh loader package identity。唯一相关项 #4606(修 master CI 红门)与本 PR 文件零交集,不构成并行。

标签: bug dsh scope/wiring p1(dsh ≥0.2 web 启动不可用的可用性缺陷,dsh 车道接线层修复——与 #4627 定级一致)。

独立审核(非复读 issue 结论)

① 方向:正确。缺陷的制造者是 bili 自己:#3662(v0.1.204)之后三个 carrier(launcher URL lane / bare lane / profile-bundle lane)都把 bili-native 与 bili-compaction-gate 两行 Loader 挂进声明了 dsh.client 的 billion-context 包,而 dsh ≥0.2.0-rc.x 的 ClientModuleRegistry.reconcilePackage 对「一个 client 包多个 active source」硬失败。修法改的正是发射侧:gate 获得独立包身份(billion-context-dsh-gate,不声明 dsh.client),每个 client 包恰好剩一行 active。治源不治标;#3662 的分离语义(gate 独立 always-on 入口)保持,回并会回归 #3662,方向成立。

② 回归清点(逐路径):

  • 老 dsh(<0.2)URL lane:行目标 flat file → 嵌套路径,加载的是同一份代码 ✓
  • 老 dsh bare lane:subpath → 兄弟 shim 包;字面 walk-up 与 CJS realpath 两种 resolver 语义都有测试覆盖 ✓
  • bundle lane:yml 行改指 billion-context/dsh-gate;npm exports 保留旧 subpath 作别名指向同一嵌套文件——存量已装 profile(yml 仍引用旧 subpath)在升级窗口内依然可解析 ✓
  • shim 升级:两个 writer 成功时 rmSync+重建目录,旧 gate.js symlink 与旧 ./dsh-compaction-gate export 随目录消失,不残留;失败时返回 false、既有 shim 原样不动(keep.txt 有测试钉住)✓
  • 构建侧:tsup 第二 defineConfig clean:false 且排在主配置后,本地验证 dist 两套产物共存;write-build-info.mjs 从 display-only 变为 gate bundle 缺失即 fail build——有意收紧,PR 正文已披露 ✓
  • 请求管道/会话状态/缓存键:未触碰(纯 install/boot 面)✓

③ 代码:launcher.ts 三个函数 + 五个构建侧文件全读。命名达意,注释讲为什么(#4627/#3662 因果),错误路径完整(返回 false 且不动既有状态),无死代码。

④ 测试有效性:新 tests/issue4627-dsh-loader-package-identity.test.ts 有牙——不复述字符串,而是回放 dsh 的 nearest-package.json 解析过程,断言「两行解析到不同包身份 + 恰好一个声明 dsh.client」,覆盖三个 carrier × 两种 resolver 语义,并字节钉住 bundle yml 的 carrier-agreement 行;#4627 的任何回退都会让它红。三个更新文件只是把共享常量按 carrier 拆开(carrier 现在合法地指向不同但等价的包),断言严格度不变,还补了负向(host shim 不得再带 ./dsh-compaction-gate、gate shim 不得有 dsh key)。非假测试。

⑤ diff 整洁度:10 文件 +350/-40,每行都服务于本修复,无 lockfile/生成物噪音。

本地定向验证(worktree @ ee24493):npm ci + 全量 build 绿(含新 gate manifest billion-context-dsh-gate@0.1.206,旧 flat 文件确认移除);typecheck 干净;四个相关测试文件 362/362 通过(与作者声称一致);unused-exports gate 本地复跑 = 仅 1 条命中,原因见下。

CI 红不是本 PR 的问题(证据链)

head ee24493 上主 CI workflow 红,fail job = unused-exports;test 矩阵 lanes 全部 skipped(gate 失败导致依赖 job 不排程)→ 此 head 尚无 full-suite 判定。其余 9 个 workflow(e2e-dsh-plugin-lane、e2e-native-pi/opencode、e2e-local-registry、PR Build Artifact 等)全绿。

失败签名 INTERNAL_ONLY src/agent/client-build-note.ts: ClientBuildCheck,已证明是 master 继承红:

  1. PR parent = origin/master tip(146b34f),merge-base 与之相同,PR 仅 1 个提交,不触碰 client-build-note.ts 及任何引用它的文件;
  2. 在 origin/master 干净 worktree 跑同一脚本,得到逐字相同的单条命中;
  3. 修复已在途:[PR] fix(ci): clear the two master-red gates in one branch — unused-exports (#4602) + the #3890 LIVE_FILES tripwire (#4604) #4606(Fixes fix(ci): master unused-exports is red — ClientBuildCheck is exported but only used inside its own file #4602/fix(ci): every test shard is red — tests/issue3890-parent-gone-confirm-drain.test.ts spawns processes but is missing from LIVE_FILES #4604,其提交 1 正是 export type ClientBuildCheck → type ClientBuildCheck 一行),与本 PR 分支文件零交集 → [PR] fix(ci): clear the two master-red gates in one branch — unused-exports (#4602) + the #3890 LIVE_FILES tripwire (#4604) #4606 合入后 rebase 本 PR 即无冲突拿到含 test lanes 的全绿。

按 #4599 协调政策:不新开 issue、不在本 PR 里重复修这条继承红。

八问

  1. 是什么问题:v0.1.204 起,dsh ≥0.2.0-rc.x 下 bili dsh web 与 profile-bundle 安装启动即死(reconcilePackage 看到同一 client 包两个 active Loader 源 → "1 required plugin did not activate")。
  2. 什么原因导致的:[dsh] Disabling the plugin permanently bricks dsh session creation - the bundle patch inject gate has no fallback (0.1.199 / dsh 0.2.1-rc.2) #3662 的 gate 分离把 bili-native 与 bili-compaction-gate 两行同时挂进 billion-context 包(声明 dsh.client),违反 dsh 0.2 新增的「每 client 包至多一个 active source」不变量。
  3. 影响范围与严重程度:dsh ≥0.2.0-rc.x 的 web 客户端 / profile-bundle 用户完全无法启动(p1 可用性缺陷);有绕行(pin 0.1.197 + 关 auto-update)。
  4. 怎么修复的:给 gate bundle 独立包身份(dist/agent/dsh-gate/{index.js,package.json},name=billion-context-dsh-gate,不声明 dsh.client),三个 carrier 的行分别指向它(URL lane 走嵌套 file:// 路径,bare lane 走兄弟 shim,bundle lane 走新 subpath);构建期加硬门禁防复发(tarball 缺 gate 对即 fail)。
  5. 是否有回归问题:未发现。逐路径结论见②;唯一语义变化是 write-build-info.mjs 从永不失败变 fail-fast(有意收紧、已披露)。
  6. 是否破坏缓存:不涉及(未触碰请求管道/会话/缓存键)。
  7. 是否改了设计方向:无,仅 gate 产物的打包身份变化;[dsh] Disabling the plugin permanently bricks dsh session creation - the bundle patch inject gate has no fallback (0.1.199 / dsh 0.2.1-rc.2) #3662 架构原样保留。
  8. 是否引入新配置:无(无 env/config/CLI 字段)。

判定:代码审核通过,建议合并。 当前唯一阻塞是 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.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

Conflict resolved and pushed. I merged master into the PR branch 2026-10-25_dsh-gate-package-identity, resolved the single conflict, verified locally, and pushed. New PR head: 786e85ec52.

What I did this run:

  1. Chose merge over rebase. The PR branch history is messy (core fix ee24493a8e + a one-liner + 6 ci-fixes merge commits from the CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 help-merge sweep). A merge avoids a force-push and is the safer integration.
  2. Single conflict, in tsup.config.ts (main entry array, lines 7–11). Both sides edited the same array:
  3. Verified locally (node v22.23.2, npm ci): npm run build green — gate manifest billion-context-dsh-gate@0.1.213 written, dist/agent/dsh-gate/{index.js,package.json} correct, old flat dist/agent/dsh-compaction-gate.js gone, claude-subagent-hook.js built, dist-import-annotations + dist-external OK. Targeted tests 372/372 pass (issue4627 4/4 + launcher/issue3354/issue3662 368/368). npm run typecheck exit 0.
  4. Pushed 1792ae7c46..786e85ec52 (clean, no force — remote head unchanged at fetch).
  5. Confirmed clean merge against current master. Master moved 17 commits ahead during the run (dd0ef22aea→243709bef2); none of those commits touch any PR file, and git merge-tree --write-tree pr4631 origin/master exits clean → the PR will merge cleanly into the live master head.
  6. Inherited master reds ([PR] fix(ci): clear the two master-red gates in one branch — unused-exports (#4602) + the #3890 LIVE_FILES tripwire (#4604) #4606) both confirmed fixed on master and carried into the PR branch: (c1) client-build-note.ts:32 is now type ClientBuildCheck (de-exported); (c2) LIVE_FILES moved to scripts/live-files.mjs and tests/issue3890-parent-gone-confirm-drain.test.ts is listed at line 66. So the two reds that blocked the prior attempt are gone — no inherited red remains.

Note on the redundant commit: the branch still carries 66e8745735 (the ClientBuildCheck de-export, a duplicate of #4606's fix, marked "discard on rebase after #4606 lands"). Because I used merge (not rebase) and #4606 has since landed on master, that commit is now a no-op in the final tree (the file is already at master's de-exported version). It is harmless — no behavioral change — but I left it rather than force-push to strip it.


八问(中文,供人工 reviewer):

  1. 是什么问题:PR [PR] fix: dsh web boot — give the compaction gate its own package identity (#4627) #4631 与 master 处于合并冲突(merge state dirty),无法合并。
  2. 什么原因导致的:PR 分支与 master 都改了 tsup.config.ts 的主 entry 数组——PR 把 dsh-compaction-gate.ts 移出主 entry(挪进独立的第三段 defineConfig,即 [dsh] bili dsh web fails to boot: "package billion-context resolves from multiple active Loader sources" (bili-native + bili-compaction-gate rows) #4627 修复的核心:给 compaction gate 独立包身份);master 独立往主 entry 加了 claude-subagent-hook.ts。两边改同一数组 → 文本冲突。
  3. 影响范围与严重程度:只影响该 PR 的合并状态(被挡住无法合入 master),无运行时/行为影响。属分支管理阻塞,非代码缺陷。严重度:PR 完全无法合并。
  4. 怎么修复的:把 master merge 进 PR 分支(选 merge 不选 rebase——分支历史含多个 ci-fixes merge commit,merge 可避免 force-push)。唯一冲突按「保留双方意图」解:主 entry 取 master 版、去掉 dsh-compaction-gate.ts(守 PR 的 gate 独立包身份意图)、保留 claude-subagent-hook.ts(守 master 的独立新增)。本地 build + 372/372 定向测试 + typecheck 全绿后推送。
  5. 是否有回归问题:无。解法同时保住两边意图——gate 仍拿独立包身份(PR 核心修复),master 的 claude-subagent-hook.ts entry 保留。build 产出正确的 gate manifest(billion-context-dsh-gate@0.1.213)与 claude-subagent-hook.js bundle;372/372 定向测试通过。
  6. 是否破坏缓存:不涉及——纯 build-config 冲突消解,未触碰任何 cache/retry/cursor/去重逻辑。
  7. 是否改了设计方向:无。PR 的设计(gate 独立包身份)与 master 的设计(claude-subagent-hook 在主 entry)均保留,无架构转向。
  8. 是否引入了新的配置:无新 env/config/默认值。

判定:冲突已解决,PR 可干净合并进当前 master(merge-tree 验证通过),本地 build + 372/372 测试 + typecheck 全绿,已推送至 786e85ec52。CI 由远端把关(镜像缓存暂无 check,刚推送)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[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: 7e0147c52a.

What I found and did this run:

  1. The system's "dirty" state was stale. Live verification against GitHub (single fetch) showed mergeable: True, mergeable_state: behind — the PR was NOT actually in conflict; the conflict was already resolved in the prior run (head 786e85ec52). "Behind" just meant master had moved 17 commits ahead since that merge.
  2. Merged the latest master into the PR branch (the task asks to merge the target branch; this also clears the "behind" state). The 17 new master commits touch none of the PR's files (verified per-file), so the merge was conflict-free. New head 7e0147c52a.
  3. Verified all PR markers survived the merge: tsup.config.ts main entry keeps claude-subagent-hook.ts and drops dsh-compaction-gate.ts (gate stays in its own third defineConfig at line 108); package.json exports ./dsh-gate + ./dsh-compaction-gate both → ./dist/agent/dsh-gate/index.js; launcher.ts gate markers intact (DSH_GATE_BARE_ENTRY :3527, writeDshGateShimFiles :3571); the new tests/issue4627-dsh-loader-package-identity.test.ts present.
  4. Verified locally (node v22.23.2): npm run build green (gate manifest billion-context-dsh-gate@0.1.213, dist-import-annotations + dist-external OK); targeted tests 372/372 pass; npm run typecheck exit 0.
  5. Pushed 786e85ec52..7e0147c52a (clean, no force — remote head unchanged at fetch).
  6. Confirmed the PR is no longer behind: git merge-base --is-ancestor origin/master pr4631 = YES; git merge-tree --write-tree pr4631 origin/master exits clean. GitHub now reports base_sha = 243709bef2 (current master head), mergeable: True, mergeable_state: blocked.
  7. CI status (mirror cache, head 7e0147c52a): 0 failed, 12 pending. All completed static gates green — unused-exports ✅ (the inherited [PR] fix(ci): clear the two master-red gates in one branch — unused-exports (#4602) + the #3890 LIVE_FILES tripwire (#4604) #4606 red is gone), lane-guard ✅, version-guard ✅, pi-subagents-guard ✅, static-gates (ubuntu,24) ✅, mysql-contract ✅. The 11-shard test matrix + static-gates (windows,22) are in_progress. E2E lanes are skipped (gated). The blocked merge state is branch protection (required CI still running), not a conflict.

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):

  1. 是什么问题:系统报 PR [PR] fix: dsh web boot — give the compaction gate its own package identity (#4627) #4631 处于合并冲突(merge state dirty),但实测并非真冲突——上一 run 已解决冲突,本次只是 PR 落后 master(behind)。
  2. 什么原因导致的:系统「dirty」状态是 stale 的(早于上一 run 的 push);PR 真正状态是 mergeable: True + behind——master 在上一 run 合并后又前进了 17 个 commit(均不触碰本 PR 文件)。
  3. 影响范围与严重程度:仅 PR 合并状态层面(看起来 dirty、实际 behind),无运行时/行为影响。严重度:PR 因 stale 的 dirty 标记被误判阻塞。
  4. 怎么修复的:先 live 核实(GitHub 单取:mergeable True、非 dirty);再把最新 master merge 进 PR 分支(清掉 behind 状态,17 个新 commit 与 PR 文件零交集 → 无冲突);本地 build + 372/372 测试 + typecheck 全绿后推送。
  5. 是否有回归问题:无。merge 带入的 17 个 master commit 不触碰任何 PR 文件;PR 全部关键标记(tsup 三段配置 / package.json exports / launcher gate 函数 / 新测试)逐一核实完好;build + 372/372 + typecheck 全绿。
  6. 是否破坏缓存:不涉及——纯分支管理操作,未触碰任何 cache/retry/cursor/去重逻辑。
  7. 是否改了设计方向:无。
  8. 是否引入了新的配置:无。

判定:合并冲突已解决(上一 run 完成,本次 stale 标记已澄清);PR 已更新到最新 master(不再 behind),可干净合并;本地 build + 372/372 测试 + typecheck 全绿,已推送至 7e0147c52a;CI 运行中(0 failed、static gates 全绿、test 矩阵 in progress),blocked 状态为分支保护(CI 未完)而非冲突。本车道无需再动分支。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(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 (bili-native + bili-compaction-gate) on the SAME billion-context package (which declares dsh.client); dsh ≥ 0.2.0-rc.x's ClientModuleRegistry.reconcilePackage hard-fails on two active sources per client package, so bili dsh web / profile-bundle installs die. The fix gives the gate its own package identity — dist/agent/dsh-gate/{index.js,package.json} (name billion-context-dsh-gate, declares no dsh.client) — and re-points all three carriers at it (URL lane → nested file:// path; bare lane → sibling shim package; bundle layer → billion-context/dsh-gate). The old ./dsh-compaction-gate subpath stays a compat alias to the same nested file, so already-installed profile bundles keep resolving and now land on the gate-only identity. The build fails if the gate bundle/manifest is missing, so a tarball can't silently re-trigger #4627.

Tests. New tests/issue4627-dsh-loader-package-identity.test.ts replays dsh's nearest-package.json walk per row across all three carriers × both resolver semantics (literal walk-up AND CJS realpath) and asserts the invariant: two rows → distinct package names, gate row → billion-context-dsh-gate, exactly one row declaring dsh.client (= billion-context). It has teeth — regressing the gate back onto the billion-context package fails it. The three updated files only split the shared carrier-agreement constant per carrier (carriers now legitimately target different-but-equivalent gate packages); strictness is unchanged and negative cases were added (host shim must NOT carry ./dsh-compaction-gate; gate shim must have no dsh key).

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 rmSync+rebuild on success (old gate.js symlink + old export disappear with the dir) and return false leaving existing shims untouched on failure (keep.txt pinned). Build: third tsup config runs after the main clean:true with clean:false; the gate manifest is written by write-build-info.mjs after tsup. write-build-info.mjs goes display-only → fail-fast on a missing gate bundle (intentional tightening, disclosed in the PR). Request pipeline / session state / cache keys: untouched (pure install/boot surface).

Local verification (worktree @ 7e0147c, node v22.23.2). npm run build green (gate manifest billion-context-dsh-gate@0.1.213 written; old flat dist/agent/dsh-compaction-gate.js confirmed gone); the four touched test files 372/372 pass (4 new, 0 skipped); npm run check:dist-thin green (gate bundle import-probed in the packed tarball); npm run typecheck exit 0.

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). mergeable_state: behind is not a conflict (the branch already merged master per the CI lane).


八问(中文,供人工 reviewer)

  1. 是什么问题:v0.1.204([dsh] Disabling the plugin permanently bricks dsh session creation - the bundle patch inject gate has no fallback (0.1.199 / dsh 0.2.1-rc.2) #3662)起,dsh ≥0.2.0-rc.x 下 bili dsh web 与 profile-bundle 安装启动即死——两个 Loader 行(bili-native + bili-compaction-gate)同时挂在声明了 dsh.client 的 billion-context 包上,reconcilePackage 对「一个 client 包多个 active source」硬失败("1 required plugin did not activate")。
  2. 什么原因导致的:[dsh] Disabling the plugin permanently bricks dsh session creation - the bundle patch inject gate has no fallback (0.1.199 / dsh 0.2.1-rc.2) #3662 的 gate 分离把两行 Loader 都挂进同一个 billion-context 包,违反 dsh 0.2 新增的「每 client 包至多一个 active source」不变量。制造者是 bili 自己的发射侧,不是 dsh。
  3. 影响范围与严重程度:dsh ≥0.2.0-rc.x 的 web 客户端 / profile-bundle 用户完全无法启动(p1 可用性缺陷);有绕行(pin 旧版 + 关 auto-update)。
  4. 怎么修复的:给 gate 独立包身份(dist/agent/dsh-gate/{index.js,package.json},name=billion-context-dsh-gate,不声明 dsh.client),三个 carrier 分别指向它(URL lane 走嵌套 file:// 路径、bare lane 走兄弟 shim 包、bundle lane 走新 subpath);旧 subpath 保留为别名指向同一嵌套文件(存量 profile 升级窗口内仍可解析);构建期加硬门禁(gate bundle/manifest 缺失即 fail build)防复发。
  5. 是否有回归问题:未发现。逐路径:老 dsh(<0.2)三种 lane 加载同一份代码;shim writer 成功时重建、失败时不动既有状态(keep.txt 有测试钉住);唯一语义变化是 write-build-info.mjs 从永不失败变 fail-fast(有意收紧、PR 已披露)。
  6. 是否破坏缓存:不涉及——纯 install/boot 面,未触碰请求管道/会话/缓存键。
  7. 是否改了设计方向:无,仅 gate 产物的打包身份变化;[dsh] Disabling the plugin permanently bricks dsh session creation - the bundle patch inject gate has no fallback (0.1.199 / dsh 0.2.1-rc.2) #3662 的「gate 独立 always-on 入口」架构原样保留。
  8. 是否引入新配置:无(无 env/config/CLI 字段)。

判定:代码审核通过,建议合并。

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dsh p1 scope/wiring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dsh] bili dsh web fails to boot: "package billion-context resolves from multiple active Loader sources" (bili-native + bili-compaction-gate rows)

1 participant