Repository navigation
[Bug] 0.2.0-rc.2 无法读取 0.1.x 历史会话:冻结 v0 清单漏声明 permission/preset.origin,整份会话被拒 #9343
Replies: 3 comments
|
I can confirm this from source on the current tip, and confirm the part that makes the fix one line. Still present at 'permission/preset': disposition(['preset']),while the members around it that gained optional fields do declare them — Your derivation claim holds, and the blast radius is a little wider than the report implies. One thing worth adding to the write-up: at the tip, the writer no longer writes On "why it wasn't tested": I think your diagnosis of the mechanism is right and it is worth stating as a general rule. This package's fixtures are built from the same inventory it validates against, so the suite is self-consistent by construction and green for any entry in the table — the table's correctness is the one thing the suite structurally cannot check, because the table is both the input and the expectation. A fixture exported by the released writer is the only artifact that can disagree with it. That is also the argument for the acceptance item you listed; it is the difference between testing the parser and testing the inventory. On the second half of your report — I would keep it as a separate item. |
|
Two tag-level checks on your second half, because the answer changes the category it belongs to.
So v2 was written by every shipped build of the 0.1.0-rc.7 → 0.1.1-rc.2 span, and 0.1.2 is the first line that moved to 3. That puts it in the same category as And the |
|
补一条和你们上面「必须改 这个形状( 一个和你们"10/11 受影响"口径有关的补充:这条闸门不只让那一条会话打不开。persistence observer 会把每条已存 v0 会话都喂进这个 payload 闸门,所以一个坏工件会让整个 store 的 session-search 查询全部失败( 边界:我们只修已经落盘的工件,不替官方改代际;上游那行 disposition( 用法: |
Uh oh!
There was an error while loading. Please reload this page.
0.2.0-rc.2 无法读取 0.1.x 历史会话:v0 迁移器漏声明 origin,整份会话被拒。
实测 10/11 会话受影响,无官方绕过方式。
复现、根因、修复与验收
影响面
从 0.1.x 升级上来的用户,凡
delegationDepth=0的顶层会话全部无法加载(实测 10/11 受影响,剩余 1 个是子会话,本身不写该事件)。必须改node_modules才能绕过。复现步骤
dsh-v0.1.1-rc.1)正常使用,产生若干会话0.2.0-rc.2(npm i @deepseek-ai/dsh@0.2.0-rc.2 --ignore-scripts)实际结果
会话加载失败,报错:
报错事件位于 seq 0,即会话第一条事件,直接中断整份 artifact。
根因
写入方与校验方的声明不一致。
写入方(0.1.x)明确声明
origin合法 ——packages/interaction/permission-presets/src/index.ts:53:该文件 439 / 465 / 478 三处
session.append('permission/preset', ...)均写入origin,默认值'default'。校验方(0.2.0)漏声明 ——
packages/session/session-format-v0-to-v1/lib/index.js:119:disposition(required, optional, opaque)本身支持声明可选成员与 opaque 成员,但该条目两处都未声明origin。校验函数
assertReleasedV0Keys(同文件 257-263 行)是封闭式校验:为什么影响这么大
permission/preset只写在顶层会话上(子会话实测 0 条该事件),因此凡delegationDepth=0必中origin,且默认'default'一处值得注意的设计意图反转
0.1.1 源码注释(
permission-presets/src/index.ts:49-51)说明:即:把
origin设为可选,目的正是让 origin 追踪功能上线前写入的日志保持可读。0.1.x 为向后兼容做的设计,0.2.0 恰好在读取这批日志时失败。已验证的修复
单行改动即可:
只需改
dsh-session-format-v0-to-v1一处:v1->v2的表由 v0 表派生(retained = Object.fromEntries(Object.entries(RELEASED_V0_EVENT_DISPOSITIONS)...),session-format-v1-to-v2/lib/index.js:6),v2->v3再引用 v1->v2 的表,补丁沿迁移链自动传播到 v4。实测(全链路
createRestore(header, {recovery:'strict', validation:'current'})+ V3→V4 子会话证据):同类问题:subagent/descriptor v2 同样被拒
同一批次还有一个性质相同的问题。子会话报:
packages/subagent/subagent/src/descriptor.ts:47→SUBAGENT_DESCRIPTOR_VERSION = 2dsh-subagent/lib/index.js:1309→= 3,且 1368 行if (version !== 3) return void 0session-format-v0-to-v1/lib/index.js:1584(data["version"] !== 3抛错)、:1290(literalValue(data["version"], [3], ...))与
origin的区别:origin是漏声明,一行可修;descriptor 是主动弃用,需同时改两处并确认 v2 载荷能过 continuable 分支校验。缓解情况:读取子会话失败会被降级处理(
dsh-session-persistence-jsonl/lib/index.js:2226-2234推入descriptor:null的 unavailable 证据;dsh-session-format-v3-to-v4/lib/index.js:1534的const entry = fact ?? {version:1, ..., mode:"unknown"}),父会话仍能加载,子会话 catalog 记为mode:"unknown"。环境
0.2.0-rc.2(0.2.1-alpha.2复测同样存在,未修复)dsh-v0.1.1-rc.1~/.dsh/sessions/<project>/<session-id>/session.jsonl.zstd(多帧 zstd,逐行一帧)为什么可能没被测出来
v0 编解码器是 0.2.0 新增代码。若测试夹具由同一份清单(或同一套代码)生成,测试会自洽通过,但与真实 0.1.x 产物不符。建议在 CI 中加入由 0.1.x 真实导出的 session 样本做回归。
验收条件
permission/preset带origin)在 0.2.x 下可正常加载mode而非unknown说明:本报告基于真实升级场景定位,含源码行号与可复现的会话产物。相关讨论:#9264(pre-V4 会话性能)、#9319(会话迁移)。
All reactions