fix(types,detail): derive five spec-named symbols instead of forking them (objectstack#4115) - #3057
Merged
Merged
Conversation
…them (objectstack#4115) Burns the first five names off the spec-symbol DEBT ledger (149 -> 144). None of these were "one spec release away from drifting" — all five had already drifted, and two were live defects: - PageVariableSchema (zod/layout.zod.ts) omitted `source`, the entire ADR-0049 write-binding, so a spec-authored master/detail page parsed into a variable nothing could ever write; its `type` enum was also missing `record_id`, rejecting spec-valid record-picker variables. The sibling PageTypeSchema three lines below was already a spec re-export, with a comment describing this exact failure — one mirror was fixed and its neighbour left broken. - FeedItemType carried 7 of the spec's 13 members. The six missing kinds (file, sharing, note, record_create, record_delete, approval) had no icon and no colour in RecordActivityTimeline, so a server emitting any of them produced an unrenderable feed item. Both maps are `Record<FeedItemType, …>`, so widening the union surfaced the gap as a compile error; the six entries are filled in here. - PermissionAction was 8 of 11, missing `execute`/`manage`/`configure`. - ObjectIndex lacked `fulltext`, `unique: 'global'` and `partial`. - PageVariable (TS) was member-for-member identical to spec's — a second place to drift from and nothing else. Note its own Zod counterpart had drifted while it had not. The ledger is regenerated with `--ledger`, not hand-edited; the diff is exactly these five names, so no other package's debt was dropped. Mutation-tested both directions: re-forking a burned-down name fails the guard by name, and leaving a burned name in the ledger fails it as stale. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
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.
承上一轮 objectui#3017 的收尾结论:「#4115 的 156 条债务是同一失效类的超集,且 objectui
@object-ui/types占 71 条,是传播根」。本 PR 是分诊 + 第一个增量。分诊结果:不是「离漂移只差一个版本」,是已经漂了
对
@object-ui/types全部 73 条碰撞记录(71 个唯一名)逐条两边对读:#4115 描述这批债务是「已漂移或离漂移只差一个 spec 版本」。实测偏向前者:四分之三已经漂了,其中若干是活的缺陷而非理论风险。完整分诊表(每条含 spec 侧定义、精确成员 delta、注释是否谎称 canonical、建议修法)见下方「分诊全表」。
本 PR 落地的五条(149 → 144)
只取可证明安全的一档:本地是 spec 的严格子集、或与 spec 逐成员相同。其中两条是活缺陷:
PageVariableSchema漏了source—— 整个 ADR-0049 写绑定。spec 写法{name:'selectedProjectId', source:'project_picker'}在这里解析后变成一个谁也写不了的变量;type枚举还漏了record_id,spec 合法的记录选择器变量直接被拒。最扎眼的是:同一文件往下三行的PageTypeSchema已经改成 spec 引用了,注释还写着「镜像漏了list导致 spec 合法页面校验失败」—— 修了一个,把隔壁那个漏了。FeedItemType只有 spec 13 个成员里的 7 个。缺的 6 个(file/sharing/note/record_create/record_delete/approval)在RecordActivityTimeline里既没图标也没颜色,服务端一旦发出就是渲染不出来的条目。两张表都是Record<FeedItemType, …>全键映射,所以 widen 联合类型直接把缺口变成编译错误 —— 六个条目在本 PR 补齐。PermissionAction8/11,漏execute(跑 flow/action 的权限)、manage、configure。ObjectIndex漏fulltext、unique: 'global'(全局唯一域)、partial。PageVariable(TS)与 spec 逐成员相同 —— 它唯一的作用就是多一个会漂的地方。有意思的是它的 Zod 对应物漂了、它自己没漂。闸门与验证
台账用脚本自带的
--ledger重生成而非手改,并逐条 diff 确认改动恰好是这 5 个名字,没有误抹其他包的债务(149→144,removed 恰为这五个、added 为空)。变异测试两个方向都验过:
PermissionAction重新 fork 成本地联合 → 守卫按名报红(declares 1 spec-named symbol the spec already owns);全仓
type-check78/78 绿;@object-ui/types+@object-ui/plugin-detail共 49 文件 535 断言绿;两包 lint 绿(仅存量 warning)。未纳入本 PR 的,以及为什么
余下 50 条 drifted 大多需要API 决策,不该和安全派生混在一个 PR 里:
FilterCondition/FilterOperator/EventHandler/CacheStrategy/MutationEvent/SpanSchema等都是概念不同的真撞名,正解是改本地名 —— 但它们多数从 barrel 公开导出,改名是 breaking change。PageSchema/AppSchema/DashboardSchema/ReportSchema,TS + Zod 各一份):spec 的type是页面/报表种类,objectui 的type是渲染器判别式,两者语义冲突,需要先定命名约定(*NodeSchema?)再动。.passthrough()静默放行:AppSchema/DashboardSchema/PageSchema的 Zod 侧继承了BaseSchema.passthrough(),spec 侧是.strict()——spec 独有的 22/13/15 个键全部未经校验地穿过去,brading:这种拼写错误完全隐形。这是 #4120 那个失效形态在 objectui 的等价物,值得单独一轮。zod/objectql.zod.ts的ListViewSchema是全场最佳实践 —— spec 字段经SpecListViewFields.shape按引用流入,配list-view-spec-parity.test.ts漂移守卫,注释所述与代码所做一致。其余几处应向它收敛。我会把完整分诊表(55 条 drifted 的逐条 delta)发到 #4115,作为后续增量的工作清单。
🤖 Generated with Claude Code