Skip to content

Commit f5fc321

Browse files
committed
test(cutover): the ui lazy-node pins count five since spec's shared chunks (bill item 37, objectstack#25803)
Cutover PR objectstack#25825 run 1, Test UI 14/16 and 15/16: imported-defaults-8317 expects 6 reachable `z.lazy` nodes and finds 5, and zod-mirror-parity's UNNAMED_LAZY_SLOTS still lists `form.zod.ts#FormFieldSchema.summaryOperations`, which the live walk no longer reports. No schema changed (FilterConditionSchema is byte-identical between the pin 5e7cf63 and main): spec objectstack#25748 ships one module graph with shared chunks, so each schema is one object across entries, and the lazy reached through `FieldSchema.summaryOperations.filter` is now the same object as the recursive filter clause (measured: 5 distinct lazies, that path in the filter clause's group). Both tests are ratchets built to red on exactly this event. The pin moves 6 -> 5 with the reason, the summaryOperations row goes (its comment stays as history), and imported-defaults.ts's walker docblock re-derives its count as five. Measured on the cutover head 1c0d02e + the series: 2 failed / 312 passed -> 314/314. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CUXv64KLMfYv3ia2sWi6te
1 parent 19c9bce commit f5fc321

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

‎ui/packages/types/src/__tests__/imported-defaults-8317.test.ts‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -492,17 +492,18 @@ describe('the import boundary strips every imported default (objectui#8317)', ()
492492
it('the walker docblock\'s `lazy` count is re-derived, not quoted', () => {
493493
// The `lazy` arm is the one place the identity property cannot hold: it
494494
// must rebuild without forcing the getter, so a clean subtree behind a
495-
// `z.lazy` is rebuilt anyway. The module's docblock names SIX such
495+
// `z.lazy` is rebuilt anyway. The module's docblock names FIVE such
496496
// nodes (the fourth, `ViewSchema`'s form-field group, since objectui#7928;
497-
// the fifth, under `FieldSchema.relatedListFilter`, since objectui#11070;
498-
// the sixth, the form-field group under the `object-form` row's
499-
// `sections[].fields[]`, since the 17.7.0 bump, objectui#11717)
497+
// the one under `FieldSchema`, added by objectui#11070, is the recursive
498+
// filter clause's own object since objectstack#25748's shared chunks; the
499+
// form-field group under the `object-form` row's `sections[].fields[]`,
500+
// since the 17.7.0 bump, objectui#11717)
500501
// and says the exception costs nothing extra for every owner but the
501502
// ones `REBUILT_CLEAN` names (objectui#10872 batch 2), because each
502503
// other owner sits inside a schema that is being rebuilt regardless.
503504
// Both halves are measured here, so a spec bump or an import that moves
504505
// either one is red rather than quietly making the docblock false.
505-
expect(walk(IMPORTED.map(([, s]) => s)).lazies).toBe(6);
506+
expect(walk(IMPORTED.map(([, s]) => s)).lazies).toBe(5);
506507
const lazyOwners = IMPORTED.filter(([, s]) => walk([s]).lazies > 0);
507508
expect(lazyOwners.length, 'no schema owns a lazy — the count above found them elsewhere').toBeGreaterThan(0);
508509
// The clean owners are exactly the named set: rebuilt (so NOT the spec's

‎ui/packages/types/src/__tests__/zod-mirror-parity.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6353,7 +6353,9 @@ const UNNAMED_LAZY_SLOTS: readonly string[] = [
63536353
// `FieldSchema` member by reference, and its optional `filter` is the spec's
63546354
// recursive filter condition. That `z.lazy` sits inside an IMPORTED schema
63556355
// (rebuilt by `stripImportedDefaults`), so no local const names it either.
6356-
'form.zod.ts#FormFieldSchema.summaryOperations',
6356+
// Retired by objectstack#25748: the spec's shared chunks make that lazy the
6357+
// same object as a named recursive mirror reached through another entry, so
6358+
// the walk no longer reports it as unnamed (the schema itself is unchanged).
63576359
'objectql.zod.ts#ObjectViewSchema.form',
63586360
'objectql.zod.ts#ObjectViewSchema.table',
63596361
];

‎ui/packages/types/src/zod/imported-defaults.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ const walk = (schema: z.ZodType): z.ZodType => {
141141
// recursive form-field group under `ObjectFormPropsSchema.sections[].fields[]`,
142142
// reached from the `object-form` and `object-master-detail-form` rows, whose
143143
// `sections` take the page-block section shape since that release.
144+
// objectstack#25748 then made the count FIVE: `@objectstack/spec` ships one
145+
// module graph with shared chunks, so each schema is one object across its
146+
// entries, and the lazy `FieldSchema` reaches (walked today as
147+
// `FieldSchema.summaryOperations.filter`) is now the SAME object as the
148+
// recursive filter clause above rather than a copy of it. The fifth is no
149+
// longer a node of its own; nothing in the schemas changed.
144150
// Each sits inside a schema that carries a default anyway, so the exception
145151
// costs no extra rebuild. objectui#10872 batch 2 had ONE named exception,
146152
// `ElementDataSourceSchema` (the `element:number` arm's `dataSource`), whose

0 commit comments

Comments
 (0)