现象
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'] }(字符串简写)。
- 而
validateReceipt 调 validateNormalizedGhostManifest,期望 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 链路后再定。
现象
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 下即可复现,与其它改动无关。
根因(已定位到格式漂移)
createSetupReceipt()用validateGhostManifest产出 manifest,其setup.requires是author format:
{ anyOf: ['secret:api_key'] }(字符串简写)。validateReceipt调validateNormalizedGhostManifest,期望 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 链路后再定。