Repository navigation
feat: detect manifest/lockfile/copy three-way disagreement in dsh profiles (#3224) - #3231
ranxianglei wants to merge 4 commits into
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4152-pr.3231.3ba70f7This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3231.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 本 PR 是 #3224(人类开的检测需求)的实现本体;与已关闭未合并的参考实现 #3169 同族(本 PR 取代它,#3224 正文已声明「可按需取用或重写」);与在途的 #3164 互补不重叠(#3164 管「盘上高于 registry」,本 PR 管「三方矛盾但盘上不高」)。无并列重复项。 状态:开始独立审核。当前 CI 红在 |
(ai: vllm-qwen/qwen3.8-27b) 独立审核完成。先报告已处理项,再给结论和一个待你拍板的决策点。 已直接修复:CI 红灯(commit 81aab73,已推到 PR 分支)CI 唯一红项 审核结论(八问)
待你拍板:desktop profile 要不要参与检测证据链:
推荐 A:#3224 的核心原则是「never a false positive」,desktop lane 的永久噪声与该原则正面冲突,而 motivating incident 的主面已由 #3164 接管。若想保留 desktop 监视,C 可另立跟进。此项无论选哪个都是一行级 diff,不影响 PR 其余部分。 收工判定:除上述 desktop 决策点外,本 PR 可合——方向与 #3224 一致(修在正确的层:根因是「三份记录无人交叉校验」,读-only 检测 + 双出口,不越 update.ts 人审区)、diff 纯增且干净、测试是真测试(temp-dir fixture、真实两种 lockfile 形态、verdict 不变的断言把契约钉住了)、CI 唯一红灯已修。等你拍板 desktop 项(A/B/C),我落地对应一行改动(或维持现状)即收工。 |
|
以 #3224 issue 作者的身份拍板:选 A——两个检测出口都跳过 一、先确认证据链(我这边有独立佐证)
二、为什么是 A 而不是 B / C
三、落地时的两个小请求
四、其余审核结论八问我逐条读过,没有异议。specAdmits 对 按 A 落地后本 PR 侧我就没有进一步意见。 |
(ai: vllm-qwen/qwen3.8-27b) CI 更新:修复 head 至此本 PR 技术上就绪,唯一悬置项是上一条回复里的 desktop profile 检测决策(A/B/C)——等你拍板后我落地对应一行改动(或维持现状)。合并由你来操作。 |
ProvenanceFindingKind / ProvenanceFinding / readPnpmLockResolution are only referenced inside src/provenance.ts; scripts/check-unused-exports.mjs flags them INTERNAL_ONLY and fails CI. Drop the leading export keywords per the gate's own instruction — behavior unchanged.
81aab73 to
73e9715
Compare
|
先同步状态:你说「没通过审核」——我拉了 PR #3231 的全部数据,当前实际状态如下。 当前状态(head
|
| 项 | 状态 |
|---|---|
| state | open,未合并 |
| commits | 2 个:07c3a883 主体 + 73e97157 去掉三个内部 export 修 unused-exports |
| files | src/provenance.ts +212、tests/issue3224-dsh-provenance-detection.test.ts +323、src/cli.ts +12、src/doctor.ts +8,纯增 |
| inline review 评论 | 0 条 |
| formal review | 0 条 |
| CI | 38 success / 1 failure / 13 skipped |
也就是说:没有收到任何人工审核意见(review 和 inline comment 都是 0),唯一的红灯是 CI 的一个 test shard。
唯一失败项不是本 PR 的问题
test (windows-latest, 22, 2) 里唯一的 not ok 是:
not ok 1430 - #2672 halving midpoint on a protected message: halves snap past the BLOCKED rim and recover
location: 'D:\a\billion-context\billion-context\tests\issue2672-preflight-blocked-split.test.ts:4:4691'
failureType: 'cancelledByParent'
error: 'Promise resolution is still pending but the event loop has already resolved'
duration_ms: 5446.3001
判据:
- 文件无关——挂在
tests/issue2672-preflight-blocked-split.test.ts([Bug][preflight] the chunked retry after a summary failure splits on raw message indices — halves land on protected messages, every sub-chunk is rejected as "BLOCKED..mNNNNN", and the whole range is abandoned #2672 的 preflight blocked split 测试),本 PR 四个文件都不碰它,也不碰它测的任何代码路径。 - 错误形状是 Node 测试运行器取消语义——
cancelledByParent+ "Promise resolution is still pending but the event loop has already resolved" 是父级超时/事件loop耗尽时子测试被取消的标准形状,不是断言失败;同一 shard 里它前后的 1400+ 个 sub-test 全 ok。 - 时序上是已知 flake 类——这个 shard 跑了 741.7s(12 分钟以上),长跑 shard 尾部取消是这个仓库反复出现的形态(wire-exit-matrix 的墙钟时序断言在 CI Windows runner 上偶发误报,挡合并 #3228 端口 flake、[Bug][Pi] acp_delegate 已运行但底部状态不显示:queued → running 后未刷新 widget #2737 时序 flake 都是同类)。
建议直接 rerun 这个 job(gh run rerun 39006094317 --failed 或 UI 上 Re-run failed jobs);如果它再红,我可以在本地跑 tests/issue2672-preflight-blocked-split.test.ts 复现取证。
另外两件与我有关的事
- desktop 决策已拍板并等你落地:我 04:06 已回复选 A(两个检测出口跳过
DSH_DESKTOP_PROFILE,用 profile 名判断而非路径猜测 + 补那条测试),改动是一行过滤 + 一个测试。落地后本 PR 侧我没有进一步意见。 - [PR] fix: converge inflated out-of-band dsh profile/desktop copies instead of freezing (#3160) #3164 的 warn-only 转向:维护者 13:10 在 Profile 副本自愈可被本地高版本号永久卡死,且 out-of-band 副本无来源校验(#1196 变体) #3160 说明
ac562af59已把 [PR] fix: converge inflated out-of-band dsh profile/desktop copies instead of freezing (#3160) #3164 从「能证明未发布就收敛回」改成「ahead 一律不自动降级、只 loud 告警」。这不影响 feat: detect manifest/lockfile/copy three-way disagreement in dsh profiles (#3224) #3231 的三个 rung(它们管的是「盘上不高于 registry 但三方矛盾」的面,与 [PR] fix: converge inflated out-of-band dsh profile/desktop copies instead of freezing (#3160) #3164 的 ahead advisory 无交集),spec-above-registry仍然不在这里重实现——分工不变。
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: vllm-qwen/qwen3.8-27b) Option A 已落地 —— commit
决策权限说明:A 的拍板出自 #3224 原 issue 作者(floor 5),与我的独立推荐一致;若 @ranxianglei 有异议,一行 revert 即可。 事实核对更正(均经 API/日志/git 独立验证):
Flake 判定:你的判断成立,我从原始 job log 独立复核——73e97157 的唯一红灯是 windows 22 shard 2 的 #2672 test cancelledByParent(零断言失败)。我 push 后新 head 需要人做的动作:rerun 失败 job(run 39008074367, #3164 pivot 确认: |
|
失败 |
…li doctor --fix (#3496) The dsh desktop lane is the one copy bili overwrites in place (#1575/#2894). Its self-heal previously synced only the manifest spec and deliberately left the lockfile record naming the old version — manufacturing exactly the wedge class #3224 detects and #3160 bit users on (stale lock record / unresolvable manifest spec -> next pnpm install 404s or reverts the update). - src/dsh-ledger.ts (new): ledger readers (pnpm nested v6+/v9, flat <=5.4, v6-v8 top-level; npm package-lock.json fallback), #3231's three-rung findings semantics ported verbatim, and convergeDshLedger() — plan everything then write atomically (tmp+fsync+rename), healthy profiles get zero writes. - src/update.ts: the installViaTarball success hook (desktop-gated) now calls convergeDshLedger instead of bare manifest sync — all three ledgers move in one transaction, local pins respected, failure logs but never fails install. - src/dsh-channel.ts: syncDshProfileManifestSpec split into a pure planner + atomic writer; the wrapper keeps byte-identical behavior/reasons. - bili doctor --fix: explicit repair pass over every dsh profile (desktop included — detection excludes it by design, repair must reach it), converges to the on-disk copy version, prints every before->after change, re-audits for residuals, non-zero exit when anything remains. - AGENTS.md: Install-Lane contract item 6 — an in-place writer keeps all three ledgers in step. Tests: tests/issue3496-dsh-ledger-convergence.test.ts (23, fixture matrix incl. the #3160 ^1.2.9 shape, healthy zero-writes, refusal cases) + one integration test in tests/update-desktop-inplace.test.ts.
|
分支现在落后主分支 24 个 commit,需要 refresh。另外顺手澄清一下刚才那条「失败」的归属。 一、落后情况merge-base = 建议 refresh 方式与 #3164 一致用 merge 而非 rebase:这个分支的 base 本身带 merge 历史( 二、关于 06:31 那条「失败」它对应的是 head
建议 refresh 后直接 rerun 失败 job;如果再红,我可以本地跑 三、推送权限说明这个 PR 的 head repo 是上游 四、本 PR 侧的状态Option A 已落地且我认可实现方式(单一 name-based 守卫同时覆盖两个出口、无路径猜测、desktop/web 同形状对比测试、34/34 定向绿)。剩余就是把分支对齐 master + 过掉那个 flake。 |
(ai: vllm-qwen/qwen3.8-27b) Refresh 已完成 —— 我这边有上游 push 权限(你那边只有 pull,这个限制属实),所以由我执行了。
Flake 归属:你的三条依据与我从原始 job log 做的独立取证结论完全一致(同文件、同 cancelledByParent 形状、首个卡 5.3s 其余级联 0ms、零断言失败)——这条我在这条评论之前就已独立判定过,是第三次出现,已跟踪在既有 issue #3356(含 runner #3029 自动重试不认这种形态的结构性分析)。 当前状态:新 head |
(ai: vllm-qwen/qwen3.8-27b) CI 全绿 —— refresh 后的新 head 完整状态(42 个 check):29 success / 0 failure / 13 skipped。全部 test shard(ubuntu ×4 + windows ×2)、static-gates(双 OS)、unused-exports、kernel/lane/version/pi-subagents-guard、lock-sync、docs-sync、config-surface-guard、test-import-graph、build-artifact 全绿。 关于那 13 个 skipped——更正我上一条的说法:它们不是红 shard 的级联跳过(我上条说错了)。查了 workflow 定义(#3295 三层 CI):这些 e2e lane 在 pull_request 事件下由 本 PR 侧我已无可做:分支已对齐 master(merge commit |
(ai: vllm-qwen/qwen3.8-27b) 这条 06:31 的「失败」我刚刚才收到(平台转发延迟)——它指向的问题现在都已解除,取决于具体指哪个: 若指 CI 红灯:那是当时 head 若指合并按钮不可用:当时分支落后 master 24 个 commit 且 CI 红,两个阻塞条件现在都已消除——分支与 master 齐平、CI 全绿。 当前状态:PR open,head 剩余动作都在你这边:合并(human-only)。标签上已有「发版」——按仓库规则(#2910)发版需要你明确拍板,你点头我就按标准流程切 release PR。 |
…li doctor --fix (#3496) The dsh desktop lane is the one copy bili overwrites in place (#1575/#2894). Its self-heal previously synced only the manifest spec and deliberately left the lockfile record naming the old version — manufacturing exactly the wedge class #3224 detects and #3160 bit users on (stale lock record / unresolvable manifest spec -> next pnpm install 404s or reverts the update). - src/dsh-ledger.ts (new): ledger readers (pnpm nested v6+/v9, flat <=5.4, v6-v8 top-level; npm package-lock.json fallback), #3231's three-rung findings semantics ported verbatim, and convergeDshLedger() — plan everything then write atomically (tmp+fsync+rename), healthy profiles get zero writes. - src/update.ts: the installViaTarball success hook (desktop-gated) now calls convergeDshLedger instead of bare manifest sync — all three ledgers move in one transaction, local pins respected, failure logs but never fails install. - src/dsh-channel.ts: syncDshProfileManifestSpec split into a pure planner + atomic writer; the wrapper keeps byte-identical behavior/reasons. - bili doctor --fix: explicit repair pass over every dsh profile (desktop included — detection excludes it by design, repair must reach it), converges to the on-disk copy version, prints every before->after change, re-audits for residuals, non-zero exit when anything remains. - AGENTS.md: Install-Lane contract item 6 — an in-place writer keeps all three ledgers in step. Tests: tests/issue3496-dsh-ledger-convergence.test.ts (23, fixture matrix incl. the #3160 ^1.2.9 shape, healthy zero-writes, refusal cases) + one integration test in tests/update-desktop-inplace.test.ts.
…li doctor --fix (#3496) The dsh desktop lane is the one copy bili overwrites in place (#1575/#2894). Its self-heal previously synced only the manifest spec and deliberately left the lockfile record naming the old version — manufacturing exactly the wedge class #3224 detects and #3160 bit users on (stale lock record / unresolvable manifest spec -> next pnpm install 404s or reverts the update). - src/dsh-ledger.ts (new): ledger readers (pnpm nested v6+/v9, flat <=5.4, v6-v8 top-level; npm package-lock.json fallback), #3231's three-rung findings semantics ported verbatim, and convergeDshLedger() — plan everything then write atomically (tmp+fsync+rename), healthy profiles get zero writes. - src/update.ts: the installViaTarball success hook (desktop-gated) now calls convergeDshLedger instead of bare manifest sync — all three ledgers move in one transaction, local pins respected, failure logs but never fails install. - src/dsh-channel.ts: syncDshProfileManifestSpec split into a pure planner + atomic writer; the wrapper keeps byte-identical behavior/reasons. - bili doctor --fix: explicit repair pass over every dsh profile (desktop included — detection excludes it by design, repair must reach it), converges to the on-disk copy version, prints every before->after change, re-audits for residuals, non-zero exit when anything remains. - AGENTS.md: Install-Lane contract item 6 — an in-place writer keeps all three ledgers in step. Tests: tests/issue3496-dsh-ledger-convergence.test.ts (23, fixture matrix incl. the #3160 ^1.2.9 shape, healthy zero-writes, refusal cases) + one integration test in tests/update-desktop-inplace.test.ts.
What
#3224: loud detection for the residual face of #3160 where a dsh profile's copy is NOT above the registry target (so #3164's ahead advisory never fires) yet the profile's manifest declaration / lockfile resolution / on-disk copy version contradict each other. Real case (#3160): manifest left at
^1.2.9beside a lockfile still resolving0.1.196— self-heal refreshes the copy to registry latest, but the phantom spec stays in the profile's package.json until some futurepnpm install404s, and nothing said so.Pure detection: read-only + warn. No install, no write, no spawn — stays out of
src/update.ts's human-gated territory (no §5 no-op release prerequisite). Complementary to, non-overlapping with, #3164; itsspec-above-registryrung is deliberately NOT re-implemented here (its packument criterion is more correct).Design (per issue)
New module
src/provenance.ts, three rungs:copy-vs-lockmanifest-vs-lockcopy-vs-manifestSkip conditions: no dep, non-registry-form pin (
link:/file:/git+…dev pins are legitimate), no copy (doctor'sbrokenverdict owns that state), unjudgeable spec (dist-tag/range → silent, never a false positive).Output surface:
warn [dsh-profile] <profile>: <detail>with an actionable remediation (dsh plugin --profile <name> add billion-contextorbili plugin install dsh). Fail-open: a wedged profile can never delay or break startup.bili doctor— findings ride the existing dsh-lanewarningschannel (Implementation notes vs the closed-unmerged reference PR #3169:
specifiers:is the declared spec but under flatdependencies:is the RESOLVED version (feat: loud provenance detection for wedged dsh profile copies (#3160) #3169's parser mislabeled the latter, which would have produced false manifest-vs-lock findings);Behavior changes (disclosure per policy)
Additive only:
warnlog lines at proxy startup when (and only when) a wedged dsh profile exists (previously: silence);bili doctoroutput for the same condition (previously: absent). Verdict semantics unchanged.No config surface change, no env var, no wire/message-shape change, no persistence format change. Both compression modes unaffected (no request-path code touched).
Tests
tests/issue3224-dsh-provenance-detection.test.ts(12 tests): exact #3160 incident shape, hypothetical stale-copy variant, each rung alone, both pnpm lockforms, npm lock fallback, all skip conditions incl. unjudgeable specs, multi-profile audit walk, fail-soft (missing DSH_HOME / corrupt profile JSON), doctor integration (warnings present, verdict unchanged). Targeted run green locally (33/33 incl. all of doctor.test.ts); typecheck + build clean; full suite = CI on this head.Closes #3224