Skip to content

finding(plugins): getDataConfig — the three-rung record-source ladder — is hand-copied in five plugin components #7632

Description

@os-sam

Found while measuring #7627 (the data.provider === 'object' fold collapse). Filed separately because it is a different fold from the one #7627 names, and it stands whichever way #7627's precedence question is ruled.

What is true today (measured on origin/main 11edab88)

getDataConfig(schema) — the helper that resolves a block's record source from one of three keys, in the order data then staticData then objectName — is defined locally, five times:

file line
packages/plugin-calendar/src/ObjectCalendar.tsx 117
packages/plugin-gantt/src/ObjectGantt.tsx 320
packages/plugin-grid/src/ObjectGrid.tsx 428
packages/plugin-map/src/ObjectMap.tsx 127
packages/plugin-tree/src/ObjectTree.tsx 92

Four of the five are byte-identical modulo the parameter type; plugin-tree's takes schema: any and is written on one line per rung. The bodies all read:

if (schema.data) return schema.data;
if (schema.staticData) return { provider: 'value', items: schema.staticData };
if (schema.objectName) return { provider: 'object', object: schema.objectName };
return null;

plugin-calendar's differs in one measured way: it guards with 'data' in schema && schema.data / 'staticData' in schema && schema.staticData rather than a bare truthiness read, because its parameter is a union of two schema types.

Why this is worth a card

This ladder is not an implementation detail — it is published contract, on both faces, and it is maintainer-ruled. packages/types/src/objectql.ts and packages/types/src/zod/objectql.zod.ts both declare, in .describe() strings that ship, that objectName is "the THIRD record source getDataConfig resolves, after data and staticData" and that data is "read FIRST by getDataConfig" (objectui#6939, maintainer ruling recorded 2026-09-02, director seat, decision batch #8). The Zod refinement requireRecordSource is written against exactly these three rungs, and packages/types/src/__tests__/objectql-record-source-refinement-6939.test.ts pins the validator half.

So the published spec names one resolver, and the repo has five copies of it that nothing holds together. A change to the ruled order has five edit sites and no gate that notices if one is missed — the same drift class AGENTS.md #0.1 names, and the same one #7627 files against the provider === 'object' reads layered on top of this helper.

No user-visible bug is claimed and none was measured: all five copies agree today for every input tested. The cost is drift risk against a published, ruled contract. Severity is for triage to set.

Note for whoever picks this up

Refs: #7627 (origin of this measurement) · #6939 (the ruling that published the ladder) · #7470 · AGENTS.md #0.1.

Activity

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

Metadata

Metadata

Assignees

Labels

domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatfindingpm:dispatched

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions