Skip to content

[PR] fix: freeze avoided-token accrual when a fold's kernel block dies - #5651

Open
ranxianglei wants to merge 3 commits into
masterfrom
2026-11-04_grosssaved-dead-fold-freeze
Open

ranxianglei wants to merge 3 commits into
masterfrom
2026-11-04_grosssaved-dead-fold-freeze

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #5646

查重: 无(open+closed issue/PR 检索 grossSaved/savings/overview/multiply-count,无既有条目)

What was wrong

Overview grossSavedTotal / netSavedTotal / savedUsdTotal kept booking requests against folds whose kernel block had LEFT the session's compression state (reaped zombie substrates #2695, host-dropped blocks, subtrees orphaned under a dead ancestor). led.folds is append-only and every elapsed fold accrues on every later usage sample forever, so marathon plugin-mode sessions reported savings beyond any physical bound — the reporter's session: 435 folds, grossSaved 26.5B = 15.5× its own input; fleet total 8.9× all input tokens.

Nested tiers were NOT the double count (the issue's hypothesis): the kernel telescopes child SUMMARIES into the parent's S, so Σ_f (S_f−σ_f) = raw ever folded − root summaries and healthy nesting counts exactly once. The leak was dead blocks keeping their terms alive indefinitely — plus #2202's wire-coverage gate being structurally blind in plugin mode (resends never carry raw originals → unverifiable → status-quo accrual).

Fix

  • src/cache-ledger.ts: new exported liveBlockIds() — liveness snapshot = active roots plus everything anchored beneath them through directBlockIds. The accrual loop freezes requestsAfter for folds whose block is no longer alive; one warn per death; self-heals when the block returns to state (host resync). Absent block lists stay UNVERIFIABLE → status quo (same discipline as [cache-ledger] netSaved 面板在 fold 覆盖坍缩后继续累计虚增——ledger 与实际重发行为无交叉校验 #2202 legacy entries). No interface change; every consumer reads stored values, so the freeze propagates to the panel, the /acp-cache report and the billing USD faces.
  • src/web/sessions-data.ts (+ i18n/client): additive payload fields — per-session blockDeadFolds / blockDeadFrozenTokens, overview blockDeadFoldTotal / blockDeadFrozenTotal, and savingsEstimated: true whenever the gross totals carry values (kernel defines those figures as "estimate, not part of the closure" — the issue's ask Use kernel renderTags:"text-only" + forbid tag echoing in prompt #3). The panel annotates both lines.

Behavior change (old → new)

  • Folds whose kernel block died: OLD accrued unboundedly on every subsequent request → NEW frozen at death (forward-only; already-persisted inflated totals are NOT retroactively deflated — the ledger stores no per-request history to recompute from).
  • New payload fields are purely additive; existing consumers unaffected.
  • No config-surface change: no new env var / config key / CLI flag.

Tests

  • NEW tests/issue5646-dead-fold-freeze.test.ts: nested-tier accrual while alive (telescoping intact), root-reap freezing root AND orphaned child, one warn per death, legacy no-bid folds + absent state stay status quo, self-heal on block return, marathon compounding shape (frozen at M×t_mid, not M×N), display reconciliation through buildSessionList/buildOverview (dead share, id-less synthetic rows stay unmarked, savingsEstimated).
  • tests/cache-ledger.test.ts: two fixtures now push the fold's block into session.state.blocks before recording it — mirroring the production invariant (the kernel writes the block into state before the ledger records it); they passed before only because absent state carried no meaning.
  • Local: typecheck clean, build clean, 85/85 green on the affected suites (cache-ledger, issue2202, issue5646, web-sessions, billing-web). Full-suite verdict = CI.

@ranxianglei ranxianglei changed the title fix: freeze avoided-token accrual when a fold's kernel block dies [PR] fix: freeze avoided-token accrual when a fold's kernel block dies Nov 4, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复。 独立检索了 open+closed 的 issue/PR(grossSaved / dead fold / savings accrual 等失败签名):触及该机制的在途工作只有本 PR;相关的历史条目 #2202(wire-coverage 冻结)、#2695/#2707(zombie 块收割)均为已关闭的前置机制,不是并行重复。与 #5646 是同一缺陷的修复 PR,方向对应。

开始独立审核(不复用 PR 描述结论):先核「嵌套层不重复计数」的 telescoping 论断是否成立(对着 kernel 源码验证),再走回归清点 + 代码 + 测试有效性。另发现分支落后 master 806 个提交且 mergeable_state=dirty——这是无决策依赖的机械步骤,我会先把分支 rebase 到当前 master、跑定向测试(cache-ledger / issue5646 / issue2202 / web-sessions / billing-web),然后给完整八问结论。

@ranxianglei ranxianglei added bug Something isn't working opencodev2 p2 scope/ui labels Nov 4, 2026
@ranxianglei
ranxianglei force-pushed the 2026-11-04_grosssaved-dead-fold-freeze branch from ecb470e to 69a62ff Compare November 4, 2026 06:58
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-04_grosssaved-dead-fold-freeze (a422aaf)

Latest build — install this exact version

npm install -g billion-context@0.0.8112-pr.5651.e7602b4

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
a422aaf billion-context@0.0.8112-pr.5651.e7602b4 build
d6ac77e billion-context@0.0.8105-pr.5651.be3e0af build
69a62ff billion-context@0.0.8103-pr.5651.8d4ccae build

Download artifact

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

合并冲突已解决并 force-push,PR #5651 恢复可合并(mergeable=true,head=69a62ff6a)。

七问:

  1. 是什么问题:分支 2026-11-04_grosssaved-dead-fold-freeze(grossSaved/netSaved multiply-count nested folds — one session reports 15x its own input #5646 死折冻结修复)与 master 合并冲突(mergeable_state=dirty),卡点在 src/web/sessions-data.ts:9-15 的一段 import。

  2. 什么原因导致的:master 与 PR 各自在相邻两行 import 上加了不同符号——master 给 billing 那行加了 validCostUsd,PR 给 cache-ledger 那行加了 liveBlockIds, type BlockLivenessView;两行紧邻被 git 归进同一冲突块,无法自动合并。

  3. 影响范围与严重程度:仅此一处 import 冲突,纯 web 会话页数据源的接线层,不碰内核/压缩逻辑。不解决则 PR 无法合并、grossSaved/netSaved multiply-count nested folds — one session reports 15x its own input #5646 修复合不出去。属阻塞性、非语义性冲突。

  4. 怎么修复的:rebase 到当前 master,import 取两侧并集——保留 master 的 validCostUsd + PR 的 liveBlockIds, type BlockLivenessView。四个符号逐一核验「既被本文件使用、又在对应模块导出」(validCostUsd×4 / liveBlockIds×2 / BlockLivenessView×2,export 均在),确认并集无未用导入、无缺失导出。rebase 后 diff 与原 PR 逐文件一致(6 文件 444+/11−),force-push(--force-with-lease,ecb470e→69a62ff6a)。

  5. 是否有回归问题:无。改动仅为 import 行并集,未触碰任何函数体/行为;其余 hunk 由 auto-merge 干净处理。CI 已重跑:static-gates / mysql-contract / lock-sync / unused-exports / docs-sync / lifecycle-ledger-guard 均 success,test 各分片 in_progress,当前 failed=0。

  6. 是否破坏缓存:不涉及——纯 import 合并,无缓存/重试/增量游标/去重键相关路径。

  7. 是否改了设计方向 / 引入新配置:不涉及——无架构转向,无新增 env/config/默认值。

判定:冲突已收敛,PR 恢复可合并;全量绿由远程 CI test 分片最终把关(当前 0 失败、进行中)。

ci-check added 2 commits November 4, 2026 15:12
)

grossSaved/netSaved/savedUsd multiplied-counted reaped, host-dropped or
orphaned folds: led.folds is append-only and every elapsed fold accrued on
every later usage sample forever, so long plugin-mode sessions reported
savings past any physical bound (issue: one session at 15.5x its own input,
the fleet total at 8.9x all input tokens). Nested tiers were never the double
count — the kernel telescopes child summaries into the parent's S — the leak
was blocks that LEFT the compression state keeping their ledger terms alive.

- cache-ledger: liveBlockIds() liveness snapshot (active roots plus anchored
  descendants); the accrual loop freezes requestsAfter for folds whose block
  is no longer alive, with one warn per death and self-heal when the block
  returns to state; absent block lists stay unverifiable → status quo (same
  discipline as #2202)
- web payloads: per-session blockDeadFolds/blockDeadFrozenTokens, overview
  blockDeadFoldTotal/blockDeadFrozenTotal, savingsEstimated flag whenever the
  gross totals carry values; panel annotates both lines
- tests: issue5646-dead-fold-freeze (nested freeze / orphaned child /
  self-heal / legacy no-bid / marathon compounding shape + display
  reconciliation); cache-ledger fixtures now mirror the production invariant
  that a fold's block sits in state before the ledger records it
…havior; fix i18n indent (review fixup)

The DEAD_LOGGED_KEY comment claimed re-logging happens when a block dies
twice within one boot, but no restore-entry deletion exists in the code:
the map persists with session metadata and a recovered-then-re-died block
stays quiet after its first warn. Reworded to state what actually holds.
Also aligned the two new ov.* i18n entries to the surrounding 8-space indent.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

进度更新——机械步骤已完成,等 CI 后给最终八问结论。

  1. 分支已 rebase 到当前 master(原落后 806 提交、mergeable_state=dirty)。唯一冲突是 src/web/sessions-data.ts 的 import 行(master 侧 [PR] Two installations differing by one version no longer deadlock on the same port; traffic is no longer sent in the clear ( | 两份安装差一个版本不再死锁在同一端口上,流量不再裸奔(#4125) #5303 加了 validCostUsd),按并集解掉。push 后 GitHub 状态:head=d6ac77ebb,mergeable=True,state=blocked(只剩 CI 门禁)。
  2. 顺手小修(独立标注 commit d6ac77ebb):
    • src/cache-ledger.ts 的 DEAD_LOGGED_KEY 注释与代码事实不符——注释声称「同一 boot 内块死两次会重新告警」,但代码里没有任何恢复时删除条目的路径(map 随 session metadata 持久化),实际是一个 bid 终身只告警一次。已改为如实描述。
    • src/web/i18n.ts 新增两行 zh/en 词条缩进 4 空格与周围 8 空格不一致,已对齐。
  3. 本地定向验证(rebase 后的 head):typecheck 干净、build 干净(dist-import-annotations/dist-external 均 OK)、定向套件 87/87 绿(cache-ledger / issue5646-dead-fold-freeze / issue2202-coverage-accrual / web-sessions / billing-web)。全量判定以 CI 为准。
  4. 机制独立核验(不采信 PR 描述,对着 kernel 源码重新验证过):telescoping 论断成立——kernel/src/compress.ts:1559-1571 父块的 compressedTokens = 新直接消息 token + 被消费子块的 summary token(不是子块原文),所以 Σ_f(S_f−σ_f) = 原始折叠总量 − 根摘要,健康嵌套恰好计一次;PR 的存活定义(active 根 ∪ 经 directBlockIds 锚定其下的全部后代)与 kernel syncBlocks 的存在性语义逐路径对齐(consumed/expanded/sync 失活/[Bug][proxy] unframed host-side history deletion leaves zombie fold blocks rendering carriers forever — one carrier flaps in/out every turn (persistent prefix-cache churn) #2695 reap/refold 五种去活路径都核对过)。

CI 跑完后补最终结构化结论。

… verdict, only absent is unverifiable (review fixup)

@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: vllm-qwen/qwen3.8-27b)

审查判定:可合(approve 级) — reviewed end-to-end at head d6ac77eb(本账号即 PR 属主,GitHub 禁止自批,故以评论形式提交审查结论) (plus my comment-only fixup a422aaf, see below).

查重: 不重复。本 PR 是 #5646 的修复;机制上区别于 #2202(wire-coverage 证据,插件模式结构性失明)与 #2695(zombie-streak reap,仅 proxy 模式)——本 PR 补的正是插件模式下唯一可验证的存活信号:kernel block 是否在 state.blocks 里活着。

方向关(①原 issue): 作者的根因分层是对的——嵌套层级本身不是重复计费(telescoping 恒等式把子摘要折进父摘要,Σ(S_f−σ_f) 每字节只计一次),真正的泄漏是死块永生:led.folds append-only,每个 fold 在块死掉后仍在每次 usage sample 上继续累计 avoided tokens。修法命中生产者(累计循环的入口判定),不是在展示层遮掩。物理上限论证成立:单请求 avoided ≤ 窗口大小,7993 请求 × 1M 窗口 ≈ 7.99B < 报告的 26.53B。

回归审查(②既有行为清点,逐项结论):

  • 无 bid 的 legacy fold(打点前旧数据):dead 要求 f.bid !== undefined → 状态不变,status quo 保持 ✓
  • #2202 coverage-lost 路径:live 块的覆盖门逐字节未动;dead 仅在块确已死亡时经 else-if 优先接管 ✓
  • state/块列表缺失(absent):aliveBlocks = null → 不可验证 → status quo,不误冻 ✓
  • 空块列表:两个调用方都按真实「无活块」判决冻结全部 bid fold——这是修复要的行为(宿主侧压缩清空历史后 syncBlocks 摘除块),不是误伤 ✓
  • web 概览/会话 payload:纯增量字段(blockDeadFolds/blockDeadFrozenTokens/blockDeadFoldTotal/blockDeadFrozenTotal/savingsEstimated),存量字段零改动;client.ts 只在字段存在时追加渲染 ✓
  • i18n:仅新增 ov.blockdead_note / ov.est_mark 两键(zh+en),存量键未动 ✓
  • tests/cache-ledger.test.ts 两处 fixture 改为先把块推入 session.state.blocks 再记账——与生产顺序一致(src/stream.ts:1418 applyRanges 在 kernel 写入 res.state.blocks 之后才调 recordCacheFoldsFromBlocks),不改被测行为,是必要对齐 ✓
  • 高危模式逐项:无 fail-fast 变吞错、无阈值/时序/输出格式漂移、无缓存/重试策略变化、无默认值变化 ✓

代码审查(③): liveBlockIds 种子集(active!==false 且有 string blockId)+ directBlockIds 下探 DFS、cycle-safe,正确实现「被活祖先锚定的被取代子块仍活着」(telescoping)而「reap/host-drop/孤儿子树」判死。dead 分支跳过 frac 与 requestsAfter 递增、hPct 不受影响、warn-once 用 metadata 持久化(跨重启静默,注释现已如实描述)。web 侧对「非空但全无 string blockId」的 sparse 行判 UNVERIFIABLE 是对 unified-index 合成行的正确防御。

测试有效性(④): 新测试是真测试——marathon 复现形态(S=1M fold,10 样本后清块再 20 样本 → requestsAfter 钉死在 10 而非 30)在移除 dead 检查时会直接红;负向行齐备(legacy 无 bid、state 清空、id-less 合成行不误标);self-heal(块恢复后继续累计、warn 总数 1);展示层走 hermetic SessionStore 真读路径。断言有牙。

行为变更披露核对: PR 正文已按规范披露——旧值:块死后 avoided tokens 无限累计 → 新值:死于首次观测到的死态即冻结;仅前向生效,不回溯削减已持久化的虚高总量(账本无逐请求历史可回溯,诚实边界)。savingsEstimated 恒 true(gross 有值即估算)是 issue 第 3 问的直接落实。均接受。

本地验证: typecheck 干净;定向套件 87/87 过(cache-ledger、issue5646-dead-fold-freeze、issue2202-coverage-accrual、web-sessions、billing-web)。CI 镜像缓存(d6ac77eb):30 checks,0 failed,其余 success/skipped,10 个 test shard 运行中——我随后推的 a422aaf 为纯注释提交,会触发重跑。

顺手小修(均已落分支,不降级判定):

  • 作者 fixup d6ac77eb 已修:DEAD_LOGGED_KEY 注释「per boot」与实现不符(实际跨重启持久)、i18n 新增两行缩进 4→8 空格。✓
  • 我再修一处同族问题:liveBlockIds 文档注释声称「空/缺失列表皆 UNVERIFIABLE」,但两个调用方都把空列表当作真实的 all-dead 判决(只有 absent 才 UNVERIFIABLE)——注释与代码事实不符,已改正。commit a422aaf。
  • 非阻塞备注(不动代码):ledger 侧没有 web 侧那条「非空但无 string blockId → UNVERIFIABLE」守卫;recordCacheSample 只见真实 kernel state(非空必有 string blockId),该形状在该路径不可达,无需处理。

判定: 可合。无 kernel/ 触碰、无配置面变更、纯 fix + 增量 payload + 有牙回归测试。

@ranxianglei

Copy link
Copy Markdown
Owner Author

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

已顺手修:liveBlockIds 文档注释与代码事实不符(声称空列表 UNVERIFIABLE,实际两个调用方都把空列表判为 all-dead,仅 absent 才 UNVERIFIABLE)+ commit a422aaf

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

审查完成——判定:可合(approve 级;本账号即 PR 属主,GitHub 禁止自批,完整审查结论已以评论形式提交在 PR #5651)。

八问:

  1. 是什么问题:概览页 grossSaved/netSaved/savedUsd 被虚高——kernel 块已离开会话压缩状态的折叠(reap、宿主侧丢弃、孤儿子树)仍在每次 usage sample 上无限累计 avoided tokens,长跑插件会话报出超过物理上限的「节省」(报告者单会话 26.5B = 自身输入 15.5 倍,全舰队 8.9 倍总输入)。
  2. 什么原因导致的:led.folds append-only,累计循环没有任何块存活判定;[cache-ledger] netSaved 面板在 fold 覆盖坍缩后继续累计虚增——ledger 与实际重发行为无交叉校验 #2202 的 wire-coverage 门在插件模式结构性失明(重发从不带原始消息 → 不可验证 → 继续累计)。嵌套层不是重复计数(telescoping 恒等式已对 kernel 源码核验:父块 S 含子摘要,Σ(S_f−σ_f) 每字节恰好计一次)——泄漏源是死块永生。
  3. 影响范围与严重程度:仅展示/计费估算面(概览总量、面板行、billing USD 口径),不碰模型流量与压缩行为本身。特定条件触发:长跑 + 发生过块死亡的插件模式会话;后果是数字失真(决策误导),非功能性损坏。
  4. 怎么修复的:新增 liveBlockIds() 存活快照(active 根 ∪ 经 directBlockIds 锚定的后代),累计循环对块已死的折叠冻结 requestsAfter;每 bid 一次 warn(metadata 持久化,跨重启静默);块恢复即自愈续计;absent 列表保持 UNVERIFIABLE→status quo。web 侧纯增量字段标注死折份额,gross 有值即 savingsEstimated: true(issue 第 3 问落实)。
  5. 是否有回归问题:无。既有行为逐项清点过:legacy 无 bid 折叠不受影响(dead 要求 bid 存在)、[cache-ledger] netSaved 面板在 fold 覆盖坍缩后继续累计虚增——ledger 与实际重发行为无交叉校验 #2202 覆盖门逐字节未动、state 缺失不误冻、web payload 纯增量、i18n 仅新增两键、两处测试 fixture 对齐生产记账顺序(不改被测行为)。高危模式逐项排除(无吞错/阈值/时序/格式漂移)。有意行为变更(PR 正文已披露,我核对过):块死后的累计从「无限继续」→「冻结于首次观测到的死态」,仅前向生效、不回溯削减已持久化总量(账本无逐请求历史可回溯——诚实边界)。
  6. 是否破坏缓存:不涉及——未触碰缓存/重试/增量游标/去重键任何路径。
  7. 是否改了设计方向:不涉及——现有账本机制内的单模块修复,kernel/ 零触碰,无配置面变更。
  8. 是否引入新配置:无——无新 env/config/key/默认值。

验证:本地 typecheck 干净;定向套件 87/87 绿(cache-ledger / issue5646-dead-fold-freeze / issue2202-coverage-accrual / web-sessions / billing-web);CI 镜像缓存(head a422aaf):30 checks,0 failed,13 个 test 分片运行中。分支上共三个 commit:原修复 + 前序 rebase/注释 fixup(d6ac77eb)+ 我的注释修正(a422aaf,liveBlockIds 文档注释与调用方语义不符——空列表实为 all-dead 判决而非 UNVERIFIABLE)。新回归测试有牙(marathon 形态在移除 dead 检查时直接红,负向行齐备)。

收尾状态:审查结论已发(PR 评论)、顺手小修已落分支并各留一行说明、无需决策项(无 kernel/ 触碰)。等 CI 全绿后由人合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

复审确认(head a422aaf,即我上一轮推的纯注释修正):审查结论不变——可合(approve 级)。 a422aaf 相对已审的 d6ac77eb 仅改 liveBlockIds 文档注释(1 文件 7+/4−,零行为变化),完整审查与八问见本线程上条及 PR #5651 审查评论。CI 镜像缓存(a422aaf,07:56 抓取):30 checks,0 failed,仅剩 3 个 test 分片收尾。无新发现、无需决策项;等分片全绿后由人合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

最终审核结论(独立复核,未照抄 PR 描述)

① 是什么问题:面板概览/会话详情的「累计节省」(grossSaved / netSaved / savedUsd)对压缩块已离开会话状态的折叠(僵尸连击被收割 #2695、宿主丢弃块、父块死后孤立的子树)继续记账。fold 账本 append-only,每个已发生的折叠在之后的每一次用量采样上永久累积 → 长跑插件会话的累计节省超出物理上限(报告者会话 grossSaved = 自身输入 token 的 15.5 倍;全舰队 8.9 倍)。

② 什么原因导致的:记账循环只看「折叠是否发生过」,不看「该块是否还活着」。issue 里的嵌套层双计假设不成立——我对过 kernel 源码(kernel/src/compress.ts:1559-1571):父块 compressedTokens = 新折叠直接消息 token + 被消费子块的 summary token(telescoping),所以 Σ(S_f−σ_f) = 原始折叠总量 − 根摘要,健康嵌套恰好计一次。真正的泄漏 = 死块的账目项被永久保留。放大因素:#2202 wire-coverage 门在插件模式下结构性失明(全量重发永不携带原文 → 不可验证 → status quo 累积)。

③ 影响范围与严重程度:p2。只影响展示/计费估算面(面板、/acp-cache 报告、USD 换算);模型流量、压缩决策、数据完整性不受影响。触发条件 = 插件模式且存在死块的长跑会话;健康/短会话零变化。严重度 = 报表虚高(与真实值可差一个数量级),用户会高估节省。

④ 怎么修复的:在记账路径引入存活快照——liveBlockIds() 计算「active 根 ∪ 经 directBlockIds 锚定其下的全部后代」;某 fold 的块确认死亡(块列表存在但 bid 不在存活集)时冻结其 requestsAfter(停止累积、每次死亡一条 warn、块回归自愈)。块列表缺失 = 不可验证 → 维持 status quo(与 #2202 legacy 条目同纪律),从不猜测。展示侧纯增量字段:每会话 blockDeadFolds/blockDeadFrozenTokens,overview blockDeadFoldTotal/blockDeadFrozenTotal,gross 总量非零即 savingsEstimated: true(kernel 自身定义这些数字为 estimate)。无接口变更、无配置面变更。

⑤ 是否有回归问题:逐项清点 diff 触碰路径的既有行为——

⑥ 是否破坏缓存:不涉及。纯记账/展示面;压缩、前缀缓存、重试策略、增量游标、去重键均未触碰。

⑦ 是否改了设计方向:不涉及。架构/边界/数据流不变;cache-ledger 模块内新增一个导出纯函数 + 展示侧增量字段。

⑧ 是否引入了新的配置:不涉及。无新 env / config key / CLI flag。

测试有效性:新套件是真测试——marathon 形状测试钉住「冻结在 M×t_mid 而非 M×N」(回归时该断言必炸);self-heal、一次一 warn、legacy status quo、显示对账(buildSessionList/buildOverview + hermetic store)均有覆盖。旧套件两个 fixture 对齐生产不变式(kernel 先把块写入 state,ledger 才记录)——是修正测试保真度,不是放宽断言。CI 全矩阵绿(head=d6ac77ebb:17 success + 13 gated skip,0 failed)。

非阻塞小问题(记录在案,不拦合并):

  1. 死块回归恢复累积时无 info log(与 [cache-ledger] netSaved 面板在 fold 覆盖坍缩后继续累计虚增——ledger 与实际重发行为无交叉校验 #2202 的 restore log 不对称)——自愈可由数值变化观察,可接受;
  2. savingsEstimated 与既有 savedEstimated 命名相近而语义不同(前者 = gross 总量含估算值;后者 = 无 ledger 的 legacy 份额)——type doc 已区分,后续可考虑改名。

判定:可合。 方向打中根因(死块账目项永生,而非表面的嵌套双计)、回归清点干净、测试有牙、CI 全绿。注意:此改动改变已持久化记账值的语义(无界累积 → 死亡冻结),属产品决策域,按 auto-merge gate 第 8 条需人工合并:#5651

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

Labels

bug Something isn't working opencodev2 p2 scope/ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

grossSaved/netSaved multiply-count nested folds — one session reports 15x its own input

1 participant