Skip to content

DROPPED_SCHEMA_EXPORTS 中 37 条已随 spec 退役而失效,断言退化为恒真 #3601

Description

@yinlianghui

发现于 objectui#3363 / PR #3600(顺带清理该列表两条时测量到,未在该 PR 修)。

现象

packages/types/src/__tests__/spec-ui-schema-reexports.test.ts 的 DROPPED_SCHEMA_EXPORTS 是一份拒绝名单:#2561 决策 (a) 规定 @objectstack/spec/ui 的 zod 校验器(…Schema)不属于 @object-ui/types 的公开面,该测试逐条断言这些名字不从 @object-ui/types 导出。

前提是这些名字在 spec 里确实存在、因而确实存在「被误再导出」的风险。当 spec 把某个 def 整个退役后,该条目就失去了意义:没有任何东西能再导出一个 spec 已不发布的名字,断言退化为恒真。

PR #3600 已按 objectui#3362 的残余清单删掉两条(NotificationActionSchema / EmbedConfigSchema,objectstack#5015 退役)。同类的还剩 37 条。

测量

在 PR #3600 的分支上(已装 @objectstack/spec@17.0.0-rc.5),对列表逐条查 spec 是否仍发布该名 —— 带 Spec 前缀的条目按注释「listed under their exported alias」回退到去前缀的 spec 原名再查:

remaining entries: 82
TRULY INERT (neither alias nor spec name exists): 37

37 条清单:

来源退役 条目
objectstack#4988 / PR objectstack#5321(五个交互配置模块) DndConfigSchema DragItemSchema DropZoneSchema DragConstraintSchema DragHandleSchema DropEffectSchema FocusManagementSchema FocusTrapConfigSchema KeyboardNavigationConfigSchema KeyboardShortcutSchema ComponentAnimationSchema AnimationTriggerSchema MotionConfigSchema TransitionConfigSchema TransitionPresetSchema EasingFunctionSchema NotificationSchema NotificationConfigSchema SpecGestureConfigSchema SpecGestureTypeSchema SwipeGestureConfigSchema SwipeDirectionSchema PinchGestureConfigSchema LongPressGestureConfigSchema TouchInteractionSchema TouchTargetConfigSchema SpecOfflineConfigSchema OfflineCacheConfigSchema OfflineStrategySchema SyncConfigSchema ConflictResolutionSchema PersistStorageSchema EvictionPolicySchema
其它/待查 DensityModeSchema PerformanceConfigSchema PageTransitionSchema WcagContrastLevelSchema

复现脚本(仓根):

const ui = require('@objectstack/spec/ui');
const src = require('fs').readFileSync(
  'packages/types/src/__tests__/spec-ui-schema-reexports.test.ts', 'utf8');
const block = src.split('const DROPPED_SCHEMA_EXPORTS = [')[1].split('];')[0];
const names = [...block.matchAll(/'([A-Za-z0-9_]+)'/g)].map(m => m[1]);
const gone = names.filter(n => {
  const cands = [n];
  if (n.startsWith('Spec')) cands.push(n.slice(4));
  return !cands.some(c => c in ui);
});
console.log(gone.length, gone);

余下 45 条仍是真守卫(spec 确实还发布该名),不要整表删除。

为什么标 finding 而非缺陷

今天没有用户会碰到:测试是绿的,行为无影响,公开面无差异。代价是认知性的 —— 这份名单自称记录「objectui 刻意不再导出的 spec/ui 校验器」,读者会据此以为这些 def 在上游仍然存在;而恒真的断言会稀释这份名单里那 45 条真守卫的信噪比。属于「未被行使的漂移」。

严重性交 PM triage 判定,不自评。

建议处置(供参考,非结论)

三选一:

倾向 B:一次性清干净,并且让「随 spec 退役而失效」这件事从此自曝,而不是等下一个 agent 顺手测量才发现。


Generated by Claude Code

Activity

  1. self-assigned this
    on Aug 7, 2026
  2. yinlianghui commented on Aug 7, 2026

    @yinlianghui
    CollaboratorAuthor

    认领(PM 派发),处置裁决:方向 B(删 37 条 + 棘轮断言),与 PR #3568 的「排除项不得超期」同手法,一次清净且此后自曝。

    • Session: session_01GTRjn8xBqp75dk7kFupVRt
    • 分支:claude/issue-3601-inert-dropped-entries
    • 文件面:packages/types/src/__tests__/spec-ui-schema-reexports.test.ts 单文件(+ changeset 仅当判定需要;测试-only 按仓例通常不需要)。
    • 约束:「待查」4 条(DensityModeSchema / PerformanceConfigSchema / PageTransitionSchema / WcagContrastLevelSchema)必须逐条对 rc.5 重测后再删,不得照抄正文清单;45 条真守卫一条不许动。

    Generated by Claude Code

  3. yinlianghui commented on Aug 7, 2026

    @yinlianghui
    CollaboratorAuthor

    验收 ACCEPT → PR #3623(session_01GTRjn8xBqp75dk7kFupVRt)。

    已核:单文件 +50/−46,包套件 28 files / 383 tests 绿,type-check 三 tsconfig 过;CI 报告时 0 红(长任务在跑,auto-merge 等绿)。

    裁决记录:

    1. 逐条重测纪律执行到位:37 条与正文零差异,但「待查」4 条独立确认并做了近名探测排除「改名而非退役」;两处分组归位更正(PageTransitionSchema→fix(data-objectstack): layered 读迁到声明路径 GET /meta/:type/:name/layers (#4016) #4988 组,使该组 32 条与上游 interaction-config-retirement 自述对上;Notification 两条→finding(tooling): rule 2's citation window still reads prose words as cited symbols when the claim sentence never terminates #4610)比正文更准,采纳。
    2. 逆向验证一对(塞假名:修前恒绿演示缺陷 / 修后红且点名)正是本单要的核心证据;额外的承重性检查(16/45 条依赖 Spec 前缀回退)超出派发要求,记入方法库。
    3. 文件头注释 DensityMode 例子的同文件顺带修正接受(注释级、同缺陷类)。
    4. 新发现 两处 filter-operator 平价测试从 spec 词表里减去 is_empty / is_not_empty,但没有一条断言这两个 token 仍在词表里 #3628(两处 filter-operator 平价测试同形结构,今日 LIVE,预防性 observation-class)入池 — 不带 pm:queue 的判断正确。

    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions