fix(spec): 导航项四条「展开」别名改为跨变体散文 target,消除二次拒绝 (#5555) - #5664
Merged
Conversation
`expanded` 只声明在 `group` 变体上,四条别名却写在被盖进九个变体的 `NAV_ITEM_ALIASES` 共享表里。于是另外八个变体把作者指向一个它们同样拒绝的 键 —— 照做之后再次被拒,且第二次没有任何建议(ledger finding 7 的二次拒绝, 由 #4001 战役自己的修复产生)。 把四条挪进按变体拼装段:`group` 保留裸键名,另外八个用散文 target `type: 'group' (with expanded)`,与既有六条跨变体别名同形。 闸门联动(alias-integrity.test.ts): - 删除 `isPinnedExpandedDefect` ≤32 容差整段 —— 债已还清,判据 2 现在零容差; - `PROSE_ALIAS_TARGETS` 扩入第七条(白名单带陈旧检查,漏改会红)。 只改面向作者的报错文案,schema 形状不变。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018fxLGQdatPbBUvCgiVxg6D
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 109 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
os-zhuang
marked this pull request as ready for review
August 5, 2026 23:22
os-zhuang
enabled auto-merge
August 5, 2026 23:23
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 #5555
问题
expanded只声明在group导航变体上(NAV_VARIANT_KEYS.group = ['expanded', 'children']),但defaultOpen/open/collapsed/isOpen四条别名写在NAV_ITEM_ALIASES—— 一张被盖进全部九个变体的共享表。于是在另外八个变体上,作者的路径是:{ type: 'url', url: '/x', defaultOpen: true }Did you mean `defaultOpen` → `expanded`?expanded: true这正是 #4001 战役要消灭的失败模式(ledger finding 7 的「二次拒绝」),由该战役自己的修复产生。
修法
四条别名从共享表挪进按变体拼装那一段,与既有六条跨变体别名同形:
group保留裸键名重定向(expanded在它身上是真键,指过去就能过);type: 'group' (with expanded)—— 回答的是「键名对、变体错」,而裸键名说不出这件事。拆成
NAV_EXPANDED_ALIASES_ON_GROUP/NAV_EXPANDED_ALIASES_ELSEWHERE两张字面表(而非派生),因为散文串是契约面:闸门白名单按字面匹配它,顺着报错 grep 过来的读者要能落到这里。闸门联动(两处,均在
shared/alias-integrity.test.ts)isPinnedExpandedDefect≤32 容差整段(而非收到 0)—— 债已还清,判据 2 现在零容差;原地留下一段注释说明这条容差去哪了。PROSE_ALIAS_TARGETS扩入第七条type: 'group' (with expanded)。白名单带陈旧检查,四条别名共用一条 target(它们共享同一个答案)。散文 target 仍受既有PROSE_TARGET_SURFACE正则约束,未放宽 surface 家族。验证(先证红)
红(修改前,方向为事先预测):未改
app.zod.ts,仅让容差失效 → 判据 2 报 恰好 32 条,4 别名 × 8 个非group变体,group正确缺席:绿(修改后):
alias-integrity.test.ts18 passed;@objectstack/spec全量 317 files / 8072 tests passed;typecheck通过。反向注入 A —— 共享表加第五种拼法
expand: 'expanded':判据 2 转红 8 条(容差已删,无物吸收),证明清理后判据仍然咬得住。反向注入 B —— 把四条散文 target 打错一个字母:判据 2 转红 32 条 且「every prose-target exemption is still load-bearing」陈旧检查同时转红 —— 两处联动都是活的。
解析期行为测试
新增
packages/spec/src/ui/app-nav-expanded-alias.test.ts(12 例):八个非group变体(separator因分支未导出,走AppSchema.navigation真门)四种拼法均得到散文、且不再出现→ `expanded`死重定向;group上四条仍重定向到expanded。可达性按「值判据」写成 full-parse-green:
{ type: 'group', expanded: true }必须真的解析通过 —— 指向一个不可达的目的地正是本次要修的缺陷,所以只断言expanded是个「被识别的键名」不够。另有一例把旧 target 为何是死的这个事实钉住:expanded写在url项上确实被拒,且第二次报错不含Did you mean。Changeset
@objectstack/specpatch:纯面向作者的报错文案改进。接受/拒绝的键集合、类型、默认值全部不变,已有元数据不受影响,group上的别名行为也不变 —— 没有形状变更,故不取 minor。范围
只动
ui/app.zod.ts+shared/alias-integrity.test.ts+ 新测试 + changeset。消费半径已扫:全仓无 fixture 拼写这四个别名(platform-objects/src/apps/account.app.ts只有一条记述历史的注释),生成物与文档均未固化该散文串。🤖 Generated with Claude Code
https://claude.ai/code/session_018fxLGQdatPbBUvCgiVxg6D
Generated by Claude Code