Repository navigation
[PR] feat: remote GitHub raw announcements lane + CI validation gate (#5548 P3) - #5563
ranxianglei wants to merge 5 commits into
Conversation
…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.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.7926-pr.5563.6b86a98This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5563.tgz
npm install -g packageInstall instructions are refreshed on each push. |
🔶 需要决策 结论先行:这个 PR(#5563,#5548 P3)与 base 的冲突不是机械冲突,而是同一功能(#5548 notice surface)已经在 master 上用另一套更干净、已评审的实现落地了;本 PR 是更早的一版迭代、已被取代。机械地「解冲突」会造出坏构建,所以本轮我没有改任何代码、没有 push,按自动修复车道规则升级为需要决策。 根因(为什么会 dirty):本分支停在旧基线(落后 master 840 commits)。#5548 最终是经另一组提交合入 master 的,模块布局与命名都不同:
master 侧对应落地: 选项:
推荐:A。 八问(结构化)
收工判定:已打 |
[bot] 🏷 已完成 / 已验证:
剩余 / 风险:等 owner 在 A(关闭为已被取代,推荐)/ B(逐特性挑 net-new 折入 master 布局)间拍板。风险点:若误选 C(强解冲突、共享文件全取 master 版+保留 PR 独有文件)会把重复模块/双注册表/旧配置键带进 master、直接破坏构建——已在评论里标为不可行。agent 无权关闭 PR,故我不自行关,留待 owner 定夺。 |
[ework] CI fix verified green ✓ |
(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 modulesrc/remote-announcements.ts:CHECK_INTERVAL_MScadence as the self-updater, first check ~10s after boot, timer unref'd so it never holds the process open). 8s timeout viaAbortSignal.timeout, proxy resolved through the sameegressDispatcherpath as advisories.warnOnceper failure class (no log spam), never a red screen. First-ever fetch failure → simply no lane-C records.<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.v:1header; a highervmakes older builds skip the whole doc (no partial parsing); unknown fields dropped with warnings; invalid entries skipped individually (applyRemoteDocinsrc/notices.ts, shared with the CI gate).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..github/workflows/announcements-gate.ymlruns on PRs/pushes touchingannouncements/remote.json— node 22,npm ci,node --import tsx scripts/validate-remote-announcements.tsreusing 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.announcements/remote.json={"v":1,"entries":[]}.Behavior changes (old → new, why)
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).<cacheDir>/announcements-remote-snapshot.json(not user config).GET /__bili/notices+ overviewnotices[]may now contain remote records — additive; shape unchanged.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 typecheckclean;npm run buildOK; 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.
八问
BILI_ANNOUNCEMENTS_URL(缺省官方 raw 地址;path-relocation 类;owner 已批准的设计点 3;文档随 P4 进 CONFIGURATION.md en/zh)。无 config 文件字段、无 CLI flag。