Skip to content

[PR] Add bili sessions orphan-sweep: remove provably-foreign collapsed blocks from upgraded sessions (D2, #5308) - #5334

Open
ranxianglei wants to merge 4 commits into
masterfrom
2026-10-31_orphan-block-sweep
Open

ranxianglei wants to merge 4 commits into
masterfrom
2026-10-31_orphan-block-sweep

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

What this fixes (D2 of #5095, tracked as #5308)

A collapsed block committed under a shared conversation id during the ≤v0.1.208 era reappears forever in the parent session after upgrading to ≥v0.1.209:

  • The #2695 zombie-reap exemption shelters it. A block whose covered substrate was never verified present on this session's wire keeps e==0, so it never accrues a death streak and is never reaped (src/fold-reconcile.ts). That exemption exists exactly so healthy proxy-mode folds (whose covered ids are permanently replaced by the anchor and never reappear) are not reaped. A foreign block from the shared-id era has the same signature — "covered ids never on this session's wire" — so the same exemption gives it permanent shelter.
  • Meanwhile the render side (kernel/src/sync.ts stillPresent) keeps the block active as long as any covered-id hash collides with the current request or its anchor is present — which happens readily when the parent and the dead child read the same files. So the foreign summary keeps being re-rendered into the parent transcript, polluting context indefinitely.
  • Once rendered into the client's persisted history the bytes become the client's own; the resent copy carries an h_ hash (not acp_summary_bN), so no proxy-side stale-copy drop can remove it afterward. There is no automatic cleanup path for provably-foreign legacy blocks.

Only upgraded sessions that lived through ≤v0.1.208 are affected (the lane split in #4774 / #5184 / #5163 means new foreign blocks can no longer be produced).

The fix — host-side sweep, option A (owner-pre-approved in #5095 / #5308)

New command bili sessions orphan-sweep [id] [--fix] [--json]:

  • Provably-foreign criterion, not a heuristic: a block is flagged when its set of covered message ids has zero overlap with its own session's unified-store transcript — reading active AND retired rows (a folded message's row is retired/tombstoned, never deleted, so it still proves the substrate belonged to this session). Zero overlap ⇒ the block references ids that never existed in this session's durable record ⇒ provably external/orphan.
  • Legit folds are structurally safe: any genuine fold of this session leaves its covered rows in the store (active or retired), so its overlap is non-empty and it is never swept. This is the negative gate that protects normal compression.
  • Dry-run by default — reports findings only, changes nothing. --fix archives.
  • Reversible archive via a metadata exclusion list: --fix records each swept block in session.metadata.orphanExcludedBlocks (blockId → {at, reason}) and persists it to the session's index.db row (advancing updated_at so the write wins the full-mode load staleness guard). buildSession drops listed blocks on load. No kstate rewrite, no schema change — deleting the entry restores the block. Idempotent (already-excluded blocks are filtered out before detection).
  • Requires full unified storage (BILI_STORAGE_UNIFIED=full); in shadow/legacy mode it degrades to read-only reporting and refuses to perform ("cannot prove", never guess).

This clears the b33-class stock. Option B (block carries creation-time conversation-key lineage — precise, no heuristic) is a kernel-boundary design item tracked separately: it needs a kernel-change declaration + owner approval and is deliberately out of scope here.

Config surface

New CLI subcommand (no new env var, no new config-file field):

Surface Added Why the existing surface can't express it Compat
CLI bili sessions orphan-sweep [id] [--fix] [--json] No existing maintenance command covers block-level provenance cleanup; this is a per-session operation, so it sits under bili sessions <sub> next to rm / archive / restore, reusing the existing --fix perform-token convention from bili doctor --fix. Additive. Dry-run by default (report-only). No-op unless invoked with --fix. Gated on full unified storage. Reversible.

Placement note: the issue proposed this as "bili doctor --fix 孤儿块清扫". I placed it under bili sessions because (a) it operates on individual sessions' blocks, matching sessions rm/archive/restore; (b) doctor --fix currently means dsh-ledger repair specifically, and overloading it would blur semantics. Same capability, same --fix token, better home — trivial to move under doctor if you prefer.

Behavior change

None at runtime. The sweep runs only when explicitly invoked. The single load-path change — buildSession now filters out blocks listed in metadata.orphanExcludedBlocks — is a no-op fast path when that key is absent (the default for every existing session), so loading behavior for all current sessions is unchanged until an operator runs orphan-sweep --fix. Old→new: state: mergeState(parsed.state) → state: filterExcludedOrphanBlocks(mergeState(parsed.state), metadata?.orphanExcludedBlocks); identical output whenever the exclusion list is empty.

Verification

Closes #5308

Related: #5095 (source, D1 closed) · #5184 / #5163 (D1 two-layer fix) · #2695 (e-gate origin) · #3640 (anchor parking) · #4774 (lane split)

ework-agent and others added 2 commits October 31, 2026 16:16
…WN_FINGERPRINT in LIFECYCLE.md (#4599)

The lifecycle-ledger-guard job fails on every tree containing master since c8d7a80 (#4788 phase 2) and fc53fd4 (#4125): two BILI_* env vars read from src/ were never registered in LIFECYCLE.md, so every PR based on current master goes red within seconds (first observed on #5037).

Backfill only, no code change: BILI_SESSION_CONTENT_STORE_PIN -> section 1 transition ledger (escape hatch for #4788 phase 2 idle-fold, default fold); BILI_SPAWN_FINGERPRINT -> section 2.2 internal spawn channel (#4125 spawner-side entry-script hash, launcher to child).
…(D2, #5308)

A collapsed block committed under a shared conversation id during the <=v0.1.208 era reappears forever in the parent session after an upgrade: the #2695 e-gate exemption shelters it (never-present substrate never accrues a death streak) while the render side keeps it active on any covered-id collision. No wire-side path reaps it.

Add a host-side maintenance sweep (bili sessions orphan-sweep [id] [--fix]) that flags blocks whose covered ids have ZERO overlap with their own session's unified-store transcript (active + retired rows) - provably foreign. Dry-run by default; --fix archives via a metadata-backed exclusion list that buildSession honors on load (reversible, no kstate rewrite). Legit folds always retain their covered rows, so they are never swept.
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-31_orphan-block-sweep (29fde22)

Latest build — install this exact version

npm install -g billion-context@0.0.7472-pr.5334.2c0aa80

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
29fde22 billion-context@0.0.7472-pr.5334.2c0aa80 build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title Add bili sessions orphan-sweep: remove provably-foreign collapsed blocks from upgraded sessions (D2, #5308) [PR] Add bili sessions orphan-sweep: remove provably-foreign collapsed blocks from upgraded sessions (D2, #5308) Oct 31, 2026
@ranxianglei ranxianglei added the p1 label Oct 31, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复 —— 本 PR 是 #5308-D2(#5095「孤儿块清理」第 2 项)的唯一实现;按失败签名与关键词检索 open+closed issue/PR,无并行工作。

标签: bug + scope/storage + p2(从原 p1 下调:这是 ≤v0.1.208 时代的有限存量污染,不是缓存泄露类只增不减的失控增长;受影响会话仍可用、有绕行,符合 p2 口径)+ 保留 pr。

中间状态(代码审核已完成,CI 红分账已完成):

  1. 代码侧:7 个文件的实现已逐项对照既有行为核验(归档会话不会误伤、retired 行不删故零重叠判定成立、staleness guard 保证 --fix 不被旧 JSON 回灌等),未发现缺陷;新测试带双向断言(Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617 纪律)。
  2. CI 红(head 29fde22)共 3 条静态门,已在纯净 master f6e69ae 与 PR head 两棵树上本地复跑确认分账:

修复合入后等 CI 重跑,再给最终八问结论。

@ranxianglei ranxianglei added bug Something isn't working p2 scope/storage labels Oct 31, 2026
ci-check added 2 commits October 31, 2026 18:09
…inding, OrphanSweepPlan)

The two helper interfaces are only used inside src/orphan-sweep.ts; the
module-boundary surface is detectOrphanBlocks/applyOrphanSweep/OrphanSweepResult.
Self-introduced violation of the #2643-era gate on this PR branch (the other
finding, CodexWindowSource, is inherited master red awaiting ci-fixes).
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

最终结论(八问)

  1. 是什么问题:≤v0.1.208 共享会话 id 时代,折叠块可能被提交到「不属于它」的会话名下;升级后这些块在父会话里永久复活渲染——每次请求都带着幻影内容,污染上下文、白烧 token。此前没有任何清理路径(Claude Code sub-agents of the same type share a single compaction lane: unrelated sessions bleed content into each other | Claude Code 同类型子代理共用一条压缩车道:无关会话互相串内容、折叠暂停;旧版共享父 id 的折叠块升级后仍残留在父会话 #5095 的 D2)。本 PR 新增 bili sessions orphan-sweep(默认 dry-run,--fix 归档)并在加载时过滤被排除的块。
  2. 什么原因导致的:因果链两层——(a) 产源:共享 id 时代把 A 会话的折叠状态写进了 B 会话的记录;(b) 为何杀不掉:两个机制互相庇护——kernel e-gate 对「substrate 从未出现过」免计死亡连击 + render 侧 stillPresent 只要任一 covered id 撞上父会话读过的消息就判 active;而唯一能收尸的 orphan-gc 只看当前 wire,这类碰撞恰好落在 wire 上。本 PR 的判别器改用存储存在性(与 wire 存在性独立):covered ids 与会话 unified-store transcript 行零重叠 ⇒ 可证外来;合法折叠必然保留其 covered 行(retire 不 delete),故永不被误伤。
  3. 影响范围与严重程度:仅 ≤v0.1.208 升级来的存量会话(新版本不再生成新孤儿);受影响会话仍可用,只是上下文带幻影内容 + token 成本;有限存量、非只增不减 → p2(已从 p1 下调,理由见上条回复)。--fix 仅在 full 统一存储模式生效,shadow/legacy 只报 performable=false 不动数据。
  4. 怎么修复的:检测 = 逐会话比对 block.effectiveMessageIds 与 store transcript msg_ids(active+retired,两侧经 baseIdOf 归一);transcript 为空的会话直接跳过(判据空真,防误报)。修复 = 写 metadata.orphanExcludedBlocks 排除清单(可逆、不改写 kstate),buildSession 加载时按清单过滤 state.blocks。测试是真行为断言且双向齐全(Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617):外来块被抓/重叠的合法块不被抓、dry-run 无副作用、--fix 只归档外来块、重载后外来块消失且合法块保留、幂等、清掉清单即还原——全部跑在真实 full-mode store 上,不是恒真断言。
  5. 是否有回归问题:逐项审过的既有行为——① 归档会话:loadAll() 枚举含 tombstone 的全量行,但归档会话无 transcript 行 → 命中跳过分支,不会误伤;② 「retire 永不 delete」前提:src/storage/store.ts 全部 4 处 DELETE FROM messages 逐一核验——ingest-repair 只删 retired 字节重复且 live twin 同 msg_id 存活、另两处是整会话删除/整会话归档,均不产生「行没了但会话还在」→ 零重叠判定成立;③ staleness guard:full 模式 buildForLoadAll 仅当 JSON savedAt > dbAt 才回灌旧 JSON,sweep 写入 updated_at=now 使 DB 行胜出,排除清单不会被旧文件回灌;④ 排除清单缺失/畸形/空 = no-op fast path,对无此键的正常会话零影响;⑤ 未触碰 kernel/、wire 格式、配置面、消息 ref/id 逻辑。已知局限(与既有 sessions rm/archive、storage gc 同类,非本 PR 引入):持有 --fix 之前内存态的宿主进程若在 --fix 之后落盘会覆盖排除清单,直到该会话下次 fresh load——PR 正文已声明「next load/restart 生效」,属离进程维护命令的共同模型。
  6. 是否破坏缓存:不影响前缀缓存/重试/去重键——过滤发生在加载期(state.blocks 收缩),出站渲染照常走服务端正史;排除清单存 metadata_json,不参与 wire 身份与 checkpoint。
  7. 是否改了设计方向:没有。Option B(块携带创建时 lineage)明确留作 kernel 侧独立项(Legacy foreign fold blocks linger forever in parent session after upgrade | 旧版共享父 id 的外来折叠块升级后在父会话永生残留 #5308),本 PR 只做 host 侧维护命令 + 加载期过滤,与现有 storage-maintenance 命令族一致。
  8. 是否引入新配置:无 env/config 字段。新 CLI 子命令 bili sessions orphan-sweep [id] [--fix] [--json];复用既有 --fix flag 名(与 doctor 的 --fix 互斥,因两条命令本身互斥)。

CI 现状与处置(head 29fde22 → 新 head 2d8f680 已推送):3 条静态门红 = 双树本地复跑分账——unused-exports 里 2 条本 PR 自带(OrphanBlockFinding/OrphanSweepPlan 无模块边界引用)已按门禁处方在分支修掉(commit 978ab77);lifecycle-ledger-guard 继承红已 merge ci-fixes@0371089db 转绿(本地 OK);docs-sync(#5319 ±"chat" 种子漂移)与 CodexWindowSource 两条继承红待哨兵收敛进 ci-fixes,已在 #4599 留言。test 矩阵此前因门红被 skip,尚无全量套件判定——等收敛后重跑即为终审证据(本地未跑全量,遵本地测试纪律)。

判定:代码本身审核通过、可合;当前被 2 条继承红阻塞,哨兵把 docs-sync 种子修复与 CodexWindowSource 收敛进 ci-fixes 后,分支再 merge 一次即可全绿合入。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

This conflict is not mechanical — it can't be resolved without a product decision, so I stopped instead of picking a side. Nothing was pushed; the branch 2026-10-31_orphan-block-sweep is clean at head 2d8f680.

What I found. Merging current master into this branch collides in src/cli.ts and src/storage-maintenance.ts for one single reason: master already contains a complete implementation of this exact D2 fix.

  • Master ships src/foreign-block-sweep.ts + the CLI command bili sessions foreign-blocks (--apply reversibly archives, --restore <sid>:<bid> brings one back). Its header literally reads #5312 D2.
  • This PR adds src/orphan-sweep.ts + bili sessions orphan-sweep [id] (--fix). Its header reads #5308 (D2).

Both solve the same problem from #5095's D2 leg (this PR's issue = #5308): legacy foreign fold blocks from the ≤v0.1.208 shared-parent-id era that linger forever in a parent session after upgrade. Same detection criterion (a block whose covered ids have zero overlap with its own session's persisted transcript ⇒ provably foreign), same kernel mechanism cited (kernel/src/sync.ts stillPresent), same option-A / option-B framing (option B = kernel lineage field, a separate item). They are two implementations of one fix; master's landed first.

Merging this PR would therefore introduce a second, near-duplicate command with a different apply mechanism (this PR writes a metadata exclusion list orphanExcludedBlocks honored by buildSession on load; master uses a hard unifiedArchiveBlock with an explicit --restore). Two writers for one job is exactly the fragmentation this repo avoids — so I'm not going to silently keep both or silently drop one.

What this PR uniquely has (both minor, both foldable into foreign-blocks):

  1. Per-session scoping — orphan-sweep [id] (master's foreign-blocks scans all sessions; it only scopes restore, not the scan).
  2. Storage-mode reporting — prints full/shadow/legacy and gates --fix on full mode.

Options:

  • A (recommended): close this PR as superseded by the already-shipped bili sessions foreign-blocks. It already covers detection + reversible archive + restore; nothing here justifies a second command.
  • B: salvage the two unique bits (per-session [id] scan scope + storage-mode reporting) into foreign-blocks, then close this PR.
  • C: merge keeping both commands. Not recommended — redundant surface, two divergent apply mechanisms managing the same blocks.

Default if undecided: A.

Per-option impact / regression:

  • A: zero change to shipped code; no user-facing loss (foreign-blocks already does the job, arguably better UX via explicit restore). Cost: discards the parallel implementation.
  • B: small additive change to foreign-blocks (one optional flag); low risk; keeps the ergonomic extras.
  • C: adds a redundant command; risk of user confusion and double-management of the same blocks through two mechanisms; against the anti-fragmentation policy.

I'll act on your pick. (Note: this workdir has no add-label.sh, so the needs-decision tag rides on this comment rather than a label.)

@ranxianglei

Copy link
Copy Markdown
Owner Author

过期了吗这个?

@ranxianglei

Copy link
Copy Markdown
Owner Author

冲突

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

刚重新拉了最新 master 核过一遍(不凭记忆答):是的,基本过期了——功能上已经被 master 取代。

现状(live 核实):

本 PR 唯一比 master 多的两点(都很小,可并入 foreign-blocks):

  1. 按会话扫描 orphan-sweep [id](master 的 foreign-blocks 只全量扫,只有 restore 能指定单会话);
  2. 打印存储模式 full/shadow/legacy,且 --fix 仅 full 模式生效。

我的建议:直接关掉(选项 A)——核心价值已落地,留着只会多一个重复命令,还带一套不同的 apply 机制(本 PR 用 metadata 排除清单,master 用 hard archive)。

若你想要那两点小功能,可走选项 B:把「按会话扫描」+「存储模式报告」并入 foreign-blocks(朝 #5312 那条线开个小 PR),再关这个。

你拍板即可;我不会擅自关或合(系统规则:关闭权在你手里),定了再动手。默认按 A。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

🔶 需要决策(续:状态无变化,等你拍板)
(ai: qwen/qwen3.8-27b)

又 live 核了一遍:PR #5334 仍 open、与 base 冲突(head 仍是 2d8f680);master(现 33104b1f95)仍带 bili sessions foreign-blocks;你没有新指令。结论不变——这已经不是机械冲突,而是「本 PR 已被 master 的 foreign-blocks(#5312 D2) 取代」的取舍,我不擅自选边(详见我上面两条长说明)。

往下走只需你回一个字母:

  • A(推荐):关掉这个 PR —— 冲突随之作废,不用解
  • B:把「按会话扫描 [id]」「存储模式报告」两点并进 foreign-blocks(朝 billion-context instead of billion-context-pi for pi? #5312 线开个小 PR),再关这个
  • C:两个命令都留 —— 只有这个我才会去做并集合并解冲突

A/B 时这个冲突根本不需要解;C 我才动手合并。拍板前我保持 hold,不重复推分支。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

本轮结论(CI 冲突车道,attempt 1/3):

拍板前保持 hold,默认按 A。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

又一次自动唤醒,live 重核过,无变化:PR #5334 仍 open、与 base 冲突(head 2d8f680);master(33104b1f95)仍带 bili sessions foreign-blocks;你也没有新指令。

补一个新数据点:镜像 upstream-checks 缓存对 #5334 当前返回 0 条 check —— 我这边拿不到一个可信的「现时 CI 绿/红」判定,所以不沿用上轮那条继承红结论当现状说。

仍只差你一个字:A 关掉(推荐)/ B 把「按会话扫描 [id]」「存储模式报告」两点并进 foreign-blocks 再关 / C 两个命令都留(只有这个我才做并集合并解冲突)。拍板前我不重复展开长分析、也不动分支;车道按 24h 窗口自限。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

本轮结论(live 核过,非凭记忆):

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

停车声明(第 4 次自动唤醒,live 核过无变化):PR #5334 仍 open/冲突(head 2d8f680)、master 33104b1f95 仍带 foreign-blocks、你无新指令。

这个冲突不是机械冲突,解法 = 你要不要留两个命令(A 关[推荐]/B 并入再关/C 都留)。拍板前我不再重复长分析、也不动分支——每次自动唤醒我只做 live 核验 + 一句确认,直到状态真的变(你拍板 / PR 或 master 有改动)。

合并、关闭都只能你来。等你一个字母。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

live 核过(第 5 次唤醒):master 前进到 259cd87674,但仍带 foreign-blocks ⇒ 本 PR 仍被取代;PR #5334 仍 open/冲突(head 2d8f680,无人 push);你无新指令。

本轮动作:已给本条正式打上 needs-decision 标签(当前标签:bug / needs-decision / p2 / pr / scope/storage)——按车道规则,这是「停在等你拍板」的正式标记。

仍只差你一个字:A 关掉(推荐)/ B 把「按会话扫描 [id]」「存储模式报告」两点并进 foreign-blocks 再关 / C 两个命令都留(只有这个我才做并集合并解冲突)。合并、关闭都只能你来。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

先说明:上个会话卡了 34 分钟没输出、被强制重启(疑似某次网络调用挂起)。本轮已给所有网络命令加超时,重核全部秒回,不会再挂。

live 重核(本条带超时):master 又前进到 e1f31ad9d5,仍带 foreign-blocks ⇒ 本 PR 仍被取代;PR #5334 仍 open/冲突(head 2d8f680);needs-decision 标签确认还在(bug / needs-decision / p2 / pr / scope/storage);你无新指令。

一个关键事实:上轮打的 needs-decision 标签并没有让自动车道停止接单——本轮它又触发了。所以这个「反复唤醒」的循环只有你能断:关掉(A,推荐) 或 选 B/C。合并、关闭都只能你来。等你一个字母。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

live 核过(带超时,秒回)无变化:master e1f31ad9d5 仍带 foreign-blocks、PR #5334 仍 open/冲突 @2d8f680、needs-decision 标签在、你无新指令。

我这边 agent 能做的都做完了——分析、打标签、每轮 live 核验;没有任何 agent 侧动作能停掉这个循环(needs-decision 标签也试过,车道照样再触发)。唯一出口在你:认可 A 就直接关掉 #5334,循环即止;或选 B / C。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

live 核过(带超时,秒回)无变化:master e1f31ad9d5 仍带 foreign-blocks、PR #5334 仍 open/冲突 @2d8f680、needs-decision 标签在、你无新指令。(上一会话进程死后处理徽标被复位,本轮已恢复并重新核验。)

结论不变:没有任何 agent 侧动作能停掉这个循环,唯一出口在你——认可 A 直接关掉 #5334 即止,或选 B / C。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

第 10 次 live 核过,无变化:master 已推进到 f648217cb8(仍带 foreign-blocks),PR #5334 仍 open/冲突 @2d8f680,needs-decision 标签在,你无新指令。

这个循环只有你能停:认可 A 的话,直接关掉 #5334 即可(关闭权在你,我不能代关)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

第 11 次 live 核过,状态与上次相同:master e0d63bf8c8(仍带 foreign-blocks)、PR #5334 仍 open/冲突 @2d8f680、needs-decision 标签在、你无新指令。

等你 A/B/C 拍板(A=关闭,推荐);关闭权在你,我不能代关。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

第 12 次 live 核过,无变化:master 301e1a5459(仍带 foreign-blocks)、PR #5334 仍 open/冲突 @2d8f680、needs-decision 标签在、你无新指令。

等你 A/B/C 拍板(A=关闭,推荐);关闭权在你,我不能代关。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

第 13 次 live 核过,无变化(master 仍 301e1a5459、带 foreign-blocks;PR #5334 仍 open/冲突 @2d8f680;needs-decision 标签在;你无新指令)。

等你 A/B/C 拍板(A=关闭,推荐);关闭权在你,我不能代关。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

第 14 次 live 核过,无变化(master 仍 301e1a5459、带 foreign-blocks;PR #5334 仍 open/冲突 @2d8f680;needs-decision 标签在;你无新指令)。

等你 A/B/C 拍板(A=关闭,推荐);关闭权在你,我不能代关。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

第 15 次自动唤醒,本轮 live 重核(不凭记忆):master 已推进到 a259e0b8fa,仍带 src/foreign-block-sweep.ts + bili sessions foreign-blocks(头标 #5312 D2)——检测判据与本 PR 的 orphan-sweep(#5308 D2)完全一致(块 covered ids 与本会话持久化 transcript 零交集 ⇒ 可证外来,引用同一 kernel 机制 kernel/src/sync.ts stillPresent),且更完整(三分类 + 显式 --restore + README)。PR #5334 仍 open/dirty @2d8f680,无你的新指令。

这个冲突不是文本冲突,是「功能已被 master 取代」的取舍:唯一的 git 级解法(并集,两个命令都留)= 选项 C,属产品决策,我不擅自选边。本轮未推送、未动分支。

八问(决策请求体例):

  1. 是什么问题:PR 与 master 冲突,根因是同一 D2 修复(Claude Code sub-agents of the same type share a single compaction lane: unrelated sessions bleed content into each other | Claude Code 同类型子代理共用一条压缩车道:无关会话互相串内容、折叠暂停;旧版共享父 id 的折叠块升级后仍残留在父会话 #5095 的 D2 腿)存在两个并行实现,master 的 foreign-blocks 先落地;合并本 PR 会引入第二个重复命令,且 apply 机制不同(本 PR 用 metadata 排除清单,buildSession 加载期过滤;master 用 hard archive + --restore)。
  2. 什么原因导致的:两线并行开发同一修复(Legacy foreign fold blocks linger forever in parent session after upgrade | 旧版共享父 id 的外来折叠块升级后在父会话永生残留 #5308 线 = 本 PR,billion-context instead of billion-context-pi for pi? #5312 线 = master 已合入);本 PR 分支钉在 10-27 的旧 master 上(落后 1831 commit),此后每次合 master 都撞 src/cli.ts + src/storage-maintenance.ts。
  3. 影响范围与严重程度(按选项):
    • A:零代码变更;弃掉本 PR 独有的两点(按会话扫描 [id]、存储模式 full/shadow/legacy 报告);功能无损失(master 版已覆盖)→ 无影响。
    • B:对 foreign-blocks 的小增量(可选 [id] 位置参数 + 模式报告行);低影响,保留人体工学优点。
    • C:新增一个重复命令面 + 第二套 apply 机制管理同一批块;用户可能双通道管理同一块 → 中影响(困惑/漂移风险)。
  4. 怎么修复的(推荐 A):无需修复——关闭本 PR,冲突随之作废,foreign-blocks 维持现状。若选 B:朝 billion-context instead of billion-context-pi for pi? #5312 线开一个小 PR,把 [id] 扫描范围 + 存储模式报告并入 foreign-blocks,再关本 PR。
  5. 回归风险(按选项):
    • A:零(不动任何已发布代码)。
    • B:低——纯增量可选参数,默认行为不变;但属配置面新增,按 Configuration Surface Discipline 需你批准后才实现。
    • C:中——同一块两个 writer、两套可逆机制(排除清单 vs hard archive),与仓库反碎片化原则(一个活一个 writer)相悖。
  6. 是否破坏缓存:三个选项都不影响——维护命令,不碰 wire/前缀缓存/重试/去重键。
  7. 是否改了设计方向:无架构转向;C 与反碎片化方向相悖(故不推荐)。
  8. 是否引入新配置:A 无;B 一个可选 CLI 位置参数 + 报告输出(配置面,需批准);C 第二个命令 + 复用 --fix flag。

选项对比:

选项 动作 代价 推荐
A 关掉本 PR 弃两点小功能 ✅ 推荐
B 两点并入 foreign-blocks 后关本 PR 一个小 PR(配置面需你批准) 可选
C 并集合并,两个命令都留 重复命令面 + 双 apply 机制 不推荐

default-if-undecided:A(关闭)。关闭权在你,我不能代关;拍板前我不重复推分支、不重复长分析。

另:镜像侧标签此前丢失(现查到为空),本轮已按 triage 口径补回 bug / needs-decision / p2 / pr / scope/storage。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

第 16 次 live 核过(带超时,秒回),无变化:master 推进到 a446a3c1c,仍带 foreign-blocks(#5312 D2)⇒ 本 PR 仍被取代;PR #5334 仍 open/dirty @2d8f680(无人 push);你无新指令。

本轮未动分支、未推送。仍只差你一个字母:A 关闭(推荐,默认)/ B 两点并入 foreign-blocks 再关 / C 两个命令都留(仅此我才做并集合并)。完整选项对比与八问见我上一条 🔶 需要决策 评论。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

第 17 次 live 核过,无变化:master a446a3c1c 仍带 foreign-blocks(#5312 D2);PR #5334 仍 open/dirty @2d8f680;你无新指令。未动分支、未推送。等你一个字母:A 关闭(推荐,默认)/ B 并入 foreign-blocks 再关 / C 都留(仅此我才并集合并)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

第 18 次 live 核过,无变化:master 推进到 04ecbb42d,仍带 foreign-blocks(#5312 D2);PR #5334 仍 open/dirty @2d8f680;你无新指令。未动分支、未推送。等你一个字母:A 关闭(推荐,默认)/ B 并入 foreign-blocks 再关 / C 都留(仅此我才并集合并)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

第 19 次 live 核过,无变化:master 推进到 6453feeeb,仍带 foreign-blocks(#5312 D2);PR #5334 仍 open/dirty @2d8f680;你无新指令。未动分支、未推送。等你一个字母:A 关闭(推荐,默认)/ B 并入 foreign-blocks 再关 / C 都留(仅此我才并集合并)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

第 20 次 live 核过,无变化:master 仍 6453feeeb,仍带 foreign-blocks(#5312 D2);PR #5334 仍 open/dirty @2d8f680;你无新指令。未动分支、未推送。等你一个字母:A 关闭(推荐,默认)/ B 并入 foreign-blocks 再关 / C 都留(仅此我才并集合并)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

第 21 次 live 核过,无变化:master 推进到 b10c1a0d4ee,仍带 foreign-blocks(#5312 D2);PR #5334 仍 open/dirty @2d8f680;你无新指令。未动分支、未推送。等你一个字母:A 关闭(推荐,默认)/ B 并入 foreign-blocks 再关 / C 都留(仅此我才并集合并)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

第 22 次 live 核过,无变化:master 推进到 e691e6e3c74,仍带 foreign-blocks(#5312 D2);PR #5334 仍 open/dirty @2d8f680;你无新指令。未动分支、未推送。等你一个字母:A 关闭(推荐,默认)/ B 并入 foreign-blocks 再关 / C 都留(仅此我才并集合并)。

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.

Legacy foreign fold blocks linger forever in parent session after upgrade | 旧版共享父 id 的外来折叠块升级后在父会话永生残留

1 participant