Skip to content

Commit f681dae

Browse files
committed
test(spec): pin PageContainerProps as isomorphic for the ADR-0122 phase-2 flip (#5775)
`check:spec-parsed-alias` (the phase-1 gate from #6072) refuses a bare `X = z.infer<typeof XSchema>` alias that is neither paired with an `XParsed` nor pinned as isomorphic. `PageContainerProps` is a lone optional array with no default, transform, catch or pipe anywhere in its tree, so `z.input` and `z.infer` coincide and the phase-2 flip of the bare name changes nothing observable — which is the pin route, not the `XParsed` route (a permanent synonym is a name an author can only pick wrongly). `component.zod.ts` had no bare alias until now, so this adds the file's first module import to the registry. It takes the next free M-index rather than the alphabetical slot: those indices are positional identifiers the 720 pin lines reference by number. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AwTBGD3gTnPKWmJLYU9R7T
1 parent 8324d71 commit f681dae

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

packages/spec/src/type-alias-convention.pin.test.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,12 @@ import type * as M165 from './ui/responsive.zod.js';
241241
import type * as M166 from './ui/theme.zod.js';
242242
import type * as M167 from './ui/view.zod.js';
243243
import type * as M168 from './ui/widget.zod.js';
244+
// Appended out of alphabetical order deliberately: the M-indices are positional
245+
// identifiers the pin lines below reference by number, so a new module takes the
246+
// next free index rather than renumbering 169 imports and every pin that names
247+
// one. #5775 is the first entry from this file — `component.zod.ts` had no bare
248+
// `X = z.infer` alias until `PageContainerProps` arrived.
249+
import type * as M170 from './ui/component.zod.js';
244250

245251
// ---------------------------------------------------------------------------
246252
// 717 isomorphic aliases: `z.input` === `z.infer`, so no `XParsed` is declared.
@@ -1316,6 +1322,14 @@ export type Iso715 = Assert<Eq< z.input< typeof M167.UserFilterFieldSchema >, z.
13161322
// ui/widget.zod.ts
13171323
export type Iso716 = Assert<Eq< z.input< typeof M168.WidgetLifecycleSchema >, z.infer< typeof M168.WidgetLifecycleSchema > >>;
13181324

1325+
// ui/component.zod.ts
1326+
// #5775 — the shared `children` contract for `page:section`/`page:footer`/
1327+
// `page:sidebar`. A lone optional array with no default, transform, catch or
1328+
// pipe anywhere in its tree, so the two shapes coincide and the phase-2 flip of
1329+
// the bare name changes nothing. `check:spec-parsed-alias` sent it here rather
1330+
// than to a `PageContainerPropsParsed`, which would be a permanent synonym.
1331+
export type Iso719 = Assert<Eq< z.input< typeof M170.PageContainerProps >, z.infer< typeof M170.PageContainerProps > >>;
1332+
13191333
// ---------------------------------------------------------------------------
13201334
// Representative spot-checks on the phase-1 ADDITIONS.
13211335
//
@@ -1371,7 +1385,7 @@ export type AFamilyParsedIsParseState = Assert<
13711385
// ---------------------------------------------------------------------------
13721386

13731387
describe('ADR-0122 type-alias convention', () => {
1374-
it('still declares all 719 isomorphic pins', () => {
1388+
it('still declares all 720 isomorphic pins', () => {
13751389
// The truth of each pin is proved by tsc, not here — an `Assert<Eq<...>>`
13761390
// that stops holding is a compile error with the alias named. What tsc
13771391
// cannot notice is a pin that was DELETED: removing the assertion removes
@@ -1390,7 +1404,7 @@ describe('ADR-0122 type-alias convention', () => {
13901404
// `ConnectorType` / `ConnectorStatus` pins beside it).
13911405
const self = readFileSync(fileURLToPath(import.meta.url), 'utf8');
13921406
const pins = self.match(/^export type Iso\d+ = Assert</gm) ?? [];
1393-
expect(pins).toHaveLength(719);
1407+
expect(pins).toHaveLength(720);
13941408
});
13951409

13961410
it('leaves the A-family parse behaviour untouched', () => {

0 commit comments

Comments
 (0)