Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

Commit 87520ea

Browse files
committed
feat(types,components)!: retire four zero-read or third-spelling keys, mirror two chatbot keys, file eighteen runtime slots by name (objectui#6152, round 4)
- LabelSchema.content: retired on both faces (a third spelling of the label text); the label renderer's third read is dropped. - ReportComponentSchema.chartConfig / reportType and DetailViewSchema.autoDiscoverRelated: re-measured zero-read, retired on both faces; specReportToPresentation stops writing reportType. - ChatbotSchema.requestBody mirrored through the shared pick; ChatbotFloatingSchema.floatingConfig mirrored through a module-private FloatingChatbotConfig restatement that carries the triggerIcon tombstone. - DataTableSchema (14 code-produced keys) and DetailViewSchema (activities, comments, history, recordNavigation) filed in RuntimeOnlyDeclared by name, each with its reason on RuntimeOnlyNamedAllowList. - UnmirroredDeclared 9 / 44 -> 6 / 20; RuntimeOnlyDeclared 4 / 9 -> 4 / 27. Claude-Session: https://claude.ai/code/session_01TdiauJaVCHuj45EzZGUxHh Co-authored-by: Claude <noreply@anthropic.com>
1 parent f61dab1 commit 87520ea

15 files changed

Lines changed: 508 additions & 220 deletions

‎packages/components/src/__tests__/form-renderers.test.tsx‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,13 +359,26 @@ describe('Form Renderers - Display Issue Detection', () => {
359359
it('should render label element', () => {
360360
const { container } = renderComponent({
361361
type: 'label',
362-
content: 'Form Label',
362+
text: 'Form Label',
363363
});
364364

365365
const label = container.querySelector('label');
366366
expect(label).toBeTruthy();
367367
expect(label?.textContent).toContain('Form Label');
368368
});
369+
370+
it('no longer reads the retired `content` spelling (objectui#6152)', () => {
371+
// `content` was the renderer's third read, after `text` and `label`. Both faces of
372+
// `@object-ui/types` retire it, so a node carrying only `content` renders no text.
373+
const { container } = renderComponent({
374+
type: 'label',
375+
content: 'Retired Spelling',
376+
});
377+
378+
const label = container.querySelector('label');
379+
expect(label).toBeTruthy();
380+
expect(label?.textContent ?? '').not.toContain('Retired Spelling');
381+
});
369382
});
370383

371384
describe('Field locators (ADR-0054 C4)', () => {

‎packages/components/src/renderers/form/label.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ ComponentRegistry.register('label',
2727
// Apply designer props
2828
{...{ 'data-obj-id': dataObjId, 'data-obj-type': dataObjType, style }}
2929
>
30-
{schema.text || schema.label || schema.content}
30+
{/* `text`, then `label`. A third spelling, `content`, is retired on both
31+
faces of `@object-ui/types` and is no longer read (objectui#6152). */}
32+
{schema.text || schema.label}
3133
</Label>
3234
);
3335
},

‎packages/types/src/__tests__/chatbot-registration-authoring-faces-7655.test.ts‎

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
* `?: never` tombstone on both faces now, the designer control and the
4848
* `defaultProps` seed in the `chatbot-floating` registration are gone, and the
4949
* key stays UNMIRRORED on both twins. The runtime pin below still asserts it
50-
* parses green with any value, as a tripwire for the moment objectui#6152
51-
* mints an arm; the tombstone's own pins are in
52-
* `chatbot-display-mode-retired.test.ts`.
50+
* parses green with any value, as a tripwire; objectui#6152 round 4 kept the
51+
* refusal TypeScript-only under that ruling, so no arm is owed. The
52+
* tombstone's own pins are in `chatbot-display-mode-retired.test.ts`.
5353
*
5454
* ## The census counts NAMED reads; the floating registration has a second channel
5555
*
@@ -376,8 +376,9 @@ describe('`ChatbotEnhancedSchema` (zod) validates what the face declares', () =>
376376
});
377377

378378
it('mirrors `requestBody` under the key the renderer reads, and refuses a non-object', () => {
379-
// `ChatbotSchema`'s twin mirrors this under `body`, colliding with the base
380-
// children slot; the two new twins do not copy that collision.
379+
// `ChatbotSchema`'s twin used to mirror this under `body`, colliding with the
380+
// base children slot; objectui#8572 retired that arm, and since objectui#6152
381+
// round 4 all three twins share one `requestBody` arm through the pick.
381382
expect(ChatbotEnhancedZod.shape.requestBody).toBeDefined();
382383
const result = ChatbotEnhancedZod.safeParse({ ...node, requestBody: 'tenant=acme' });
383384
expect(result.success).toBe(false);
@@ -395,7 +396,7 @@ describe('`ChatbotEnhancedSchema` (zod) validates what the face declares', () =>
395396
});
396397
});
397398

398-
describe('`ChatbotFloatingSchema` (zod) validates what the face declares, and leaves the two shared floating keys unmirrored', () => {
399+
describe('`ChatbotFloatingSchema` (zod) validates what the face declares, and leaves `displayMode` unmirrored', () => {
399400
const node = {
400401
type: 'chatbot-floating',
401402
messages: [{ id: '1', role: 'user', content: 'hi' }],
@@ -419,7 +420,7 @@ describe('`ChatbotFloatingSchema` (zod) validates what the face declares, and le
419420
}
420421
});
421422

422-
it('TRIPWIRE — `displayMode` stays unmirrored here as on `ChatbotSchema`: any value still parses green (retired by objectui#7654; the `retirementTombstone()` half is owed when objectui#6152 mints an arm)', () => {
423+
it('TRIPWIRE — `displayMode` stays unmirrored here as on `ChatbotSchema`: any value still parses green (retired by objectui#7654; the refusal stays TypeScript-only under that ruling, objectui#6152 round 4)', () => {
423424
// objectui#7654 retired the key (maintainer ruling B, 2026-09-05): a
424425
// `?: never` tombstone on both TypeScript faces, designer control and seed
425426
// removed. The RUNTIME face was deliberately left alone — the key has no
@@ -446,11 +447,14 @@ describe('`ChatbotFloatingSchema` (zod) validates what the face declares, and le
446447
expect(ChatbotFloatingZod.safeParse({ ...node, enableMarkdown: 'anything-at-all' }).success).toBe(false);
447448
});
448449

449-
it('`floatingConfig` has no mirror here either — the objectui#6152 axis is not widened into', () => {
450-
expect((ChatbotFloatingZod.shape as Record<string, unknown>).floatingConfig).toBeUndefined();
451-
// Rides through unvalidated, wrong shape and all — byte for byte the
452-
// outcome on `ChatbotSchema`'s twin, which has no arm for it either.
453-
expect(ChatbotFloatingZod.safeParse({ ...node, floatingConfig: { panelHeight: '520px' } }).success).toBe(true);
450+
it('`floatingConfig` is mirrored here since objectui#6152 round 4, and a wrong member value is refused at its path', () => {
451+
// This registration is the one that reads the key; `ChatbotSchema`'s twin,
452+
// whose registration never does, still has no arm for it.
453+
expect((ChatbotFloatingZod.shape as Record<string, unknown>).floatingConfig).toBeDefined();
454+
const wrong = ChatbotFloatingZod.safeParse({ ...node, floatingConfig: { panelHeight: '520px' } });
455+
expect(wrong.success).toBe(false);
456+
expect(wrong.error?.issues.some((i) => i.path.join('.') === 'floatingConfig.panelHeight')).toBe(true);
457+
expect((ChatbotZod.shape as Record<string, unknown>).floatingConfig).toBeUndefined();
454458
});
455459

456460
it('`onClear` / `onError` / `onSend` are refused by name here too', () => {
@@ -465,7 +469,7 @@ describe('`ChatbotFloatingSchema` (zod) validates what the face declares, and le
465469
describe('the census is structural: picked off `ChatbotSchema`, never copied', () => {
466470
const shared: readonly ChatbotSharedKey[] = [
467471
'messages', 'placeholder', 'api', 'conversationId', 'systemPrompt', 'model', 'streamingEnabled',
468-
'headers', 'onError', 'showTimestamp', 'userAvatarUrl', 'userAvatarFallback',
472+
'headers', 'requestBody', 'onError', 'showTimestamp', 'userAvatarUrl', 'userAvatarFallback',
469473
'assistantAvatarUrl', 'assistantAvatarFallback', 'autoResponse', 'autoResponseText',
470474
'autoResponseDelay', 'onSend',
471475
];

‎packages/types/src/__tests__/floating-chatbot-trigger-icon-retired.test.ts‎

Lines changed: 65 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@
4949
* type-checks its tests through `tsconfig.test.json`, so re-widening the
5050
* declaration fails the build on the unused directive. A green `vitest` run is
5151
* NOT evidence about them — type assertions are erased before it runs.
52+
*
53+
* ⚠️ AMENDED by objectui#6152 round 4: "type-level only" now holds on a `chatbot`
54+
* node alone. That round minted the `FloatingChatbotConfig` mirror on the
55+
* `chatbot-floating` twin — the registration that reads `floatingConfig` — with
56+
* the `retirementTombstone()` half this file's tripwire asked for, so a
57+
* `chatbot-floating` node refuses `triggerIcon` at runtime as well. The runtime
58+
* section below pins the two twins apart.
5259
*/
5360

5461
import { describe, it, expect } from 'vitest';
@@ -128,69 +135,88 @@ describe('the `triggerIcon` tombstone makes authoring a `tsc` error', () => {
128135
});
129136
});
130137

131-
/* ── the runtime channel: DELIBERATELY unchanged, and a tripwire if that ends ─ */
138+
/* ── the runtime channel: unchanged on `chatbot`, refused on `chatbot-floating` since objectui#6152 round 4 ─ */
132139

133140
// Both faces declare `floatingConfig` — `ChatbotSchema` always did, and
134141
// objectui#7655 declared it on `ChatbotFloatingSchema`, the face of the one
135-
// registration that reads it — and NEITHER twin has an arm for it, so the
136-
// tripwire parses both nodes, each through its own twin.
137-
describe.each([
138-
['chatbot', ChatbotSchema],
139-
['chatbot-floating', ChatbotFloatingSchema],
140-
] as const)('there is NO zod refusal on a `%s` node, and that is deliberate (objectui#7654)', (type, twin) => {
142+
// registration that reads it. Until objectui#6152 round 4 NEITHER twin had an arm
143+
// for it, and this file's runtime half pinned that on both, as a TRIPWIRE: whoever
144+
// minted a `FloatingChatbotConfig` mirror had to add the `retirementTombstone()`
145+
// half for `triggerIcon` in the same change, and flip these controls rather than
146+
// delete them into a vacuum. Round 4 minted it on the `chatbot-floating` twin only
147+
// (that registration reads the key; `chatbot`'s never does), so the two twins are
148+
// now pinned apart.
149+
describe('there is NO zod refusal on a `chatbot` node, and that is deliberate (objectui#7654)', () => {
141150
const node = {
142-
type,
151+
type: 'chatbot',
143152
messages: [{ id: 'm1', role: 'user' as const, content: 'hi' }],
144153
};
145154

146-
it(`a ${type} node carrying \`floatingConfig.triggerIcon\` still parses GREEN`, () => {
147-
// `FloatingChatbotConfig` has NO zod mirror: `floatingConfig` sits in the
148-
// `UnmirroredDeclared` ledger (`zod-mirror-parity.test.ts`, under both
149-
// `complex.zod.ts#ChatbotSchema` and, since objectui#7655,
150-
// `complex.zod.ts#ChatbotFloatingSchema`), and `BaseSchema` is
151-
// `.passthrough()`, so the whole object rides through unvalidated. This was
152-
// green before the tombstone and is green after it — the retirement changed
153-
// the TypeScript face only, and this pins that it changed no parse outcome.
154-
//
155-
// ⚠️ TRIPWIRE: if objectui#6152 ever mints a `FloatingChatbotConfigSchema`
156-
// and wires it onto these twins as the `floatingConfig` arm, the assertion
157-
// that fires is the SHAPE PIN at the foot of this block — the one reading
158-
// `shape.floatingConfig` — and NOT this line. Measured on objectui#7678's
159-
// base, arm injected on both twins and restored under a trap: a
160-
// house-style non-strict `z.object` mirror reds the shape pin ONLY (2
161-
// failures, one per twin) and leaves this parse-green line GREEN, because
162-
// a non-strict object accepts `triggerIcon` and strips it, so `success`
163-
// stays `true`; a `z.strictObject` mirror reds both (4 failures). Either
164-
// shape trips the file — that is the intended signal, not a nuisance:
165-
// whoever lands the mirror must add the `retirementTombstone()` half for
166-
// `triggerIcon` at the same time, and flip these controls rather than
167-
// delete them into a vacuum.
168-
const result = twin.safeParse({
155+
it('a chatbot node carrying `floatingConfig.triggerIcon` still parses GREEN', () => {
156+
// `ChatbotSchema.floatingConfig` stays in the `UnmirroredDeclared` ledger
157+
// (`zod-mirror-parity.test.ts`): the `chatbot` registration never reads it, so
158+
// objectui#6152 round 4 did not mirror it. `BaseSchema` is `.passthrough()`,
159+
// so the whole object rides through unvalidated on this twin.
160+
const result = ChatbotSchema.safeParse({
169161
...node,
170162
floatingConfig: { title: 'Chat', triggerIcon: 'Sparkles' },
171163
});
172164
expect(result.success).toBe(true);
173165
});
174166

175167
it('a live `floatingConfig` parses green too — the non-vacuity control', () => {
176-
const result = twin.safeParse({
168+
const result = ChatbotSchema.safeParse({
177169
...node,
178170
floatingConfig: { title: 'Chat', triggerSize: 56 },
179171
});
180172
expect(result.success).toBe(true);
181173
});
182174

183175
it('the mirror really has no `floatingConfig` key at all', () => {
184-
// The load-bearing fact behind everything above, asserted rather than
185-
// assumed: a key the mirror declares would appear in its shape.
186-
//
187-
// ⚠️ This is also the assertion the objectui#6152 TRIPWIRE fires through:
188-
// under a house-style non-strict mirror it reds HERE and nowhere else in
189-
// this file. The measurement is recorded at that comment, above.
190-
const shape = (twin as unknown as { shape: Record<string, unknown> }).shape;
176+
// The load-bearing fact behind the two lines above, asserted rather than
177+
// assumed: a key the mirror declares would appear in its shape. This is the
178+
// assertion the TRIPWIRE fires through if this twin ever gains the arm.
179+
const shape = (ChatbotSchema as unknown as { shape: Record<string, unknown> }).shape;
191180
expect(shape.floatingConfig).toBeUndefined();
192181
// Lit control: a key the mirror DOES declare is present, so the reading
193182
// above is a measurement and not an empty object.
194183
expect(shape.messages).toBeDefined();
195184
});
196185
});
186+
187+
describe('a `chatbot-floating` node REFUSES `floatingConfig.triggerIcon` at runtime (objectui#6152 round 4 minted the mirror)', () => {
188+
const node = {
189+
type: 'chatbot-floating',
190+
messages: [{ id: 'm1', role: 'user' as const, content: 'hi' }],
191+
};
192+
193+
it('`floatingConfig.triggerIcon` is refused at its own path, and the refusal says the key was never read', () => {
194+
// The flipped tripwire: this line used to assert `success: true`.
195+
const result = ChatbotFloatingSchema.safeParse({
196+
...node,
197+
floatingConfig: { title: 'Chat', triggerIcon: 'Sparkles' },
198+
});
199+
expect(result.success).toBe(false);
200+
const issues = (result.error?.issues ?? []).filter((i) => i.path.join('.') === 'floatingConfig.triggerIcon');
201+
expect(issues.length, JSON.stringify(result.error?.issues)).toBe(1);
202+
expect(issues[0].code).toBe('invalid_type');
203+
expect(issues[0].message).toContain('objectui#7654');
204+
});
205+
206+
it('a live `floatingConfig` parses green — the non-vacuity control', () => {
207+
const result = ChatbotFloatingSchema.safeParse({
208+
...node,
209+
floatingConfig: { title: 'Chat', triggerSize: 56 },
210+
});
211+
expect(result.success).toBe(true);
212+
});
213+
214+
it('the mirror declares `floatingConfig`, and its `triggerIcon` is a MEMBER tombstone, not an undeclared key', () => {
215+
const shape = (ChatbotFloatingSchema as unknown as { shape: Record<string, unknown> }).shape;
216+
expect(shape.floatingConfig).toBeDefined();
217+
const inner = (shape.floatingConfig as { unwrap: () => { shape: Record<string, unknown> } }).unwrap().shape;
218+
expect(inner.triggerIcon).toBeDefined();
219+
// Lit control: a live member sits beside it.
220+
expect(inner.triggerSize).toBeDefined();
221+
});
222+
});

‎packages/types/src/__tests__/spec-report.test.ts‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,23 @@ describe('SpecReport bridge', () => {
7979
expect(legacy.fields?.[0].name).toBe('email');
8080
});
8181

82-
it('collapses joined report type to tabular for legacy renderer', () => {
82+
it('writes no `reportType` — the key is retired and nothing read it (objectui#6152)', () => {
83+
// The adapter used to write the spec `type` as `reportType` (collapsing `joined`
84+
// to `tabular`). No reader existed, so the key was retired on both faces of
85+
// `ReportComponentSchema` and this write was removed with it.
8386
const report = SpecReport.create({
8487
name: 'joined_demo',
8588
label: 'Joined',
8689
type: 'joined',
8790
blocks: [{ name: 'b1', label: 'Block 1', dataset: 'account_ds', values: ['name'] }],
8891
} as never);
8992
const legacy = specReportToPresentation(report);
90-
expect(legacy.reportType).toBe('tabular');
93+
expect('reportType' in legacy).toBe(false);
94+
// Lit control: the same conversion still writes the keys the viewer reads.
95+
expect(legacy.title).toBe('Joined');
9196
});
9297

93-
it('preserves matrix report type and maps rows to groupBy', () => {
98+
it('maps a matrix report\'s rows to groupBy', () => {
9499
const report = SpecReport.create({
95100
name: 'matrix_demo',
96101
label: 'Matrix',
@@ -100,7 +105,7 @@ describe('SpecReport bridge', () => {
100105
values: ['amount_sum'],
101106
});
102107
const legacy = specReportToPresentation(report);
103-
expect(legacy.reportType).toBe('matrix');
108+
expect('reportType' in legacy).toBe(false);
104109
expect(legacy.groupBy?.[0].field).toBe('region');
105110
});
106111

0 commit comments

Comments
 (0)