Skip to content

[PR] fix: observability gaps — unpriced-token ledger, health installPath, lineage column docs (#5647) - #5650

Open
ranxianglei wants to merge 10 commits into
masterfrom
2026-11-04_observability-gaps-5648
Open

ranxianglei wants to merge 10 commits into
masterfrom
2026-11-04_observability-gaps-5648

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #5647

What this PR does

Covers the #5647 items closable on the host side without kernel or config-surface changes:

Item 3 — unpriced models silently count as free. Requests for a model with no resolvable price (absent from billing.prices AND models.dev) returned early from both settle sites (billInputUsage / billOutputUsage) with NO trace at all, so costUsdTotal understated spend by an unknown amount while dashboards read 0.00 as "free". The same sites now accumulate raw tokens into a new stats.unpricedTokens {input, cacheRead, cacheWrite, output} ledger when no price resolves — going forward 0.00 + unpricedTokens > 0 means unknown, not free. The ledger persists through the buildSession restore whitelist (validated by a new validUnpricedTokens, same discipline as validCostUsd) and is exposed on /__bili/sessions list rows and detail. This subsumes the reporter's priced: false ask: ledger presence/non-zero is derivable, and it also says HOW MUCH is unknown.

Item 5 — version skew between CLI and running instance. /__bili/health now reports installPath — the package root of the bundle actually serving requests (extracted from the existing package-root walk-up in src/version.ts). Together with the existing version + commit, a report can locate WHICH install serves the running copy, so a skew is locatable instead of guessed. The field is omitted when unresolvable (honest degradation).

Item 1 (partial) — blocks.supersedes_block_id always NULL. Verified: the column has NO writer anywhere — the schema declares it, the store passes through what callers provide, but nothing in the repo (kernel block shapes included) ever sets it. Per the reporter's alternative ask, both DDLs (sqlite schema.ts, mysql mysql.ts) now document that no writer exists yet and tooling must not infer events from its NULLness. Populating real lineage (tier-upgrade supersession + retirement reason) needs a kernel change → decision comment posted on the issue thread.

Item 2 — tracked elsewhere, not duplicated here. DB tokensSaved=0 while the API reports values is exactly #4700 (the counter has no incrementer; the web layer derives the value from blocks). Fix PR #4723 is open and credits the counter at the shared fold-commit point on every lane; once merged, DB and API converge.

Item 4 — pending decision. The residual miss bucket ("TTL expiry / eviction or client-side wire rewrite") is computed inside the kernel (kernel/src/cache-report.ts), and the requested discriminator (first-diverging message id behind a debug flag) implies BOTH a kernel change AND a new config knob — double owner gate. Options posted as a decision comment on the issue.

Behavior changes (old → new)

Surface Old New
session record (stats_json) no trace of unpriced traffic new OPTIONAL key unpricedTokens; absent when no unpriced traffic
/__bili/sessions rows + detail no such field optional unpricedTokens (same shape); absent for priced-only sessions
/__bili/health version+commit identify the build adds installPath (string; omitted if unresolvable)
billInputUsage internals early return when unpriced accumulates raw tokens instead; cost math for priced sessions byte-identical
schema DDL undocumented column comments only — no DDL change

No wire-protocol, kernel, config-schema, or persistence-format-version changes.

Config surface

None added — unpricedTokens is an output field (session stats + API response), not a config input; no new env var, no new config key.

Verification

  • npm run typecheck clean (incl. kernel + pi-subagents pre-builds).
  • Targeted local runs green: tests/issue5647-unpriced-tokens.test.ts (8 tests: split/inclusive/zero input semantics, output, priced negative gate, mid-session price-loss split, validator table, reload round-trip, restored-accumulation, corrupt-blob rejection, legacy-absence) and tests/issue5647-health-install-path.test.ts (unit + server e2e), plus the existing consumers of the touched surfaces: tests/billing-prices.test.ts, tests/issue5303-costusd-restore.test.ts, tests/billing-web.test.ts, tests/web-sessions.test.ts, tests/issue4990-web-single-store.test.ts, tests/issue3199-overview-cold-scan.test.ts, tests/build-info.test.ts — all pass. Full-suite verdict left to CI.

ci-check added 2 commits November 4, 2026 14:20
…5647)

Requests for models with no resolvable price (absent from billing.prices AND models.dev) returned early from both settle sites with no trace at all, so costUsdTotal understated spend by an unknown amount while dashboards read 0.00 as free. The same sites now accumulate raw tokens into stats.unpricedTokens {input,cacheRead,cacheWrite,output} when no price resolves; 0.00 + unpricedTokens > 0 now means unknown, not free. Persisted through the buildSession restore whitelist (validated by validUnpricedTokens, same discipline as validCostUsd) and exposed on /__bili/sessions rows and detail.
…supersedes_block_id column (#5647)

bili --version can cite a different build than the running instance (self-update moves only the instance); version+commit identify the running copy, installPath now identifies WHICH install serves it so a skew is locatable. /__bili/health gains installPath = the package root of the serving bundle (JSON-omitted if unresolvable). Also documents blocks.supersedes_block_id as having no writer yet (always NULL) in both sqlite and mysql schema DDL, per the reporter's ask that tooling stop guessing events from it.
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-04_observability-gaps-5648 (f4472cd)

Latest build — install this exact version

npm install -g billion-context@0.0.10985-pr.5650.edfccc7

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
f4472cd billion-context@0.0.10985-pr.5650.edfccc7 build
2789d10 billion-context@0.0.10891-pr.5650.394c5a5 build
02267ca billion-context@0.0.10648-pr.5650.faab2bd build
deb4531 billion-context@0.0.10643-pr.5650.ca6f774 build
f6999a0 billion-context@0.0.10058-pr.5650.25d202b build
338111a billion-context@0.0.8893-pr.5650.63258ae build
18d7c28 billion-context@0.0.8106-pr.5650.9cc1a3b build
50d2ef7 billion-context@0.0.8102-pr.5650.3481fa6 build
d175b3f billion-context@0.0.8098-pr.5650.367519a build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title fix: observability gaps — unpriced-token ledger, health installPath, lineage column docs (#5647) [PR] fix: observability gaps — unpriced-token ledger, health installPath, lineage column docs (#5647) Nov 4, 2026
… persist field

The unpriced-token ledger (#5647 item 3) now persists stats.unpricedTokens for sessions whose model has no resolvable price. The storage-render corpus (tests/golden-storage-drive.ts) is driven with setRegistryForTest({}) - an empty price registry - so every turn in it is unpriced and the new field enters the persisted stats blob. viewStateDigest digests that stats sub-object, so the four committed state digests shift. costUsd already sits in the same digested stats (added in #4899/#5303 with a matching golden regen), so regenerating is the consistent remedy. Regenerated under the script's documented parity pins (BILI_IMAGE_RESCALE=0 / BILI_SNAPSHOT_SHADOW=0 / BILI_MESSAGE_TIMESTAMPS=0); verified green locally under the preload launch (storage-engine-proofs + golden-storage-render + both #5647 suites, 28/28). Priced-traffic behavior stays byte-identical.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复。 检索了 open+closed 的 issue 与近期 PR(按失败签名 + 主题),没有并行在途工作覆盖 #5647 这三项(unpriced-token ledger / health installPath / lineage 列注释);PR 里 item 2(tokensSaved 无累加点)明确指向既有 #4700/#4723,不是重复立项。

标签: scope/storage p3 regression —— 会话可观测面的存储层改动;我修的是它自己引入的 CI 红,零用户面影响(p3),且确属自引入回归(regression)。

结论先行:代码本身干净、正确、测试有牙;但 CI 红了——是它自己引入的回归,我已定位根因、修好并推回 PR 分支。

审了什么(独立重做,未照抄 issue 侧结论):

  • Item 3 unpriced-token ledger(src/billing.ts / persist.ts / session.ts / web/sessions-data.ts):无价模型原先在两个 settle 点被静默丢弃,$0.00 被读成"免费"而非"未知"(报告人看到 kimi-for-coding 1,041 req / 95.6M input / $0.00)。现改为 stampedBillingPrice===undefined 时把原始 token 累计进新的 stats.unpricedTokens{input,cacheRead,cacheWrite,output}。stampedBillingPrice 已核实是纯函数(只读 session.metadata.billingPrice),挪到 total>0 guard 之后安全;有价路径逐字节不变。写路径 buildRecord spread stats 天然带上,读路径 buildSession 加白名单 validUnpricedTokens(镜像 validCostUsd:finite ≥0,全非法→undefined,部分缺失补零)。持久化向后/向前兼容(旧 reader 忽略新 key)。新测试 199 行含负向门(有价会话绝不碰 unpricedTokens)、真实 SessionStore legacy 往返(正是 [PR] Two installations differing by one version no longer deadlock on the same port; traffic is no longer sent in the clear ( | 两份安装差一个版本不再死锁在同一端口上,流量不再裸奔(#4125) #5303 丢字段那条路)、损坏 blob fail-safe——质量高。
  • Item 5 health installPath(src/version.ts / server/admin.ts):新增导出 pkgRoot()(向上找 package.json,顺带收敛了旧的 inline walk-up),/__bili/health 多一个 installPath(undefined 时 JSON 自动省略)。用途:定位"跑歪的那份安装到底是哪一份"。测试 82 行,真实 startServer 断言 version/commit 仍在 + installPath 新增,用 listen(0) 临时端口(确定性)。
  • Item 1 lineage 列注释(storage/schema.ts / mysql.ts):给 supersedes_block_id 加"no writer yet — ALWAYS NULL"注释,纯注释、无 DDL 变更;我独立 grep 确认全仓确实没有 writer(只有 ingest 读取 + INSERT/SELECT 透传),注释与代码事实相符。

CI 红的根因(自引入,非继承、非 flaky):
4 个失败全在 tests/storage-engine-proofs.test.ts —— "full-mode restart is invisible on the {chat,anthropic,responses,google} wire"(state digest 不符,actual≠expected sha256)。因果链:① golden 语料用 setRegistryForTest({})(tests/golden-storage-drive.ts)驱动 = 空价格表 → 全部流量都算无价;② viewStateDigest(tests/corrupt-index-child.ts)会摘要包含 stats 在内的整个持久化状态;③ 本 PR 给无价会话的 stats 新增了 unpricedTokens;④ 那 4 个 golden 是 master 上(#5620)在该字段出现之前生成的 → 摘要漂移。costUsd 早就坐在同一段被摘要的 stats 里(#4899/#5303 当时也是配一次 golden 重生成),所以重新生成 golden 是一致且正确的修法,不应把字段从摘要里剔掉。

怎么修的: 按脚本声明的 parity pin(BILI_IMAGE_RESCALE=0 / BILI_SNAPSHOT_SHADOW=0 / BILI_MESSAGE_TIMESTAMPS=0)跑 scripts/update-storage-render-goldens.ts,只动了 4 个 golden 的状态摘要三行(stateDigest / stateDigestAligned / stats 子哈希),wire-body 摘要一行没动(wire 字节稳定,符合预期——unpricedTokens 是 stats 里的字段,不进 wire)。本地用 preload 启动方式跑(storage-engine-proofs + golden-storage-render + 两个 #5647 套件)28/28 绿。已作为独立 commit test(#5647): regenerate storage-render goldens … 推到 PR 分支 2026-11-04_observability-gaps-5648,CI 正在新 head 上重跑。

结构化八问:

  1. 是什么问题:PR 本身(Observability gaps on Linux + OpenCode: block lineage always NULL, tokensSaved never persisted, unpriced models, 61% of misses unattributed #5647 三项可观测缺口)方向没问题;真正要处理的是它自己把 4 个 storage-render golden 跑红了。
  2. 什么原因:新增的持久化字段 unpricedTokens 落进了被 viewStateDigest 摘要的 stats,而 golden 语料全是无价流量、golden 又是该字段出现前生成的 → 摘要漂移。
  3. 影响范围与严重程度:只波及测试契约 golden,零用户可见行为变化;严重度低(CI 红挡合并,修法平凡)。
  4. 怎么修复的:在正确 parity 条件下重新生成 4 个 storage-render golden,独立 commit 推回 PR 分支。
  5. 是否有回归问题:逐项过既有行为——有价计费路径逐字节不变、wire 字节稳定、持久化向后/向前兼容——均未被破坏;我这次改动本身不引入新回归,反而消除了 PR 自带的回归。
  6. 是否破坏缓存:不涉及(未触碰任何 cache / 重试 / 增量游标 / 去重键逻辑)。
  7. 是否改设计方向:不涉及。
  8. 是否引入新配置:不涉及(无新 env / config / knob;unpricedTokens 是输出型持久化/展示字段,不是配置输入)。

行为变更披露(rule 4): 本次 golden 重生成不改任何运行时行为,只是把"现在会被持久化的 unpricedTokens 字段"钉进测试基线——纯测试契约更新,无旧值→新值的运行时漂移。(PR 本身的用户可见变更——web 面板多出 unpricedTokens、health 多出 installPath——已在 PR 描述的行为表里披露。)

判定: 代码可合(走人工合并;§7.4 不满足自动合并——属 feat + 持久化新增,正常)。等 CI 在新 head 上转绿即可合并。我不执行合并(PR 合并仅人工)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

一句话:PR #5650 那 6 个红的 test 分片已经转绿。根因不是负载 flake,而是这个 PR 自己改了持久化形状却没同步参考快照;修复(重生成 4 个 storage-render golden)已经在分支上(18d7c28),我独立复现了同样的失败并本地验证修复有效。

接手过程:我按指派当这个 PR 的 CI 工程师查红 CI。排查中发现分支在我工作期间被并发推进过两次——先合入 ci-fixes(d175b3f→50d2ef70f0),再重生成 golden(50d2ef7→18d7c28f8)。golden 重生成这一步跟我独立推导出的修法逐字节完全一致,所以我没有再推一个重复 commit(避免冲突),改成独立复现 + 验证。

结构化结论(八问):

  1. 是什么问题:PR 要解决"无价格的模型被静默当成免费"(Observability gaps on Linux + OpenCode: block lineage always NULL, tokensSaved never persisted, unpriced models, 61% of misses unattributed #5647 item 3),做法是给 session.stats 加一个 unpricedTokens 账本。但存储渲染 golden 把「持久化后的整个 session.stats」逐字节钉死,新增字段使快照失配,于是 storage-render golden(chat/anthropic/responses/google)与 storage engine: full-mode restart is invisible(同四线)在 CI 上全红。

  2. 什么原因导致的:根本原因是持久化形状变了、参考快照没跟进。billInputUsage/billOutputUsage(src/billing.ts)在解析不到价格时现在会写 session.stats.unpricedTokens;golden 语料用的模型 gpt-golden-a 恰好无价格且带真实 token 用量,持久化的 stats 因此多一个字段,stats 段摘要必变。这是确定性失败而非 flake:我在干净本地零负载跑,4/4 线报同一组 digest,且 state/blockContents/metadata 三段全部一致、仅 stats 段不同——精准落在本 PR 唯一动过的持久化字段上。

  3. 影响范围与严重程度:只影响本 PR 自己的 CI 门禁(参考快照过期),不改任何线上行为、wire 字节或用户可见功能。严重度 = 阻塞合并的门禁问题,非产品缺陷。

  4. 怎么修复的:跑仓库自带的 node --import tsx scripts/update-storage-render-goldens.ts 重生成 4 个 golden,把参考快照对齐到"有意为之"的新持久化形状。diff 严格限定在 stateDigest/stateDigestAligned/sectionDigests.stats 三处,逐轮 wire body、block contents、state 全部逐字节不变(已逐一核对)。这属于把 PR 正文 Behavior-changes 表里已声明的 unpricedTokens 落盘同步进快照,不是新决策。

  5. 是否有回归问题:无。只改了 4 个测试参考 JSON,零源码改动;wire 字节未变(逐轮 body digest 不变即证);两个受影响套件本地由红转绿(storage-render 5/5、storage-engine-proofs 12/12)。高危模式逐项过:无语义漂移、无 fail-fast 变化、无阈值/时序/输出格式漂移。

  6. 是否破坏缓存:不涉及(纯测试参考文件,不触碰缓存/重试/游标/去重键任何失效策略)。

  7. 是否改了设计方向:不涉及(持久化 unpricedTokens 是原 PR 既定设计,只是让 golden 跟上)。

  8. 是否引入新配置:不涉及(无新 env/config/默认值)。

当前状态:head 18d7c28 的 CI 已全绿(镜像缓存:30 项 check 全部 success/skipped,0 失败、0 进行中)。合并是 owner 的动作,我不合 PR。

判定:红 CI 已闭环——根因 = 确定性快照漂移(非 flake),修法 = 同步 golden(已在分支并经独立复现验证),可交 owner 验收合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

说明:本账号无法 approve 自己开的 PR(GitHub 限制),以评论形式给出同等审核结论——判定: APPROVE / 可合并。

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

查重: 不重复。本 PR 是 #5647 可无决策落地部分(第 1/3/5 项)的唯一实现;第 2 项(tokensSaved)明确指向既有 #4700/#4723,未重复实现;无其他在途 PR 触碰同一机制。

独立性声明: 以下结论基于本 PR diff 独立重读与本地定向验证产出。

八问

  1. 是什么问题: 三个观测盲区——①无可解析价格的模型用量零痕迹(billing 结算点在 price 解析失败时直接 return,$0.00 与「免费」不可区分,报告者实测 kimi-for-coding 1041 请求 / 95.6M input 显示 $0.00);②/__bili/health 只有 version+commit,CLI 与运行实例版本 skew 时无法定位是哪份安装副本在服务;③blocks.supersedes_block_id 恒 NULL 且两处 DDL 均无说明,使用者会误以为 lineage 坏了。
  2. 什么原因导致的: billInputUsage/billOutputUsage 在无价路径早退,token 静默消失、不记任何账;health 响应构造处没有取安装路径的通道(version.ts 的路径查找逻辑是模块私有的);supersedes_block_id 由 schema 预留但至今没有写入方,DDL 也没写这件事。
  3. 影响范围与严重程度: 纯观测面缺陷,不影响任何现有用户行为;严重度=体验/内部可观测性(无可用性影响)。此前触发条件宽泛——任何未定价模型的全部流量都不可见。
  4. 怎么修复的: 同一批 settle 点,price 未解析时按与 priced 路径完全相同的 token 分解口径(fresh/cacheRead/cacheWrite 及 output)累加进新的可选 stats.unpricedTokens;restore 走与 costUsd 同纪律的 validUnpricedTokens(全无效→无账本,部分缺→补零);health 增加 installPath(从 import.meta.url 上溯定位 package.json 根,解析不出则字段省略,诚实降级);两处 DDL 注释注明该列当前无写入方、恒 NULL。
  5. 是否有回归问题: 无。逐项清点:
  6. 是否破坏缓存: 不涉及。unpricedTokens 是纯观测字段,不进任何决策路径;缓存键/重试/增量游标/去重均未触碰。
  7. 是否改了设计方向: 不涉及。issue 第 4 项(88M miss 桶归因)与 lineage 真实写入需 kernel 改动 + 新配置面,已在 issue 评论走决策流,未塞进本 PR——范围控制正确。
  8. 是否引入了新的配置: 无。无新 env/config/CLI flag;unpricedTokens 是持久化统计字段,不属于配置面。

测试有效性: 两个新测试文件均为真断言(非恒真):reload round-trip、恢复后续累加而非清零、损坏 blob 拒绝、legacy 缺失保持缺失、priced 负门、真 server health e2e(含 #2941 启动期 503 轮询)。此 bug 类回归时抓得住。

CI: head 18d7c28f8 镜像缓存 30 checks,failed 0 / pending 0,全绿。

结论: 可合并(APPROVE)。未发现需要顺手修的机械性小问题。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

审核完成:APPROVE / 可合并。结论已贴到上游 PR #5650(GitHub 禁止账号 approve 自己的 PR,以评论形式给出同等判定);CI head 18d7c28f8 30 checks 全绿;无回归、无缓存影响、无新配置面;未发现需顺手修的机械性小问题。等待 owner 合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

来源:#5660 四车道源码验证——F2「压缩后条条带 id」前提不全部成立(opencode v1/v2 不保证、pi/dsh 有条件保证,结论表见该 issue)。对本 PR 的两个直接影响(均不动数据面):

  1. 放量前必须修:src/server/fastpath-v6.ts:564-569 ——「载体会场 + tail-ids 缺失」现为硬故障(400 + 熔断计数)。但四条车道每个模型请求都打 x-bili-plugin-conversation,所以任何诚实清表的会话(v1 工具回合、pi 手动压缩分支、dsh 侧车瞬态洞)在 watermarkV6MsgId 放量后会循环「5 轮 400(用户可见回合失败)+ 60 分钟停车」。修法:该组合移入 cohort exclusion(静默基线,与 :553 同类),「在场但畸形/宽度不符」保留 400。契约侧 §3.2 容错条款已在 Snapshot-Centric Compression Foundation: Single-Row Table as Source of Truth + Compression = Insert/Delete/Update Events | Snapshot中心化的压缩底座:单行表真源 + 压缩=对表的增删改事件(非增量车道,#5652/v6 线定位纠正) #5643 评论给出拟议文本。发送端 ef35c98 整表清除策略保持不变。
  2. 待确认(残留风险):① dsh persona 请求若存在「带 sessionId、复用主会话 conversation id、非 title-gen」的形状(KDD#9 fork 是服务端 keying,宿主打同一 id),主会话学会 echo 后其合成消息 id 在平面解析不到 → consistency-break fault(fastpath-v6.ts:617-627)替主会话消耗熔断连击;agentless auto-review 已确认走无 sid 透传(dsh-native.ts:1935-1941)不受影响,需确认的是其余 persona 形状。② pi entry id 为 32 位空间(randomUUID 前 8 hex),长分支生日碰撞(~1% @ 1 万条目)× F2 一洞清全表 = 全损;建议评估放宽为「仅窗口内槽位缺失才清」或加碰撞诊断日志。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

误投说明:本线程最后一条「fastpath-v6 放量前必修项」评论是 agent 编号混用导致的误投——它针对的是 PR #5652(fastpath v6 身份车道),不是本 PR(#5650 可观测性缺口)。已在正确线程(PR #5652)重新发布,请忽略/删除该评论。对本 PR 的审核结论不受影响(此前已给 APPROVE)。

@MorningStar0709

Copy link
Copy Markdown

Branch is now CONFLICTING against master (head 50d2ef70f, last touched 2026-11-04). Checked master commits since 11-04: nothing supersedes the three items here (unpriced-token ledger, health installPath, lineage column docs), so the PR is still live. Could your agent rebase onto current master and re-run CI? I don't have push rights on this branch.

…torage-render goldens)

master advanced ~657 commits past the merge-base (d7a1a91), including kernel
0.0.191 render/storage changes. All source files auto-merged cleanly; the only
conflicts were the four tests/golden/storage-render/*.json, which both sides had
modified. Resolved by regenerating them from the merged+rebuilt tree via
scripts/update-storage-render-goldens.ts rather than hand-merging digests: the
result preserves every one of master's per-turn wire-body / block / metadata
bytes byte-for-byte and adds only this PR's stats.unpricedTokens field.
Verified locally on the merged tree: golden-storage-render 5/5,
storage-engine-proofs 12/12, issue5647-unpriced-tokens 9/9,
issue5647-health-install-path 2/2.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Conflict resolved & pushed. The branch was CONFLICTING against master; I merged current master into it, resolved the one real conflict, and pushed as a clean fast-forward (no force-push). CI is re-running on the new head.

What was wrong

How I resolved it

  • Merged current master (4dea18eab) into the branch. The only conflicting files were the four goldens.
  • Regenerated them from the merged code via scripts/update-storage-render-goldens.ts — deliberately not hand-editing hashes, because neither side's committed snapshot alone was correct (master's lacked unpricedTokens; mine predated master's render changes).
  • Proof it's safe: diff of the regenerated goldens vs master shows only stateDigest / stateDigestAligned / sectionDigests.stats changed per file — every per-turn wire body, blockContents, and metadata section stayed byte-identical to master. So none of master's 657 commits were lost; the sole addition is this PR's stats.unpricedTokens field.
  • Chose merge over rebase: it avoids a force-push while other agents may touch this branch, and the branch already contained a merge commit. Landed as a plain fast-forward push.

Verified (live, this run)

  • Local, on the merged tree (CI-parity preload chain): golden-storage-render 5/5, storage-engine-proofs 12/12, issue5647-unpriced-tokens 9/9, issue5647-health-install-path 2/2 — all green.
  • Mirror cache (read moments ago): new head 338111ad1c pushed; merge state moved dirty(conflict) → blocked(no conflict, awaiting CI/approvals); CI re-running — 0 failures so far, test shards in progress, static-gates/mysql-contract/gate already green. The full matrix will confirm on the new head.

@MorningStar0709 — done: the branch is updated onto current master and CI is re-running; you didn't need push rights for this.


中文八问(供人工 reviewer):

  1. 是什么问题:PR 分支落后 master 约 657 个提交,且双方都改过同样的 4 个 storage-render golden JSON,导致分支与 master 冲突(GitHub merge 状态 dirty),PR 无法合并。
  2. 什么原因导致的:fork 点 d7a1a915b 之后,master 经 render/storage/kernel(0.0.191) 变更更新了这 4 个 golden;本 PR 又因 item 3 (Observability gaps on Linux + OpenCode: block lineage always NULL, tokensSaved never persisted, unpriced models, 61% of misses unattributed #5647) 新增 unpricedTokens 字段也改了同样 4 个文件。同一份黄金快照被两条线各自更新 → git 无法自动合并。本质是「快照文件双线都动」,并非源码逻辑冲突(所有 .ts 均自动合并干净)。
  3. 影响范围与严重程度:仅卡住这一个 PR 的合并门禁;不影响产品运行时、其它 PR、终端用户。严重度=单 PR 被卡,非舰队级。
  4. 怎么修复的:把当前 master(4dea18eab) 合入分支;唯一冲突即那 4 个 golden;用 scripts/update-storage-render-goldens.ts 从「合并后代码」重新生成(不手改 hash——任一方单独提交的快照都不完整)。diff 证明:相对 master 每文件仅 stateDigest/stateDigestAligned/sectionDigests.stats 变化,逐轮 wire body / blockContents / metadata 全部字节一致 → master 的 657 提交零丢失,唯一新增是本 PR 的 stats.unpricedTokens。选 merge 而非 rebase:避免 force-push(并发 agent 安全)+分支已含 merge commit;以 fast-forward 推送,无 force-push。
  5. 是否有回归问题:无。源码全部自动合并(master 未碰本 PR 的 src/billing.ts 等,本 PR 未碰 master 的 render/storage 源码);golden 只对齐到合并后代码的真实渲染,wire body 字节未变。本地 4 套件全绿;CI 全矩阵在新 head 上复验中(当前 0 failed)。
  6. 是否破坏缓存:不涉及运行时缓存/重试/增量游标;golden 仅为测试基线同步,前缀缓存接缝不变(wire body 字节未变)。
  7. 是否改了设计方向:否。纯冲突消解 + 测试基线再生,无架构/边界/数据流转向。
  8. 是否引入了新的配置:否。无新 env/config/默认值。

收工判定:冲突已解决并推送(fast-forward,无 force-push);merge 状态 dirty→blocked(冲突消除,待 CI 转绿+审批);本地受影响套件全绿,等 CI 全矩阵在新 head 上确认即可合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

No action taken this run — the reported conflict does not exist in the live state. I verified directly instead of trusting the forward (status-freshness rule):

  • Live PR head = 338111ad1c (the merge commit pushed in the previous run); LIVE master = 4dea18eab.
  • 4dea18eab is a direct parent of 338111ad1c — i.e. master is fully contained in the PR head (0 commits ahead), so merging master into the branch is a trivial no-op. No conflict is possible right now.
  • Mirror cache (read this run): mergeable_state = blocked, not dirty. "blocked" = no conflict, awaiting CI/approvals; "dirty" = has conflicts. So the conflict is gone.
  • This looks like a stale duplicate of the pre-fix detection I already resolved. Master has not advanced since (4dea18eab unchanged; the four storage-render goldens are untouched by any new master delta).

Current live state: CI is re-running on 338111ad1c — 0 failures, 12 test shards in progress, static-gates/mysql-contract/gate green. (The mirror-cache timestamp is 05:11:38Z; the poller hasn't advanced further, so that is the freshest CI snapshot available to me.)

I deliberately did not re-merge or force-push — that would only add a pointless no-op commit and risk racing a concurrent agent on the branch. There is nothing to fix.


中文八问(供人工 reviewer):

  1. 是什么问题:系统再次转发「分支与 master 冲突(dirty)」;但本轮实时核验表明当前并不存在冲突。
  2. 什么原因导致的:这是上一轮已解决事件的前置检测被重复/陈旧转发。上一轮已把 master(4dea18eab) 合入并推送(338111ad1c);master 此后未再前进(领先 0 提交、golden 未被新 delta 触碰),故不可能重新产生冲突。
  3. 影响范围与严重程度:无实际影响——PR 可合并性不受阻(冲突态已消除),仅待 CI 转绿+审批。非缺陷、非回归。
  4. 怎么处理的:只核验、不改动。用 git 祖先关系证明 master ⊆ PR head(4dea18eab 是 338111ad1c 的直接父提交,领先 0),并用镜像缓存确认 mergeable_state=blocked(非 dirty)。因此未再 merge、未 force-push(避免制造空提交、避免与并发 agent 抢分支)。
  5. 是否有回归问题:不涉及——本轮零代码改动。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:否。
  8. 是否引入了新的配置:否。

判定:无需任何操作。冲突已在上一轮解决,且本轮实时状态确认仍为「无冲突(blocked)」;等 CI 全矩阵在新 head 上转绿即可合并。若后续出现真实 CI 红项,会作为独立事件另行处置。

@ranxianglei

Copy link
Copy Markdown
Owner Author

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

Round-2 review — head 338111ad1. Verdict: APPROVE / mergeable.

Note: this account cannot approve its own PR (GitHub restriction); this comment carries the equivalent review verdict.

What changed since the previous review (18d7c28f8): the only new commit is the merge Merge master into #5650 to resolve base drift — the branch picked up current master (merge-base moved 23a826d3 → 4dea18ea). That merge's own message states the conflict was confined to the four storage-render goldens, resolved as the union of both sides' digest updates. There are no new author code commits: the effective diff against the new merge-base is the same three PR commits as before (35c904e / d175b3f / 18d7c28), 14 files, and every source hunk is byte-identical to what I reviewed last round (verified hunk-by-hunk; the earlier 17-file stat also included the ci-fixes sentinel commits, which have since landed on master and therefore drop out of the effective diff).

Independence: the effective delta was re-derived against the CURRENT merge-base, every source hunk re-read in the merged tree, and local verification re-run on the new head — not carried over from round 1.

Duplicate screening: not a duplicate — remains the sole implementation of #5647's decision-free items (1/3/5); item 2 stays under #4700/#4723; no parallel work found.

八问

  1. 是什么问题:与上轮相同——三个观测盲区(未定价模型流量在账单中零痕迹、health 无安装路径、恒 NULL 的 lineage 列无文档)。本轮无新问题面。
  2. 什么原因导致的:未变——计费结算点在价格解析失败时早退丢弃 token;health 响应没有安装根目录通道;DDL 未说明该列无写入方。
  3. 影响范围与严重程度:纯观测面,不影响任何用户行为;体验/内部可观测性级别,无可用性影响。
  4. 怎么修复的:未变——同一批结算点按 priced 路径相同口径累加进可选 stats.unpricedTokens;restore 走 validUnpricedTokens(同 costUsd/[PR] Two installations differing by one version no longer deadlock on the same port; traffic is no longer sent in the clear ( | 两份安装差一个版本不再死锁在同一端口上,流量不再裸奔(#4125) #5303 纪律);health 经 pkgRoot() 上溯取安装根,解析不出则诚实省略;两处 DDL 注明该列当前无写入方。
  5. 是否有回归问题:无。本轮唯一的增量风险是 PR hunk 与 master 对同一文件的大改(persist.ts/session.ts/sessions-data.ts/admin.ts/storage schema)之间的语义交互,已排除:合并后 head typecheck 干净;定向套件全绿(issue5647×2 + billing-prices + issue5303-costusd-restore + build-info + persist-stats-roundtrip = 33 测试:30 过 / 0 败 / 3 跳);web-sessions + golden-storage-render = 34/34 本地通过——含并集解决后的 4 个 storage-render golden,证明合并解法与代码现产出的 digest 一致。CI 全量在 338111ad1c 绿。
  6. 是否破坏缓存:不涉及——unpricedTokens 是纯观测字段,不进任何决策路径;缓存键/重试/游标/去重均未触碰。
  7. 是否改了设计方向:不涉及——第 4 项(miss 归因)与 lineage 真实写入仍留在 issue 决策流;合并带入的 master 内容与本 PR 无交互。
  8. 是否引入了新的配置:无——无新 env/config/CLI flag。

CI:mirror cache @ 338111ad1c:30 checks,0 failed,0 pending——全绿。

结论:可合并(APPROVE)。无需顺手修的小问题,无遗留开口。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

Round-2 review done for new head 338111ad1: APPROVE / mergeable. Only delta since last reviewed head is the branch merging current master (no new author commits; effective diff byte-identical to round 1, verified hunk-by-hunk against the new merge-base 4dea18ea). Local verification re-run on the merged head: typecheck clean, targeted suites green (33 tests: 30 pass / 3 skip), web-sessions + golden-storage-render 34/34 including the union-resolved goldens. CI mirror cache @ 338111ad1c: 30 checks, 0 failed, 0 pending. Review posted upstream (self-approval blocked by GitHub, verdict carried in comment). No small findings to fix, no open ends. Awaiting owner merge.

Resolve tests/golden/storage-render/chat.json conflict by regenerating all 4 storage-render goldens from the merged tree. Delta vs master is only the unpricedTokens stats field (stateDigest/stateDigestAligned/sectionDigests.stats); wire bodies byte-identical to master.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Conflict resolved and pushed — 338111ad1c..f6999a0c65 (clean fast-forward, no force-push).

Unlike the two prior forwards (which were stale duplicates of an already-resolved state), this one was real and fresh:

  • LIVE master advanced to f21b601893 — 420 commits past my previous merge's base (4dea18eab). The PR branch was 11 days stale.
  • Those 420 commits re-modified tests/golden/storage-render/chat.json, which this PR also changes (for the unpricedTokens field) → a genuine 3-way conflict. merge-tree(live master, live PR head) returned exit=1 before the fix.
  • Conflict surface was minimal: only chat.json conflicted; the 5 src/ files this PR touches (persist.ts, session.ts, storage/mysql.ts, storage/schema.ts, web/sessions-data.ts) all auto-merged cleanly — no semantic conflicts.

Resolution (the proven workflow): merged live master into the PR branch, rebuilt (the 420 commits carry a heavier kernel/ refactor), then regenerated all 4 storage-render goldens from the merged tree via scripts/update-storage-render-goldens.ts.

Correctness proof (field-by-field vs master): for all 4 goldens the only differences are stateDigest / stateDigestAligned / sectionDigests.stats — exactly the unpricedTokens field's effect. Wire bodies (messages/blocks), blockContents, metadata, and state are byte-identical to master, so master's 420-commit render behavior is fully preserved; I only added this PR's billing field.

Verified before push: local CI-parity run of the 4 relevant test files (golden-storage-render, storage-engine-proofs 28/28, issue5647-unpriced-tokens, issue5647-health-install-path) all green (exit 0), and npm run typecheck clean (exit 0) — no compile/semantic break from the large auto-merge.

Post-push state: merge-tree(live master, new head f6999a0c65) = exit 0 (clean); master is now an ancestor of the PR head, so the conflict is gone. (The mirror cache is lagging — still showing the old head 338111ad1c from 06:02:27Z — so it will surface f6999a0c65 and the fresh CI run on its next poll; CI is the final gate.)


中文八问(供人工 reviewer):

  1. 是什么问题:master 前进了 420 个提交(f21b601893),其中重新修改了 tests/golden/storage-render/chat.json,而本 PR 也因 unpricedTokens 字段改过同一文件 → 真实冲突(与前两次陈旧转发不同,这次是新的)。
  2. 什么原因导致的:该 PR 分支已 11 天未更新(2026-11-04 建),期间 master 高速前进 420 提交并触碰了同一 golden 文件;两侧都改 chat.json → 3-way 冲突。
  3. 影响范围与严重程度:仅 PR 可合并性受阻(冲突态);非缺陷、非回归。冲突面极小——只有 chat.json 一个文件冲突,5 个 src/ 文件全部自动合并干净。
  4. 怎么修复的:把 live master 合入 PR 分支,用 scripts/update-storage-render-goldens.ts 从合并后的树重新生成全部 4 个 storage-render golden(唯一冲突文件是 chat.json)。正确性证明:与 master 逐字段对比,差异仅为 unpricedTokens 引入的 stats 段(stateDigest/stateDigestAligned/sectionDigests.stats),wire 消息体与 master 逐字节一致(完整保留 master 420 提交的渲染行为)。
  5. 是否有回归问题:无。wire 体与 master 完全一致,只多了本 PR 的 unpricedTokens 字段;420 提交的自动合并经 typecheck + 定向测试验证,无编译/语义断裂。
  6. 是否破坏缓存:不涉及(golden 是测试夹具,非运行时缓存)。
  7. 是否改了设计方向:否。
  8. 是否引入了新的配置:否。

判定:冲突已解决并推送(f6999a0c65),merge-tree 确认 master 现为 PR head 的祖先(无冲突)。等 CI 全矩阵在新 head 上转绿即可合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

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

Round-3 review — head f6999a0c6. Verdict: APPROVE / mergeable.

Note: this account cannot approve its own PR (GitHub restriction); this comment carries the equivalent review verdict.

What changed since the previous reviewed head (338111ad1): again only a master merge (Merge remote-tracking branch 'origin/master', merge-base moved 4dea18ea → f21b601893). No new author commits: the effective diff against the new merge-base is the same three PR commits (35c904e / d175b3f / 18d7c28), 14 files, and every content hunk is byte-identical to what I verified in rounds 1–2 (diffed the two effective diffs — the only differences are git blob-index lines). Master's new content touched 6 of the PR's files (persist.ts, session.ts, sessions-data.ts, storage schema/mysql, chat.json golden), so the merged state was re-verified rather than assumed:

  • typecheck clean on the merged head;
  • all PR-relevant suites green locally on this head: issue5647 ×2 + billing-prices + issue5303-costusd-restore + build-info + persist-stats-roundtrip + web-sessions + golden-storage-render = 67 tests, 64 pass / 0 fail / 3 skip — including the storage-render goldens, which confirms the merged golden files match what the code now produces;
  • no kernel/ involvement in the effective diff, no kernel-change declaration — no authorization boundary engaged.

CI (mirror cache @ f6999a0c6): 30 checks, 0 failed; 25 complete, the 5 full-suite test shards still in progress at time of writing with no failures. The effective diff is byte-identical to the two previously fully-green heads, so the in-flight shards are re-confirming, not discovering.

八问

  1. 是什么问题:与前三轮相同——三个观测盲区(未定价模型流量零痕迹、health 无安装路径、恒 NULL 的 lineage 列无文档)。本轮无新问题面。
  2. 什么原因导致的:未变——计费结算点无价早退丢 token;health 无安装根通道;DDL 未说明列无写入方。
  3. 影响范围与严重程度:纯观测面,无用户行为影响;体验/内部可观测性级别,无可用性影响。
  4. 怎么修复的:未变——结算点按 priced 同口径累加进可选 stats.unpricedTokens;restore 走 validUnpricedTokens(同 costUsd/[PR] Two installations differing by one version no longer deadlock on the same port; traffic is no longer sent in the clear ( | 两份安装差一个版本不再死锁在同一端口上,流量不再裸奔(#4125) #5303 纪律);health 经 pkgRoot() 上溯、解析不出则省略;两处 DDL 注明无写入方。
  5. 是否有回归问题:无。本轮增量风险 = PR hunk 与 master 新一轮改动(persist.ts/session.ts/sessions-data.ts/storage schema/chat.json golden)的语义交互,已排除:合并后 head typecheck 干净 + 8 个相关套件本地全绿(67 测试,含 golden 并集解决验证);CI 25/30 完成零失败,5 个全量 test 分片在跑(无失败)。有效 diff 与两个此前全绿 head 逐字节一致。
  6. 是否破坏缓存:不涉及——unpricedTokens 纯观测字段,不进决策路径。
  7. 是否改了设计方向:不涉及——第 4 项与 lineage 写入仍在 issue 决策流;master 合入内容与本 PR 无交互。
  8. 是否引入了新的配置:无——无新 env/config/CLI flag。

结论:可合并(APPROVE)。无需顺手修的小问题,无遗留开口;全量 test 分片跑完前无失败信号。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

Round-3 review done for new head f6999a0c6: APPROVE / mergeable. Delta since last reviewed head is again only a master merge (no new author commits; effective diff byte-identical to rounds 1–2, verified by diffing the two effective diffs). Re-verified the merged head locally: typecheck clean, 8 PR-relevant suites green (67 tests: 64 pass / 3 skip) including the storage-render goldens. CI mirror cache @ f6999a0c6: 0 failed, 25/30 complete, 5 full-suite test shards in progress with no failures. Review posted upstream (self-approval blocked, verdict in comment). No small findings, no open ends. Awaiting owner merge.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

CI status update for f6999a0c6: the 5 full-suite test shards are still in progress (~15 min in), 0 failures so far across all 30 checks. Verdict unchanged (APPROVE). If any shard goes red I'll report it here.

Resolve tests/golden/storage-render/{chat,anthropic,responses,google}.json conflicts by regenerating all 4 storage-render goldens from the merged tree (master 77fe0b1, kernel 0.0.198). Delta vs master is only the unpricedTokens stats field; wire bodies byte-identical to master.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Conflict resolved and pushed — f6999a0c65..deb4531d6b (clean fast-forward, no force-push).

This is the 3rd re-conflict in this session from master churn. Master advanced another 185 commits (f21b601893 → 77fe0b1d63, kernel 0.0.197→0.0.198) since my last resolution, and this time re-modified all 4 storage-render goldens. merge-tree(live master, live PR head) = exit 1 before the fix. (CI-hold check: prior head was a clean unmarked final, no stuck mid-session state.)

Resolution (same proven mechanical workflow): merged live master into the PR branch (only the 4 generated goldens conflicted; persist.ts/session.ts/storage/mysql.ts auto-merged cleanly — no src//kernel/ semantic conflicts), rebuilt (kernel 0.0.198), regenerated all 4 goldens from the merged tree.

Correctness proof (field-by-field vs master 77fe0b1d63): for all 4 goldens the only differences are stateDigest/stateDigestAligned/sectionDigests.stats — the unpricedTokens field's effect. Wire bodies byte-identical to master (master's render fully preserved). Local CI-parity tests (4 files) 28/28 + typecheck clean.

Post-push: merge-tree(live master, new head deb4531d6b) = exit 0 (clean); master unchanged since the merge (0 new commits) → conflict gone. Unmarked final head → the full CI pass is now running.

⚠️ Recurring-churn flag (needs your attention): this PR is 13 days stale (branch cut 2026-11-04) and master is moving at 420 + 185 commits across this one session, re-touching the same 4 generated goldens every time (master's own CI regenerates them for its render changes, and this PR adds unpricedTokens to the same files). I keep resolving it mechanically and it keeps re-conflicting. To break the loop cleanly, the best fix is for the PR author to rebase the branch onto current master (one-time) rather than me re-merging master on every forward. I'll continue resolving mechanically as long as it stays a clean golden-only conflict, but flagging so you can decide whether to rebase fresh or accept the churn.


中文八问(供人工 reviewer):

  1. 是什么问题:master 又前进了 185 个提交(f21b601893→77fe0b1d63,kernel 0.0.197→0.0.198),这次重新修改了全部 4 个 storage-render golden,而本 PR 也因 unpricedTokens 改过同样文件 → 真实冲突(本 session 第 3 次)。
  2. 什么原因导致的:PR 分支已 13 天未更新(2026-11-04 建),master 高速前进(本 session 累计 420+185 提交)且其 CI 持续为渲染变更重新生成这 4 个 golden;本 PR 在同一批文件上加 unpricedTokens → 每次 master 前进都重新冲突。
  3. 影响范围与严重程度:仅 PR 可合并性受阻(冲突态);非缺陷、非回归。冲突面始终只有 4 个生成文件,src//kernel/ 无语义冲突。
  4. 怎么修复的:把 live master 合入 PR 分支(仅 4 个 golden 冲突,persist.ts/session.ts/storage/mysql.ts 自动合并干净),重建(kernel 0.0.198),从合并树重新生成全部 4 个 golden。正确性证明:与 master 逐字段对比,差异仅为 unpricedTokens 的 stats 段,wire 消息体与 master 逐字节一致。
  5. 是否有回归问题:无。wire 体与 master 完全一致;自动合并的 3 个 src 文件经 typecheck + 定向测试验证无断裂。
  6. 是否破坏缓存:不涉及(golden 是测试夹具)。
  7. 是否改了设计方向:否。
  8. 是否引入了新的配置:否。

判定:冲突已解决并推送(deb4531d6b,未标记最终 head → 触发完整 CI),merge-tree 确认无冲突。建议:为打破反复冲突循环,请 PR 作者把分支 rebase 到当前 master(一次性),否则我每次被唤醒都会重新 merge master。

summaryFromRow (the full-mode / shadow fresh-row projection) whitelisted
stats fields for the web list but carried costUsd without the new
unpricedTokens ledger — full-mode list rows (and shadow mode's fresh-row
adoption) silently dropped it while the file-decode path (summaryFromRecord)
and the detail view kept it. Add the field to the projection (one line,
same validator) and pin it with a full-mode row-path regression test in the
web single-store suite (verified red on the pre-fix head).

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

Verdict: APPROVE (posted as a comment review — the bot account owns the PR, and GitHub forbids approving one's own PR) — clean, well-scoped, host-side-only; every claim in the body verified against the code independently.

Verified (not taken from the PR body):

  • Item 3 (unpriced ledger): the unpriced branch of billInputUsage/billOutputUsage (src/billing.ts:214/236) mirrors the priced path's token decomposition exactly (fresh / min(cached,total) / creation); the priced math is byte-identical (same expressions, same order; the stamp read is pure). validUnpricedTokens mirrors validCostUsd field-for-field. Round-trip confirmed: buildRecord spreads session.stats (src/persist.ts:4161), buildSession whitelists through the new validator (src/persist.ts:4323) — the #5303 drop-class is covered.
  • Item 5 (installPath): the pkgRoot() refactor (src/version.ts) preserves behavior for every valid layout (flat entry → .., subdir bundle → ../..); the only divergent case (malformed package.json at the first candidate) now degrades to the fallback instead of reaching past it into an unrelated grandparent — more conservative, not a regression. installPath is omitted from the health JSON when unresolvable (undefined drops out of JSON.stringify) — honest degradation as claimed.
  • Item 1 (lineage column): confirmed no writer exists — the only assignment in the repo is the explicit supersedesBlockId: null at src/storage/ingest.ts:475; kernel block shapes never set it. DDL comments are accurate; comment-only, no DDL change.
  • Wire: unchanged — in the regenerated storage-render goldens the per-turn wire shas are untouched; only the persisted-state stats digest moved (the golden corpus model gpt-golden-a has no price, so its traffic now lands in the new field). Legitimate regen.
  • Tests: both new suites have teeth — round-trip, negative priced gate, mid-session price-loss split, corrupt-blob rejection, legacy absence (unpriced); health unit + server e2e with the pre-existing identity fields pinned.

已顺手修:summaryFromRow (src/web/sessions-data.ts:754) — the unified-index row projection carried costUsd but dropped the new unpricedTokens field, so full-mode list rows (and shadow mode's fresh-row adoption) silently lost the ledger while the file-decode path and the detail view kept it. One-line fix + a full-mode row-path regression test in tests/issue4990-web-single-store.test.ts (verified red on the pre-fix head, green with the fix). + commit 02267ca

八问(结构化结论)

  1. 是什么问题:#5647 报告的四个可观测性缺口——无价模型流量在账单里"凭空消失"(0.00 被误读为免费)、CLI 与运行实例版本漂移无法定位、blocks.supersedes_block_id 恒 NULL 且无人说明(item 2 由 #4723 承接、item 4 走决策评论,均不在本 PR)。
  2. 什么原因导致的:结算点在价格解析失败时直接 early-return,原始 token 数没有任何落账;/__bili/health 只有 version+commit,没有安装路径,无法区分"哪个安装在服务";supersedes_block_id 列自始没有写入方(唯一赋值是 ingest 的显式 null)。
  3. 影响范围与严重程度:纯可观测性/展示面——计费、压缩、线上行为全部不变;影响面是所有无价模型流量(如 issue 里 kimi-for-coding 1041 请求 / 95.6M input 记 0.00)的账单解读。体验瑕疵级,无数据丢失、无安全面。
  4. 怎么修复的:结算点在无价时把原始 token 累进新的 stats.unpricedTokens 账本(与 costUsd 同一套校验/恢复/展示纪律);health 增加 installPath(从既有 package-root 上行走取,解析失败则字段省略);两个 DDL 加注释声明该列无写入方、工具不得从 NULL 推断事件。
  5. 是否有回归问题:逐项过过——priced 路径计费数学逐字节不变(表达式与顺序相同);持久化格式未升版(stats_json 新增可选键:旧文件读回无此键=无账本,新文件被旧代码读=忽略未知键);readPkgField 重构对一切合法安装布局行为一致(唯一分歧场景:首个候选 package.json 损坏时,旧代码会越级读祖父目录的 package.json,新代码退回 fallback——更保守);health 响应只增字段;wire 零变化(golden 每轮 wire sha 未动)。审核中另发现并当场修掉一处真缺口:统一存储行投影(summaryFromRow)漏带新字段,full 模式列表行会静默丢账本(见上"已顺手修")。
  6. 是否破坏缓存:不涉及——不触碰任何缓存/重试/增量游标/去重键。
  7. 是否改了设计方向:不涉及——纯 host 侧可观测性补齐,无架构/边界/数据流转向;kernel 未动。
  8. 是否引入了新的配置:无——unpricedTokens 是输出字段不是配置输入;无新 env、无新 config key(PR 正文已按规范声明)。

Regression audit (existing behaviors of touched paths): billing settle sites (priced math unchanged) / persist round-trip (additive optional key, validator-gated) / version resolution (behavior-preserving refactor) / health endpoint (additive field) / web session list+detail (additive field + the row-path fix above) / storage DDL (comments only). No kernel, no wire, no config schema, no persistence version.

Verdict: APPROVE — mergeable once CI is green on the new head (02267ca).

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

Round-4 review done for new head deb4531d6 (post-fix head 02267cae): APPROVE / mergeable. Unlike rounds 1–3, this round found one real gap and fixed it on the spot: summaryFromRow (the unified-index row projection, src/web/sessions-data.ts:754) carried costUsd but dropped the new unpricedTokens field — full-mode list rows and shadow mode's fresh-row adoption silently lost the ledger while the file-decode path and the detail view kept it. One-line fix + a full-mode row-path regression test (verified red on the pre-fix head, green with the fix), pushed as commit 02267cae. Review posted upstream (self-approval blocked by GitHub, verdict carried in the comment). No other findings, no open ends. CI on 02267cae: 0 failed, 12 shards in progress. Awaiting owner merge.

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

Round-5 review — head 02267cae1. Verdict: APPROVE / mergeable.

Note: this account cannot approve its own PR (GitHub restriction); this comment carries the equivalent review verdict.

What changed since the previous reviewed head (deb4531d6): exactly one commit — 02267cae "fix: surface unpricedTokens on the unified-row web list path (#5647)", the round-4 on-the-spot fix by the review worker (reviewer-authored, not an author commit). Two files, +39/−1:

  • src/web/sessions-data.ts (+4): summaryFromRow (the unified-index row projection) now carries unpricedTokens: validUnpricedTokens(stats.unpricedTokens) alongside costUsd — closing the gap where full-mode list rows and shadow mode's fresh-row adoption silently dropped the new ledger while the file-decode path and the detail view kept it.
  • tests/issue4990-web-single-store.test.ts (+36/−1): local Stats interface extended with the optional field + a full-mode row-path regression test (seed a session with a non-zero ledger, remove the JSON twin, buildSessionList, assert the row carries the ledger).

Independence: the fix hunk was re-read in the merged tree — minimal (one projection line + a why-comment, same validator as the record path, no new predicate, no behavior change beyond surfacing the field the record path already carries). The regression test was verified red on the pre-fix head and green with the fix.

Freshness: live master 77fe0b1d63 is the merge-base — 0 commits ahead; branch is current, no conflict possible.

Local verification (this exact head, clean tree): issue4990-web-single-store 3/3; issue5647-unpriced-tokens + issue5647-health-install-path + billing-web + billing-prices + issue5303-costusd-restore 34/34; web-sessions + issue3199-overview-cold-scan 32/32; typecheck clean.

CI (mirror cache @ 02267cae1): 30 checks, 0 failed, 0 pending — 15 success + 15 skipped, fully green.

八问

  1. 是什么问题:与第 4 轮相同——#5647 的三个可落地观测缺口(无价流量零痕迹、health 无安装路径、恒 NULL lineage 列无文档);本轮增量 = 第 4 轮发现的行投影漏字段已修复。
  2. 什么原因导致的:未变(结算点无价早退丢 token、health 无安装根通道、DDL 未声明无写入方);增量原因:统一存储行投影的 stats 白名单是逐字段手写的,新字段加进了记录路径但漏进了行投影路径。
  3. 影响范围与严重程度:纯观测面,无用户行为影响;增量修复消除了 full 模式列表行/影子模式新行静默丢账本的缺口,无可用性影响。
  4. 怎么修复的:行投影白名单补一行(与记录路径同一校验器 validUnpricedTokens),并加 full 模式行路径回归测试钉住(修复前红、修复后绿)。
  5. 是否有回归问题:无。增量 diff 仅 2 文件 +39/−1:投影加一个可选输出字段(无新谓词、无行为变化,只是把记录路径已有的字段带到行路径)+ 测试。priced 计费数学、持久化格式、wire、缓存键均未触碰;master 领先 0 提交,无合并交互风险。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:无。

结论:可合并(APPROVE)。无新发现、无遗留开口;CI 全绿,等 owner 合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

Round-5 review done for head 02267cae1: APPROVE / mergeable. Delta since the round-4 reviewed head is exactly the round-4 on-the-spot fix (02267cae, the summaryFromRow unpricedTokens projection + regression test) — re-read and re-verified on this head: master is the merge-base (0 ahead), local targeted suites green (69 tests, 0 failures), typecheck clean, CI mirror cache fully green (30 checks: 15 success + 15 skipped, 0 failed, 0 pending). No new findings, no open ends. Awaiting owner merge.

Resolve the recurring storage-render golden conflict: master's CI regenerated tests/golden/storage-render/*.json (kernel 0.0.199), which textually conflicts with this PR's unpricedTokens stats field. Regenerated all 4 goldens from the merged tree via scripts/update-storage-render-goldens.ts; per-file delta vs master is ONLY stateDigest/stateDigestAligned/sectionDigests.stats (the unpricedTokens ledger) - wire bodies byte-identical. Local: golden + storage-engine-proofs + issue5647 + issue4990 tests 31/31, typecheck clean.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Conflict resolved (4th re-conflict on this PR). Live master had advanced 88 commits (77fe0b1d63 → a446a3c1c, kernel 0.0.198→0.0.199); its CI regenerated the 4 tests/golden/storage-render/*.json again, which textually conflicts with this PR's unpricedTokens stats field.

What I did this run:

  • Verified live first: the PR head was 02267cae1 — a ci-check fix commit ("surface unpricedTokens on the unified-row web list path") sitting on top of my previous merge deb4531d6b, its CI fully green. Master was NOT an ancestor → real conflict on all 4 goldens (git merge-tree exit 1).
  • Built on the current head 02267cae1 (integrated the concurrent ci-check work, no racing), merged live master a446a3c1c. Only the 4 goldens conflicted; ~48 src/ files (incl. persist.ts/session.ts) auto-merged clean.
  • Regenerated all 4 goldens from the merged tree via scripts/update-storage-render-goldens.ts (no hand-edited digests).
  • Verified diff-vs-master: each golden changes ONLY stateDigest/stateDigestAligned/sectionDigests.stats (the unpricedTokens ledger); state/blockContents/metadata section digests and all wire bodies byte-identical.
  • Local CI-parity: golden + storage-engine-proofs + issue5647 (unpriced-tokens + health-install-path) + issue4990 = 31/31 pass; typecheck clean.
  • Fast-forward push 02267cae1..2789d1039 (no force-push). Post-push git merge-tree (master, new head) = clean; master now an ancestor of the head → PR mergeable at current master.

⚠️ 持续 churn 提醒(第 4 次):本 PR(2026-11-04 开)已第 4 次因同一机制重新冲突——master 高频推进(本会话累计 +420 / +185 / +88 commits),其 CI 每次都重新生成这 4 个 golden,与本 PR 的 unpricedTokens 字段在同一文件同一区域相撞。PR 内容仍在演进(02267cae1 是 ci-check 新加的修复),所以每次 master 一动就重冲突,本车道只能反复 merge+regen。建议:等 PR 内容定稿后,作者一次性 rebase 到当前 master(而非继续累积 merge commit),可显著降低后续冲突频率;在此之前本车道会继续按需接冲突。


八问

  1. 是什么问题:PR 与 base 冲突(merge state dirty)。master 再前进 88 commits(kernel 0.0.198→0.0.199),CI 重新生成 4 个 storage-render golden,与本 PR 的 unpricedTokens stats 字段文本冲突。
  2. 什么原因导致的:同一组 4 个 golden 文件被两条独立变更同时写——本 PR 往 session.stats 加 unpricedTokens(改 stats 序列化 → 摘要变),master 高频 CI 每次重新生成这 4 个 golden(代码演进 → 摘要变),都改同一文件同一区域,git 无法自动合并。结构性冲突,master 只要继续动 golden 就会反复出现。
  3. 影响范围与严重程度:仅本 PR 的可合并性(dirty),不影响 master / 其他 PR / 运行时行为。PR 功能本身健康(02267cae1 CI 全绿)。
  4. 怎么修复的:在当前 head 02267cae1(已含并发 ci-check 修复)上 merge live master a446a3c1c;4 golden 冲突后用 scripts/update-storage-render-goldens.ts 从合并树重新生成全部 4 个(不手改摘要);核验 diff-vs-master 仅 stats 摘要变、wire body 逐字节一致;本地 31/31 + typecheck 干净;fast-forward 推送(无 force-push)。
  5. 是否有回归问题:无。逐文件核验 4 golden 仅 stats 摘要变(state/blockContents/metadata 三段摘要 + 全部 wire body 逐字节不变);88 个 master commit 自动合并进 ~48 个 src/(含本 PR 触碰的 persist.ts/session.ts),typecheck + 31 项测试(含 9 项 unpricedTokens 逻辑 + 1 项 02267cae1 的 summaryFromRow web-list 测试)确认无语义破坏。
  6. 是否破坏缓存:不涉及(纯 golden 摘要 + merge,无缓存/重试/游标逻辑变更)。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

判定:冲突已解决,PR 在当前 master(a446a3c1c)下可合并。 等 CI 全绿即可由 owner 合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

No action needed — stale forward. I verified live this run:

  • Live master is still a446a3c1c — 0 commits beyond the master-parent I merged last run; it has not moved since I resolved the conflict.
  • Live PR head is 2789d1039a — my merge commit from the previous run (parents 02267cae1 + a446a3c1c), no [ework:ci-held] marker.
  • git merge-tree (live master, live head) = clean (exit 0); live master is an ancestor of the head → no active conflict.
  • Mirror cache is lagging (still shows the pre-resolution head 02267cae1, fetched_at 2 days old, mergeable_state=blocked — which itself means no merge conflict, just other required gates).

The "conflicts (dirty)" state this forward reports was already cleared by my previous run's push 02267cae1..2789d1039. Nothing to resolve, nothing to push this run. The PR is mergeable at the current master once the mirror cache refreshes to 2789d1039a.

(Churn note: this is the 6th conflict forward for this PR; 4 were real and resolved, 2 were stale. The root cause — this PR's unpricedTokens field and master's high-churn CI both rewriting the same 4 storage-render goldens — is unchanged. Once the PR content is final, a one-time author rebase onto current master would stop the re-conflicts; flagged in prior runs.)


八问

  1. 是什么问题:无——本次为过期转发(stale forward),当前无活动冲突。
  2. 什么原因导致的:转发基于我上一轮推送前的旧「dirty」状态;我上一轮已把 master(a446a3c1c)merge 进 PR 并推送 2789d1039a,master 此后未再前进。
  3. 影响范围与严重程度:无影响。PR 在当前 master 下可合并(merge-tree 干净、master 是 head 祖先)。
  4. 怎么修复的:本轮无需修复——live 核验(fetch + merge-tree + 祖先判定)确认无冲突,未做任何 push。
  5. 是否有回归问题:不涉及(未改动任何代码)。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

判定:无活动冲突,本轮无操作。 等镜像缓存刷新到 2789d1039a 后,PR 即可由 owner 合并。

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

Round-6 review — head 2789d1039. Verdict: APPROVE / mergeable.

Note: this account cannot approve its own PR (GitHub restriction); this comment carries the equivalent review verdict.

What changed since the previous reviewed head (02267cae1): exactly one commit — 2789d1039 "Merge origin/master (a446a3c) into 2026-11-04_observability-gaps-5648", the 4th master-churn re-merge (master advanced ~80 commits, the wave11 batch incl. #6775 persisted fields). No new author commits.

Independence (re-derived, not carried over):

  • Freshness: live master a446a3c1c IS the merge-base — 0 commits ahead; branch is current, no conflict possible.
  • Effective diff (master → PR head): 15 files, +414/−30 — same shape as the previously reviewed effective diff. Diffed the two effective diffs hunk-by-hunk: the ONLY differences are (a) hunk line-offsets in src/persist.ts (master added lines above the PR's hunks), (b) git blob-index lines, (c) the 4 storage-render goldens — and for those, the PR's contribution on top of MASTER's goldens (which already carry master's #6775 persisted-field digests) is exactly stateDigest/stateDigestAligned/stats-section digests per file. Every source hunk is byte-identical to what was verified in rounds 1–5.
  • No kernel involvement in the effective diff — no authorization boundary engaged.

Local verification (this exact merged head, clean tree):

  • golden-storage-render + storage-engine-proofs 17/17 — the decisive check for the 4th golden union: the merged golden files (master's #6775 fields + this PR's unpricedTokens) match exactly what the merged code produces;
  • issue5647-unpriced-tokens + issue5647-health-install-path + issue4990-web-single-store + billing-prices + billing-web + issue5303-costusd-restore + build-info: 41 pass / 0 fail / 3 skip;
  • web-sessions + issue3199-overview-cold-scan: 32/32;
  • typecheck clean.

CI (mirror cache @ 2789d1039): 30 checks, 0 failed, 6 in progress (14 skipped + 10 success complete) — the full-suite test shards are running; no failure signal.

八问

  1. 是什么问题:与第 5 轮相同——#5647 的三个可落地观测缺口(无价流量零痕迹、health 无安装路径、恒 NULL lineage 列无文档)+ 第 4 轮已修的行投影漏字段;本轮增量仅为第 4 次 master 冲突重并。
  2. 什么原因导致的:未变;增量原因:PR 分支 15 天未动,期间 master 高速前进(wave11 批次 ~80 提交,含 #6775 持久化字段),再次触碰同样 4 个 golden 文件 → 第 4 次 3-way 冲突。
  3. 影响范围与严重程度:纯观测面,无用户行为影响;本轮增量为纯合并操作,无新代码。
  4. 怎么修复的:CI 工程师把 live master 合入分支,从合并树重新生成 4 个 golden(既有成熟流程);本轮审核独立重验了合并结果(有效 diff 逐块比对 + golden 并集本地复跑)。
  5. 是否有回归问题:无。有效 diff 与第 5 轮审核过的逐字节一致(仅 persist.ts hunk 行偏移 + golden 摘要);master 领先 0 提交;golden 并集经本地 golden-storage-render + storage-engine-proofs 17/17 证明与合并树代码产出一致;wire 体不变。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:无。

结论:可合并(APPROVE)。无新发现、无遗留开口;CI 全量分片在跑、零失败信号,等 owner 合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

Round-6 review done for head 2789d1039: APPROVE / mergeable. Delta since the round-5 reviewed head is exactly the 4th master-churn re-merge (2789d1039, master a446a3c1c wave11 batch, ~80 commits) — no new author commits. Effective diff re-derived against the new merge-base: 15 files +414/−30, hunk-by-hunk byte-identical to rounds 1–5 except persist.ts line-offsets and the 4 goldens, where the PR's contribution on top of master's own #6775-field goldens is exactly the stats digests. Local verification on the merged head: golden-storage-render + storage-engine-proofs 17/17 (proves the golden union matches merged-code output), PR + consumer suites 73 pass / 0 fail / 3 skip, typecheck clean. CI mirror cache: 0 failed, 6 shards in progress. No new findings, no open ends. Awaiting owner merge.

Conflicts were confined to the four storage-render golden digests
(stateDigest / stateDigestAligned / sectionDigests.stats). Resolved by
rebuilding kernel + pi-subagents and regenerating the goldens from the
merged code via scripts/update-storage-render-goldens.ts — the merged
stats carry the PR's unpricedTokens field while metadata/state/
blockContents take master's values. Verified: typecheck clean, full build
clean, tests/golden-storage-render.test.ts green (4 wires + orphan check).
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Resolved the merge conflict on PR #5650 and pushed the new head.

What I did this run

  • The branch 2026-11-04_observability-gaps-5648 was dirty against master: master advanced past the merge base (a446a3c1c → 6453feeeb) and both sides touched the storage-render golden digests.
  • Merged origin/master into the PR branch. The only content conflicts were the four tests/golden/storage-render/*.json files (stateDigest / stateDigestAligned / sectionDigests).
  • Resolved them the correct way for digest goldens — not by hand-picking a side: rebuilt kernel/ + pi-subagents/ (fresh dist, required by the #3325 stale-dist guard) then regenerated the goldens from the merged code via scripts/update-storage-render-goldens.ts. The merged result keeps master's state/blockContents/metadata and the PR's stats (which carries the new unpricedTokens field).
  • Verified locally before pushing: tsc --noEmit clean, full npm run build clean, tests/golden-storage-render.test.ts green (4 wires + orphan check).
  • Pushed merge commit f4472cdf8 as a fast-forward (no force — the remote head was unchanged).

Live state (verified this run, not from memory)

  • GitHub: mergeable: true, mergeable_state: blocked (no longer dirty) — the conflict is cleared; blocked is the normal pre-merge state (CI + review).
  • Mirror check cache on the new head f4472cdf8: 30 checks, 0 failed, 14 pending — CI is running.

八问

  1. 是什么问题: PR [PR] fix: observability gaps — unpriced-token ledger, health installPath, lineage column docs (#5647) #5650 与 master 冲突(merge state = dirty),卡住无法合并。
  2. 什么原因导致的: master 越过 PR 的 merge base(a446a3c1c → 6453feeeb),两侧都改了 storage-render golden 摘要,4 个 golden 文件产生内容冲突。
  3. 影响范围与严重程度: 仅阻塞该 PR 合并,无用户面影响;属流程阻塞(merge 被卡),非功能性回归。
  4. 怎么修复的: 把 origin/master 合入 PR 分支;4 个 golden 冲突按 golden 的正确方式解决——重建 kernel + pi-subagents(满足 test: rebaseline storage-render goldens after remove-absorb (#3309) #3325 新鲜 dist 守卫)后用 scripts/update-storage-render-goldens.ts 从合并后代码重新生成摘要;合并结果保留 master 的 state/blockContents/metadata 与 PR 的 stats(含 unpricedTokens)。
  5. 是否有回归问题: 无。重新生成的 golden 相对 master 侧只改了 stateDigest/stateDigestAligned/sectionDigests.stats(即 unpricedTokens 字段),metadata/state/blockContents 取 master 值;typecheck、全量 build、storage-render 测试均绿。
  6. 是否破坏缓存: 不涉及。
  7. 是否改了设计方向: 不涉及——纯 merge 冲突解决,无架构/数据流变更。
  8. 是否引入了新的配置: 不涉及。

判定:冲突已解决并推送,CI 在新 head f4472cdf8 上运行中(0 失败 / 14 进行中),等 CI 全绿后即可走 review/合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Round-7 review — head f4472cdf8. Verdict: APPROVE / mergeable.

Note: this account cannot approve its own PR (GitHub restriction); this comment carries the equivalent review verdict.

What changed since the previous reviewed head (2789d1039): again only a master merge — the 5th re-conflict resolution. The new head f4472cdf8 is a merge commit (parents 2789d1039 + master 6453feeeb); master advanced past the prior merge base and its CI re-touched the four storage-render goldens, so the CI engineer merged master and regenerated them. No new author commits. The effective diff against the new merge-base (which is now master itself — master is 0 commits ahead) is the same four PR commits (35c904e51 / d175b3fee / 18d7c28f8 / 02267cae1), 15 files, +414/−30, and every content hunk is byte-identical to what rounds 1–6 verified.

Independence: I re-derived the effective diff against the CURRENT merge-base, re-read every src/ hunk in the merged tree, and re-ran local verification on this exact head — not carried over from prior rounds.

Duplicate screening: not a duplicate — remains the sole implementation of the #5647 decision-free items (1/3/5); item 2 stays under its own decision flow; no parallel work found.

Re-verified this round (live, on f4472cdf8):

  • npm run typecheck clean (kernel 0.0.200 + pi-subagents 0.2.4 pre-builds, tsc --noEmit no errors).
  • 11 targeted suites green: golden-storage-render 5/5 (proves the merged goldens match what the code now produces), storage-engine-proofs 12/12 (4-wire full-mode restart invisible), issue5647-unpriced-tokens 9/9, issue5647-health-install-path 2/2, issue4990-web-single-store 3/3 (incl. the round-4 summaryFromRow row-path regression), billing-prices 10/10, issue5303-costusd-restore 4/4, billing-web 9/9, web-sessions 29/29, issue3199-overview-cold-scan 3/3, build-info 4 pass / 3 skip (stable conditional skips). Total 93 tests, 90 pass / 0 fail / 3 skip.
  • Golden change is minimal and correct: all 4 tests/golden/storage-render/*.json change ONLY stateDigest / stateDigestAligned / sectionDigests.stats (the unpricedTokens field's effect); state / blockContents / metadata section digests and all per-turn wire bodies are byte-identical to master.
  • No kernel/ file in the effective diff, no kernel-change: declaration — no authorization boundary engaged.

CI (mirror cache @ f4472cdf8): 30 checks, 0 failed, 0 pending (15 success + 15 skipped) — fully green.

八问

  1. 是什么问题:三个观测盲区——未定价模型流量在账单里零痕迹、/__bili/health 无安装路径、恒 NULL 的 lineage 列无文档。本轮无新问题面。
  2. 什么原因导致的:计费结算点在价格解析失败时早退丢弃 token;health 响应没有安装根目录通道;DDL 未说明该列当前无写入方。
  3. 影响范围与严重程度:纯观测面,不影响任何用户行为;体验/内部可观测性级别,无可用性影响。
  4. 怎么修复的:同一批结算点按 priced 路径相同口径累加进可选 stats.unpricedTokens;restore 走 validUnpricedTokens(同 costUsd/[PR] Two installations differing by one version no longer deadlock on the same port; traffic is no longer sent in the clear ( | 两份安装差一个版本不再死锁在同一端口上,流量不再裸奔(#4125) #5303 纪律);health 经 pkgRoot() 上溯取安装根、解析不出则诚实省略;两处 DDL 注明该列当前无写入方。
  5. 是否有回归问题:无。本轮增量风险 = PR hunk 与 master 新一轮改动的语义交互,已排除:合并后 head typecheck 干净 + 11 个相关套件本地全绿(93 测试,90 过 / 3 跳,含 golden 并集解决验证);4 个 golden 仅 stats 段摘要变、wire 体逐字节与 master 一致;有效 diff 与此前六个全绿 head 逐字节一致。
  6. 是否破坏缓存:不涉及——unpricedTokens 纯观测字段,不进任何决策路径;缓存键/重试/增量游标/去重键均未触碰。
  7. 是否改设计方向:不涉及——未定价 miss 归因与 lineage 真实写入仍在各自 issue 决策流;master 合入内容与本 PR 无交互。
  8. 是否引入新配置:无——无新 env/config/CLI flag;unpricedTokens 是持久化统计字段,不是配置输入。

结论:可合并(APPROVE)。本轮未发现需顺手修的机械性小问题,无遗留开口。等待 owner 合并(合并仅人工)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

Round-7 review done for head f4472cdf8: APPROVE / mergeable. Delta since round 6 = 5th master merge (no new author commits; effective diff byte-identical to rounds 1–6, re-derived hunk-by-hunk against the new merge-base = master). Local on this head: typecheck clean, 11 targeted suites green (93 tests, 90 pass / 3 stable skips), 4 goldens changed stats digests only (wire bodies byte-identical to master). CI mirror cache @ f4472cd: 30 checks, 0 failed, 0 pending. No small findings, no open ends. Awaiting owner merge.

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.

Observability gaps on Linux + OpenCode: block lineage always NULL, tokensSaved never persisted, unpriced models, 61% of misses unattributed

2 participants