refactor: hand-copied checklists become derivations or gated inventories (#3017) - #3043
Merged
Merged
Conversation
…s become derivations or gated inventories (#3017) Sites #3-#6 of the audit, plus three more of the same species found while gating - all previously "keep in sync" comments with zero mechanism: - DesignerFieldType is now derived from a runtime DESIGNER_FIELD_TYPES array in @object-ui/types; app-shell's object-fields-bridge and plugin-designer's MetadataFieldsPage derive their 27-type sets from it instead of restating the list (FieldDesigner's FIELD_TYPE_META was already compile-gated via Record<DesignerFieldType>). The dead ALL_FIELD_TYPES const is removed, and the FIELD_TYPE_CATEGORIES / CATEGORY_ORDER partition gets a coverage gate - a type added to the vocabulary but left uncategorized would silently vanish from the type pickers. - The audit-provenance columns get one source: AUDIT_FIELD_BY_ROLE / AUDIT_FIELD_NAMES in @object-ui/types, consumed by RecordMetaFooter and RecordDetailView. RecordDetailView's HIDDEN_SYSTEM_FIELD_NAMES is now derived as spec FIELD_GROUP_SYSTEM_FIELDS minus the audit set, so a newly injected system column defaults to hidden instead of leaking into detail bodies until a hand list is edited. - ImportWizard's REFERENCE_IMPORT_TYPES is derived from the spec's REFERENCE_VALUE_TYPES plus the generic 'reference' alias - the same derivation the server uses - in a new importCoercionContract module. - The boolean token table cannot be derived (no spec export yet, framework#3786): it is split into true/false sets with disjointness + normalization gates and a pinned inventory so edits are deliberate. - multiValueFields' two sets were member-for-member copies of the spec's MULTI_OPTION_TYPES / MULTI_CAPABLE_TYPES - now consumed directly, with non-vacuity anchors so a shrinking spec vocabulary fails loudly instead of resurrecting the #2204 column-shape corruption. Mutation-tested: seven injected drifts across five source files produced 13 test failures across all five gate files, plus compile errors in FieldDesigner (TS2353/TS2322), MetadataFieldsPage (TS2769) and RecordMetaFooter (TS2339). Zero behavior change - every derived set is value-identical to the list it replaces. 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.
Closes #3017. 承 framework#3786 / objectstack#4120 的修法模板:能派生就从唯一来源派生;确实无法派生的,加集合覆盖/不相交断言当闸门;闸门必须变异测试证明会红。
Issue 六处中 #1/#2 已由 #3019 落地;本 PR 处理其余四处,并在加闸门过程中捞到三处同种残留(issue 表格之外)。
逐处修法
object-fields-bridge.tsDESIGNER_TYPESDesignerFieldType联合改为从新的运行时数组DESIGNER_FIELD_TYPES(@object-ui/types)派生;bridge 直接new Set(DESIGNER_FIELD_TYPES)。FieldDesigner的FIELD_TYPE_META本就是Record<DesignerFieldType,…>,词汇增删自动变编译错误;顺手删掉死代码ALL_FIELD_TYPESRecordMetaFooterAUDIT_FIELDS↔RecordDetailViewAUDIT_FIELD_NAMESAUDIT_FIELD_BY_ROLE/AUDIT_FIELD_NAMES落在@object-ui/types(两包公共底座;app-shell 不依赖 plugin-detail,反向也不行)。RecordDetailView的HIDDEN_SYSTEM_FIELD_NAMES进一步改为 specFIELD_GROUP_SYSTEM_FIELDS− 审计集 派生 —— framework 明天新注入的 bookkeeping 列默认隐藏,而不是漏进 detail 正文等人补清单ImportWizardBOOLEAN_IMPORT_TOKENSImportWizardREFERENCE_IMPORT_TYPESREFERENCE_VALUE_TYPES+'reference'(新模块importCoercionContract.ts);plugin-grid 新增@objectstack/spec运行时依赖FieldDesignerFIELD_TYPE_CATEGORIES/CATEGORY_ORDERDESIGNER_FIELD_TYPES集合相等、无重复、CATEGORY_ORDER覆盖全部类目MetadataFieldsPageKNOWN_FIELD_TYPESDESIGNER_FIELD_TYPESmultiValueFields.ts两个 SetMULTI_OPTION_TYPES/MULTI_CAPABLE_TYPES逐项相同 → 直接消费 spec(保留 null 容错包装),锚点断言防词汇缩水复发 #2204 形状腐蚀变异测试(闸门真的会红)
七处注入漂移(词汇删
slider、审计删updated_by、hidden 派生偷排tenant_id、布尔加'True'/两侧同置'on'、别名'reference'删除、CATEGORY_ORDER掉date):FieldDesignerTS2353/TS2322、MetadataFieldsPageTS2769、RecordMetaFooterTS2339;行为不变
每个派生集与被替换清单逐值相同(hidden 集今天恰为原 4 项字面量;spec 词汇未来增长时行为按上表设计演化)。测试内的清单钉扎是有意的第二份陈述(照 #3032 ActionDef inventory / #4120 的登记表模式):它把「静默漂移」换成「红着的、指路的测试」。
沿途观察、未动的:
ObjectFieldInspector的SUMMARY_NUMERIC_TYPES是语义选择(可汇总类型)而非清单拷贝;isPlausibleEmail/importJobUndoable等是算法镜像,不属本 issue 的清单模式。🤖 Generated with Claude Code