Skip to content

[REQ-128][CODE] PackageRecordV1 从未被持久化 —— update preview 的当前版本恒为 null #764

Closed

Description

@jinjunnn

大白话

安装账本里从来没有真正存过 package 记录。writeLedgerFile 只写 packageGraphs 和 claims,
PackageRecordV1 这个类型定义了但没人持久化它。

后果目前是:Bundle 更新预览里的「当前版本」恒为 null —— 用户看不到自己正在从哪个版本升上来。

实测(2026-08-01,alpha-code#698 实现过程中发现)

  • PackageRecordV1 在 #706 的 V3 账本里有类型定义;
  • writeLedgerFile 的落盘键只有 packageGraphs / claims(+ 既有 records / receipts);
  • ⇒ #698 的 update preview 取 versionBefore 恒得 null。

为什么单独立票

这是 #706 的形状,不是 #698 的欠账。#698 的实现方按边界没有顺手改账本 schema
—— 改落盘键要动 V3 的严格解码、迁移与降级路径,属账本票的范围。

Development plan(方向,需先勘破)

  1. 先确认 PackageRecordV1 该不该持久化:它与已有的 InstallRecordV2 是什么关系?
    是补充(package 级)还是重复(component 级已有)?别先写代码,先答这一问。
  2. 若该持久化:在 writeLedgerFile 的落盘键里加它,同步 V3 严格解码、迁移、降级 fail-closed。
  3. 若不该:删掉这个类型,并把 update preview 的「当前版本」改为从别处派生
    (例如 root component 的 InstallRecordV2.version),或如实降级为不显示。

⚠️ 两条路都要先勘破再动笔 —— 这一期反复付代价的形态就是「先写了再发现前提不对」。

Acceptance and named gates

  • update preview 的「当前版本」要么有真值、要么明确不显示,不能是一个恒 null 的字段
    (那正是「声明了却不写入 = 假闸门」的形态,本期在 graphDigest 上已咬过一次)。
  • 若持久化:写入 → 重启 → 读回,值不变;判据 = 把落盘键删掉会变红。

出处

alpha-code#698(PR #763)实现方报告,按边界未顺手改,交回账本侧。

Activity

  1. added
    type:bugSomething is incorrect or regressed
    prio:P2Planned normal-priority work
    on Aug 1, 2026
  2. added a commit that references this issue on Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    prio:P2Planned normal-priority worktype:bugSomething is incorrect or regressed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions