Repository navigation
[PR] fix: converge inflated out-of-band dsh profile/desktop copies instead of freezing (#3160) - #3164
ranxianglei wants to merge 8 commits into
Conversation
… of freezing (#3160) A hand-placed copy whose version is inflated above the registry (e.g. 1.2.9 vs registry 0.1.197) froze the #1196 self-heal forever: every gate compared one-directionally (local < authority => converge; local >= authority => "up to date", skip) and none carried a provenance check. - refreshDshDesktopCopy: skip only when exactly in step; an ahead/out-of-band registry-form copy is loudly warned and converged back through the verified registry tarball (the installer also re-syncs the profile manifest spec, #2894). - refreshDshProfileCopy: same divergence classification; a locally-pinned running copy stays a deliberate dev pin (info, siblings still refreshed), a registry-form ahead copy is warned and converged back through dsh's plugin channel. - bili doctor: new dshOutOfBandCopyWarning advisory surfaces any registry-form profile copy ahead of the registry latest (it reads as "ok" under laneVerdict); verdict unchanged, mirroring dshBundleShadowWarning. Regression tests reproduce the frozen inflated-copy case and assert it now converges + warns (profile, desktop, and doctor lanes). Fixes #3160
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3803-pr.3164.504e95eThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3164.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…ia the verified-tarball lane, not the plugin channel) (#3164 review)
(ai: vllm-qwen/qwen3.8-27b) 独立审核完成:在 PR head 上逐段通读了完整 diff,并独立核对了相关既有代码路径(gate 逻辑、收敛通道、doctor verdict、backoff),未复用 issue 侧结论。Review 发现 3 个小问题,已直接修在分支上(3 个带
定向验证:三个相关测试文件本地 42/42 通过,typecheck 干净;全量回归看远端 CI( 结构化八问
合并前置条件(PR 正文已列,重申):
判定:可合(待 |
(ai: vllm-qwen/qwen3.8-27b) CI 最终状态(head 结合上一条八问结论:判定维持「可合」,前置条件不变——人工 review(§7.4, |
|
以 #3160 issue 作者的身份确认:语义翻转( 一、对语义翻转的确认host-managed lane 该守的不变量是「盘上版本 == 权威目标版本」,不是「盘上 ≤ 权威就安全」。registry-form 副本高于 latest 在物理上不可能是一次真实解析——registry 上不存在那个版本的产物——所以它只能是 out-of-band 放置。旧行为把它当「已最新」静默跳过,等于把「真·更新的 prerelease」和「手工伪造的高版本号」混为一谈,这正是 #3160 的病灶。把 ahead 从「静默 no-op」改成「loud warn + 经 integrity-verified 通道收敛回」是把 #1196 的自愈语义补完整(原来只覆盖「落后」这一半),不是行为退化。 二、披露的边界全部认可
收敛只走 integrity-verified 通道(pnpm 从 registry 解析 / verified registry tarball),单写者安全,这点也让翻转可接受。 三、与 stage 2 检测 PR(#3169)的衔接#3169(检测 only)与本 PR 的 doctor advisory 有一处重叠:本 PR 的 建议这样分工,避免 doctor 重复告警:
四、CI 备注本 PR 当前唯一红灯 五、门禁认可「排在 no-op release 之后合入」的排序。 |
…to-downgrade a published build (#3160 owner-feedback)
|
勘误:本条上面确认评论里「mirrors the bundled-snapshot-must-not-outrank-live-registry KDD (#2439)」的引用是错的——#2439 是 Windows PowerShell 黑框 issue,与版本不变量无关,抱歉。 正确的依据是仓内已文档化的同向不变量: |
(ai: vllm-qwen/qwen3.8-27b) 逐条回复: 1. 勘误——已核实:#2439 确实是「Windows: 重建 combined-ca.pem 时闪出 PowerShell 黑框」,与版本不变量无关,更正成立。一点澄清:本线程我发的两条 review 评论均未引用 #2439(第 7 问只以文字表述了「bundled snapshot 不得压过 live registry」原则、未给编号),被更正的引用应来自线程里的其他评论。你给出的两个正确依据我都查证过、成立: 2. 语义翻转确认——收到。作为 #3160 作者,你的确认是这个产品决策的重要背书;但按仓库规则最终拍板仍在 owner(@ranxianglei):人工 review(§7.4, 3. 与 #3169 的衔接——注意:#3169 当前状态是 closed(不是 open)。你截断的「本 PR 合入后我把 #3169 rebase 并去…」计划以它仍开放为前提,请先核对现状与意图——是已被有意关闭(被本 PR 取代 / 待重开)?分工建议本身我认同方向:本 PR 的 doctor 告警是只读、离线(覆盖 dormant profiles),若 #3169 的 spec-above-registry rung 以后回归,「doctor 告警归本 PR、#3169 保留其余 rung」可避免同机双告警。具体怎么拆由你与 owner 定夺,我不会代为改动 #3169。 |
|
确认该分支已过时(mergeable_state=behind),并做了两件核实,供 refresh 时参考: 一、落后幅度与 CI 现状
二、两个此前登记的 master 级失败不会复活我此前在本 PR 与 #3160 评论区提过「rebase 后会撞两个既有失败」——这两个失败的修复已经落在本分支里了:
两者均早于本分支 01:44 的 master 合入,已在分支内(这也是本轮 test lanes 全绿的原因)。两个 issue 均已 closed/completed。 三、本地试合结果:零冲突我把当前 建议merge master 或 rebase 刷新一下分支即可,刷新后按原计划走 §5 no-op 验证 release 与 §7.4 人工 review。语义侧我作为 issue 作者已在 #3160 确认(含 packument 判据这版),无进一步意见,不催 merge。 |
(ai: vllm-qwen/qwen3.8-27b) 你列的事实我都独立核实过,然后按 §7.2(合并前对齐当前 master)刷新了分支。逐条: 核实结果
已完成的刷新
顺带 review 了 当前状态: |
(ai: vllm-qwen/qwen3.8-27b) 刷新后的 head |
…ly (#3160 owner-feedback) Being absent from the public packument is not safe proof of tampering: a user's own maintained build is also absent. An ahead registry-form copy is now surfaced loudly (self-heal log + bili doctor) and left untouched instead of being converged back; local pins still fall through so their siblings refresh. Auto-quarantine of provably-unexplained copies moves to #3224.
The #3224 author's in-thread decision (floor 5): the desktop profile is the one dsh lane bili writes IN PLACE — after every self-update its manifest spec is synced to the new version while the lockfile stays stale by design until dsh's in-app manager reconciles it (#2894), so post-update manifest/lock/copy disagreement there is expected and locally indistinguishable from a true wedge. Detecting it would mean a permanent false positive on every machine with an updated desktop profile, with a remediation command the CLI refuses (--profile desktop, #1575). The ahead face of that lane rides #3164's registry advisory instead. One name-based guard in dshProfileCopyFindings covers both detection exits (startup audit + doctor lane); no path guessing. One new test pins the skip: identical wedge shape on desktop + web, only web reported.
|
(ai: zhipuai-lb/glm-5.3) 陈旧票清理(第三批动作①):目标 issue #3160 已关。为避免重复劳动关闭本 PR;如判断有误请直接 reopen 并留言。 |
What & why
#3160: a dsh profile/desktop copy whose version was hand-inflated above the registry (real case:
package.jsonedited to1.2.9while registry latest is0.1.197) froze the #1196 self-heal forever — every self-heal gate compared one-directionally (local < authority ⇒ converge,local ≥ authority ⇒ "up to date", skip), so an inflated copy read as "newer" and was never touched; and nothing carried a provenance check, so the copy loaded silently with no warning.This makes host-managed dsh lanes treat the registry as authoritative for the equality of the installed copy (same principle as KDD "the bundled registry snapshot must not outrank the live registry") instead of trusting any on-disk version ≥ the registry. An ahead copy is no longer read as "up to date" — it is surfaced loudly (self-heal log +
bili doctor) so it can never again be a silent, permanent wedge.Owner-feedback refinements (this head): two rounds tightened when bili may act on an ahead copy:
fetchPublishedVersions).Changes
fetchPublishedVersions(src/update.ts) — GETs the npm packument and returns the set of all published versions;undefinedon any failure / unexpected shape. Used here purely for diagnostic wording (telling the operator which situation they're seeing: published-other-tag vs unverifiable vs absent); it does not gate any downgrade.refreshDshDesktopCopy(src/update.ts) — skip only when exactly in step. Any ahead registry-form desktop copy → loudwarn(naming the situation) + left untouched; no auto-downgrade, no tarball reinstall. A locally-pinned copy falls through so its siblings refresh.refreshDshProfileCopy(src/update.ts) — same. A locally-pinned running copy stays a deliberate dev pin (info log; sibling registry-pinned profiles still refreshed via dsh's plugin channel). A registry-form ahead copy → loudwarn+ left untouched.bili doctor(src/doctor.ts) —dshOutOfBandCopyWarningadvisory surfaces any registry-form profile copy ahead of the tracked latest, worded to name both possibilities (deliberate other-tag/local build vs hand-placed/tampered) and point at the fix (pin vialink:/file:or a private registry, or remove it); verdict unchanged, mirroringdshBundleShadowWarning.Behavior change (disclosed)
local > registry-latest, version absent from registry (hand-placed fake)warn+ left untouched (never auto-downgraded)local > registry-latest, version present in registry (other-tag build) OR packument unverifiablewarn+ left untouched (never auto-downgraded)local == registrylocal < registrylink:/file:/git+pinNet effect: the #3160 wedge can no longer be silent or read as "up to date" — it always yields a loud warning plus a
bili doctorfinding. What this PR deliberately does not do is auto-replace it: replacing an ahead copy on the strength of "not in the public registry" would clobber a legitimate self-maintained build, so that action waits for #3224's stronger evidence. A user protecting their own higher version should pin it (link:/file:or a private registry) — pinned copies are never touched.Scope notes
staleDshProfileCopies/convergeDshProfileBundles, dsh boot crash on mixed copies: global >=0.1.176 bundle yml (bare name) + profile copy <=0.1.175 (exports["."]=CLI) — window opened by manual npm i -g, self-heal blocked by the crash itself #1803) deliberately unchanged: its mandate is the older-copy boot-crash. Ahead-copies are surfaced by the self-heal gates (from the copy's own process) plus the doctor advisory (offline, covering dormant profiles too).src/update.ts(load-bearing infra — human review required, AGENTS.md §7.4). Shipping additionally requires the §5 no-op validation release first; this PR is ready to review now and sequences behind that release.Closes #3160
Related: #3224 (auto-quarantine of provably-unexplained copies — the follow-up that safely restores automatic replacement)