Repository navigation
[PR] kernel: preserve issued refs and quarantine known historical collisions (#5196) - #5233
qiangu2020 wants to merge 7 commits into
Conversation
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 本 PR 对应 GitHub PR #5233(外部贡献者 qiangu2020,分支
标签: bug, scope/kernel, p1(ref 被复用 → 模型引旧 ref 可能解析/压缩到另一条消息,属数据完整性/会话损伤类,按 owner 修订归 p1;无具体客户端,不打客户端标签)。 初审初步发现(完整八问审核随后跟进):
审核进行中,结论稍后以结构化八问回复。 |
Resolve four conflicts where this branch's CI-baseline commit (5f7218c) had independently fixed the same gaps that already landed on master via 527e850 (sessions.hardMaxBytes config docs) and abe4c27 (v9 terminal stamp assert in the ranxianglei#4666 concurrent-boots lock test): - CONFIGURATION.zh-CN.md / LIFECYCLE.md / website/config-reference/process.yaml: take master's registration text (semantically identical; also drops an off-schema default_zh field only this branch had). - tests/issue4666-migration-dedup.test.ts: take master's literal v9 assert, matching the three sibling asserts in the same file. No code conflict: kernel/src/refs.ts, src/* and the rest auto-merged clean; kernel version stays 0.0.171, root package stays 0.1.209.
|
(ai: vllm-qwen/qwen3.8-27b) Merge-guard outcome: merged origin/master (44067a5) into |
|
(ai: vllm-qwen/qwen3.8-27b) Merge-guard re-fire note: no action taken — verified stale. Master has not moved since the resolution above (still 44067a5, 0 new commits) and the branch head fca461e already contains all of master; GitHub currently reports mergeable=true / mergeable_state=blocked (checks + review pending, not a conflict). No new push. |
(ai: vllm-qwen/qwen3.8-27b) 冲突已解决:把 origin/master(44067a5)合入 PR 分支 |
|
(ai: congee/gpt-6.1-sol) Additive refresh complete at Real repository validation: typecheck/build pass; kernel1553/1553; targeted host/ref/fork/recovery/summary/verif/version172/172; newly merged web regression7/7. Official .211 reproduces the four synthetic lifetime-floor/tombstone failures in #5485; repaired source passes all four. Full public-host regression remains remote CI on this head. No full-public-suite pass is claimed. Kernel/message-identity changes still require maintainer scope approval and human review. No approval claim, auto-merge, release, publish or service/store action. Known limits remain in the PR body. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) merge-guard 独立核实(非复读上方结论):新 head |
(ai: vllm-qwen/qwen3.8-27b) PR #5233(镜像 #5235)审核结论 — findings-only(kernel PR,不批准) 先说结论:代码自洽、测试有牙、无阻塞性缺陷;但这是 kernel/message-identity 变更,按 Kernel Boundary 属人工评审合入、禁止 auto-merge,agent 不得批准 → 已走 🔶 需要决策(见下条评论 + CI(head 结构化八问
具体发现(均非阻塞)
判定:代码质量达标、测试兜底到位、无阻塞缺陷;因触碰 |
🔶 需要决策 本 PR(PR #5233 / 镜像 #5235,head 被门禁的 diff:
选项:
建议:A。实现自洽、测试有牙( |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 审核收工(PR #5233 / 镜像 #5235):已独立重做方向/回归/代码/测试审查——代码自洽、测试有牙、无阻塞缺陷。因触碰 |
|
(ai: congee/gpt-6.1-sol) Async fork-publication admission follow-upPushed additive commit
The identical 15-case actual-module suite was RED on the previous public head Local Node 24.21.0 / npm 11.19.0 evidence on commit
Both mandatory host preloads, the zone preload and fresh task-owned HOME/TMP/XDG were used. Dependencies came from an independent cache copy with exact-lock offline npm ci. Builds finished before test imports. This does not claim a complete new local host-suite verdict, production acceptance, real-provider testing, or multi-process publication atomicity. The superseded base This follow-up is now on the existing PR. No merge, npm publication or release action was taken. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 已独立复审本次追加提交 范围核对:本提交为纯 host 侧——未触碰 机制正确性(逐条核对,判定成立):
测试有效性:约 11 个具名因果用例与修复机制一一对应(双发布者预留、in-flight load 不得在 persist 期间 adopt、无发布时 single-flight 保持、锁释放不泄漏 exclusion set、envelope 失败后恢复已 durable 提交的 fork、 CI:新 head 八问(针对本追加提交):
两条非阻塞观察(不拦合并,供 owner/作者定夺):
结论:本追加提交代码自洽、测试有牙、纯 host 侧、无阻塞缺陷。整体 PR 仍停在 owner 内核授权这一步(🔶 需要决策),待 owner 拍板 + 新 head CI 全绿后人工合入。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 🔶 需要决策(仍待)— CI 车道再次被触发,已 live 复核最近楼层(floor 45–51):尚无 owner 对 floor 50 那处内核设计分叉(#5196 封死+隔离 vs #5608-D 延迟 restamp)的 A/B/C 拍板, 结论不变、不重复贴全文(见 floor 50):22 处冲突里 20 处是机械 union,唯一卡点是 按规则停手等拍板;一旦你选定(尤其 A:封死优先于 #5608-D)我立即完成 merge + 推送(push 通道上轮已验证可用)。默认 C=继续 hold。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 🔶 需要决策(仍待 · 第 3 次自动触发)— 刚 live 复核 floor 52–55:仍无 owner 对 floor 50 那处内核设计分叉(#5196 封死+隔离 vs #5608-D 延迟 restamp)的拍板, 为避免这个 dirty 状态让 CI 车道一直空转,给你个最低成本收敛口(回一个字即可):
不重复贴分析全文(见 floor 50)。当前零改动、零回归。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 🔶 需要决策(仍待)— live 复核(floor 56–57 + 镜像缓存 23:31Z):PR head 仍 我这边机械动作已全部做完并停在 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) live 复核(镜像缓存 23:52Z + floor 58–60):PR head 仍 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 重复触发——5 分钟前 floor 60 已回复(live 核:PR head 仍 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 第 8 次触发,零实质变化。镜像缓存 ~2 天陈旧, 唯一卡点不变(owner 对 #5196 vs #5608-D 的取舍),CI 车道不猜解 p1 内核分叉。回 A/B/C 任一字即落地 merge+推送;不再推进则关闭/搁置以止住空转。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 第 9 次自动触发,零实质变化。镜像缓存 ~12h 陈旧, 唯一卡点不变(owner 对 #5196 vs #5608-D 的取舍),CI 车道不猜解 p1 内核分叉。回 A/B/C 任一字即落地 merge+推送;不再推进则关闭/搁置以止住空转。完整选项见 floor 50。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 第 10 次自动触发,零实质变化。镜像缓存 ~25h 陈旧, 唯一卡点不变(owner 对 #5196 vs #5608-D 的取舍),CI 车道不猜解 p1 内核分叉。回 A/B/C 任一字即落地 merge+推送;不再推进则关闭/搁置以止住空转。完整选项见 floor 50。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 第 11 次自动触发,完全零变化——连 master 都未再前进(仍 唯一卡点不变(owner 对 #5196 vs #5608-D 的取舍),CI 车道不猜解 p1 内核分叉。回 A/B/C 任一字即落地 merge+推送;不再推进则关闭/搁置以止住空转。完整选项见 floor 50。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 第 12 次自动触发,零实质变化。镜像缓存 ~28h 陈旧, 唯一卡点不变(owner 对 #5196 vs #5608-D 的取舍),CI 车道不猜解 p1 内核分叉。回 A/B/C 任一字即落地 merge+推送;不再推进则关闭/搁置以止住空转。完整选项见 floor 50。 |
第 13 次自动触发,零实质变化。镜像缓存 ~22h 陈旧, 唯一卡点不变(owner 对 #5196 vs #5608-D 的取舍),CI 车道不猜解 p1 内核分叉。回 A/B/C 任一字即落地 merge+推送;不再推进则关闭/搁置以止住空转。完整选项见 floor 50。 |
第 14 次自动触发,零实质变化。镜像缓存 ~18h 陈旧, 唯一卡点不变(owner 对 #5196 vs #5608-D 的取舍),CI 车道不猜解 p1 内核分叉。回 A/B/C 任一字即落地 merge+推送;不再推进则关闭/搁置以止住空转。完整选项见 floor 50。 |
第 15 次自动触发,完全零变化——连 master 都未再前进(仍 唯一卡点不变(owner 对 #5196 vs #5608-D 的取舍),CI 车道不猜解 p1 内核分叉。回 A/B/C 任一字即落地 merge+推送;不再推进则关闭/搁置以止住空转。完整选项见 floor 50。 |
Cherry-picked from #5233 (qiangu2020) kernel core, rebased onto current master. The deadRefs tombstone infrastructure already landed via #5360; this adds the missing ref floor: - highestIssuedIndex: byRef orphans whose byRaw owner is gone still count - assignRefs: cursor clamped to max(requested, historicalHighWater+1) - ledger stamp accepted only above the floor and outside tombstones - allocateFreeRef skips tombstoned indices - both restamp paths seed nextIndex from the unified floor Prevents lifetime ref reuse after pruning (the #5485 defect). Cherry-picked-from: 3e137c4 (qiangu2020/2026-10-30_ref-safety)
🔶 需要决策(第 18 次自动触发 · live 复核:连 master 都未动)
选项不变(全文见 floor 97/49):A = 本 PR 为准(删 restamp,回退 #5608-D)/ B = 两者共存(需内核评审确认无双重处理)/ C = Hold(推荐默认)。回任一字我立即落地 merge + 推送。本轮零改动、零推送。 |
🔶 需要决策(第 19 次自动触发 · live 复核:master 又前进,分叉依旧)
选项不变(全文见 floor 97/49):A = 本 PR 为准(删 restamp,回退 #5608-D)/ B = 两者共存(需内核评审确认无双重处理)/ C = Hold(推荐默认)。回任一字我立即落地 merge + 推送。本轮零改动、零推送。 |
Problem and scope
Closes #5196. Reported against billion-context 0.1.209. A restart could restamp previously issued refs, and an allocator could reuse historical numbers. A model citing a previously seen ref could then resolve or compress a different message.
kernel-change: preserve issued message refs across restart and prevent historical ref reuse, including low ledgerSeq/dead/reserved ref cases. Host-only removal of restamping is insufficient because the kernel owns allocation and its never-reuse contract.
Changes
No new dependency, database schema, public config, wire surface, behavior budget or threshold. The kernel remains platform-agnostic and has no host I/O. This does not reconstruct intent whose historical evidence was already pruned or missing, nor claim a general multi-process transaction guarantee.
Validation on rebased head
Base: dcf7607 (current official master when checked). The only newer upstream changes were two non-overlapping revert paths; all 25 reviewed file bytes are unchanged after rebase.
Node 24.21.0, real repository commands:
npm run typecheck: exit 0.npm run build: exit 0 (build-info names this repair commit).npm --prefix kernel test: 1494 tests, 1494 PASS, 0 FAIL/SKIP.tests/verif-subset-guard.test.ts: 158 tests, 157 PASS, 1 existing SKIP, 0 FAIL.Prior isolated RED/GREEN probes and independent Standards/Spec closures cover retained collision rejection, before-work mutation boundaries, durable multi-hop quarantine, all active-convergence directions and healthy controls. Full host regression is intentionally left to the remote CI lanes on this pushed head, per AGENTS.md; no local full-host-suite verdict is claimed.
Review and delivery boundary
Kernel/message identity changes require human review and merge. Do not auto-merge. This PR does not publish, merge, activate a service or alter user stores. A separately versioned local-maintained artifact is being prepared for the user's expressly authorized local deployment; its version/provenance metadata is not mixed into this repair PR. Native Prime integration acceptance remains a separate delivery gate.
Baseline CI prerequisite follow-up
Head
5f7218c6cb2329232f27b3b6210988433e1f93a7adds only five baseline prerequisite paths: the existingsessions.hardMaxBytesauthoritative seed, its normal generated EN/ZH outputs, the existing environment knob lifecycle entry, and the stale MySQL concurrent-lock test expectation. The nine original related blobs matched official basedcf76075342dbe57eb1a2b10107aef6235c4289a; the faults predate this ref repair. The test captures the already-initialized MySQL stamp before rewind and demands strict equality after migration, without coupling it to SQLite's separate version constant or changing any lock/dedup/marker assertions.The original 25 ref-repair file hashes remain byte-for-byte unchanged. Root version remains 0.1.209 and kernel 0.0.171; no runtime, schema, guard, workflow, dependency, budget or new public API change. Parent independently ran config-surface/lifecycle/config-docs coverage and clean-commit official generator + git diff: all exit 0. Bounded migration file: 2 SQLite PASS, 3 MySQL explicitly SKIP locally (no service), 0 FAIL. Real MySQL and full regression matrix remain pending the new remote CI run; prior skipped jobs are not represented as test passes. Initial typecheck/build/kernel/targeted host results above were measured at repair commit
58a53c79dfed7333d6764c063296be5b90c75274.No auto-merge or publish. Kernel changes still require human review and merge.
2026-11-01 additive refresh — current validation supersedes older base/version lines above
Fixes #5485 (focused residual lifetime-ref floor/tombstone gap after #5360; original #5196 remains historical context).
This refresh preserves the contributor's existing commits and authorship. It merges current master
0d0c0b956b496761a0512558f444371aaac8531fadditively rather than replacing the contribution. Root package and all plugin manifests remain official0.1.211; in-repo kernel version is0.0.178. No private release metadata is included.Both official #5360 settlement loops retain same-pass retired-seat protection, and BOTH now use historical/tombstone-aware parking. The full current host/kernel changes, including #5253 and #5188, remain present. Five added combined tests cover orphan highwater + tombstones + both settlement paths + overlap dedup/idempotence + atomic exhaustion. The known-collision cold-load, before-work mutation refusal and durable fork/restart/active-store quarantine coverage remains intact.
Native Node24.21.0 / npm11.19.0 validation:
npm run typecheck: exit0.npm run build: exit0; frozen CLI version/commit verified.npm --prefix kernel test:1553 PASS,0 FAIL/SKIP. The later master merge changes only three unrelated web-comment files; kernel/source test bytes are unchanged.Full public host regression is the remote CI matrix on this pushed head; no full-public-suite pass is claimed here. Kernel/message identity changes require explicit maintainer approval and human review. No approval, auto-merge, release, npm publish, service activation or store migration is claimed. This cannot reconstruct historical intent whose identity evidence was already pruned and is not a general multi-process transaction-safety claim.