You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refs #3160 (partial — stage 2 of the maintainer's staged plan; the equality gate is deliberately NOT in this PR, see "Deferred" below).
What
The dsh-lane self-heal paths all compare the on-disk copy's version against the target with ONE-WAY semver:
refreshDshProfileCopy (src/update.ts:1127) — if (!isVersionNewer(latest, currentVersion)) return
refreshDshDesktopCopy (src/update.ts:1172) — if (!isVersionNewer(targetVersion, diskVersion ?? "0.0.0")) return
staleDshProfileCopies (src/update.ts:1289) — only collects copies older than global
A copy dropped out-of-band at a fabricated higher version (the #3160 incident: a hand-made 1.2.9 beside a lockfile that still resolves 0.1.196) reads as "already newest" on every path, so the inner === targetVersion skip in refreshDshProfileBundles (src/dsh-channel.ts:490) is never reached and the profile wedges forever — silently, because readDiskVersion (src/update.ts:778) has no provenance.
This PR adds DETECTION ONLY — it never installs, writes, or spawns:
src/provenance.ts — per-profile findings across four rungs: copy-vs-lock, manifest-vs-lock, copy-vs-manifest (no lockfile), spec-above-registry (a spec whose base version is newer than the registry's latest cannot be a real resolution), plus build-divergence (same version from different build commits across profiles). Local pins (link:/file:) and declared-but-missing copies stay silent — both are legitimate states under the dsh plugin-market installs never auto-update: the refresh chain's only trigger is a global bili self-update #1196 install-lane contract.
src/cli.ts — one detached, fail-open audit at startup (after the auto-update block); a wedged copy can never delay or break startup, and the registry lookup happens only when at least one profile carries a registry-pinned copy.
src/doctor.ts — the same findings ride the dsh lane's existing warnings channel (alongside dshBundleShadowWarning); the freshness verdict is untouched, because a wedged copy keeps a legitimately "ok" verdict while the one-way gate skips it.
Why detection and not the gate
src/update.ts is load-bearing and human-gated: any change to the updater itself requires a no-op validation release first (AGENTS.md §5) — a broken updater bricks every future upgrade. This PR touches src/update.ts only through a read-only import (isVersionNewer), so it carries none of that risk and can land immediately. The equality gate — local != target and not a local pin -> converge with a loud warning — lands as the follow-up once the no-op release proves the existing upgrade path healthy.
Deferred (stage 1 of the plan)
The equality gate in src/update.ts (needs the no-op release first).
Web-UI banner surface: findings currently reach the log, bili doctor, and (via doctor) the advisory-style status paths; the dedicated banner rides the follow-up with the gate.
Pre-flight
npm run typecheck — clean.
Targeted suites green: tests/issue3160-dsh-profile-copy-provenance.test.ts (12/12 — includes the exact Profile 副本自愈可被本地高版本号永久卡死,且 out-of-band 副本无来源校验(#1196 变体) #3160 incident shape: 1.2.9 copy vs 0.1.196 lockfile, ^1.2.9 manifest, registry 0.1.197), tests/update-dsh-self-refresh.test.ts, tests/dsh-refresh.test.ts. (tests/doctor.test.ts cannot complete its teardown on this Windows host — a pre-existing esbuild temp-dir Access is denied that reproduces with the change stashed; all its assertions pass.)
npm run build — success; node dist/index.js --version = 0.1.197.
Rebased onto current master (4db1536) before push; full-suite verdict belongs to the CI test lanes on this head.
static-gates (windows, 22) 挂在 npm --prefix pi-subagents test 的 queued run renders once it enters running under maxConcurrent=1 (#2737)(delegate-widget-refresh.test.ts:198,duration 600ms 的时序断言)。同一个 pi-subagents 套件本地全绿(237/237),且另外 3 个 static-gates leg 通过——典型的 loaded-runner 时序 flake。同 run 里 hook e2e: an occupied stable port never crashes the host 也是已知端口争用 flake。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #3160 (partial — stage 2 of the maintainer's staged plan; the equality gate is deliberately NOT in this PR, see "Deferred" below).
What
The dsh-lane self-heal paths all compare the on-disk copy's version against the target with ONE-WAY semver:
refreshDshProfileCopy(src/update.ts:1127) —if (!isVersionNewer(latest, currentVersion)) returnrefreshDshDesktopCopy(src/update.ts:1172) —if (!isVersionNewer(targetVersion, diskVersion ?? "0.0.0")) returnstaleDshProfileCopies(src/update.ts:1289) — only collects copies older than globalA copy dropped out-of-band at a fabricated higher version (the #3160 incident: a hand-made
1.2.9beside a lockfile that still resolves0.1.196) reads as "already newest" on every path, so the inner=== targetVersionskip inrefreshDshProfileBundles(src/dsh-channel.ts:490) is never reached and the profile wedges forever — silently, becausereadDiskVersion(src/update.ts:778) has no provenance.This PR adds DETECTION ONLY — it never installs, writes, or spawns:
src/provenance.ts— per-profile findings across four rungs: copy-vs-lock, manifest-vs-lock, copy-vs-manifest (no lockfile), spec-above-registry (a spec whose base version is newer than the registry's latest cannot be a real resolution), plus build-divergence (same version from different build commits across profiles). Local pins (link:/file:) and declared-but-missing copies stay silent — both are legitimate states under the dsh plugin-market installs never auto-update: the refresh chain's only trigger is a global bili self-update #1196 install-lane contract.src/cli.ts— one detached, fail-open audit at startup (after the auto-update block); a wedged copy can never delay or break startup, and the registry lookup happens only when at least one profile carries a registry-pinned copy.src/doctor.ts— the same findings ride the dsh lane's existingwarningschannel (alongsidedshBundleShadowWarning); the freshness verdict is untouched, because a wedged copy keeps a legitimately "ok" verdict while the one-way gate skips it.Why detection and not the gate
src/update.tsis load-bearing and human-gated: any change to the updater itself requires a no-op validation release first (AGENTS.md §5) — a broken updater bricks every future upgrade. This PR touchessrc/update.tsonly through a read-only import (isVersionNewer), so it carries none of that risk and can land immediately. The equality gate — local != target and not a local pin -> converge with a loud warning — lands as the follow-up once the no-op release proves the existing upgrade path healthy.Deferred (stage 1 of the plan)
src/update.ts(needs the no-op release first).bili doctor, and (via doctor) the advisory-style status paths; the dedicated banner rides the follow-up with the gate.Pre-flight
npm run typecheck— clean.tests/issue3160-dsh-profile-copy-provenance.test.ts(12/12 — includes the exact Profile 副本自愈可被本地高版本号永久卡死,且 out-of-band 副本无来源校验(#1196 变体) #3160 incident shape:1.2.9copy vs0.1.196lockfile,^1.2.9manifest, registry0.1.197),tests/update-dsh-self-refresh.test.ts,tests/dsh-refresh.test.ts. (tests/doctor.test.tscannot complete its teardown on this Windows host — a pre-existing esbuild temp-dirAccess is deniedthat reproduces with the change stashed; all its assertions pass.)npm run build— success;node dist/index.js --version= 0.1.197.testlanes on this head.