fix(metadata-protocol): 删除回执按 isArtifactBacked 分句,不再对 runtime-only 项谎称回退默认值 (#5927) - #6336
Merged
Merged
Conversation
…称回退默认值 deleteMetaItem 的四句成功回执(repository 路径两句 + legacy raw-engine 路径两句) 原本无条件把每一次删除叙述成"摘掉一层 overlay、回落到 artifact 默认值"。对一个 runtime-only 项 —— 管理员新建的 object / flow / hook,没有任何 code package 提供 同名 artifact —— 底下没有默认值可回落:那一行就是这个项的全部,删完它不复存在。 判据沿用 #5265 / PR #5926 在 save 侧的同一个事实:isArtifactBacked,也就是 intent: 'override-artifact' | 'runtime-only' 的来源。新增的方法级绑定替换了 intent 原来那次 inline 调用,分句后 registry 读取次数不增反减。 artifact-backed 两句逐字不变;草稿两句本就没声称过 overlay 或 reset,对两类项都 为真,同样逐字保留。success / reset / seq 一字未动。 反向验证(方向先于运行预测):还原无条件模板 → 预测 6 红 / 9 绿,实测 6 红 / 9 绿。 Fixes #5927 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019Q7oc7ASjh8yxyS3Yz78We
…ete-receipt-truth
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 3 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
baozhoutao
marked this pull request as ready for review
August 7, 2026 14:19
This was referenced Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5927
deleteMetaItem的四句成功回执 —— repository 路径两句 + legacy raw-engine 路径两句 —— 原本无条件把每一次删除叙述成"摘掉一层 overlay、回落到 artifact 默认值"。但对一个 runtime-only 项(管理员在 Studio 里新建的
object/flow/hook,没有任何 code package 提供同名 artifact),底下根本没有默认值可回落:那一行就是这个项的全部,删掉之后它在任何层都不复存在。回执却把管理员指向一个从未存在过的基线。这是 #5265 / PR #5926 在 save 侧修掉的同一类问题(回执可以说真话但没说),换到了 reset 路径 —— 参照实现就在同一个文件里。
判据:同方法内早已算出的现成事实
不是
supportsOverlay,也不是allowOrgOverride,而是isArtifactBacked—— 即intent: 'override-artifact' | 'runtime-only'的来源。本次新增的方法级绑定替换了intent原来那次 inline 调用,所以分句后 registry 读取次数不增反减:之所以必须新起一个绑定而不能复用上方两层授权里的那个:后者块作用域限定在
environmentId !== undefined内,legacy 路径够不着。两处拼写一致 ——canonicalizeMetaRequestType已在方法开头把request.type折成单数(#4432),singularTypeForRepo是一次 no-op 重折。四句的去向
Customization overlay deleted — type/name reset to artifact default. [seq=N]Deleted TYPE 'NAME' — it no longer exists. [seq=N]No customization overlay found for type/name — already at artifact default.No TYPE 'NAME' found — nothing to delete.刻意未动的部分:草稿两句(
Draft discarded — …/No pending draft for …)本来就没有声称过 overlay 或 reset,对两类项都为真,逐字保留。success/reset/seq一字未动 ——message没有任何消费方解析,仅作展示。legacy 路径不写 history、不发 watch 事件,两句因此本就不带[seq=…],该差异为既有设计,分句未触碰。反向验证(方向先于运行预测)
肢 A = 还原无条件模板。预测 6 红 / 9 绿,实测 6 红 / 9 绿。
红的正是六条 runtime-only 断言,每一条都按 issue 描述的形状失败:
绿的一半是分句的要点而非余量:四条
override-artifact用例逐字节未变,两条草稿用例、registry 前提 pin、envelope pin 亦然。一个只是"到处不再说 overlay"的改法能过红的一半,会在绿的一半翻车。测试与门
pnpm --filter @objectstack/metadata-protocol test—— 51 files / 523 tests 全绿(merge origin/main 之后复跑)check:engine-double-contract—— OK,79 pinned;新测试文件按 delete + update 双动词双双入 pinned(fake engine 的delete()用assertEngineDeleteDispatch,非手抄守卫)check:nul-bytes—— OK,5984 个文件无裸控制字节objectql的 lock-enforcement / recorded-by / canonicalization / package-lifecycle 五个文件 110 tests 复跑绿)。protocol.lock-gate-fail-closed.test.ts里那条记录值是注释不是断言,按 PR fix(metadata-protocol): 保存回执按 isArtifactBacked 分句,不再一律自称 customization overlay (#5265) #5926 的先例标注而非回填。与 #5079 的关系
未触其面。 #5079 是 deleted overlay 仍出现在
/metalisting —— 完成判据是 list / get / dispatch 三者立即一致,走的是枚举与注册表愈合路径;本 PR 只改message字符串模板,不碰restoreArtifactRegistryView、不碰持久化、不碰任何枚举。两单正交,互不覆盖也互不阻塞。Generated by Claude Code