Skip to content

[PR] feat: remote GitHub raw announcements lane + CI validation gate (#5548 P3) - #5563

Closed
ranxianglei wants to merge 5 commits into
masterfrom
2026-11-02_notices-remote-ci-p3
Closed

ranxianglei wants to merge 5 commits into
masterfrom
2026-11-02_notices-remote-ci-p3

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

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

Part of #5548 (unified announcement panel, design v2 approved) — phase 3 of 4. Stacked on #5557 (P1) + #5561 (P2); merge those first.

What this adds

Lane C: announcements/remote.json ({"v":1,"entries":[...]}) living on master — publish = git push, retract = push without the entry. New module src/remote-announcements.ts:

  • Piggyback fetch: one GET per update-check throttle cycle (same CHECK_INTERVAL_MS cadence as the self-updater, first check ~10s after boot, timer unref'd so it never holds the process open). 8s timeout via AbortSignal.timeout, proxy resolved through the same egressDispatcher path as advisories.
  • Fail-open everywhere (§五/§六): offline / timeout / non-2xx / over-size (>512 KB) / bad JSON / wrong doc version → keep last-known-good entries, warnOnce per failure class (no log spam), never a red screen. First-ever fetch failure → simply no lane-C records.
  • Last-known-good snapshot in <cacheDir>/announcements-remote-snapshot.json; written on every successful check, read at startup so a restart after an outage still shows the last published set.
  • Doc contract: v:1 header; a higher v makes older builds skip the whole doc (no partial parsing); unknown fields dropped with warnings; invalid entries skipped individually (applyRemoteDoc in src/notices.ts, shared with the CI gate).
  • Merge order in collectVisibleNotices: local B > remote C > built-in A (id collision), then priority sort — records from all three lanes share the renderer, targeting gates, and hash-dismiss store from P1/P2.
  • CI gate (the only new CI touch, §五.4): .github/workflows/announcements-gate.yml runs on PRs/pushes touching announcements/remote.json — node 22, npm ci, node --import tsx scripts/validate-remote-announcements.ts reusing the client validator (size cap + v header + per-entry schema/matcher/time checks). A bad push fails before merge instead of silently dying on clients.
  • Initial publish: announcements/remote.json = {"v":1,"entries":[]}.

Behavior changes (old → new, why)

  1. New env var BILI_ANNOUNCEMENTS_URL (default = official raw URL). Path-relocation class per env-var discipline (precedent: 发版可见性:分级标签的 release 元数据(模型撰写摘要)+ 用户版跨 span 更新说明 + acp_status //acp 面板送达「更新已就绪待重启」(#1577 延伸) #1870 release-notes URL override); owner-approved design point Use kernel renderTags:"text-only" + forbid tag echoing in prompt #3 in Unified Announcement Panel Design (Approved): Built-in declarations + local JSON + remote GitHub raw — a single renderer | 公告面统一设计(已批准):内置声明 + 本地 JSON + 远程 GitHub raw,三来源一套渲染器 #5548. Lets firewall-blocked installs point at their own relay. CONFIGURATION.md en/zh docs land in P4 (docs phase).
  2. New machine-generated cache file <cacheDir>/announcements-remote-snapshot.json (not user config).
  3. GET /__bili/notices + overview notices[] may now contain remote records — additive; shape unchanged.
  4. One extra GET per update-check cycle when the raw host is reachable (non-critical path, unref'd timer, fail-open).

No kernel change, no wire involvement, built-in banner copy/tones byte-stable (P1 tests re-run green).

Verification

Targeted suites (local; full verdict = CI): tests/remote-announcements.test.ts (new, 20 tests) + P1/P2 batch = 72/72 pass; npm run typecheck clean; npm run build OK; gate script smoke-run on the committed empty doc → OK: 0 entries validated (v1).

§七 exit criteria: 断网 ✓ (fetch reject → previous entries kept) / 慢响应 ✓ (timeout seam fires, previous kept) / 坏JSON ✓ / 超大文件 ✓ — all four injections green hermetically. 推条目→真机可见→关闭→删条目不复现: the mechanics are unit-proven (snapshot round-trip, dismiss keys survive across reloads, empty-doc publish clears entries); the real-machine leg is left to you as acceptance since it needs a live push to master.

八问

  1. 是什么问题:公告面三期之三——远程公告车道:仓库里推一个 JSON 文件,所有装机在下一个自更新检查周期自动看到;撤回 = 再推一次。
  2. 什么原因导致的:设计缺口(Unified Announcement Panel Design (Approved): Built-in declarations + local JSON + remote GitHub raw — a single renderer | 公告面统一设计(已批准):内置声明 + 本地 JSON + 远程 GitHub raw,三来源一套渲染器 #5548):内置与本地两条车道之外,缺一条 owner 可全局广播的渠道;本 PR 按已批准设计补齐,含发布前校验门。
  3. 影响范围与严重程度:新增能力,默认零影响(空文档 = 零记录);既有横幅行为不变。失败路径全部降级为「该来源缺席」,最坏情况 = 没有远程公告。严重程度:不涉及(非缺陷修复)。
  4. 怎么修复的:独立薄模块(fetch+快照+warnOnce),纯函数 applyRemoteDoc 与 CI 门禁共用同一校验器;服务端 collectVisibleNotices 一处合并三来源;启动时挂一个不阻塞退出的定时器。
  5. 是否破坏回归:逐项过——自更新节流器未改动(只复用其周期常量,独立定时器);egressDispatcher 只多一个调用点,语义不变;overview/notices 载荷形状不变(数组内容增加来源);告警日志 warnOnce 去重不刷屏;坏推送由 CI 门禁拦在合并前,客户端侧还有一道 warnOnce 降级兜底。
  6. 是否破坏缓存:不涉及(快照是公告自己的 last-known-good,与模型前缀缓存/会话缓存无关)。
  7. 是否改了设计方向:否——严格按已批准设计 §五 实施(单文件、便车拉取、URL 逃生门、唯一新 CI 触点、v 头兼容)。
  8. 是否引入了新的配置:是——env BILI_ANNOUNCEMENTS_URL(缺省官方 raw 地址;path-relocation 类;owner 已批准的设计点 3;文档随 P4 进 CONFIGURATION.md en/zh)。无 config 文件字段、无 CLI flag。

ci-check added 3 commits November 3, 2026 00:27
…rer (lane A, #5548 P1)

Part of #5548 (approved unified announcement panel design, phase 1 of 4).

Converge the hand-copied panel banners (pck-default-off #5079, wm-fastpath-intro #5469) into one registry (src/notices.ts) with a shared record schema, kind-priority/tone/dismiss-mode pure functions, and one client render loop (textContent only, max 5 header banners + overflow list card). Overview payload now carries a unified notices array; new GET /__bili/notices endpoint. Dismissal store, endpoint and allowlist semantics preserved (allowlist widened to registered dynamic ids for lanes B/C). No config surface change.
@ranxianglei ranxianglei changed the title feat: remote GitHub raw announcements lane + CI validation gate (#5548 P3) [PR] feat: remote GitHub raw announcements lane + CI validation gate (#5548 P3) Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-02_notices-remote-ci-p3 (89996f6)

Latest build — install this exact version

npm install -g billion-context@0.0.7926-pr.5563.6b86a98

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
89996f6 billion-context@0.0.7926-pr.5563.6b86a98 build
e00013e billion-context@0.0.7923-pr.5563.321ce88 build
e287ec9 billion-context@0.0.7916-pr.5563.89674c3 build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

🔶 需要决策
(ai: vllm-qwen/qwen3.8-27b)

结论先行:这个 PR(#5563,#5548 P3)与 base 的冲突不是机械冲突,而是同一功能(#5548 notice surface)已经在 master 上用另一套更干净、已评审的实现落地了;本 PR 是更早的一版迭代、已被取代。机械地「解冲突」会造出坏构建,所以本轮我没有改任何代码、没有 push,按自动修复车道规则升级为需要决策。

根因(为什么会 dirty):本分支停在旧基线(落后 master 840 commits)。#5548 最终是经另一组提交合入 master 的,模块布局与命名都不同:

  • 注册表 src/notices.ts:master 109 行(纯注册表)vs 本 PR 484 行(逻辑全内联)
  • 本地公告:master src/announcements.ts + src/notice-store.ts vs 本 PR src/local-announcements.ts
  • 远端 feed:master src/remote-notices.ts vs 本 PR src/remote-announcements.ts
  • 安装 id:本 PR 有独立的 src/install-id.ts,master 无此文件
  • CI 门:master .github/workflows/announcements-lint.yml vs 本 PR .github/workflows/announcements-gate.yml——两者都跑同一个 scripts/validate-remote-announcements.ts 校验 announcements/remote.json;但 master 版额外先 build in-repo kernel,本 PR 版在当前 master 上会因此缺步而红
  • 配置键:本 PR 用 BILI_ANNOUNCEMENTS_URL,master 已按 review 改名为 remoteAnnouncementsUrl(commit 2f91f63b4e)
  • 数据文件 announcements/remote.json:两边完全一致(0 行差异)

master 侧对应落地:32042ac6d9(P1 统一注册表)、90115b6efc(P2 本地公告)、c0f09bf44f(dismissal→统一存储 kv_store)、321940c1e4(远端 feed + B>A>S 合并 + docs + CI lint),外加 review 修复(2f91f63b4e 键改名、6075577b48 给 feed 读取加 bound)与 iot-thinking 告警。设计即仓库 AGENTS.md 记录的 KDD #16(单一注册表、三来源 S/A/B、B>A>S 遮蔽、dismissal 存 kv_store namespace "notices")。

选项:

推荐:A。
无人拍板时的默认动作:保持 PR 打开、已打 needs-decision 标签、不 merge、不强推坏解,由 owner 定夺关或走 B(agent 无权关闭 PR,故我不自行关。)


八问(结构化)

  1. 是什么问题:CI 报本 PR 与 base 冲突;实质是同一功能(Unified Announcement Panel Design (Approved): Built-in declarations + local JSON + remote GitHub raw — a single renderer | 公告面统一设计(已批准):内置声明 + 本地 JSON + 远程 GitHub raw,三来源一套渲染器 #5548 notice surface)在 master 已由另一套成熟实现落地,本 PR 是被取代的早期版本,两版在同一批文件上分叉,无法机械合并。
  2. 什么原因导致的:Unified Announcement Panel Design (Approved): Built-in declarations + local JSON + remote GitHub raw — a single renderer | 公告面统一设计(已批准):内置声明 + 本地 JSON + 远程 GitHub raw,三来源一套渲染器 #5548 被重做——原始 P1/P2/P3 分解(本 PR 所属)后被重构为更干净的实现并合入 master;本分支留在旧基线未跟进,于是同一功能的两个版本撞到同批文件。
  3. 影响范围与严重程度(按选项):A)无影响(关闭,什么都不合并);B)低(仅折入 net-new,需验证);C)高(破坏 master 构建)。当前线上用户不受影响(master 上 Unified Announcement Panel Design (Approved): Built-in declarations + local JSON + remote GitHub raw — a single renderer | 公告面统一设计(已批准):内置声明 + 本地 JSON + 远程 GitHub raw,三来源一套渲染器 #5548 实现是好的)。
  4. 怎么修复的:本轮未做代码改动;处置路径为判为已被取代→建议关闭(A),或逐特性挑净-new 折入(B)。
  5. 是否有回归问题(按选项):A)无(不改);B)中低(向既有模块重构,需补测试钉住);C)高(重复符号、旧配置键、缺 kernel build 的 CI 门)。
  6. 是否破坏缓存:不涉及(纯模块组织/CI 门层面,无缓存语义)。
  7. 是否改了设计方向:否。master 的 Unified Announcement Panel Design (Approved): Built-in declarations + local JSON + remote GitHub raw — a single renderer | 公告面统一设计(已批准):内置声明 + 本地 JSON + 远程 GitHub raw,三来源一套渲染器 #5548 设计(KDD release v0.1.5 #16)才是当前方向;本 PR 代表被废弃的旧方向。
  8. 是否引入了新的配置:否。本 PR 引入的其实是旧配置键 BILI_ANNOUNCEMENTS_URL,master 已改用 remoteAnnouncementsUrl——这正是不应合并本 PR 的理由之一。

收工判定:已打 needs-decision 标签,未做任何 push;等 owner 在 A/B 间拍板(推荐 A:关闭为已被取代)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷
本轮结论:PR #5563(#5565)与 base 的冲突不是机械冲突——#5548 notice surface 已在 master 上用另一套更干净、已评审的实现落地,本 PR 是被取代的早期版本。强解冲突会造出坏构建,故本轮未改任何代码、未 push。

已完成 / 已验证:

  • 已打 needs-decision 标签(via add-label.sh)。
  • 已发 🔶 需要决策 评论(见上一条):根因分层 + 选项 A/B/C + 推荐(A:关闭为已被取代)+ 默认动作 + 完整中文八问。
  • 关键证据:announcements/remote.json 两边逐字节相同(0 行差异);两个 CI workflow 跑同一个 scripts/validate-remote-announcements.ts,而 master 版还多一步 build in-repo kernel(本 PR 版在当前 master 会因此缺步而红);配置键 master 已 BILI_ANNOUNCEMENTS_URL→remoteAnnouncementsUrl(commit 2f91f63b4e);模块布局分叉(src/notices.ts master 109 行 vs 本 PR 484 行;master 用 announcements.ts/remote-notices.ts/notice-store.ts,本 PR 用 local-announcements.ts/remote-announcements.ts/install-id.ts)。
  • 工作树干净,分支未动。

剩余 / 风险:等 owner 在 A(关闭为已被取代,推荐)/ B(逐特性挑 net-new 折入 master 布局)间拍板。风险点:若误选 C(强解冲突、共享文件全取 master 版+保留 PR 独有文件)会把重复模块/双注册表/旧配置键带进 master、直接破坏构建——已在评论里标为不可行。agent 无权关闭 PR,故我不自行关,留待 owner 定夺。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant