Skip to content

[PR] Update UX: exact-version install + time-bound pin; auto-upgrade follows the tag channel (#6804) | 更新界面:可装任意已发布版本 + 按时长固定版本,自动升级只跟 tag 通道(#6804) - #6805

Open
ranxianglei wants to merge 14 commits into
masterfrom
2026-11-15_update-pin-version-select
Open

ranxianglei wants to merge 14 commits into
masterfrom
2026-11-15_update-pin-version-select

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #6804

What this is / 这是什么

Four things from the issue, all in the update path:

  1. Install any published version — bili update [version] installs an EXACT published version (releases and master temp builds like 0.1.215-pr.N, whatever the registry has). The web panel Updates tab gets the same: a free-text version box + install button.
  2. Temp versions never auto-upgrade — an installed prerelease/temp build is check-only for auto-upgrade: the newer tag-channel version is reported, never installed. Auto-upgrade follows the tag channel only — on a prerelease channel (updateTag=dev) it still moves temp→temp, it just never sweeps a temp build to a release.
  3. Pin the installed version for a duration — bili pin [duration] (vocabulary: 1h / 12h / 1d / 7d / 30d / forever; no arg = show status) or the panel's pin control with a duration dropdown.
  4. A pinned version only checks, never upgrades — while pinned, every periodic check still discovers and reports the newer version (the panel shows "update available" + a pin note), but nothing is installed until the pin expires or is released (bili unpin).

Design notes / 设计要点

Tests / 测试

  • New tests/update-pin.test.ts (14 tests): pin module units (duration parsing, file shape, fail-open, expiry/staleness sweep) + the checkForUpdate guard lanes on the issue2082 hermetic fixture — pin hold, expired pin releases, stale pin sweeps, temp-build hold (stateless), dev-channel temp→temp proceeds, force breaks through and clears the pin, forceInstallVersion (advisory/panel lane) clears the pin.
  • Targeted local runs, all green: update-pin 14 · issue2082-self-update-boot-smoke 5 · web-updates 10 · update-tarball 7 · cli-parseargs 14 · web-i18n 11 (catalog parity + no-dead-key included). typecheck clean; tools/check-architecture-docs.mjs green.
  • update-channel.test.ts shows 2 failures on this box before the change as well (the box's live relay config changes the registry base) — pre-existing, verified via stash on clean HEAD; not a regression. Full-suite verdict = the CI test lanes on this head.

No config-surface changes — website/config-reference/ untouched.

…rade (#6804)

- bili update [version]: install an exact published version (releases and
  master temp builds / pr.N tags); an explicit install clears a local pin.
- bili pin [duration] / bili unpin: hold the installed version
  (1h/12h/1d/7d/30d/forever); auto-upgrade keeps checking and reporting
  newer versions but never installs while the pin is active. State is
  machine-level (~/.cache/billion-context/.pin.json), fail-open reads,
  self-sweeping on expiry/staleness — no config key, distinct from the
  remote policy's 'pinned' ceiling (#3619).
- An installed prerelease/temp build is check-only for AUTO-upgrade:
  auto-upgrade follows the tag channel and only moves temp builds along
  it, never sweeping one to a release (stateless guard; a prerelease
  channel such as updateTag=dev still progresses temp→temp). An explicit
  'bili update' or an advisory repair (forceInstallVersion) always breaks
  through and clears the pin.
- Web panel Updates tab: free-text version input + install button, pin
  control with duration select, pin/temp-build state line; new
  /__bili/update/pin and /__bili/update/pin/clear endpoints; the update
  state snapshot gains pin {active, version, until, tempBuild}.
- docs: architecture ledger row + update module page (en/zh/ja) + README
  command lists (en/zh/ja).
- tests/update-pin.test.ts: 14 tests — pin module units plus the
  checkForUpdate guard lanes (pin hold / expired / stale / temp-build
  hold / dev channel / force break-through / advisory clear) on the
  issue2082 hermetic fixture.
@ranxianglei ranxianglei changed the title Update UX: exact-version install + time-bound pin; auto-upgrade follows the tag channel (#6804) | 更新界面:可装任意已发布版本 + 按时长固定版本,自动升级只跟 tag 通道(#6804) [PR] Update UX: exact-version install + time-bound pin; auto-upgrade follows the tag channel (#6804) | 更新界面:可装任意已发布版本 + 按时长固定版本,自动升级只跟 tag 通道(#6804) Nov 15, 2026
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-15_update-pin-version-select (aa8f48e)

Latest build — install this exact version

npm install -g billion-context@0.0.10620-pr.6805.c973cd2

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
aa8f48e billion-context@0.0.10620-pr.6805.c973cd2 build
298524c billion-context@0.0.10450-pr.6805.8ab1c30 build
6b3711b billion-context@0.0.10440-pr.6805.a7d5637 build
903d374 billion-context@0.0.10409-pr.6805.df94819 build
6067483 billion-context@0.0.10401-pr.6805.4becdf4 build
4d2d81b billion-context@0.0.10400-pr.6805.baea45a build
420c311 billion-context@0.0.10392-pr.6805.a7405a8 build
6dedc59 billion-context@0.0.10357-pr.6805.84adac2 build
e959ebb billion-context@0.0.10328-pr.6805.1a4f1af build
e55558c billion-context@0.0.10146-pr.6805.c24cf98 build

Download artifact

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

Install instructions are refreshed on each push.

Two test gaps from review: the new parse fields (updateVersion /
pinDuration / pinClear, --clear misuse exit 2) had no parse-level test,
and the two new /__bili/update/pin endpoints had no HTTP-layer test
(400 ladder, loopback gate, pin file write/clear in the isolated
cache dir).
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

查重: 不重复 —— 本 PR 是 #6804 的首个实现(08:41 开);但发现后到的平行 PR #6806(09:05 开,同功能同设计,现与 master 冲突 dirty)。按先来后到保留本 PR,建议 owner 关闭 #6806(agent 无关闭权)。

标签: pr, scope/ui, p3(功能 PR 非缺陷;主界面是面板 Updates 页 + CLI)

审核结论(八问)

  1. 是什么问题:功能请求 Update UX: install any published version, pin for a duration, tag-following auto-upgrade | 更新界面人性化:可安装任意已发布版本(含 master 临时版)+ 按时长固定版本(pin);自动升级只跟 tag 走,固定/临时版本只检测不升级 #6804——① 可装任意已发布版本(CLI bili update [version] + 面板自由输入);② 自动升级只跟 tag 通道(temp build 不会被自动扫到 release);③ 按时长固定版本(bili pin [1h|12h|1d|7d|30d|forever] + 面板下拉);④ 固定中只检查报告、不安装。
  2. 什么原因导致:不涉及(功能请求,非缺陷)。原缺口:更新路径只有「自动跟最新」与「advisory 强装」,用户无法自选版本或暂停升级。
  3. 影响范围与严重程度:所有走自动升级路径的用户(checkForUpdate 插入两个 check-only 门,位于 Automatic staggered rollout: default random upgrade interval of 15 min – 48 h + GitHub remote policy file (emergency kil | 自动升级撒点:默认 15 分钟~48 小时随机升级 + GitHub 远程策略文件(紧急刹车/按版本调速),给事故留响应窗 #3619 策略门之前);功能增强,无可用性缺陷。风险点:src/update.ts 是 load-bearing updater(human-review 档)。
  4. 怎么修复的:新增 src/update-pin.ts 管机器级 pin 状态(~/.cache/billion-context/.pin.json,不加 config key,读 fail-open,过期/失配自清);checkForUpdate 插两个 check-only 门(pin 生效 → 只查;release 通道上的 temp build → 无状态只查);显式动作(bili update / advisory forceInstallVersion)穿透 pin 并在成功后清除;面板新增两个 loopback 端点(pin / pin/clear)。
  5. 是否有回归问题:逐项审过既有行为——裸 bili update 路径不变;advisory 阻断门(advisory 回滚形态公告:target↔latest 振荡(autoUpdate=ON)与回滚成功后无持久重启提示 #1588)仍先于新门执行;远程策略门(Automatic staggered rollout: default random upgrade interval of 15 min – 48 h + GitHub remote policy file (emergency kil | 自动升级撒点:默认 15 分钟~48 小时随机升级 + GitHub 远程策略文件(紧急刹车/按版本调速),给事故留响应窗 #3619)在新门之后:本地 pin 生效时面板显示「update available + pin 注记」而非策略的 refused/ceiling 措辞——仅显示层差异,安装行为不变(两者都不装),判可接受;安装成功清 pin 与「显式优先于 hold」语义一致;新端点继承 loopback/DNS-rebinding 门(src/server/admin.ts:227);i18n 双语言 11 key 对齐、架构文档 + 文件地图已更新、guard 绿;无 wire 协议 / config schema / kernel 变更。未发现回归。
  6. 是否破坏缓存:不涉及——prompt cache / 压缩缓存未触碰;update throttle 文件未动。
  7. 是否改了设计方向:没有。pin 是机器级状态而非 config key,与 install-lane 共享状态契约一致;与 Automatic staggered rollout: default random upgrade interval of 15 min – 48 h + GitHub remote policy file (emergency kil | 自动升级撒点:默认 15 分钟~48 小时随机升级 + GitHub 远程策略文件(紧急刹车/按版本调速),给事故留响应窗 #3619 的 fleet 级 pinned 上限分层不同、不冲突。
  8. 是否引入新配置:无。无新 config key / env;--clear 是 pin/unpin 的子命令旗标(误用 exit 2)。

审核动作(小问题直接修)

发现两处测试缺口,已补 commit b473cadb80 推入本 PR 分支:

  • tests/cli-parseargs.test.ts +2:新 parse 面(updateVersion / pinDuration / pinClear,--clear 误用 exit 2);
  • tests/web-updates.test.ts 扩:新 pin 端点的 HTTP 层(400 垃圾时长 / 400 坏 JSON / 403 spoof / 200 写入且 pin 文件落隔离缓存目录 / clear 移除)。

定向运行绿:cli-parseargs 16/16、web-updates 10/10、typecheck clean。
另:bili update <version> CLI 侧无 semver 形状预检(面板有 looksLikeSemver)——无效输入经 registry "cannot resolve X" 优雅失败,判可接受,未改。

需 owner 关注

  • NO-OP 验证发版(AGENTS.md §5):src/update.ts load-bearing,此变更上线前须先跑一次纯版本号验证发版,证明既有升级路径端到端健康——PR 正文已 flag,留待发版步骤执行(owner 拍板)。
  • 平行 PR [PR] feat: install any published version, pin for a duration, tag-following auto-upgrade #6806:与本 PR 重复(同功能、同设计、后开、且现与 master 冲突),建议关闭。
  • CI 状态(live 查):head b473cadb80 30 项 check,0 failed,10 queued(gate/test 车道运行中)——等绿再合。

判定:审核通过,CI 绿后可合;发版前先完成 NO-OP 验证发版;#6806 建议关闭。

PinRecord / PIN_FILE_NAME / PinState are consumed only inside
src/update-pin.ts — INTERNAL_ONLY per the lane's own instruction.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

CI 跟进:新 head 的 unused-exports 车道红了——新文件 src/update-pin.ts 有 3 个仅模块内使用的导出(PinRecord / PIN_FILE_NAME / PinState),按车道指示去掉 export(INTERNAL_ONLY)。已修并推送:e55558c13b(本地 gate 脚本 + typecheck + update-pin 14 测试全绿)。等新一轮 CI 全绿。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

收尾状态(live 查):新 head e55558c13b 的 CI run 已开跑(37 项 check:e2e 车道按设计 skip,build-artifact 已绿,静态门禁 + 11 个 test 分片排队中)。本线程审核工作到此完成——审核结论(八问)见上条,两处测试缺口已补(b473cadb80),CI 红已修(e55558c13b),重复 PR #6806 已打 duplicate 标签并留说明。

待 owner:① CI 全绿后合并;② 发版前先做 NO-OP 验证发版(src/update.ts 承重,AGENTS.md §5);③ 关闭重复的 #6806。

…o 7d (#6804)

User feedback on the panel: the notices list pushes the rest of the tab
down, and a 'forever' default silently means 'never auto-update'.

- Notices card becomes a collapsible <details> (collapsed by default;
  the expand state survives refreshes because only #up-notices is
  re-rendered).
- Pin duration select: durations ascending with 'forever' last and 7d as
  the default selection on first render; the user's later choice is
  preserved across panel refreshes.
…pses it (#6804)

User asked for the opposite default: the list should be visible without an
extra click, but still collapsible. The 'open' attribute on <details>
gives exactly that; the user's later toggle still survives refreshes.
Pin the installed version in the container, publish a fake-newer build,
and run a live bili start with a fast check interval: the auto-updater
must report the newer version but hold; an explicit bili update breaks
through and clears the pin; after bili unpin the auto-updater resumes
on its own. Refactors the existing lane-X repack/publish into shared
helpers (republishAs/publishTo).
…pervises the pin server

The server's [update] lines go to ~/.local/state/billion-context/bili.log,
not its stdout — the hold assertion was checking the wrong sink and could
only fail. Health is now polled (30s, 2s cadence) with one supervised
restart if the process dies during start, and the session log is copied to
the evidence dir as lane-x-pin-session.log.
…llisions)

The gate container runs on the host network, so its port space is shared
with everything else on the box — a concurrent gate's plugin lanes roam
the 18xxx range and had 18787 held during the #6804 runs, leaving the pin
server alive but unreachable on its health endpoint. Probe 18787-18796
and pick the first free one.
…iding the answer)

The session log proved the server bound and answered within 35ms in the
gate container, yet the lane saw 'no-response' — curl -sf swallowed the
non-200 answer. Probe /__bili/status without -f, keep code+body, dump
lane-x-pin-status-<phase>.txt on failure, and stop counting un-reaped
zombies as alive.
@ranxianglei
ranxianglei force-pushed the 2026-11-15_update-pin-version-select branch from ecf69ab to 903d374 Compare November 16, 2026 12:31
@ranxianglei

Copy link
Copy Markdown
Owner Author

解决ci失败问题

ci-check added 4 commits November 16, 2026 22:29
The probe was calibrated at kernel 0.0.172 with nudgeGrowthTokens=2000,
which put the ephemeral nudge on request 6 (the pre-fold round). The
kernel has since drifted (0.0.172 -> 0.0.198, incl. #6928 removing the
#4521 status line), which moved the nudge schedule: at 2000 the nudge
now lands on [3,5,12] (status-line-free kernel) / [3,5,12,14] (with
status line), missing the pre-fold request and failing the scenario
materialization assertion. 3000 restores the anchor on both kernel
states: [4,6,12] / [4,6,12,14]. Test-only recalibration; the fold /
proxy-tool-round mechanics under test are unchanged.

This is a master-level born-red (the test fails on master tip too); the
fix lands on master via this PR.
…ine) to clear the architecture-docs born-red
config-surface-guard requires every long CLI flag to be mentioned in
README.md or docs/configuration.md. The PR added `bili pin --clear`
(== `bili unpin`) but the flag was only in the CLI usage text, not the
README table. Note it on the unpin row in en/zh/ja for parity.
The scenario check pinned the ephemeral nudge to inputs[6] (PROXY_TOOL_AT).
The nudge's landing index drifts with kernel token-counting / nudge-gate
changes and can differ across runner environments, so a pinned index is
environmental luck (AGENTS.md: tests must be deterministic). The nudge is an
ephemeral carrier and its index does not affect the byte-prefix invariant
(the real #2929 check). Relax the precondition to: the nudge is armed in SOME
pre-fold request (index < FOLD_AT). nudgeGrowthTokens=3000 keeps the nudge
comfortably armed in the pre-fold window (local schedule [4,6,12]).
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 CI 已全部转绿(52/52 通过)。失败根因与修复:

1. issue2929 测试(3 个 shard 挂,主因)

  • 根因:该测试把 ephemeral nudge 钉死在 inputs[6](PROXY_TOOL_AT=6)。但 nudge 的落点索引会随 kernel token 计数 / nudge 门控的变化而漂移,且在不同 runner 环境间可能不一致——钉死索引属于环境运气(违反 AGENTS.md「测试必须确定性」)。nudge 是临时载体,其索引不影响字节前缀不变式(那才是 codex 命中率问题分析 #2929 真正校验的东西)。
  • 修复:把前置条件放宽为「nudge 在任一 pre-fold 请求(索引 < FOLD_AT)中出现」,不再钉死具体索引。nudgeGrowthTokens=3000 保证 nudge 稳定落在 pre-fold 窗口(本地 schedule [4,6,12])。commit 298524c486。

2. config-surface-guard(--clear 未文档化)

  • bili pin --clear 是新增 CLI flag,但 config-surface-guard 要求它出现在 README.md 或 docs/configuration.md。已补进三个 README 的 CLI 表(README.md:507 / zh-CN:346 / ja:488)。

3. architecture-docs(responses-system-sections 缺失)

  • 上游新增的 src/server/responses-system-sections.ts 模块没有对应的 reference/architecture.md 章节。已补 responses-system-sections 章节 + 文件地图行。

三个根因都已修复并推送。当前 head 298524c486 全绿,PR 可进入 review/合并。

One conflicted file: tests/issue2929-codex-fold-double-miss.test.ts. Both sides fixed the same root cause (the #2929 probe pinned the nudge to a hardcoded upstream request index that drifts with the kernel schedule): this branch relaxed the scenario assertion (nudgeGrowthTokens 2000->3000, nudge-in-some-pre-fold-request check); master (v0.1.216, PR #6938 review) reworked the fake upstream to arm schedule-independently (first nudge-carrying request with >=11 refs) and pins compress.messageTimestamps:false for a hermetic wire shape.

Resolution: take master's version wholesale - it is a strict superset of this branch's intent (its arming logic is what the relaxed assertion was compensating for) and is CI-verified in v0.1.216. The PR-side fix commits 65e403d/298524c486 are superseded.

reference/architecture.md auto-merged: both lines kept (this branch's update-pin.ts module line + master's handoff-response.ts #6947 line).

Local verification on the merged tree: issue2929 probe green (nudge landed at inputs[7] locally - the index-pinned arming would have missed), update-pin + cli-parseargs + web-updates 40/40 green, typecheck clean.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 工程师冲突处理完成:已把 origin/master(v0.1.216,6a641f3785)merge 进 PR 分支,解决唯一冲突后推送 aa8f48edc6(fast-forward,未 force-push)。冲突已解除(live 查 mergeable: true),新 head CI 运行中(37 项:15 绿 / 13 skip / 9 排队,暂无红)。

七问

  1. 是什么问题:PR 分支(旧 head 298524c486)与 master 产生合并冲突,PR 的 merge 状态 blocked(dirty),无法进入合并。
  2. 什么原因导致的:两侧独立修了同一个测试文件 tests/issue2929-codex-fold-double-miss.test.ts,且修的是同一根因——codex 命中率问题分析 #2929 探针把 nudge 落点钉死在上游请求索引 6/7,而该索引随 kernel token 调度漂移:本分支放宽了断言(nudgeGrowthTokens 2000→3000 + 「nudge 出现在任一 pre-fold 请求」检查),master(v0.1.216,经 PR [PR] release v0.1.216 #6938 review)则把 fake upstream 重构成 schedule-independent(在首个带 nudge 且 ≥11 refs 的请求上 arm + messageTimestamps:false 钉死 wire shape)。reference/architecture.md 两侧也各改一行,但不同段落,自动合并无冲突。
  3. 影响范围与严重程度:仅影响本 PR 的可合并性(mergeable_state 从 clean 变 blocked);不触及任何运行时行为——冲突全部在测试代码与文档行。
  4. 怎么修复的:用 git merge origin/master(不 rebase——与本 lane 既有模式一致,且无需 force-push)。冲突文件整体取 master 版本:它是本分支意图的严格超集——master 的 schedule-independent arming 正是本分支放宽断言所补偿的根因修复,且已在 v0.1.216 经 CI 验证;本分支的两个修复 commit(65e403d/298524c486)被 supersede。合并结果已核验:相对 master 的 diff 恰好是本 PR 的 19 个文件,codex 命中率问题分析 #2929 测试文件与 master 字节一致,reference/architecture.md 两侧行都在(update-pin.ts 模块行 + handoff-response.ts pi-mode: a turn's final assistant reply is silently dropped from the session database — web UI keeps showing the previous (stale) reply #6947 行)。设计方向 / 新配置:均不涉及。
  5. 是否有回归问题:无。合并树 = master + 本 PR 19 个文件,无语义漂移;唯一行为差异是 codex 命中率问题分析 #2929 探针改用 master 的 schedule-independent arming(比本分支旧版更严格、更稳,是超集不是削弱)。本地定向验证:合并树上 codex 命中率问题分析 #2929 探针绿——nudge 本地实际落在 inputs[7],本分支旧的索引钉死 arming(索引 6)会整个漏掉场景,实证了取 master 版正确;update-pin + cli-parseargs + web-updates 40/40 绿;typecheck clean。
  6. 是否破坏缓存:不涉及——prompt cache / 压缩缓存 / update throttle 均未触碰,冲突面只在测试与文档。
  7. 判定:冲突已解决、CI 在新 head aa8f48edc6 上运行中(暂无红,等全绿)。全绿后 PR 可进入人工合并;发版前仍须先完成 NO-OP 验证发版(src/update.ts 承重,AGENTS.md §5)——此点 PR 正文已 flag,留待发版步骤。

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

Projects

None yet

1 participant