Repository navigation
[PR] fix(update): respect the dsh desktop profile's pnpm minimumReleaseAge in the in-place auto-refresh - #7148
ranxianglei wants to merge 3 commits into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.10944-pr.7148.50efe26This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr7148.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) Re-verified live state first — the reported failure is already fixed; no new work needed this run. The Verified the fix is sound:
This run: verification only, no pushes. If a test lane goes red on 结构化八问(中文)
结论:事件报告的红项已由上一轮运行修复并推送为最终 head(无 ci-held 标记,正在跑全量 CI);本次运行仅核实,未推送。等 test 车道结果即可。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 open+closed 按 Review verdict: direction correct, pnpm semantics faithful (verified against pnpm source, not just docs), mergeable once the CI test shards go green. ① 原 issue(方向) — #7139: the dsh desktop profile is a pnpm-managed project, and ② 回归审查(既有行为) — the no-profile / up-to-date / backoff-cooldown early returns in ③ 代码审查 — pnpm fidelity, source-verified:
④ 测试有效性 — teeth confirmed: byte-identical copy/manifest/lockfile assertions on defer, zero-traffic assertions (fetch stub that rejects), strike counts read from disk, unique version per gate test (in-process memo discipline), hermetic policy env so no machine pnpm policy leaks into the 3 pre-existing tests. Gate discipline #3617: both directions asserted — triggers when it should (immature → defer) and does NOT when it should not (no-policy / excluded / mature → proceed). ⑤ diff 整洁度 — clean: every line serves the PR's purpose; the two follow-up commits are each a single concern (export fix; null-exclude semantics + tests). CI (live): on §7.4: touches 八问(中文):
判定:可合 —— 等 CI 测试分片转绿(本地 44d5e5d 上 43/43 + 全部静态 gate 干净)。按 §7.4(src/update.ts 属 load-bearing + 新增模块),需人工合并。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Status follow-up (full review is the previous comment, floor 6). What is done:
What is verified (local, on final head What remains: CI on Risk: low — every static gate passed on the previous head, the delta since is a 1-line parser semantics fix + tests, and the affected suites are green locally. If any test shard goes red, it is a fresh event for the next wake. Verdict unchanged: 可合 once CI green; human merge required (§7.4 — src/update.ts is load-bearing + new module). |
44d5e5d to
59d5660
Compare
(ai: vllm-qwen/qwen3.8-27b) Merge conflict resolved — branch rebased onto current master and force-pushed. What I did this run:
No content changes beyond the CHANGELOG conflict resolution; the PR's code and tests are byte-identical to what was already reviewed. 结构化八问(中文)
结论:冲突已解,新 head |
(ai: vllm-qwen/qwen3.8-27b) Stale event — the conflict was already resolved by the previous run; verified live, no work needed. Live verification this run:
No pushes, no changes. Waiting on the remaining test lanes. 结构化八问(中文)
结论:冲突已解(上一轮完成),本轮仅核实;等剩余 test 车道跑完即可。 |
… in the in-place auto-refresh (#7139) The dsh desktop profile is a pnpm-managed project whose host can pin a package-maturity policy (minimumReleaseAge + minimumReleaseAgeExclude). The desktop in-place refresh (refreshDshDesktopCopy) installs the selected release's tarball directly and converges the profile ledger, bypassing pnpm's resolver — so a fresh release could land before its maturity window elapsed, leaving the manifest requesting a version the lockfile cannot resolve and breaking every pnpm operation on the profile until it matured. Add a maturity gate (new src/release-maturity.ts) on the auto-refresh path: - resolve the profile's effective pnpm policy with pnpm's own precedence (env pnpm_config_* > env npm_config_* > project pnpm-workspace.yaml > project .npmrc > user ~/.npmrc > global config.yaml > $PREFIX/etc/npmrc, per-key first definition wins; a null file value is 'not provided' and does not shadow a lower-precedence positive value); - match minimumReleaseAgeExclude with pnpm's version-policy grammar (bare/wildcard name = whole package, name@v1 || v2 = exact union, * / ? name globs); - read the target release's publish time from the registry packument's time map (fetched at most once per version; cached under cacheDir(), in-process memo as fallback); - verdicts: no-policy / excluded / mature -> proceed; immature -> defer without a strike (it matures on its own); undatable policy or publish time -> fail closed (defer + strike, the host policy is never bypassed or silently excluded). The advisory/panel install path (forceInstallVersion) is out of scope: it targets already-mature older versions. No new bili config keys — the gate reads the host's pnpm config. Regression tests: tests/release-maturity.test.ts (19: policy precedence, source forms, malformed values fail closed, exclude grammar, gate verdicts, time cache) and 7 new cases in tests/update-desktop-inplace.test.ts (immature defers with copy/manifest/lockfile byte-identical, excluded proceeds, other-version exclude does not lift the gate, mature proceeds, no-time / network-failure / malformed-policy fail closed).
The verdict type is only consumed through the inferred return type of checkReleaseMaturity; nothing imports it, so the export is dead surface.
…list pnpm treats a null list value as unset (serde None), so a bare 'minimumReleaseAgeExclude:' with no items must fall through to the next source — the parser modeled it as an empty string, which shadowed a lower-precedence exclude list (contradicting the module's own documented contract: null/empty = 'not provided'). An explicit empty list '[]' stays 'provided' and clears the excludes. 4 tests: 2 regression (fail on the old code), 2 pinning the '[]' semantics (the gate must still apply — the #7139 breakage direction).
59d5660 to
9b68c56
Compare
(ai: vllm-qwen/qwen3.8-27b) Conflict re-resolved — master advanced again since the last rebase, so this one was real. Branch rebased onto current master and force-pushed. What I did this run:
No content changes beyond the CHANGELOG conflict resolution; the PR's code and tests are byte-identical to what was already reviewed. 结构化八问(中文)
结论:冲突已解,新 head |
Closes #7139
What this fixes
The dsh desktop profile is a pnpm-managed project whose host can pin a package-maturity policy (
minimumReleaseAge+minimumReleaseAgeExclude, e.g. the strict 1440-minute window in the report). The desktop in-place refresh (refreshDshDesktopCopy) installs the selected release's tarball directly and converges the profile ledger (manifest spec + lockfile specifier/version), bypassing pnpm's resolver — so a fresh release could land in the profile before its maturity window elapsed. The manifest then requests a version the lockfile's store sections cannot resolve, and every subsequent pnpm operation on the profile (even for unrelated packages) fails withERR_PNPM_LOCKFILE_MISSING_DEPENDENCY/ERR_PNPM_RESOLUTION_POLICY_VIOLATIONS_UNHANDLEDuntil the release matures.This is distinct from #7125 / #7137 (post-convergence lockfile store sections): even with that repair, the direct installer can still pick a release the host's policy does not yet allow.
How
A maturity gate on the auto-refresh path (new
src/release-maturity.ts, checked insiderefreshDshDesktopCopyafter the backoff check, before any registry traffic for the tarball):pnpm_config_*> envnpm_config_*> projectpnpm-workspace.yaml> project.npmrc> user~/.npmrc> global$XDG_CONFIG_HOME/pnpm/config.yaml>$PREFIX/etc/npmrc. A null/empty file value is "not provided" (pnpm semantics) and does not shadow a positive value in a lower-precedence source; only an explicit number (including0= policy off) wins. Excludes travel with the source that defined them.name@1.0.0 || 2.0.0= exact version union;*/?name globs; a wildcard name combined with a version part is a pnpm config error → surfaced as a parse error.timemap — the same field pnpm's resolver reads (the tarball'sLast-Modifiedis not reliable: measured 12 s off). The full packument is tens of MB, so it is fetched at most once per target version: the extractedtimemap is cached undercacheDir()(.registry-time-<pkg>.json) and a hit means zero registry traffic on later checks; an in-process memo bounds traffic when the cache dir is unwritable.no-policy/excluded/mature→ proceed;immature→ defer this cycle without a strike (the release matures on its own, retry every check cycle);undatable(registry failure, notimefield, malformed/unreadable policy) → fail closed: defer, record a strike with a dedicated lane hint, and never bypass or silently exclude against the host policy.Behavior change (old → new)
forceInstallVersion) — it targets already-mature older versions and is a manual action, not the auto-update lane the issue names. Documented in therefreshDshDesktopCopydoc comment.Config surface
None new. The gate reads the host's pnpm configuration (env + project/user/global files); no bili config key, env var, or CLI flag is added.
Tests
tests/release-maturity.test.ts(new, 19): policy precedence across all seven sources, per-source value forms (yaml flow/block lists, null, inline comments, quotes; npmrc comments/semicolons), malformed values fail closed, the full exclude grammar (bare/scoped/exact/union/wildcards/glob/?/error cases), gate verdicts (no-policy no-fetch, excluded no-fetch, mature, immature, no-time, missing version, fetch failure, HTTP 404, malformed policy before any traffic), time-cache single-fetch behavior.tests/update-desktop-inplace.test.ts(+7): immature release defers with the installed copy, manifest, and lockfile byte-identical and no strike; whole-package exclude proceeds (zero registry traffic); an exclude for a different version does not lift the gate; a mature release proceeds and converges the ledger (store sections still untouched, per dsh 车道自动更新改全:自愈同步三本账(manifest/lockfile/副本)+ 存量漂移显式修复,自动更新后必须还能用 #3496); no-timepackument / network failure / malformed policy each fail closed with a strike and the copy untouched.tests/issue2082-desktop-boot-smoke.test.ts(drivesrefreshDshDesktopCopyend-to-end) stays green.npm run typecheckclean; the three suites above green. Full-suite verdict = remote CI on this head.Review notes
src/update.tsis load-bearing (auto-merge gate §7.4 excludes it) — this PR needs human review. The gate is additive: it only ever defers the refresh; the existing fetch/install/converge flow is untouched on the proceed path.kernel/orpi-subagents/changes; no new runtime dependencies (the module uses node builtins + existing repo helpers only); no wire/message-shape change.reference/architecture.mdfile map,docs/architecture/update.{md,zh-CN.md}(new "Maturity gate" section),CHANGELOG.md(Fixed entry with the old→new disclosure).node tools/check-architecture-docs.mjsgreen.