Skip to content

fix: ghost install receipt「normalized setup」测试失败 — helper 用 author format #2897

Description

@BarneyZhaoooo

现象

apps/desktop/src/main/cindy-brain/__tests__/ghostInstallReceipt.test.ts
GhostInstallReceiptStore cleanup > still reads normalized setup receipts emitted by affected builds
稳定失败(2 个断言),store.read('hello') 返回 state: 'invalid' 而非 state: 'approved'

在干净的 main + 标准 node_modules 下即可复现,与其它改动无关。

根因(已定位到格式漂移)

  • 测试 helper createSetupReceipt()validateGhostManifest 产出 manifest,其 setup.requires
    author format{ anyOf: ['secret:api_key'] }(字符串简写)。
  • validateReceiptvalidateNormalizedGhostManifest,期望 normalized format
    { anyOf: [{ kind: 'secret', key: 'api_key' }] }(对象)。
  • 测试上方 writes setup in the author format accepted by the v0.1.48 receipt reader 说明仓库刻意区分
    author / normalized 两套格式,但 helper 把未经 normalize 的 author format 塞进了 receipt。

待判定

normalize 该发生在哪一侧:是 createGhostInstallReceipt 漏了 normalize(源码 bug),还是
测试 helper 该直接用 normalized 格式(测试过时)?需追 ghost 的真实 build/normalize 链路后再定。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions