Repository navigation
[PR] Payload-addressed image message IDs: seed adds media fingerprint slot (#3751) | 图片消息 id 按载荷寻址:种子增加媒体指纹槽(#3751) - #3767
Conversation
Image cores now seed their id with the image's own fingerprint (bytes hash for data images, URL string for URL references, ordered join for the legacy plural shape). One image changing re-mints only its own core instead of shifting the whole family's _N ordinals; the ordinals return to their #459/#463 role of disambiguating true duplicates. Text/tool seeds are untouched (non-image ids stay byte-identical); cross-protocol same-image-same-id and responses legacy/split shape equivalence are pinned in the cross-protocol golden. kernel-change: image media fingerprint slot in canonical identity (deriveCanonicalMessageId options.mediaFingerprint + 4 codec sites); kernel 0.0.136.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4464-pr.3767.2f800bdThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3767.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复——本 PR 是 #3751(图片 id 按成员集合重铸、每 fold 断前缀缓存)的唯一实现;近 7 天 open PR/issue 检索无第二份「图片载荷指纹种子」方案。同家族近亲 #3642/#3658(切协议 churn → canonical 种子)机制不同且已合入,#3748 是存储侧下游症状、互链各自管理。 标签: bug, dsh, scope/kernel, p2(缺陷修复;生产证据来自 dsh 车道;kernel 身份层;p2 与 #3751 定级一致——图片会话每 fold 一次前缀缓存断点,属性能/成本劣化,非不可用) 审核开工:分支 |
…ixed 60ms nap The first #3767 full run tripped the D-lane tests on loaded CI runners: the save→ingest roundtrip outlived the nap, the D engine degraded to the legacy path (surface asserts still passed — prune renders the same anchor), and only the snapshotRenderTurns latch exposed the miss. Poll until the session's tail view CHANGES (not grows — a rewind turn legitimately net-shrinks the pointer sequence) before the next turn.
… decoded bytes Review nit on #3751 (no behavior change): imageMediaFingerprint() hashes the base64 string carried on the wire (design m36538: sha256(imageBase64)), but four code comments described the input as decoded bytes. Wording only — identity.ts, openai.ts, responses.ts, google.ts.
Review nit on #3751 (no behavior change): imageFingerprintsOfParts was inserted between two import groups. Move it below the imports so the file matches the repo's all-imports-first convention.
(ai: vllm-qwen/qwen3.8-27b) PR #3767 审核结论(第二轮,覆盖新 head 审核动作:全量 diff 逐文件精读(identity.ts / 四 codec / 金桩测试 / 文档 / CHANGELOG / 版本号)、仓库级 grep(旧共享 base id 字面量、指纹函数使用面、host src/ 耦合面)、本地定向测试(kernel identity 8/8 + wire/media/reid 批次 115/115,修后复跑 60/60 全绿)。CI:head 审核中发现并已直接修复的两处小问题(独立标注 commit,零行为变更):
第二 commit(snapshot-render harness 结构化八问
判定:审核通过,建议 CI 全绿后合入(kernel/** 变更属 human-only review tier,合并由你执行:https://github.com/ranxianglei/billion-context/pull/3767)。CI 若在新 head 上有红我再跟进。 |
CI-red fix (labeled, unrelated to #3751): the 'unmarked lane'd spawn against a LIVE same-build twin' live test pinned exitCode === 1, but since #3654 a twin-collision loser exits TWIN_ADOPT_EXIT_CODE (3) as the spawner's adopt signal (src/listen-policy.ts) — every other listen failure keeps 1. Which code surfaces depends on a socket-level race (clean EADDRINUSE + registry hit → 3; concurrent-bind-tolerant bind losing at the post-bind claim → 1), so the pin flaked per tree on the ubuntu shards (master run on this PR's exact base failed identically). Both outcomes satisfy the test's invariant — lost loudly without hopping — which the hop/port/twin-alive asserts keep carrying.
(ai: vllm-qwen/qwen3.8-27b) CI 红更新:新 head 的两个 ubuntu test shard(24/1、22/1)红了,查明与 #3751 无关——是 master 上既有的 flake:
修复已推(标注独立 commit,test-only,零行为变更): 关联:作者补的 CI 正在新 head |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.591-master.e3ddb4a # this exact build
npm install -g billion-context@master # always the newest merged build
|
…t 0.0.133) The 0.0.134→0.0.136 bumps (ranxianglei#3759/ranxianglei#3767) updated kernel/package.json and the root lock's workspace entry but never regenerated kernel/package-lock.json — the same dual-lock drift ranxianglei#3658 hit. npm ci inside kernel/ would refuse (lock does not satisfy package.json). Regenerated with npm install --package-lock-only; no source changes.
问题(#3751)
图片 core 的规范文本是常量
[image],所有图片哈希出同一个共享 base id,全靠 ClusterCounter 的_N序号区分——而序号是位置敏感的:一张图变化(offload 占位、重编码、删除)把全族序号整体位移,每轮把整个家族的 id 重铸一遍。这是每轮 fold 断缓存的直接喂数机,也是 #3748(17.8GB/天写放大)的放大器之一。修法(与讨论定案一致:m36538)
deriveCanonicalMessageId增加第六槽mediaFingerprint,仅媒体 core 有:sha256(imageBase64)——字节在 codec sidecar 与内容 CAS 两边都已有_N序号回归本职:仅区分字节完全相同的重复图(fix(#457): strip model-emitted render tags from plugin-mode openai/anthropic wires #459/plugin 模式 openai SSE:混合文本字段 chunk 因单字段纯标签 echo 被整体丢弃(丢失同 chunk 真实输出) #463 实例纪律)。不变量(金桩钉死)
kernel/tests/cross-protocol-identity.test.ts 新增 4 测试:
_1;跨协议金桩(同图四方言同 id)原 4 测试在指纹化后依然全绿——所有方言对同一份字节算出同一指纹。
存量会话影响
图片会话一次性 re-key(图片 core 的 id 变化),由已落地的两层吸收:
非图片会话零影响(种子逐字节不变)。
文档
kernel-change: identity.ts 媒体指纹槽 + 四 codec 图片位点;kernel 0.0.136(0.0.135 为 #3756 测试缝,已发布)。