test(types): 删除 37 条随 spec 退役而失效的 DROPPED_SCHEMA_EXPORTS,并加棘轮断言 (#3601) - #3623
Merged
Merged
Conversation
…veness ratchet (#3601) The deny-list guards #2561 decision (a): spec/ui zod validators are not part of @object-ui/types' public surface. A row only asserts something while the spec still publishes the name — once upstream retires it, nothing can re-export it and the row passes as a tautology. 37 of 82 rows had rotted that way: objectstack#4988 / PR #5321 (32, the five interaction-config modules), #4610 (2), #3494 / PR #3516 (2), #3896 (1). They are deleted; the 45 rows that still guard a live spec export are untouched. The new ratchet asserts every remaining row resolves to a real `@objectstack/spec/ui` export (with the Spec-prefix alias fallback the list's own doc comment describes, load-bearing for 16 of the 45), so the next upstream retirement fails here by name instead of waiting for an audit. Same technique as PR #3568's `$icontains` exclusion ratchet. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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 #3601
按 PM 裁决的方向 B:删 37 条恒真条目 + 加一条棘轮断言,让「随 spec 退役而失效」从此自曝。
背景
DROPPED_SCHEMA_EXPORTS是 #2561 决策 (a) 的拒绝名单:逐条断言@objectstack/spec/ui的 zod 校验器不从@object-ui/types导出。这条断言只在 spec 仍然发布该名时才有意义 —— 上游一旦整个退役某个 def,没有任何东西能再导出它,该行退化为恒真,还会稀释真守卫的信噪比。测量(在本分支重跑,非照抄 issue 正文)
worktree 装的是 lockfile 解析的
@objectstack/spec@17.0.0-rc.5,对 82 条逐条查 spec 是否仍发布该名(Spec前缀条目按名单注释的既有语义回退到去前缀原名再查):与 issue 正文的 37 条清单逐条一致,包括正文标为「待查」的 4 条 ——
DensityModeSchema/PerformanceConfigSchema/PageTransitionSchema/WcagContrastLevelSchema全部确认已退役。另做了近名探测(Density/Performance/Transition/Wcag/Contrast在 204 个 spec/ui 导出里零命中),排除「改名而非退役」的可能。45 条真守卫一条未动。
删除的 37 条,按退役来源分组
正文表格的分组有两处需要更正,已按上游退役测试的实际名单归位:
ui/五个交互配置模块(touch / dnd / keyboard / animation / offline)整体退役TouchTargetConfigSchemaSpecGestureTypeSchemaSwipeDirectionSchemaSwipeGestureConfigSchemaPinchGestureConfigSchemaLongPressGestureConfigSchemaSpecGestureConfigSchemaTouchInteractionSchemaTransitionPresetSchemaEasingFunctionSchemaTransitionConfigSchemaAnimationTriggerSchemaComponentAnimationSchemaPageTransitionSchemaMotionConfigSchemaDragHandleSchemaDropEffectSchemaDragConstraintSchemaDropZoneSchemaDragItemSchemaDndConfigSchemaFocusTrapConfigSchemaKeyboardShortcutSchemaFocusManagementSchemaKeyboardNavigationConfigSchemaOfflineStrategySchemaConflictResolutionSchemaSyncConfigSchemaPersistStorageSchemaEvictionPolicySchemaOfflineCacheConfigSchemaSpecOfflineConfigSchemaNotificationAction的两个包装器,零消费者删除NotificationSchemaNotificationConfigSchemaDensityModeSchemaWcagContrastLevelSchemaperformance块每个承载者都是 authorable 且 inertPerformanceConfigSchema两处更正:
PageTransitionSchema正文归在「其它/待查」,实际出自ui/animation.zod.ts,属 #4988 那一组 —— 归位后该组正好 32 条,与上游interaction-config-retirement.test.ts自述的「32 emitted defs」对上。NotificationSchema/NotificationConfigSchema正文归在 #4988 组,实际 notification 不在退役的五个模块内,出自更早的 finding(tooling): rule 2's citation window still reads prose words as cited symbols when the claim sentence never terminates #4610。棘轮断言
手法同 PR #3568 给
$icontains排除项加的「排除项不得超期」断言:两处设计取舍:
toBe(true):退役是整族落地的(上游一个 PR 就带走 32 条),逐条断言会停在第一条、藏住其余 31 条。Spec前缀回退是承重的,不是装饰:45 条里有 16 条只能靠回退解析(SpecPageSchema→PageSchema等),29 条直接命中。去掉回退这条断言会立刻误报那 16 条。逆向验证(先预测后运行,两个方向都如预测)
在名单末尾临时塞一个 spec 从未有过的名字
NeverExistedInSpecSchema:name in Types === false,对一个谁都不导出的名字恒真Tests 3 passed (3)no longer publishes these DROPPED_SCHEMA_EXPORTS entries: NeverExistedInSpecSchema修后那一轮的完整失败输出:
修前那一轮绿就是恒真缺陷的现场演示:被删的 37 条这些年一直是这个状态。验证后假名已还原。
顺带更正的一处注释
文件头注举「dual type+value 名」的例子是
`Dashboard`, `DensityMode`, `ThemeMode`—— 而DensityMode本身已被 objectstack#3494 / PR objectstack#3516 从 spec 退役(Dashboard/ThemeMode仍在)。同一份文件里同一类腐化,仅注释改动,已在注释里点明出处。验证
无 changeset:测试-only 改动,不触碰任何包的公开面、运行时行为或类型导出 —— 按仓例(changeset 用于 user-visible 变更)无需 changeset。
文件面:
packages/types/src/__tests__/spec-ui-schema-reexports.test.ts单文件,+50 −46。🤖 Generated with Claude Code
https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt