Skip to content

[PR] fix(release): label-gated head-tree publish for conflicted carve-out ship PRs - #4596

Merged
ranxianglei merged 4 commits into
masterfrom
2026-10-25_release-bugfix-label-publish
Oct 25, 2026
Merged

ranxianglei merged 4 commits into
masterfrom
2026-10-25_release-bugfix-label-publish

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Problem

Two gaps found while shipping v0.1.207 through the patch lane:

  1. Conflicted ship PRs are unpublishable by design. A lane cut from an old tag (e.g. bugfix-v0.1.206 = v0.1.206 tag + backported fixes) conflicts with master at ship time when those fixes already landed on master and master moved on (renames, follow-ups touching the same files). GitHub's merge button then refuses. The two available resolutions are both unacceptable:

    • resolve on the lane = merge master INTO the lane → the published pre-merge head tree absorbs unreleased master work (exactly what the carve-out channel exists to prevent; also forbidden by Never merge master into a lane);
    • resolve on master = a direct master push.
  2. Old-tag lanes carry an old release-bugfix.yml. The bugfix-v* head marker was added to this workflow only on master (10-24); a lane cut from v0.1.206 ships the 206-era copy, which only recognizes bugfix-release/* — so even a cleanly mergeable ship PR would publish NOTHING (silent notice). The pull_request closed event runs the head's copy of the workflow.

Change

  • pull_request_target: [labeled] trigger: adding the backport-ship label to an OPEN, same-repo ship PR whose head branch matches bugfix-v* / bugfix-release/* publishes the PR HEAD tree — no merge into master required. labeled fires on ADD only, so the gate is a deliberate triage-capable human action. Every existing guard (monotonic vs npm latest, not-already-live, no sub-0.1.0, release-notes ON THE REF) and the full gate (npm ci + typecheck + test + build + full-CI gate at the publish sha) still run. Fork PRs are rejected as before. inputs.fast is meaningless on this event, so the label path is always full-gate.
  • Label naming joins the existing release-family prefix: backport (route a fix) → backport-carry (lane carry PR) → backport-ship (publish the lane). Same pattern as ci:full.
  • Because pull_request_target runs the master copy of the workflow, gap 2 is fixed for this path automatically.
  • Manifest sync check fails open (notice, not MODULE_NOT_FOUND) on pre-[PR] feat: Codex Desktop Plugin (Git marketplace + MCP tools + version sync) | feat: Codex 桌面版插件(Git marketplace + MCP 工具 + 版本同步) #4449 trees — same existence-guard philosophy release-manual.yml got in [PR] fix(release): train mode survives pre-#4449 patch lanes #4576.
  • Post-publish PR comment documents that publish ≠ merge here; the PR stays open as the publish record (closing it later fires the harmless "closed without merging" notice).
  • reference/release.md: new "Conflicted ship PRs (label publish)" paragraph + a pointer in "Ship the lane".

Label backport-ship has been created on the repo.

Security notes

  • Secrets are only used AFTER the resolve gate passes (label + open + same-repo + marker); the workflow checks out the head SHA only after those checks — standard pull_request_target discipline.
  • The pre-flight executes the head tree's build/test (npm ci && npm test && npm run build), same trust as a merged ship PR; the labeler must have triage permission on the repo.
  • pull-requests: write added (post-publish comment only).

Validation

  • python3 -c yaml.safe_load on the workflow — OK.
  • Resolve step extracted from the parsed YAML and simulated against synthetic events (jq paths exercised): backport-ship on open same-repo bugfix-release/* and bugfix-v* PRs → proceed=true with correct branch/sha; other labels / closed PR / fork PR / non-marker head → notice-exit or fork-error as designed.
  • bash -n on the extracted script — OK.

Test plan

After merge: open the v0.1.207 ship PR from bugfix-release/v0.1.207-storage-backport (head = current lane tip ec5d3e3e, tree = v0.1.206 tag + 5 storage fixes + notes + bump + 3 diagnostics), wait for its CI, apply backport-ship → expect publish of the pure head tree with all guards green.

@ranxianglei ranxianglei changed the title fix(release): label-gated head-tree publish for conflicted carve-out ship PRs [PR] fix(release): label-gated head-tree publish for conflicted carve-out ship PRs Oct 24, 2026
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-25_release-bugfix-label-publish (d515aea)

Latest build — install this exact version

npm install -g billion-context@0.0.5671-pr.4596.ec86ca4

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
d515aea billion-context@0.0.5671-pr.4596.ec86ca4 build
c267b98 billion-context@0.0.5636-pr.4596.c983068 build
d5811bf billion-context@0.0.5576-pr.4596.9ce2d03 build
23baf2b billion-context@0.0.5553-pr.4596.f661353 build
77e74e8 billion-context@0.0.5550-pr.4596.70273a5 build
76882e6 billion-context@0.0.5549-pr.4596.97c87b7 build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr4596.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)

结论先行:本车道点名的 unused-exports 已修复并验证转绿——修复 commit 23baf2bd 已在分支上(我独立复现+核验了它的正确性)。当前 head 上另外全红的 11 个 test 分片是继承自 master 的另一条独立问题(非本 PR 引入),已在 CI 总控 #4599 跟踪、由 #4606 集中修复,本 release PR 保持聚焦、不夹带该无关修复。

查重:不重复——这是 #4596 自身 CI 的自动修复车道;根因与 master 侧记录(#4602→#4603、#4599 盘点第 1 条)同源,但那是 master 侧条目,本车道是独立触发、独立收口。

八问:

  1. 是什么问题:CI 的 unused-exports 门禁报 src/agent/client-build-note.ts:32 的 ClientBuildCheck 为 INTERNAL_ONLY——带了 export 但仓库里没有任何外部模块按名字引用它,门禁判失败、PR 卡红。
  2. 什么原因导致的:根本原因是 master 自身的 born-red,不是本 PR 引入的。[PR] dsh lane: note in-session when running an unverified @deepseek-ai/dsh client build (soft, exact-match) #4545 引入这个 type-only 常量时带了 export,但调用方全部走结构化的 DSH_BUILD_CHECK / 函数参数,无人按名字 import 它;[PR] fix: redact storage diagnostics at the publish boundary #4499 落地 unused-exports 门禁后,每个 rebase 到 tip 的 PR 都继承这条红。
  3. 影响范围与严重程度:只影响 CI 静态门禁,不影响运行时行为与任何用户面;严重度低(纯卫生项),但会把所有基于当前 master 的 PR 卡红。
  4. 怎么修复的:去掉该行 type 声明前导的 export(改为 file-local)——门禁对 INTERNAL_ONLY 的推荐处置,也是最小改动。type 仍在模块内供本文件导出函数签名使用;未来若某条车道需跨文件引用再按需重新导出即可。
  5. 是否有回归问题:无。type-only、零运行时代码的可见性收窄;本地 tsc --noEmit 全绿(exit 0)、✓ unused-export gate: clean (6 waived);不触碰 wire/消息形状/配置/持久化/kernel。
  6. 是否破坏缓存:不涉及——无缓存/重试/游标/去重键相关改动。
  7. 是否改了设计方向:不涉及——纯导出可见性调整,架构/边界/数据流不变。
  8. 是否引入新的配置:不涉及——无新 env/config/默认值。

关于 test 分片(顺带核实,非本车道范围):当前 head 上 11 个 test 分片全红,但一行测试都没跑——死在 pretest 自检:tests/issue3890-parent-gone-confirm-drain.test.ts(会起子进程)未登记进 scripts/run-ci-tests.mjs 的 LIVE_FILES(#1248 门禁)。已本地核实:该文件在 master tip 就存在且未登记,本 PR 既没加它也没改 run-ci-tests.mjs,故判定为继承性失败,与本 PR 的 release 改动无关。它已在 #4599 总控盘点(第 2 条)中,由 #4606 集中补登记(该登记按门禁要求需先做 #1248 并发假设评审,不宜在自动修复车道盲改)。等 #4606 合入后本分支 rebase 即全绿。

收工判定:unused-exports(本车道唯一被点名项)已修复、本地+CI 双重验证转绿,任务完成;无需我再 push(修复 commit 23baf2bd 已在分支上,我的本地工作树与其一致、干净)。test 分片红属继承性 master 问题,已移交 #4599/#4606。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复。 open+closed issue/PR 检索(机制关键词 + CI 失败签名):无既有「label-gated head-tree publish」条目或在途同类 lane 修复 PR。背景引用(非重复):#2011/#2851(bugfix carve-out 通道)、#4449(manifest sync)、#4576(release-manual existence-guard 哲学)。

标签: bug / scope/ci / p2 — 发版管道缺陷(conflicted carve-out lane 无法发布);bili 用户运行时不受影响,故 p2 非 p1。

审查中状态(head 23baf2bd,branch 2026-10-25_release-bugfix-label-publish):

接下来:workflow 变更全量审查(resolve gate、guards、publish 路径)+ 处置那条 LIVE_FILES 继承红。

@ranxianglei ranxianglei added bug Something isn't working p2 scope/ci labels Oct 24, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b) 重复/过期通知——本条针对的 head 77e74e85 已被 23baf2bd 取代,unused-exports 在该 head 已转 success(本地 ✓ unused-export gate: clean + tsc exit 0 + CI check-run success 三重核验)。修复 commit 23baf2bd(去掉 ClientBuildCheck 前导 export,master born-red 的一行 rider heal)已在分支上,无需再 push。完整八问判定见本线程上一条回复;test 分片红为独立的继承性 master 问题(#3890 测试未登记 LIVE_FILES),已移交 #4599/#4606,与本 release PR 无关。任务完成。

ranxianglei pushed a commit that referenced this pull request Oct 24, 2026
…aster

Review finding on #4596: the labeled path lacked the base-branch filter the
closed-PR path carries, and its comment claimed pull_request_target does not
support one -- false per GitHub docs (on.<pull_request_target>.<branches> is
matched against the PR base). A backport-ship label on a PR targeting any
non-master branch would arm the publish path (still version-guarded, but
needlessly). Add branches: [master] to match the closed-PR trigger and fix
the comment.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

审核完成:结论为通过。 独立通读了全部 diff(3 文件)+ 新 workflow 全文(381 行)+ reference/release.md 变更,并对照 GitHub 官方文档核验了触发器语义。机制成立、安全纪律正确、守卫完整、文档一致。审核中发现一处收紧点已直接修掉(见下)。

结构化八问:

  1. 是什么问题:发布通道两个缺口——patch lane(从旧 tag 切出)在 ship 时若与 master 冲突,就没有合规的发布路径(在 lane 上解冲突会把未发布的 master 工作吸进发布的树,在 master 上解要直推 master);且旧 tag lane 自带一份不认 bugfix-v* 标记的旧版 release-bugfix.yml,连可合并的 ship PR 也会静默不发。
  2. 什么原因导致的:carve-out 通道(bili 0.1.181:clampOutputBudget 把小数写进 max_tokens,上游 400 max_tokens: Input should be a valid integer / 422 Endpoint is unavailable #2011/bugfix通道也走pr而不是静默推分支 #2851)只在「合并关闭」时发布,隐含假设 ship PR 永远可合并——lane 与 master 分叉大(fix 已落 master + master 继续演进)时假设破裂;第二点是 closed 事件执行的是 HEAD 侧的 workflow 文件,旧 tag lane 只能看到 206 年代的触发器定义。
  3. 影响范围与严重程度:只影响 owner 的紧急 patch-lane 发布流程,不影响用户运行时与常规发版。严重度 = 操作阻塞:冲突发生时 lane 无法经正规通道 ship(有绕行但两者都不想要)。终端用户无感。
  4. 怎么修复的:增加第二个发布入口——对 open、同仓、head 分支匹配 bugfix-v*/bugfix-release/* 的 PR 打 backport-ship 标签,即发布 PR HEAD 树,不需要合入 master。标签动作本身是门(labeled 仅在添加时触发,需 triage 权限的人工动作);既有守卫(monotonic vs npm latest / not-already-live / 拒 sub-0.1.0 / release-notes 在 ref 上检查 / publish sha 处全量 CI 门禁)原样保留;fork PR 在 checkout 前拒绝;pull_request_target 跑的是 master 侧副本,缺口 2 随之自动修复。
  5. 是否有回归问题:无。既有行为逐项清点:closed-PR 合并路径的触发器与守卫未动;workflow_dispatch 手动路径未动(inputs.fast 语义仍只在 dispatch 生效——label 路径上 fast 为空,恒走全量门禁,符合设计);双发竞态有覆盖(label 发布后若再 merge,closed 路径重触发会被 not-already-live 守卫拦下;重复打标同理);发布后评论步骤非致命。另:我在本分支补了一个独立收紧 commit d5811bf33——label 触发器原来没有 base 分支过滤,且注释声称「pull_request_target 不支持 branches filter」与 GitHub 文档不符(实际支持,按 PR base 匹配);不加的话对任意非 master 目标的 PR 打标签也能武装发布路径(虽仍有版本守卫兜底,但无理由存在)。现在与 closed 路径一致 branches: [master],是收窄不是语义变化。
  6. 是否破坏缓存:不涉及(纯发布基建,不触碰运行时缓存/重试/增量游标)。
  7. 是否改了设计方向:是,刻意且窄——carve-out 通道在原有「合并关闭发布」模式旁新增「标签发布 HEAD 树」模式;header 注释与 reference/release.md(新增 "Conflicted ship PRs (label publish)" 段 + Ship the lane 指针)已同步更新,表述一致。
  8. 是否引入了新的配置:无新 env/config/默认值。唯一新面是仓库标签 backport-ship(已创建,经 API 核实存在)。注意:PR 正文里写的还是旧名 carve-out-ship——commit 77e74e85e 已改名,实际门控标签是 backport-ship,正文措辞过期(正文属原始输入,我不动,仅在此指出)。

CI 状态与新 head d5811bf33:

动作清单:标签已打(bug/p2/scope/ci,见前一条);收紧 commit d5811bf33 已推至 PR 分支;#4599 协调备注已留。

判定:审核通过,可以合。 合并权在你(human-only)。合并后按正文测试计划执行:v0.1.207 ship PR(bugfix-release/v0.1.207-storage-backport @ ec5d3e3e)等 CI 绿后打 backport-ship,预期纯 head 树发布、全守卫绿。

ranxianglei pushed a commit to z0d0dOr/billion-context that referenced this pull request Oct 24, 2026
…same one-word fix as ranxianglei#4606 commit 1; duplicate in-branch per CI-coordination precedent ranxianglei#4607/ranxianglei#4595/ranxianglei#4596, drop on rebase after ranxianglei#4606 merges)
ranxianglei and others added 4 commits October 25, 2026 11:15
…ship PRs

A patch lane cut from an old tag whose fixes already landed on master
conflicts with master at ship time: the merge button refuses, resolving
on the lane would leak unreleased master work into the published head
tree, and resolving on master needs a direct master push. Also, lanes
cut from old tags carry an old release-bugfix.yml that predates the
bugfix-v* marker, so even a clean merge would silently skip publish.

- add pull_request_target [labeled] trigger: the carve-out-ship label on
  an OPEN same-repo ship PR (bugfix-v* / bugfix-release/* head) publishes
  the PR head tree with every existing guard + full gate, no merge needed
- run the master copy of the workflow (pull_request_target), fixing the
  old-tag lane marker gap for this path
- manifest sync check fails open with a notice on pre-#4449 trees (same
  existence-guard philosophy as release-manual's lane guard, #4576)
- annotate the ship PR after publish (audit trail; publish != merge)
- document the label path in reference/release.md (carve-out + ship-the-lane)
…aster

Review finding on #4596: the labeled path lacked the base-branch filter the
closed-PR path carries, and its comment claimed pull_request_target does not
support one -- false per GitHub docs (on.<pull_request_target>.<branches> is
matched against the PR base). A backport-ship label on a PR targeting any
non-master branch would arm the publish path (still version-guarded, but
needlessly). Add branches: [master] to match the closed-PR trigger and fix
the comment.
eb483c6 made every BILI_DUMP_4XX err/summary-err dump lead with
DUMP_PLAINTEXT_BANNER, but the cap budget still measured only the body, so
every file overshot the operator's byte knob by exactly the banner (1024-cap
file => 1111 bytes) and the #4297 final-UTF-8-bytes contract plus the
JSON.parse assertions went red on master (masked until the LIVE_FILES
tripwire stopped failing shards first).

- cappedBudget(): knob minus banner bytes (floor 0), used by both
  dumpRejectedBody and dumpSummaryRejection so the file on disk honors the cap
- #4297 tests: stripDumpBanner before exactness/JSON asserts and banner-aware
  boundary budgets, matching how issue1993/reasoning-echo already consume
  these dumps
@ranxianglei
ranxianglei force-pushed the 2026-10-25_release-bugfix-label-publish branch from df240a5 to d515aea Compare October 25, 2026 03:18
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

冲突已解决:分支已重建到当前 master tip(64fc7324c)之上并推送。旧 head df240a554 → 新 head d515aeae8,GitHub 状态 mergeable: true(当前 blocked 是新 head 的 CI 检查在跑,不是冲突)。

做了什么:master 自分支基点(146b34f27)前进期间,恰好把本分支携带的两个 rider-heal commit 的同款修复合了进来——client-build-note.ts 去 export(master 6f4eb1635/c560a2a3b,#4602)和 live-files.mjs 登记 #3890 测试(master 79eedfd83,#4604)。因此按 floor 10 已定的计划(「等其合入后 rebase 并丢弃重叠的 23baf2b」)执行:cherry-pick 保留 4 个有实际内容的 commit(76882e619 label publish、77e74e85e 改名 backport-ship、d5811bf33 触发器限定 base=master、df240a554 dump banner 计容 rider),丢弃已被 master 吸收的 2 个重复 commit(23baf2bd4、c267b984b)。全程零文本冲突(master 未动过 release-bugfix.yml 与 reference/release.md)。force-push 用了 lease 保护(确认远端仍在 df240a554 才推)。

本地验证(定向,非全量):tsc --noEmit exit 0;tests/error-dump.test.ts 14/14 过;workflow YAML 解析 OK,触发器 = pull_request + pull_request_target + workflow_dispatch;树完整性核对:新 head 与旧 head 的差异 = 仅 master 侧前进的内容 + live-files.mjs 一处注释措辞(保留 master 版,两处注释对 fixture 行为的描述不一致,不在此车道裁决);最终 PR diff vs master = 4 文件(workflow +79/−5、release.md +19/−1、error-dump.ts +10/−2、test +8/−5)。此前卡分片的继承性 LIVE_FILES 红随 master 登记落地而消失,预期新 head 全绿。

需你知晓的一点:df240a554(dump rider,#4297/#4482 follow-up)是运行时行为变更——4xx dump 的字节上限现在会先扣除凭据警告 banner 的占用再截断正文,否则每个 dump 都会恰好超出 BILI_DUMP_4XX_MAX_BYTES 一个 banner 长度,「最终 UTF-8 字节」契约被破坏。它按 rider 先例(#4506)骑在本 release 分支上,使 PR diff 从审核过的 3 文件变为 4 文件;是否随本 PR 一起合、还是拆出去单独走,由你定。

结构化八问:

  1. 是什么问题:PR 分支与 master 冲突(dirty),合并按钮不可用,release lane 被卡。
  2. 什么原因导致的:master 前进 13 个提交,其中两个与本分支的 rider-heal 修复完全同内容(去 export、LIVE_FILES 登记),同一行被两边各改一次 → 文本冲突;不是设计分歧,无需决策。
  3. 影响范围与严重程度:只影响本 PR 的可合并性,用户运行时零影响;严重度 = 操作阻塞。
  4. 怎么修复的:rebase 到当前 master,cherry-pick 保留 4 个有效 commit、丢弃 2 个已被 master 吸收的重复 commit,lease 保护 force-push。
  5. 是否有回归问题:无——逐树核对确认 PR 自身面(workflow 守卫/触发器、文档、dump 上限逻辑)与被审核通过的旧 head 逐字节一致;唯一非 master 来源差异是 live-files 注释措辞,取 master 已合并版本。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及——仍是 floor 10 审核通过的 label-gated head-tree publish 设计,未做任何语义改动。
  8. 是否引入新的配置:无新 env/config/默认值。

收工判定:冲突解决完毕,PR 处于可合并状态(等 d515aeae8 的 CI 转绿即可),合并权在你。

@ranxianglei
ranxianglei merged commit bd29924 into master Oct 25, 2026
21 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.829-master.bd29924 (rolling master tag).

npm install -g billion-context@0.0.829-master.bd29924  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

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

Labels

bug Something isn't working p2 scope/ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant