Repository navigation
feat(web): critical-update banner — the #1870 notice reaches the browser - #2846
Conversation
The critical-update line (#1870, #1977 display policy) only ever surfaced on the /acp panel and acp_status; the web UI had NO update notice at all — the browser only had the disk-vs-running stale banner. A remote user on an old install never learned a critical release existed, which the notes-package staleout of 0.1.191-0.1.193 made painfully visible. - admin.ts: one updateReadyLine() feeds BOTH /__bili/status and /__bili/overview (the #2152 advisory-parity lesson: one source, no drift) — null when invisible (#1977: routine/recommended stay silent) - page.ts: #update-banner above #stale-banner (the original surface is kept untouched; the new banner carries release context, stale stays the generic restart cue) - client.ts renderBanners: shows the wire line behind a localized label, escapeHtml'd (registry summary is remote-doc text) - tests/web-update-banner.test.ts: wire parity across both endpoints, #1977 silence for non-critical spans, ready vs available wording, pending-restart branch, page/client/escape assertions
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3284-pr.2846.b690aebThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2846.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Review 结论(结构化八问) 已验证:全 diff 通读(单 commit,5 文件 +185/-1)、对最新 master merge-tree 干净(分支 behind 但无冲突);本地定向跑 web-update-banner / web-i18n / web-routing / web-conflict-banner / advisory-endpoint-parity / update-notes / admin-probe = 51 pass, 0 fail;typecheck 干净、unused-exports gate 干净;CI 28/28 check runs 全绿(config-surface / version / kernel / lane / docs 各 guard、build-artifact、hermetic registry e2e、ubuntu/windows × node22/24 测试矩阵)。查重:无同类在途 PR。
测试有效性:新套件起真实 server + hermetic sessions 目录,4 个 wire case 用 deepEqual 钉两端点字节级 parity、#1977 静默 case(routine/recommended-only → null)、available/ready 两个措辞分支、escape 正则 pin——去掉转义、漏掉任一端点字段、或让 routine 变可见都会红,断言有牙。一条非阻塞观察:通知行正文为英文(zh locale 下也是「升级提醒: Critical update available: …」),与 /acp 面板 describeUpdateReady 措辞一致、标签已本地化——是单源策略下的有意取舍,不算缺陷。 判定:可合。 方向正确(补真缺口、修在源头)、diff 干净(每行都在题上)、回归清点无破坏、测试有牙、CI 全绿。合并由你操作。 |
…differently describeUpdateReady and the acp_status section both told every user to `npm install -g billion-context@X`, but bili runs under several hosts (npm -g / opencode plugin / dsh / pi) with different install flows — the wrong hint is worse than none. Name the version, let each client's own docs say how. - update-notes.ts: describeUpdateReady loses the install suffix on all branches (web banner, /acp panel, acp_status all share the wording) - acp-status.ts: drop the "Update with: npm install -g …" line - tests: pin the ABSENCE of any npm-install prescription
The banner read "Critical update available: 0.1.193" — as if exactly that
version were the target. Any release >= the critical one is safe, and hosts
with auto-update often land on a newer build, so the guidance must be
"upgrade to vX or newer" (大到等于). Baking an English sentence also left the
zh UI showing a mixed-language line.
- update-notes.ts: describeUpdateReady's available branch now names the
MINIMUM fixed version (first critical in the ascending span) with a >=
prefix; new updateBannerPayload() exports kind/version/summary so the
SERVER never bakes a sentence — locales compose it
- admin.ts: /__bili/status + /__bili/overview carry the structured payload
- client.ts + i18n.ts: zh 「请升级到 v{version} 或更新版本」/ en "upgrade to
v{version} or newer", ready branch "重启 bili 即可生效" / "restart bili
to apply" — each fully localized, remote summary HTML-escaped
- tests: pin version selection (minimum critical, disk version on ready),
parity, #1977 silence, per-locale composition, no npm-install prescription
# Conflicts: # src/acp-status.ts
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.328-master.bf5f885 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Why
The critical-update notice (#1870, #1977 display policy) only ever surfaced on the /acp panel and acp_status — the web UI had no update banner at all. The browser's only upgrade cue was the disk-vs-running stale banner (#1603). A user on an old install never learned a critical release existed; the notes-package staleout of 0.1.191–0.1.193 (fixed in #2818) made exactly this gap visible in practice.
What
GET /__bili/status+GET /__bili/overviewupdateReady— one sharedupdateReadyPayload()(the #2152 advisory-parity lesson: single source, no drift),nullwhen the span is invisiblesrc/web/page.ts#update-bannerabove#stale-banner— the original stale banner is kept untouchedsrc/web/client.tsrenderBannerssrc/web/i18n.tssys.update/sys.update_available/sys.update_readyzh + entests/web-update-banner.test.tsTwo deliberate wording rules (
aa14eb6b):≥ version, never exactlyversion— any release at-or-above the critical one is safe, and hosts with auto-update often land on a newer build.availabletherefore carries the minimum version that contains the fix (first critical in the ascending span);readycarries the on-disk version a restart delivers. The TUI line readsCritical update available: ≥ 0.1.193 — ….kind/version/summary, never a baked English sentence, so the zh UI shows a fully-Chinese line instead of a mixed one.No install prescription anywhere (
28602246): the wording never tells the user tonpm install -g …— bili runs under several hosts (npm -g / opencode plugin / dsh / pi) with different install flows, so the line just names the version and the host's own docs say how.Behavior
(与 stale banner 并存,语义不同:一个讲发布内容,一个讲重启)
Verification
node --import tsx --test tests/web-update-banner.test.ts tests/update-notes.test.ts tests/acp-panel.test.ts tests/acp-status.test.ts tests/web-i18n.test.ts tests/web-conflict-banner.test.ts tests/advisory-endpoint-parity.test.ts tests/plugin-status-provenance.test.ts→ 81 pass, 0 failnpm run typecheckclean; unused-exports gate cleanRisk
Management-endpoint + web-UI + wording only — no proxy/data-path changes.