Skip to content

[PR] Boot contract stubbing: four-lane verifyAttachAndRecover behavior matrix + latch permanence + health glossary (#5241 Pha | 启动契约打桩:四车道 verifyAttachAndRecover 行为矩阵 + 闩锁永久性 + health 词汇表(#5241 阶段 0,只加测试) - #5242

Open
ranxianglei wants to merge 12 commits into
masterfrom
2026-10-31_contract-v2-stake-tests

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

(ai: zai/glm-5.3)

Refs #5241(阶段 0,不 Closes——umbrella 走完全部阶段才关)

这个 PR 做什么:给 #5241 综合治理的第一阶段(打桩)交第一批特征化测试。只新增测试文件,零产品代码改动。钉的是「现在怎样」——包括不一致——让后续抽取共享生命周期时有明确的等价性验收网,改行为时必须显式改桩。

三个桩(8 个测试,全绿):

  1. 四车道 verifyAttachAndRecover 矩阵(contract-v2-stake-verify-attach)

    • S1 健康等版本 target:pi/omp/opencode/dsh 一致 → 原地 attach,不 spawn、不发 shutdown;
    • S2 严格旧版本 target:pi/omp/opencode 照样 attach(无版本轮换);dsh 会轮换+重生(已有 issue3544 专项桩,不重跑)——四车道对同一输入给出不同答案,这是抽取合并前必须显式裁决的分歧;
    • S3 死 target:四车道一致 → spawnFallback 恰一次;env 侧 pi/omp/opencode 把 BILLION_CONTEXT_PROXY 重发布到新 origin,dsh 则解除 preset 改写 register。
    • 每车道一个子进程驱动(contract-v2-stake-lane-probe.mts):实测四车道共享同进程的 global fetch/env/模块状态,同进程顺序驱动会互相污染(一条车道的后台异步会改写另一条的 env 和 spawn 计数)——这本身就是打桩发现,生产现实就是每车道一个宿主进程。
  2. 两把一次性闩锁的永久性(contract-v2-stake-latches)

    • shadow ingest 失败永不自我禁用(owner policy 2026-10-30 「never give up on index writes」):结构性失败每次 save 都重试、warn 按消息去重([Bug][fork] Cold restore cannot use an intact unified raw tail for a non-retained parent (#4266 item 4) #5140)、读保持 unified-first、fork 不 fail-close、stats.disabled 恒 false;故障消失后 record() 能恢复——这里钉的是旧 3-strike 闩锁被政策取代后的现状(C3 契约的对照基线);
    • logger stderrDead:一次失败永久跳过 stderr 腿,warn 恰一条(两条触发路径幂等),日志本身不沉默。闩无导出无 reset 且独占整个进程,所以用子进程驱动。
  3. /__bili/health 词汇表(contract-v2-stake-health)

    • boot 前恰 503 {ok:false, reason:"starting"} 两键;boot 后恰 11 字段快照(键集逐一断言)。今天没有 degraded/lifecycle 词汇——sidecar 闩死、stderr 闩死、车道降级直发在 health 里一个字都不说,C1 要补的就是这个;先钉死,阶段 1 加字段就是显式可见的变更。

验证:三个套件本地全绿(重复跑稳定);tsc --noEmit 干净;相邻回归 issue3544(20)/issue5140(5)/pi-native(19)/opencode-native(65)全绿(opencode 套件须在无 BILLION_CONTEXT_NATIVE 的干净 env 下跑——本机 shell 被 bili pi 钩子标记时会误报,CI 不受影响)。

下一步(等 owner 点头):把四份 verifyAttachAndRecover 的「老方案 vs 新方案对比」写进 #5241 讨论,批准后再动阶段 1。

…#5241 phase 0)

Phase-0 characterization stakes for umbrella #5241 — tests only, zero
product changes. They freeze TODAY's behavior (including the
inconsistencies) so the phase-1 lifecycle extraction has an explicit
equivalence net:

- contract-v2-stake-verify-attach: the four verifyAttachAndRecover
  copies (pi/omp/opencode/dsh) answer a common scenario matrix (healthy
  equal-version / strictly-older / dead target). Pins the S2 divergence:
  pi/omp/opencode attach an older resident untouched, dsh rotates+respawns
  (already pinned by issue3544 suite). Each lane runs in its own child
  process (contract-v2-stake-lane-probe.mts) — the four lanes share the
  host process's global fetch/env/module state and pollute each other
  when driven in-process, which is itself part of the characterization.
- contract-v2-stake-latches: the two one-way latches. shadow stats.disabled
  has NO in-process recovery (healthy records after the latch are
  permanent no-ops — the C3 target); logger stderrDead flips once, warns
  once, and never touches stderr again (driven in a child process because
  the latch owns the whole process lifetime).
- contract-v2-stake-health: /__bili/health answers exactly 503
  {ok,reason:"starting"} pre-boot and an 11-field snapshot post-boot —
  no lifecycle/degradation vocabulary exists yet (the C1 gap, pinned so
  adding fields is a visible, deliberate change).
@ranxianglei ranxianglei changed the title 启动契约打桩:四车道 verifyAttachAndRecover 行为矩阵 + 闩锁永久性 + health 词汇表(#5241 阶段 0,只加测试) [PR] 启动契约打桩:四车道 verifyAttachAndRecover 行为矩阵 + 闩锁永久性 + health 词汇表(#5241 阶段 0,只加测试) Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-31_contract-v2-stake-tests (8cc00e6)

Latest build — install this exact version

npm install -g billion-context@0.0.11174-pr.5242.0352bba

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
8cc00e6 billion-context@0.0.11174-pr.5242.0352bba build
e1d75bc billion-context@0.0.11032-pr.5242.085e033 build
0a84612 billion-context@0.0.10699-pr.5242.5e72506 build
d5864ca billion-context@0.0.10281-pr.5242.aa0787b build
9a81a82 billion-context@0.0.9369-pr.5242.751694e build
d18e0f5 billion-context@0.0.9202-pr.5242.5f1e2fc build
ac991de billion-context@0.0.9180-pr.5242.d25a773 build
9ad1609 billion-context@0.0.9119-pr.5242.dd23c58 build
54523d0 billion-context@0.0.7229-pr.5242.1ad664c build
3518c2f billion-context@0.0.7142-pr.5242.6f41bf5 build

Download artifact

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

Install instructions are refreshed on each push.

contract-v2-stake-latches.test.ts and contract-v2-stake-verify-attach.test.ts
both spawn child processes but were never added to scripts/live-files.mjs, so
run-ci-tests.mjs's SPAWN_RE tripwire (#1248) dies the test lane with
"process-spawning test files missing from LIVE_FILES". Appended both entries
(append-only: slot=index drives each file's zone port band, so mid-list inserts
would renumber later bands). Neither suite binds a shared port — the mock bili
servers are listen(0) and the spawns are stubbed — so no real zone band is
needed; the entries exist for the tripwire alone, like #3890's.
…+ persist flush-waiter ref + win32 shadow db-path + issue4739 closeQuietly + inc-canonical afterNextFlush
…242-conflict

# Conflicts:
#	scripts/live-files.mjs
@ranxianglei ranxianglei changed the title [PR] 启动契约打桩:四车道 verifyAttachAndRecover 行为矩阵 + 闩锁永久性 + health 词汇表(#5241 阶段 0,只加测试) [PR] Boot contract stubbing: four-lane verifyAttachAndRecover behavior matrix + latch permanence + health glossary (#5241 Pha | 启动契约打桩:四车道 verifyAttachAndRecover 行为矩阵 + 闩锁永久性 + health 词汇表(#5241 阶段 0,只加测试) Nov 11, 2026
ci-check added 2 commits November 12, 2026 02:04
… (CI fix for #5242)

The phase-0 stake pinned the 3-strike self-disable latch that owner policy
b9eb27a (2026-10-30, "never give up on index writes") removed from
src/storage/shadow.ts hours before this branch forked from its base — the
stale expectation red every CI shard after rebase onto master.

Rewritten to pin the landed contract on the same fault seam: structural
strikes never disable (stats.disabled stays false), one warn per distinct
message (#5140 dedup), lastError carries the latest failure, healthy records
resume ingesting once the fault clears, full-mode reads stay unified-first,
and fork publication does not fail closed. Fixture now opens in FULL mode so
readsUnified is a live gate (shadow mode made it structurally false).
Tests-only; no product code touched.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

PR #5242 的两个 blocker(与 base 分支冲突 + CI 三片红)本轮已全部处理完,head ac991de7 上 30 项 check 全绿(镜像缓存实测:failed 0 / pending 0)。过程如下。

做了什么

  1. 冲突:唯一冲突文件 scripts/live-files.mjs(append-only 数组)。解法:保留 master 新增的 5 条在其原位置不动,PR 的 2 个新测试文件追加到数组末尾(fresh slot,tests/preload-zone-slot.mjs 的端口带编号不受影响),共 66 条、无重复、全部在盘上存在。merge commit 9ad1609b7d,plain push。
  2. CI 红的根因(git 历史查证,非 master 回归):master b9eb27a448(owner policy 2026-10-30「never give up on index writes」)把 src/storage/shadow.ts 里的「3 次结构错误自禁用 sidecar」闩锁整个移除;本 PR 的 stake 测试从更早的 base 分出,仍钉着已被移除的旧行为 → 三个红片(u22/3、u24/3、win22/4)全是同一个断言 three structural strikes latch the sidecar(expected true, actual false)。
  3. 修法(纯测试,零产品代码改动,commit f922f13e82):同一 fault seam(sync.getBlocks 抛 "file is not a database")下改写 stake,钉住已落地的契约——结构错误永不 self-disable(stats.disabled 恒 false)、warn 按 distinct message 去重([Bug][fork] Cold restore cannot use an intact unified raw tail for a non-retained parent (#4266 item 4) #5140)、stats.lastError 携带最新失败细节、故障清除后健康记录恢复 ingest(retry-forever、可恢复)、full 模式读恒 unified-first(ingest 健康不参与读门)、createForkAsync 不再 fail-closed。fixture 从 shadow 模式改为 BILI_STORAGE_UNIFIED=full——只有 full 模式让 readsUnified 成为活门(shadow 模式下它结构性恒 false,原断言是假阳性)。
  4. push 前 master 又前进(33104b1 → c26c31a,~20 commits,[PR] Web Panel: Handoff Documentation and Collapsed Tree Diagram Rendering Upgrade (eWork-Level Rendering, Appendix Sectionin | Web 面板:交接文档与压缩树图渲染升级(eWork 级渲染、附录分节、冻结快照水合) #6260/Request two capabilities: compressed block "retirement" and summary "external rewrite". | 请求两个能力:压缩块「退役」与摘要「外部重写」 #5765 等),干净合入无冲突(merge commit ac991de70e);合并树上 rebuild + typecheck + 定向测试全绿后 plain push(未 force-push;push 前两次 fetch 确认远端 head 未被并发推进)。
  5. live 核验(本轮实测,非记忆):镜像缓存 sha=ac991de7,summary {total:30, failed:0, pending:0},11 个 test 分片全 success;一次性 GET 确认 PR mergeable=true(无冲突)。mergeable_state=blocked 且全部 check 已过 → 是必需评审/批准类分支保护,非 CI 或冲突,CI bot 不处理也不应处理(合并本就是 human-only)。

七问

  1. 是什么问题:PR [PR] Boot contract stubbing: four-lane verifyAttachAndRecover behavior matrix + latch permanence + health glossary (#5241 Pha | 启动契约打桩:四车道 verifyAttachAndRecover 行为矩阵 + 闩锁永久性 + health 词汇表(#5241 阶段 0,只加测试) #5242([Design] Host contract v2: pin behavior with stubs first, then unify lifecycle / capability declaration / degradation re | [Design] 宿主契约 v2:先打桩固定行为,再统一生命周期/能力声明/降级恢复/入口实测(讨论通过后才动工)| [Design] Host contract v2: pin behavior with tests first, then unify lif… #5241 阶段 0 契约打桩,只加测试)有两个 blocker——与 base 分支 dirty 冲突;rebase 后 CI 三个分片红,且都是同一个测试失败。
  2. 什么原因导致的:① 冲突:双方都往 append-only 的 LIVE_FILES 数组尾部追加;② CI 红:master b9eb27a448 按 owner 既定政策移除了 sidecar 自禁用闩锁,而本 PR 的 stake 测试钉的是分叉前旧 base 上的已废弃行为——过期期望(stale stake),不是代码回归。
  3. 影响范围与严重程度:仅本 PR 自己新增的测试文件受影响;产品代码零 diff;严重度 = PR 无法合并(CI 红 + 冲突),对用户零影响。
  4. 怎么修复的:冲突按数组语义追加式解决(master 条目原位保留、PR 条目末尾 fresh slot);CI 红按 owner 已在 b9eb27a 拍板的政策重写 stake 为落地契约(retry-forever / 不自禁用 / 可恢复 / 读不翻 legacy / fork 不 fail-closed),fixture 切 full 模式使关键断言成为真门。全部机械性修复,无设计决策点。
  5. 是否有回归问题:审过的既有行为——LIVE_FILES 完整性(tripwire 复刻 run-ci-tests.mjs 检查:66 条/无重复/全在盘/PR 两文件仍在末位)、shadow.ts 产品代码零 diff、同文件其余测试(stderr-dead latch、isStreamWriteError 真值表、S1/S2/S3 attach 矩阵)在 pushed head 上 CI 全绿。无回归。
  6. 是否破坏缓存:不涉及——纯测试改动,不触运行时路径,无缓存/重试/游标逻辑。
  7. 是否改了设计方向 / 引入新配置:不涉及——无架构转向,无新 env/config/默认值;测试只是把 owner 已裁决的行为(b9eb27a)钉进回归网。

判定:两个 blocker 均已解除,CI 全绿(head ac991de,live 验证),PR 处于可人工评审/合并状态;剩余 blocked 仅为必需批准项,等 human 操作即可收工。

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(ai: opencode/qwen3.8-27b)

APPROVE — test-only PR(#5241 阶段 0 特征化打桩),零产品代码、不涉 kernel/、不动配置面。独立审核结论如下(非复读 issue 侧结论)。

独立验证

① 原 issue 方向:#5241 阶段 0 流程规则 = 先用特征化测试钉「现在怎样」(含不一致),老 vs 新对比经 owner 批准后才动实现。本 PR 严格照此执行,三个桩钉的都是 master 现状而非「应该怎样」。我逐条对照生产代码复核(不是只读 diff):

  • 四车道矩阵:pi-native.ts:188 / omp-native.ts:294 / opencode-native.ts:335 / dsh-native.ts:775 四份 verifyAttachAndRecover 拷贝各自经 armNative*+singleFlight 挂到 state.respawn,生产唯一入口;S1/S3 断言与代码路径吻合(健康 → 原地 attach,spawn/shutdown 均 0;死 target → spawnFallback 恰一次,env 重发布 / dsh 解 preset + 改 register)。S2「无轮换只有 dsh」成立:pi/omp/opencode 三份拷贝版本抓取成功后无条件 attach(无版本比较),仅 dsh 有 isVersionNewer→rotatePinnedStaleProxy(dsh-native.ts:799-818);dsh 的 S2 分歧已有专项桩 tests/issue3544-stale-proxy-rotation.test.ts:392,此处正确地不重跑、只记录分歧事实并留给阶段 1 裁决——没有静默抹平。
  • health 词汇表:src/server/admin.ts:306 boot 前恰 503 {ok:false,reason:"starting"} 两键;:314 boot 后恰 11 字段快照——与桩的键集断言逐一吻合;absence 循环(lifecycle/state/mode/degraded/reason 等)正是 C1 要补的 gap,有意钉死。
  • 闩锁:logger.ts 的 markStderrDead 幂等、warn 恰一条、同步抛错与流 error 事件双路径都翻闩(log() 先 capture 后写 stderr,capture sink 不受闩影响)——子进程桩的断言机制上全部成立;shadow.ts:245 "Nothing is ever disabled; the next save retries the write",stats.disabled 恒 false、故障消失后 record() 能恢复——桩钉的是 b9eb27a 政策落地后的现状(C3 的对照基线),方向正确。

② 回归审查:diff 触碰路径 = scripts/live-files.mjs(+2 行注册)+ 4 个新测试文件。既有行为清单:产品代码零改动,不存在被触碰的既有行为。live-files.mjs 的改动是 CI tripwire 的强制要求(scripts/run-ci-tests.mjs:145-153:凡 SPAWN_RE 匹配的文件必须登记否则 CI 红),两个 spawn 子进程的新套件均已登记 ✓。无语义漂移、无 fail-fast 变吞错、无阈值/时序/输出格式变化。结论:无回归。

③④ 代码与测试有效性:hermetic 充分(mkdtemp + BILI_CONFIG_FILE 隔离、listen(0) 随机端口、NODE_TEST_CONTEXT 解除 MCP-entry 自启动守卫——claude-mcp-entry.ts:127 / zcode/mcp-entry.ts:201 有对应 if (process.env.NODE_TEST_CONTEXT !== undefined) return;,probe 的设置有据)。每车道独立子进程驱动避免共享 fetch/env/模块状态互污(PR 正文给出实测现象;生产现实也是每车道一个宿主进程),probe 末尾 PROBE 行打印后 force-exit(车道模块留后台定时器)合理。断言有牙:精确键集、精确计数(spawns==1 / shutdowns==0)、值级 deepEqual、warn 去重计数 ==1、isStreamWriteError 真值表逐格——行为任一漂移桩必红,非恒真测试。

证据:head ac991de 镜像缓存全绿(30 checks,0 failed / 0 pending,gated 车道按惯例 skip);本地定向复跑 8/8 绿(需先 build kernel dist);tsc --noEmit 干净;分支 base = 当前 master tip(c26c31a),不陈旧。PR 正文列的相邻回归(issue3544/issue5140/pi-native/opencode-native)由作者跑过,CI 全绿再覆盖一遍。

已顺手修

  1. 删未使用 import:tests/contract-v2-stake-health.test.ts:15 before、tests/contract-v2-stake-verify-attach.test.ts:27-29 fs/os/path + commit d18e0f5(修后本地套件复跑绿 + typecheck 干净)
  2. PR 描述 stale 表述:stake-2 的 shadow 半段还是 CI-fix commit f922f13 之前的旧措辞(称「3 次结构性失败闩死后进程内不存在任何恢复路径……永久 no-op」),与最终代码相反(最终桩钉的是 landed never-give-up 行为:永不自我禁用、故障消失后可恢复)→ 已 PATCH PR 正文对应段对齐最终桩语义(API PATCH,无 commit)

CI 会为新 head d18e0f5 重跑一轮(仅删 import,零行为变化;旧 head 已全绿)。合并动作归人类。

八问

  1. 是什么问题:非缺陷修复——#5241 宿主契约 v2 治理的阶段 0:用特征化测试先钉住四车道 attach/recover 行为、两把闩锁现状、health 应答词汇表,为后续统一重构提供等价性验收网。
  2. 什么原因导致的:N/A(非 bug)。根因动机:四车道各有一份 verifyAttachAndRecover 拷贝且行为分歧(仅 dsh 轮换严格旧版本 target)、health 无法表达降级状态——不先钉「现在怎样」,阶段 1 统一重构就没有验收基准。
  3. 影响范围与严重程度:对产品行为零影响(test-only)。作用面 = 未来回归检测能力;若桩缺失,阶段 1 重构无等价性网(内部风险,无外部用户影响)。
  4. 怎么修复的:三个独立套件;每车道独立子进程驱动避免全局状态污染;精确键集/精确计数强断言;不一致被有意钉死(S2 跨车道分歧作为事实记录、留阶段 1 显式裁决,不抹平)。
  5. 是否有回归问题:无。产品代码零改动;唯一非测试文件 live-files.mjs 加两条登记(CI tripwire 强制要求)。无语义漂移、无吞错、无阈值/时序/输出格式变化。
  6. 是否破坏缓存:不涉及(未触碰缓存/重试/游标/去重逻辑)。
  7. 是否改了设计方向:无转向;这正是 #5241 声明的方向基础(阶段 0 打桩 → 阶段 1 统一),未来改行为必须显式改桩,构成可见变更账本。
  8. 是否引入了新的配置:无。BILI_ATTACH_EVIDENCE_GRACE_MS / BILI_ATTACH_HEALTH_DEADLINE_MS 是既有 knob(native-intercept.ts:1196 等),仅在 probe 子进程内收紧用于计时控制。

判定:可合并(APPROVE;新 head d18e0f5 的 CI 重跑预期绿,合并动作归人类)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 PR #5242 审核完成:APPROVE / 可合并(test-only,零产品代码、不涉 kernel/)。GitHub review 已提交(review id 5866229151)。

独立验证(非复读 issue 结论)

  • 三个桩逐条对照生产代码复核:四车道 verifyAttachAndRecover 矩阵与 pi/omp/opencode/dsh-native.ts 的代码路径吻合(S1 原地 attach 零 spawn/shutdown;S3 spawnFallback 恰一次;S2「无轮换只有 dsh」成立——pi/omp/opencode 三份拷贝版本抓取成功后无条件 attach,仅 dsh 有 isVersionNewer→rotate;dsh 分歧已有专项桩 issue3544:392,此处正确地不重跑只记录分歧)。health 两态形状(admin.ts:306 boot 前 503 两键 / :314 boot 后 11 字段)与桩的键集断言逐一吻合;logger 双路径翻闩(同步抛错 + 流 error 事件,幂等、warn 恰一条)+ shadow never-give-up 现状(b9eb27a 落地后)机制上全部成立。
  • 回归审查:无回归。diff 仅 live-files.mjs +2 行(CI tripwire 强制登记,scripts/run-ci-tests.mjs:145-153)+ 4 个新测试文件;产品行为零触碰,无语义/阈值/时序/输出格式漂移。
  • 证据:旧 head ac991de 镜像缓存全绿(30 checks,0 failed / 0 pending);本地定向复跑 8/8 绿 + tsc --noEmit 干净;分支 base = 当前 master tip(c26c31a),不陈旧。

已顺手修(2 处,均已落 PR 分支)

  1. 删未使用 import:tests/contract-v2-stake-health.test.ts:15 before、tests/contract-v2-stake-verify-attach.test.ts:27-29 fs/os/path + commit d18e0f5(修后本地复跑绿 + typecheck 干净);
  2. PR 描述 stale:stake-2 的 shadow 半段还是 CI-fix commit f922f13 之前的旧措辞(称「闩死后进程内不存在任何恢复路径、永久 no-op」),与最终代码相反(最终桩钉的是 landed never-give-up:永不自我禁用、故障消失后可恢复)→ 已 API PATCH PR 正文对齐最终桩语义。

说明:GitHub API 不允许作者账号对自己 PR 提交 APPROVE review(422),按舰队惯例以 COMMENT review 提交、正文首行明确 APPROVE/可合并判定(同 #5681 模式);若分支保护要求正式 approve,owner 合并时点一下即可。新 head d18e0f5 的 CI 会重跑一轮(仅删 import,零行为变化)。

协调一行:#5241 阶段 0 打桩 PR #5242 审核完毕——APPROVE,2 处机械性小修已进 PR 分支(d18e0f5),CI 重跑中,待人类合并。

ranxianglei added a commit that referenced this pull request Nov 11, 2026
…phase 1, PR-1a)

First lane migration of the approved phase-1 plan (#5241 comment): the
verifyAttachAndRecover lifecycle moves from pi-native.ts into a shared
native-attach.ts, parameterized by a per-lane NativeLaneSpec (publish /
unpublish / onEvent / spawn seam / bootstrap). Pure transposition — the
pi lane's observable behavior is unchanged, proven by the phase-0 stake
matrix (tests/contract-v2-stake-verify-attach.test.ts) passing untouched.

Also lands the one-lane-per-process guard (armNativeLane): the four lane
implementations all assume they are alone in the process (same
BILLION_CONTEXT_PROXY env var, same global fetch-intercept slot, background
timers that outlive any call). Phase-0 probing (#5242) showed two armed
lanes in one process overwrite each other within milliseconds. Production
never does this — the guard makes the implicit contract explicit and
plainly worded. Re-arming the same lane stays legal (tests/restarts);
a second, different lane throws. omp/opencode/dsh keep their own copies
until their migration PRs; their suites and issue3544 stay green untouched.

Net: pi-native.ts -77 lines, one spec + one-line wrapper in their place.
ranxianglei added a commit that referenced this pull request Nov 12, 2026
…phase 1, PR-1b)

Second lane migration: omp's verifyAttachAndRecover swaps its private copy
for the shared native-attach.ts lifecycle via a NativeLaneSpec, exactly as
pi did in PR-1a (#5244). Pure transposition — the phase-0 stake matrix
(tests/contract-v2-stake-verify-attach.test.ts) passes untouched.

omp specifics preserved through spec hooks instead of being silently
unified: every origin write funnels through omp's publishOrigin() so a
test-pinned probe base (_setOmpOriginForTest) survives a mid-suite attach
verify / respawn landing, and the fallback branch's state clear routes
through the same guard — hence the new optional clearOrigin spec hook
(default remains the direct state.origin = undefined the other lanes use).

armNativeOmp now calls armNativeLane("omp"): the one-lane-per-process
contract (BILLION_CONTEXT_PROXY + fetch-intercept slot are per-process
singletons — #5242 phase-0 stakes) is enforced for both migrated lanes.
opencode/dsh keep their own copies until PR-1c/1d; their suites stay green
untouched (issue3544 20/20, opencode-native 65/65).
…242-conflict

# Conflicts:
#	scripts/live-files.mjs
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

重启后状态核实:floor 44 交代的冲突(上游 PR 冲突 dirty)在前一个会话卡死前已完成并推送——它卡在等 CI 结果上。本轮逐项 live 验证(非记忆),全部处于收工状态。

现状(live 实测)

八问

  1. 是什么问题:PR [PR] Boot contract stubbing: four-lane verifyAttachAndRecover behavior matrix + latch permanence + health glossary (#5241 Pha | 启动契约打桩:四车道 verifyAttachAndRecover 行为矩阵 + 闩锁永久性 + health 词汇表(#5241 阶段 0,只加测试) #5242([Design] Host contract v2: pin behavior with stubs first, then unify lifecycle / capability declaration / degradation re | [Design] 宿主契约 v2:先打桩固定行为,再统一生命周期/能力声明/降级恢复/入口实测(讨论通过后才动工)| [Design] Host contract v2: pin behavior with tests first, then unify lif… #5241 阶段 0 契约打桩,纯测试)与 master 再次脱节(floor 44「上游 PR 冲突 dirty」),需一次处理冲突与红项。
  2. 什么原因导致的:master 持续前进,PR 分支基于旧 base → dirty;旧 head 上的红项是继承性陈旧信号。
  3. 影响范围与严重程度:仅本 PR 的合并信号;对用户零影响(纯测试 PR,零产品代码)。
  4. 怎么修复的:标准冲突流程——merge origin/master 进 PR 分支、push(未 force-push);merge 后 CI 全量重跑验证,红项消失确认是继承性而非本 PR 缺陷。
  5. 是否有回归问题:无。merge 只带入 master 变更;PR 自身 diff(4 桩文件 + LIVE_FILES 2 行)不变,新 head 全绿。
  6. 是否破坏缓存:不涉及(纯测试,不触运行时路径)。
  7. 是否改了设计方向:不涉及。
  8. 是否引入新配置:不涉及。

判定:PR #5242 处于可人工评审/合并状态——冲突已解、CI 全绿(head 9a81a826a9 live 验证),剩余 blocked 仅为必需批准项,等 human 合并即收工。

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(ai: opencode/qwen3.8-27b)

Review(第 2 轮)—— head 9a81a826a vs master 259cd87674

Delta since 第 1 轮(d18e0f5):纯 master 重同步。 PR 侧唯一新提交是 merge 9a81a826a("Merge remote-tracking branch 'refs/remotes/origin/master' into wt-pr5242-conflict"),parents = d18e0f5(PR 侧,含我第 1 轮的 import 修复)+ 259cd87(当前 master tip)。零新增 PR 内容;分支 base 现等于当前 master tip,不陈旧。

合并解法核对(唯一双方都碰的文件):scripts/live-files.mjs——merge 结果对两个 parent 分别 diff:master 侧新增的两条登记(tests/pack-install.test.ts、tests/ci-janitor-fork-heads.test.ts)完整保留,PR 侧的两条登记(tests/contract-v2-stake-latches.test.ts、tests/contract-v2-stake-verify-attach.test.ts)也完整保留——干净的并集,无丢更新,两侧 CI tripwire 登记都在。

钉死面漂移检查:master 窗口(c26c31a..259cd87)未触碰三个桩钉的任何源面——src/server/admin.ts(health 两态)、src/logger.ts(stderr 闩)、src/storage/shadow.ts(never-give-up stats)、四车道模块 pi/omp/opencode/dsh-native.ts、src/agent/native-intercept.ts、src/storage/ingest.ts——桩断言对新 master 依然有效。kernel 在窗口内有移动(compress.ts 小修 + 版本 bump,是合入 master 的独立 kernel 发布),但本 PR 不碰 kernel/、桩也不钉该 kernel 行为,两层 CI(kernel 套件 + bili 套件)已覆盖。

证据:head 9a81a82 镜像缓存全绿(30 checks,0 failed / 0 pending);本地在新 head 上定向复跑 8/8 绿(kernel dist 已按新树重建)。

本轮无新发现;第 1 轮两处机械性修复(d18e0f5 + PR 正文 PATCH)继续有效。

八问

  1. 是什么问题:非缺陷修复——#5241 宿主契约 v2 阶段 0 特征化打桩(四车道 attach/recover 矩阵、两把闩锁现状、health 词汇表),为统一重构提供等价性验收网。本轮 delta = 纯 master 重同步,无新问题。
  2. 什么原因导致的:N/A(非 bug);根因动机同第 1 轮(四车道拷贝行为分歧 + health 不可表达降级,先钉现状才有验收基准)。
  3. 影响范围与严重程度:对产品行为零影响(test-only);作用面 = 未来回归检测能力,无外部用户影响。
  4. 怎么修复的:三个独立套件 + 每车道独立子进程驱动 + 精确键集/计数强断言;本轮仅验证 merge 解法(并集完整)与钉死面未漂移。
  5. 是否有回归问题:无。本轮 merge 唯一双方触碰文件 live-files.mjs 已逐 parent 核对为干净并集;master 窗口未触碰任何桩钉源面;产品代码零改动。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:无转向;仍是 #5241 阶段 0 打桩基础。
  8. 是否引入了新的配置:无(仅使用既有 knob)。

判定:可合并(APPROVE;合并动作归人类)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 PR #5242 第 2 轮审核完成:APPROVE / 可合并(新 head 9a81a82)。GitHub review 已提交(review id 5880087858)。

本轮 delta = 纯 master 重同步(merge 9a81a82,parents = d18e0f5 + 当前 master tip 259cd87,零新增 PR 内容)。核对结果:

  • 唯一双方触碰文件 scripts/live-files.mjs 的合并解法 = 干净并集(master 侧 pack-install / ci-janitor-fork-heads 两条登记与 PR 侧两条 stake 登记都在,无丢更新);
  • master 窗口未触碰三个桩钉的任何源面(admin health / logger 闩 / shadow stats / 四车道模块 / native-intercept / ingest),桩断言对新 master 依然有效;
  • 证据:新 head 镜像缓存全绿(30 checks,0 failed / 0 pending)+ 本地新 head 定向复跑 8/8 绿。

本轮无新发现、无新修复;第 1 轮两处机械性修复(d18e0f5 + PR 正文 PATCH)继续有效。

协调一行:#5241 阶段 0 打桩 PR #5242 第 2 轮(纯 master 重同步)审核完毕——APPROVE,无新发现,待人类合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

冲突已解并推送,head d5864ca72f,live 验证 mergeable=true。 本轮(auto-fix attempt 1/6)全程动作如下。

做了什么

  1. live 核实(非记忆):PR head 仍是 9a81a826a9,master 已从 259cd87674 前进到 f648217cb8([PR] Gate completion: restart lane to add Anthropic line (Claude) + fix double-execution bug on P lane | gate 补全:重启车道加 anthropic 线(claude)+ 修 P 车道双重执行 bug #6823/[PR] Update cache health statistics in README #6824 等合入),mergeable=false / dirty 坐实。
  2. 合入:checkout PR 分支 → merge origin/master(纯 merge,未 rebase、未 force-push)。唯一冲突文件 scripts/live-files.mjs(append-only 数组,双方都往尾部追加):master 新增的 2 条(web-logs-query、content-encoding-zstd)保留在原位置不动,PR 的 2 条(contract-v2-stake-latches、contract-v2-stake-verify-attach)追加到数组末尾取 fresh slot——与上一轮同一解法,既有 slot 的端口带编号全部不受影响。
  3. 验证:合并树无冲突残留;LIVE_FILES 71 条、无重复、全部在盘;用 run-ci-tests.mjs:103 的逐字 SPAWN_RE 复刻 tripwire 复扫,无漏登 spawner;npm run typecheck 干净;PR 三个桩套件定向复跑 8/8 绿。
  4. 推送:push 前 fetch 确认远端 head 未被并发推进(仍 9a81a826a9),plain push 9a81a826a9 → d5864ca72f(merge commit,parents 9a81a826a9 + f648217cb8)。
  5. 推送后 live 核实:GitHub API 实测 mergeable=true、base = 当前 master tip f648217cb8;mergeable_state=blocked 是分支保护的必需评审/批准项,非冲突,bot 不处理。

七问

  1. 是什么问题:PR [PR] Boot contract stubbing: four-lane verifyAttachAndRecover behavior matrix + latch permanence + health glossary (#5241 Pha | 启动契约打桩:四车道 verifyAttachAndRecover 行为矩阵 + 闩锁永久性 + health 词汇表(#5241 阶段 0,只加测试) #5242(阶段 0 契约打桩,纯测试)与 master 再次脱节(dirty),需解冲突恢复可合并状态。
  2. 什么原因导致的:master 持续前进(3 天新增 [PR] Gate completion: restart lane to add Anthropic line (Claude) + fix double-execution bug on P lane | gate 补全:重启车道加 anthropic 线(claude)+ 修 P 车道双重执行 bug #6823/[PR] Update cache health statistics in README #6824 等),PR 分支 base 停在 259cd87674;双方在 append-only 的 LIVE_FILES 尾部各自追加 → 文本冲突。
  3. 影响范围与严重程度:仅本 PR 的合并信号;对用户零影响(纯测试 PR,零产品代码)。
  4. 怎么修复的:标准 merge 流程 + 按数组 append-only 语义解冲突(master 条目原位、PR 条目末尾 fresh slot),push 前 fetch 防并发,推送后 live 复核 mergeable。
  5. 是否有回归问题:无。merge 只带入 master 变更;PR 自身 4 个桩文件零改动;typecheck + 8/8 桩测试 + tripwire 逐字复刻全过。
  6. 是否破坏缓存:不涉及(纯测试,不触运行时路径)。
  7. 是否改了设计方向 / 引入新配置:不涉及。

判定:冲突 blocker 已解除,d5864ca72f 上的 CI 会重跑(以 CI 结果为准,本轮不轮询);若绿则 PR 回到「可人工评审/合并」状态,剩余 blocked 仅为必需批准项,等 human 合并。

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(ai: opencode/qwen3.8-27b)

Review(第 3 轮)—— head d5864ca72f vs master f648217cb8

Delta since 第 2 轮(9a81a82):又是纯 master 重同步。 PR 侧唯一新提交是 merge d5864ca72f("Merge remote-tracking branch 'origin/master' into wt-pr5242-conflict"),parents = 9a81a82(第 2 轮 head)+ f648217(当前 master tip),merge-base = master tip,零新增 PR 内容。

合并解法核对(唯一双方都碰的文件):scripts/live-files.mjs——对两个 parent 分别 diff:master 侧新增的三条登记(tests/storage-open-busy-lock.test.ts、tests/web-logs-query.test.ts、tests/content-encoding-zstd.test.ts)完整保留,PR 侧的两条 stake 登记也完整保留——干净并集,无丢更新。

钉死面漂移检查(本轮 master 窗口较大,逐文件读过):master 窗口(259cd87..f648217)确实触碰了桩钉的源文件,但没有一处改变桩钉的行为:

  • src/agent/dsh-native.ts(+168):工具注册生命周期重构(ToolsOwner + tools/change 恢复,#6702 Cordis 重启场景)——只动注册就绪判定,verifyAttachAndRecover / spawnFallback / 版本轮换 / env 重发布路径未动;S3 断言(registerBase=SPAWNED、envAfter null)钉的 respawn 分支原样;
  • src/storage/shadow.ts(+79):视图校验的 suffix 对齐(#4390 家族)+ 媒体归一化 digest(#6351)+ 两个新 accessor——save 路径、disabled 恒 false 契约、warn 去重逻辑未动,闩锁桩断言全部有效;
  • src/agent/native-intercept.ts(+13):Request 重建时透传 AbortSignal——不涉 attach/recover;
  • src/agent/pi-native.ts(+14):direct-send 超尺寸守卫武装(#4894)+ 测试钩子;src/agent/omp-native.ts(+17):recovery-owner 头标记 + applyOmpMessageThreadsOff(#6088)+ 测试钩子;src/agent/opencode-native.ts(+6):仅注释更新——三者均不触碰 attach/recover/spawn/env 行为;
  • src/server/admin.ts(health 两态)与 src/logger.ts(stderr 闩)在窗口内零改动。

证据:head d5864ca CI 全绿(48 check-runs:36 success + 12 skipped,0 failed,0 in_progress);本地在新 head 上定向复跑 8/8 绿(kernel dist 已按新树重建)。

本轮无新发现;第 1 轮两处机械性修复(d18e0f5 + PR 正文 PATCH)继续有效。

八问

  1. 是什么问题:非缺陷修复——#5241 宿主契约 v2 阶段 0 特征化打桩(四车道 attach/recover 矩阵、两把闩锁现状、health 词汇表),为统一重构提供等价性验收网。本轮 delta = 纯 master 重同步,无新问题。
  2. 什么原因导致的:N/A(非 bug);根因动机同第 1 轮(四车道拷贝行为分歧 + health 不可表达降级,先钉现状才有验收基准)。
  3. 影响范围与严重程度:对产品行为零影响(test-only);作用面 = 未来回归检测能力,无外部用户影响。
  4. 怎么修复的:三个独立套件 + 每车道独立子进程驱动 + 精确键集/计数强断言;本轮仅验证 merge 解法(并集完整)与钉死面未漂移(逐文件核对 master 窗口 6 个触碰文件)。
  5. 是否有回归问题:无。本轮 merge 唯一双方触碰文件 live-files.mjs 已逐 parent 核对为干净并集;master 窗口对 6 个桩钉源文件的改动逐一读过,均未改变桩钉行为;产品代码零改动。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:无转向;仍是 #5241 阶段 0 打桩基础。
  8. 是否引入了新的配置:无(仅使用既有 knob)。

判定:可合并(APPROVE;合并动作归人类)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 PR #5242 第 3 轮审核完成:APPROVE / 可合并(新 head d5864ca)。GitHub review 已提交(review id 5913695481)。

本轮 delta = 纯 master 重同步(merge d5864ca,parents = 9a81a82 + 当前 master tip f648217,零新增 PR 内容)。本轮 master 窗口较大,对桩钉源文件逐一读过:

  • 唯一双方触碰文件 scripts/live-files.mjs 合并解法 = 干净并集(master 三条新登记 + PR 两条 stake 登记都在);
  • dsh-native.ts(+168,工具注册生命周期重构 dsh: stale tool readiness after same-context reload or adopted-owner disposal #6702)、shadow.ts(+79,视图校验对齐 + 媒体归一化 digest)、native-intercept.ts(+13,AbortSignal 透传)、pi/omp/opencode-native.ts(守卫武装/头标记/注释)——均未改变桩钉的 attach/recover/spawn/env/闩锁/health 行为;admin.ts 与 logger.ts 窗口内零改动;
  • 证据:CI 全绿(48 check-runs:36 success + 12 skipped,0 failed)+ 本地新 head 定向复跑 8/8 绿。

本轮无新发现、无新修复;第 1 轮两处机械性修复(d18e0f5 + PR 正文 PATCH)继续有效。

协调一行:#5241 阶段 0 打桩 PR #5242 第 3 轮(纯 master 重同步,窗口内钉死面逐一核对未漂移)审核完毕——APPROVE,无新发现,待人类合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

冲突已解并推送,head 0a84612b6a,live 验证 mergeable=true。 本轮(auto-fix attempt 1/6)动作如下。

做了什么

  1. 唤醒检查(CI-hold 纪律):远端 head d5864ca72f 的 commit message 无 [ework:ci-held] 标记——上一轮正常收工,不是中途死亡,无需补推。
  2. live 核实:master 已从 f648217cb8 前进到 0e475ceb4f([PR] batch-2: 4 held Afloat16 fixes (2 as-is, 2 with review-patch commits) #7101 batch + 两个 fix 合入),PR mergeable=false / dirty 坐实。
  3. 合入:merge origin/master 进 PR 分支(纯 merge,未 rebase、未 force-push)。唯一冲突仍是 scripts/live-files.mjs(append-only 数组尾部碰撞):master 新增的 upstream-ca-default-trust(55d1f69)保留在原位置,PR 的 2 条 stake 条目追加到末尾取 fresh slot——与前两轮同一解法,既有 slot 端口带编号不受影响。
  4. 验证:无冲突残留;LIVE_FILES 72 条、无重复、全部在盘;用 run-ci-tests.mjs:103 逐字 SPAWN_RE 复刻 tripwire 复扫无漏登;npm run typecheck 干净;PR 三个桩套件定向复跑 8/8 绿。
  5. 推送:push 前 fetch 确认远端 head 未被并发推进(仍 d5864ca72f),plain push d5864ca72f → 0a84612b6a(merge commit,parents d5864ca72f + 0e475ceb4f);这是本分支的最终 head 推送,未带 [ework:ci-held] 标记,触发唯一一次完整 CI。
  6. 推送后 live 核实:GitHub API 实测 mergeable=true、base = 当前 master tip 0e475ceb4f;mergeable_state=blocked 为分支保护必需评审项,非冲突,bot 不处理。

七问

  1. 是什么问题:PR [PR] Boot contract stubbing: four-lane verifyAttachAndRecover behavior matrix + latch permanence + health glossary (#5241 Pha | 启动契约打桩:四车道 verifyAttachAndRecover 行为矩阵 + 闩锁永久性 + health 词汇表(#5241 阶段 0,只加测试) #5242(阶段 0 契约打桩,纯测试)与 master 第三次脱节(dirty),需解冲突恢复可合并状态。
  2. 什么原因导致的:master 持续前进([PR] batch-2: 4 held Afloat16 fixes (2 as-is, 2 with review-patch commits) #7101 等),PR base 停在 f648217cb8;双方在 append-only 的 LIVE_FILES 尾部各自追加 → 文本冲突。
  3. 影响范围与严重程度:仅本 PR 的合并信号;对用户零影响(纯测试 PR,零产品代码)。
  4. 怎么修复的:标准 merge 流程 + 按数组 append-only 语义解冲突(master 条目原位、PR 条目末尾 fresh slot),push 前 fetch 防并发,推送后 live 复核 mergeable。
  5. 是否有回归问题:无。merge 只带入 master 变更;PR 自身 4 个桩文件零改动;typecheck + 8/8 桩测试 + tripwire 逐字复刻全过。
  6. 是否破坏缓存:不涉及(纯测试,不触运行时路径)。
  7. 是否改了设计方向 / 引入新配置:不涉及。

判定:冲突 blocker 已解除,0a84612b6a 上的 CI 会重跑(以 CI 结果为准,本轮不轮询);若绿则 PR 回到「可人工评审/合并」状态,剩余 blocked 仅为必需批准项,等 human 合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] (ai: vllm-qwen/qwen3.8-27b)
CI 自动修复 attempt 1/6 完成:win22/4 是继承自 master 的红,不是本 PR 引入;已报告 #4599,等哨兵把修复收敛到 ci-fixes

1. 是什么问题:PR 的 test (windows-latest, 22, 4) 分片红了,失败文件是 tests/server-process-listeners.test.ts。这不是本 PR 引入的——master 自己在同一文件上也是红的(继承性失败)。

2. 什么原因导致的:根因在 master 侧——该文件是 #7101 批次(6acab22 + 894835a,今天合入 master 的 0e475ce)新加的测试,首次 CI 运行即在 Windows 上确定性失败:subtest 1-2 通过后,文件进程在 subtest 3 开始前静默 exit 1(测试 log:false 吞掉了错误日志),隔离串行重跑复现、全量重试也失败。本 PR 报在 win22/4 的原因:PR 新增的 3 个 stake 测试文件改变了 weighted LPT 分片(586 个文件换片),该文件从 windows shard 5 挪到了 shard 4——master 自己在 win22/5 + win24/5 报同一失败,签名逐字相同。

3. 影响范围与严重程度:所有在 Windows 上跑该文件的 CI 分片必红(master 的 win22/5、win24/5 与本 PR 的 win22/4);ubuntu 不受影响。对 master 是可用性级 CI 红(阻塞合入)。

4. 怎么修复的:按 CI 协调政策,master 级修复必须收敛到 ci-fixes(哨兵统一维护),不能在本 PR 分支修。本轮做了:① 逐字比对 master 与 PR 的失败签名(同文件、同形态、同复现方式);② 本地复算 LPT 分片,证明 shard 5→4 的挪片,且两树文件列表差异只有 3 个 stake 文件;③ 确认 origin/ci-fixes 已完全包含在本分支中(merge 为 no-op,#2929 修复已落地 master),无东西可推;④ 完整签名已报告 #4599,请求哨兵收敛修复。

5. 是否有回归问题:不涉及——本轮未改任何代码、未推任何 commit。

6. 是否破坏缓存:不涉及。

7. 是否改了设计方向:不涉及。

8. 是否引入了新的配置:不涉及。

状态:PR head 0a84612 保持不动;30 项 check 中 29 项绿,仅 win22/4 红(继承)。哨兵把修复收敛到 ci-fixes 后,我会在下一次唤醒 merge ci-fixes + push 转绿。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] (ai: vllm-qwen/qwen3.8-27b)
重复唤醒,同 head 0a84612 同红——live 复核:状态无变化。win22/4 仍红(继承 master 红,分析见上一条八问);ci-fixes 仍在 7247410(修复未落地),master 仍在 0e475ce。无可推内容、无动作可做,继续等哨兵把修复收敛到 ci-fixes(签名已报 #4599)。修复落地后我在下一次唤醒 merge ci-fixes + push 转绿。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] (ai: vllm-qwen/qwen3.8-27b)
冲突已解决并推送:merge commit e1d75bc(普通 push,未 force;push 前已 fetch 确认远端 head 无并发变更)。mergeable=true,mergeable_state=blocked(分支保护,等人工合并)。

做了什么

八问

  1. 是什么问题:PR 分支落后 master([PR] fix: #7156 storage-corruption fallout — webSummaryRows json_valid guard, .chk close-time gate, first-write corruption classification #7173 合入后),merge 状态 dirty。
  2. 什么原因导致的:master 与 PR 各自在 scripts/live-files.mjs 的 LIVE_FILES 数组末尾追加新条目,文本冲突。
  3. 影响范围与严重程度:仅影响本 PR 可合并性;无产品代码、无用户面影响。
  4. 怎么修复的:merge master 进 PR 分支,冲突按 append-only 惯例解决(双方条目都保留),无语义变更。
  5. 是否有回归问题:无——tripwire 双向、typecheck、8/8 stake 测试全绿;改动只是注册表追加,既有行为未动。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

遗留:win22/4 的继承性 master 红(tests/server-process-listeners.test.ts,#7101 批次新测试)仍在等哨兵把修复收敛到 ci-fixes(签名已报 #4599)——本次 push 触发新一轮 CI,该红预计持续,修复落地后我再 merge ci-fixes + push 转绿。

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(ai: opencode/qwen3.8-27b)

Review(第 4 轮)—— head e1d75bcd5a vs master 1e357bf2d6

Delta since 第 3 轮(d5864ca):又是纯 master 重同步,且是两次。 PR 侧新增提交只有两个 merge:e1d75bcd5a(parents = 0a84612 + 1e357bf 当前 master tip)和中间的 0a84612(parents = d5864ca + 0e475ce)——作者在本轮之间做了两次 re-sync。git log d5864ca72f..e1d75bcd5a --not origin/master 只剩这两个 merge 提交本身,零新增 PR 内容。

合并解法核对(唯一双方都碰的文件):scripts/live-files.mjs——对两个 parent 分别 diff:master 侧新增的登记(tests/storage-integrity-cache.test.ts,#7156)完整保留,PR 侧的两条 stake 登记也完整保留——干净并集,无丢更新。

钉死面漂移检查(本轮 master 窗口 ~212 提交,对触碰的 4 个桩钉源文件逐一读过):

  • src/agent/dsh-native.ts:purpose 头盖戳(#6880,x-bili-plugin-purpose 随 llm/stream dispatch 上行)+ 压缩覆盖读数一次性输出(#6770)+ gateCoverageSuffix 改用 compactionCoverageText()——均为请求头/日志面,verifyAttachAndRecover / spawnFallback / 版本轮换 / env 重发布路径未动;
  • src/agent/omp-native.ts:prepareDirectSend 从 createPrepareDirectSend() 换成 createOmpDirectSendGuard()(direct-send 路径同时丢弃 prompt_cache_key)——只动降级直发守卫,attach/recover/spawn 未动;
  • src/storage/ingest.ts:纯新增导出(planStoredMessageRow + HandoffReplyStashRow 接口,#6947 handoff reply stash)——既有函数零改动;
  • src/storage/shadow.ts:#7156 修复——index.db 打开路径的首次写失败增加 corruption 分类(损坏 → 无索引启动 + 响亮告警,不写 verdict 缓存)——save 路径与闩锁契约(disabled 恒 false、saved/lastError 语义、warn 去重、故障清除后恢复)零改动,闩锁桩断言全部有效;
  • src/server/admin.ts(health 两态)与 src/logger.ts(stderr 闩)在窗口内零改动。

证据:head e1d75bc CI 全绿(30 checks,0 failed / 0 pending);本地在新 head 上定向复跑 8/8 绿(kernel dist 已按新树重建)。

本轮无新发现;第 1 轮两处机械性修复(d18e0f5 + PR 正文 PATCH)继续有效。

八问

  1. 是什么问题:非缺陷修复——#5241 宿主契约 v2 阶段 0 特征化打桩(四车道 attach/recover 矩阵、两把闩锁现状、health 词汇表),为统一重构提供等价性验收网。本轮 delta = 纯 master 重同步(两次),无新问题。
  2. 什么原因导致的:N/A(非 bug);根因动机同第 1 轮(四车道拷贝行为分歧 + health 不可表达降级,先钉现状才有验收基准)。
  3. 影响范围与严重程度:对产品行为零影响(test-only);作用面 = 未来回归检测能力,无外部用户影响。
  4. 怎么修复的:三个独立套件 + 每车道独立子进程驱动 + 精确键集/计数强断言;本轮仅验证 merge 解法(并集完整)与钉死面未漂移(逐文件核对 master 窗口 4 个触碰文件)。
  5. 是否有回归问题:无。本轮 merge 唯一双方触碰文件 live-files.mjs 已逐 parent 核对为干净并集;master 窗口对 4 个桩钉源文件的改动逐一读过,均未改变桩钉行为(omp 的 direct-send 守卫换型与 dsh 的 purpose 头都在桩断言面之外);产品代码零改动。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:无转向;仍是 #5241 阶段 0 打桩基础。
  8. 是否引入了新的配置:无(仅使用既有 knob)。

判定:可合并(APPROVE;合并动作归人类)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 PR #5242 第 4 轮审核完成:APPROVE / 可合并(新 head e1d75bc)。GitHub review 已提交(review id 5987623043)。

本轮 delta = 纯 master 重同步,且是两次(中间 merge 0a84612 + 本轮 merge e1d75bc,parents 均指向 master;--not origin/master 只剩这两个 merge 提交本身,零新增 PR 内容)。本轮 master 窗口 ~212 提交,对触碰的 4 个桩钉源文件逐一读过:

本轮无新发现、无新修复;第 1 轮两处机械性修复(d18e0f5 + PR 正文 PATCH)继续有效。

协调一行:#5241 阶段 0 打桩 PR #5242 第 4 轮(纯 master 重同步×2,窗口内钉死面逐一核对未漂移)审核完毕——APPROVE,无新发现,待人类合并。

Resolve the single conflict in scripts/live-files.mjs: both sides added
entries to the same LIVE_FILES array position (PR #5241 phase-0 added the
two contract-v2 stake suites; master added the #7156 storage-backup-repair
suite). Kept all three entries — purely additive, no logic change.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Conflict resolved and pushed. Here is what I did this run (auto-fix lane, attempt 1/6).

What happened. The PR branch 2026-10-31_contract-v2-stake-tests was dirty against master. Merging current origin/master produced exactly one conflict: scripts/live-files.mjs. Both sides had appended entries to the same LIVE_FILES array position — the PR added its two #5241 phase-0 stake suites, master added the #7156 storage-backup-repair suite. I kept all three (purely additive, no logic change), confirmed there were no other conflicts and no stray markers anywhere in the tree, and pushed a clean fast-forward (no force-push was needed) as the unmarked final head → 8cc00e6b68f.

Local verification (this run, not memory):

  • The PR's own diff vs master is purely additive (526 insertions / 0 deletions: 4 new test files + the live-files entries), so there was no semantic-conflict surface beyond that one list merge.
  • LIVE_FILES integrity: 74 entries, no duplicates, every entry points to a real file on disk.
  • Replicated the exact CI spawn tripwire (scripts/run-ci-tests.mjs:103 SPAWN_RE + the :145-157 registration gate) against the pushed tree: every LIVE_FILES entry exists, and zero unregistered spawners → the #1248 tripwire passes.
  • Confirmed the pushed head contains all of current master (clean fast-forward, no force-push).

CI state (stated honestly). The mirror cache still reports the previous head e1d75bcd5ab (its last full pass was all-green: every test shard, static-gates, mysql-contract, test-import-graph, lock-sync, lifecycle-ledger-guard, pi-subagents-guard = success; gated e2e lanes = skipped). CI on the new head 8cc00e6b68f has not completed within this run, so I am not asserting green for it — it will re-run on the pushed head.

One transparency note. My first attempt at this reply was posted to the wrong thread (mirror issue #5242, a different/closed PR) due to a mirror-vs-GitHub number mix-up. I have posted a clarifying note there; this #5245 thread is the correct home for the work.

八问:

  1. 是什么问题:PR 分支与 master 产生合并冲突(merge state dirty),阻塞了本 PR 的合并与 CI。
  2. 什么原因导致的:两边在同一位置向 scripts/live-files.mjs 的 LIVE_FILES 数组追加了不同条目——PR 侧加了 [Design] Host contract v2: pin behavior with stubs first, then unify lifecycle / capability declaration / degradation re | [Design] 宿主契约 v2:先打桩固定行为,再统一生命周期/能力声明/降级恢复/入口实测(讨论通过后才动工)| [Design] Host contract v2: pin behavior with tests first, then unify lif… #5241 phase-0 的两个 stake 测试套件,master 侧加了 [Bug][storage] Takeover spawns before reclaim: old and new sidecars simultaneously hold index.db, causing corruption; em | [Bug][storage] 接管时先 spawn 后回收:新旧侧车同时持有 index.db 引发损坏;空 payload_json 又让历史会话静默变 0 #7156 的 storage-backup-repair 套件;git 无法自动合并「同一数组位置的新增项」,故报冲突。
  3. 影响范围与严重程度:仅阻塞本 PR 的合并与 CI,不影响任何已发布行为;属合并卫生问题,无用户面影响。
  4. 怎么修复的:把 master 合并进 PR 分支,对唯一冲突文件 scripts/live-files.mjs 保留双方全部条目(纯追加、无逻辑改动);确认无其他冲突、无残留冲突标记、LIVE_FILES 无重复且全部在盘、逐字复刻 tests/claude-native.test.ts linux live-E2E subtests fail/hang in shared multi-agent sandboxes #1248 spawn tripwire 通过后,以干净 fast-forward 推送(未 force-push)。
  5. 是否有回归问题:无。PR 自身 diff 相对 master 是纯新增(526 增 / 0 删),唯一重叠文件是字符串列表,保留双方条目不改变任何既有行为;其余自动合并文件均为 master 单侧改动,PR 从未触碰,无语义冲突面。涉及真实端口带的既有 LIVE_FILES 条目位置全部未动,仅在该数组尾部追加三条 tripwire-only 登记(这三条都不绑真实端口,注释已明说 zone 带无关)。
  6. 是否破坏缓存:不涉及。未触碰任何缓存/重试/增量游标/去重键逻辑。
  7. 是否改了设计方向:不涉及。纯合并冲突解决,无架构/边界/数据流变化。
  8. 是否引入了新的配置:不涉及。无新增 env/config/默认值。

判定:冲突已解决并推送,分支已包含全部当前 master;新 head 的 CI 本轮尚未跑完,不在此断言绿。

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

Development

Successfully merging this pull request may close these issues.

1 participant