Skip to content

finding(console): metadataConverters.ts and MetadataService.ts lose their last importer with the object-detail retirement — two console-local duplicates of live app-shell modules #4368

Description

@yinlianghui

Out-of-scope finding from PR #4365 (the #3731 / #3736 object-detail factory retirement). Recorded, not fixed, and unassigned — deleting these is a separate judgement from the ruling I was executing, and the ruling did not name them.

Fact

PR #4365 deletes the bespoke object-detail widgets. Those widgets were the only importers of two console-local modules, so both drop to zero importers the moment it lands:

File Only importers before #4365
apps/console/src/utils/metadataConverters.ts components/schema/objectDetailWidgets.tsx, components/schema/ObjectFieldDesignerWidget.tsx
apps/console/src/services/MetadataService.ts components/schema/ObjectFieldDesignerWidget.tsx

Measured on the PR's branch point ca269fecd:

grep -rn 'metadataConverters' --include='*.ts' --include='*.tsx' apps packages | grep -v node_modules
grep -rn "services/MetadataService" --include='*.ts' --include='*.tsx' apps packages | grep -v node_modules

Why it is worth a card rather than a silent deletion

Both are duplicates of live modules in app-shell, and the app-shell copies are the ones with consumers:

  • packages/app-shell/src/utils/metadataConverters.ts — same module name, same exported toObjectDefinition / toFieldDefinition pair.
  • packages/app-shell/src/services/MetadataService.ts — consumed by packages/app-shell/src/hooks/useMetadataService.ts and covered by MetadataService.saveAdvisories.test.ts.

That is the imitation-trap shape the maintainer named in another 2026-08-11 ruling: an agent grepping for "the converter" or "the metadata service" can land on the console-local copy, which after #4365 nothing exercises and no test covers, and drift it away from the live one. It is dormant either way — no user reaches it — hence finding and no pm:queue.

A third, smaller item in the same shadow: apps/console keeps its @object-ui/plugin-designer dependency, whose only remaining mention in the app is a vi.mock() in src/__tests__/AppContent.systemHubRoutes.test.tsx after the FieldDesigner consumer is deleted.

Not asserted here

Whether the right exit is "delete the console copies" or "keep one and make the other re-export it" is exactly the call that should be ruled, not guessed — the two copies have not been diffed for behavioural divergence in this finding, and that diff is the first step of whichever fix is chosen. No dead-code gate exists in this repo, so nothing turns red while this sits.

How to re-check

git log --oneline -1                                   # after #4365 lands
grep -rn 'metadataConverters\|services/MetadataService' --include='*.ts' --include='*.tsx' apps/console/src | grep -v node_modules
diff apps/console/src/utils/metadataConverters.ts packages/app-shell/src/utils/metadataConverters.ts

Searched open issues for metadataConverters, MetadataService, and the two file paths before filing; the nearest hits (#3639, #3661) are closed and about MetadataRedirect, not these modules.


Generated by Claude Code

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions