Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions packages/spec/src/shared/alias-integrity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ describe('alias integrity — coverage', () => {
expect(unreached, 'these alias tables are not reachable from any module export, so nothing judges them').toEqual([]);
});

it('NOTHING in packages/spec calls `strictUnknownKeyError` directly any more (#5593)', () => {
it('NOTHING in packages/spec calls `strictUnknownKeyError` directly any more', () => {
// This was a shrink-only ratchet at 44 — the pre-helper wiring, which hands
// the factory a hand-transcribed `knownKeys` array instead of a shape.
// #5593 migrated the last of them, so it is a hard ZERO and the assertion
Expand Down Expand Up @@ -767,7 +767,7 @@ describe('alias integrity — every table is a true claim about its schema', ()
expect(broken.sort()).toEqual([]);
});

it('no two alias keys in one table collapse onto the same probe (#5481)', () => {
it('no two alias keys in one table collapse onto the same probe', () => {
// The table is indexed by `aliasProbe(key)`, so a colliding pair does not
// produce two entries — it produces one, decided by source order, with the
// earlier key gone before any author can reach it. Judged with the REAL
Expand Down Expand Up @@ -809,7 +809,7 @@ describe('alias integrity — every table is a true claim about its schema', ()
expect([...PROSE_ALIAS_TARGETS].filter((x) => !used.has(x)).sort()).toEqual([]);
});

it('no guidance SET member is itself a declared key, and no two entries claim one key (#6619)', () => {
it('no guidance SET member is itself a declared key, and no two entries claim one key', () => {
// The set-keyed guidance form arrived with #6619's fold of the three
// hand-written `$ZodErrorMap`s — maps that, being hand-rolled, no registry
// saw and nothing judged (#6416's blind spot). Folding them in is only
Expand Down Expand Up @@ -849,7 +849,7 @@ describe('alias integrity — every table is a true claim about its schema', ()
expect(broken.sort()).toEqual([]);
});

it('every pattern-keyed set carries examples that really match it and are really rejected (#6619)', () => {
it('every pattern-keyed set carries examples that really match it and are really rejected', () => {
// A pattern is an OPEN family, so the dead-entry question cannot be asked
// of its membership the way it is of a list — the visibility pattern
// deliberately also matches the canonical `visibleWhen`, which the shape
Expand Down Expand Up @@ -880,7 +880,7 @@ describe('alias integrity — every table is a true claim about its schema', ()
expect(broken.sort()).toEqual([]);
});

it('no alias row is dead on arrival because a guidanceSet in the same table already consumes it (#7889)', () => {
it('no alias row is dead on arrival because a guidanceSet in the same table already consumes it', () => {
// The live-table verdict. If this ever turns red on a real schema, the fix
// is at the authoring site (drop the row, or fold the key into the set's
// prescription) — never here, and never a change to the predicate that
Expand All @@ -904,7 +904,7 @@ describe('alias integrity — every table is a true claim about its schema', ()
).toBeGreaterThan(0);
});

it('the guidanceSet-reachability check can actually go red — a planted dead row, no live schema touched (#7889)', () => {
it('the guidanceSet-reachability check can actually go red — a planted dead row, no live schema touched', () => {
// Self-test, per the triage ruling: prove the gate can fail before trusting
// that it passing on the live table means anything. Entirely synthetic —
// `unreachableAliasRows` only reads `options.aliases` / `options.guidanceSets`,
Expand All @@ -914,7 +914,7 @@ describe('alias integrity — every table is a true claim about its schema', ()
const planted: StrictObjectDeclaration[] = [{
options: {
surface: 'synthetic reachability probe',
history: 'n/a — planted for #7889 self-test',
history: 'n/a — planted for the reachability self-test',
aliases: { visibleIf: 'visibleWhen' },
guidanceSets: [{
name: 'SYNTHETIC_VIS_PATTERN',
Expand All @@ -936,7 +936,7 @@ describe('alias integrity — every table is a true claim about its schema', ()
const reachable: StrictObjectDeclaration[] = [{
options: {
surface: 'synthetic reachability probe (no set)',
history: 'n/a — planted for #7889 self-test',
history: 'n/a — planted for the reachability self-test',
aliases: { visibleIf: 'visibleWhen' },
},
shape: emptyShape,
Expand All @@ -949,7 +949,7 @@ describe('alias integrity — every table is a true claim about its schema', ()
const nonMatching: StrictObjectDeclaration[] = [{
options: {
surface: 'synthetic reachability probe (non-matching set)',
history: 'n/a — planted for #7889 self-test',
history: 'n/a — planted for the reachability self-test',
aliases: { disabled: 'readonly' },
guidanceSets: [{
name: 'SYNTHETIC_VIS_PATTERN',
Expand All @@ -963,7 +963,7 @@ describe('alias integrity — every table is a true claim about its schema', ()
expect(unreachableAliasRows(nonMatching)).toEqual([]);
});

it('the three #6416 hand-written maps are FOLDED and judged here — the blind spot stays closed (#6619)', () => {
it('the three hand-written error maps are FOLDED and judged here — the blind spot stays closed', () => {
// The reason #6619 existed: `strictVisibilityError`,
// `strictWidgetAnalyticsError` and `strictTenancyError` were hand-rolled
// `$ZodErrorMap`s, so their alias pointers and prescriptions registered in
Expand Down Expand Up @@ -1008,7 +1008,7 @@ describe('alias integrity — every table is a true claim about its schema', ()
.toEqual(['crossTenantAccess', 'organizationField', 'strategy']);
});

it('no live surface still reports the shared view/page FAMILY name (#8202)', () => {
it('no live surface still reports the shared view/page FAMILY name', () => {
// `VISIBILITY_STRICT_OPTIONS.surface` is the family's name, and every
// consumer overrides it with its own shape's (`'this form field'` /
// `'this form section'` / `'this page component'`) — because since #7887
Expand All @@ -1028,7 +1028,7 @@ describe('alias integrity — every table is a true claim about its schema', ()
).toEqual([]);
});

it('the two maps #6619 MISSED are folded and judged here too (#6805)', () => {
it('the two maps the first fold MISSED are folded and judged here too', () => {
// #6619's inventory was two short, and both survivors were the same shape
// as the three above — `unrecognized_keys` prescription tables attached to
// a `.strict()` object through `{ error: … }`, seen by no registry. The
Expand All @@ -1055,7 +1055,7 @@ describe('alias integrity — every table is a true claim about its schema', ()
expect(Object.keys(capabilities!.options.guidance ?? {}).sort()).toEqual(['mru', 'trash']);
});

it('NO module outside the shared helpers writes its own `unrecognized_keys` map (#6805)', () => {
it('NO module outside the shared helpers writes its own `unrecognized_keys` map', () => {
// The class, not the instances. Both closure pins above name surfaces, so
// each only holds the line it was written for — #6416 named three, and the
// inventory that produced the number was two short. A pin over the SHAPE
Expand Down Expand Up @@ -1097,11 +1097,11 @@ describe('alias integrity — every table is a true claim about its schema', ()
offenders.sort(),
'build the shape with `strictObject(options, shape)` and put the prescriptions in '
+ '`guidance` / `guidanceSets` — a hand-rolled map registers in no registry, so its '
+ 'aliases and prescriptions are unmeasured rather than clean (#6416/#6619/#6805)',
+ 'aliases and prescriptions are unmeasured rather than clean',
).toEqual([]);
});

it('…and that scan is alive: the pre-fold shape is found, prose and the two out-of-class maps are not (#6805)', () => {
it('…and that scan is alive: the pre-fold shape is found, prose and the two out-of-class maps are not', () => {
// Anti-vacuity for the verdict above, which asserts that a search came back
// EMPTY — the shape that passes just as well when the instrument is dead.
// Four controls, each closing a different way it could be.
Expand Down
2 changes: 1 addition & 1 deletion packages/spec/src/shared/duration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export type IsoDurationSeconds = Assert<
Eq<z.input<typeof DurationSeconds>, z.infer<typeof DurationSeconds>>
>;

describe('the closed duration vocabulary — exactly two units (#18122)', () => {
describe('the closed duration vocabulary — exactly two units', () => {
it('declares milliseconds and seconds, and no speculative third unit', async () => {
// ⛔ `DurationMinutes` / `DurationHours` / `DurationDays` are added when a
// real row needs one, in the PR that converts it — the unit set is derived
Expand Down
14 changes: 7 additions & 7 deletions packages/spec/src/shared/editability-boundary.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const EDITABILITY_KEYS = ['disabled', 'disabledWhen', 'readonly', 'readOnly', 'r
// ===========================================================================
// 1. The guidance reaches an author — on the real parse error
// ===========================================================================
describe('#7887 — the boundary prescription an author actually sees', () => {
describe('editability lives on fields — the boundary prescription an author actually sees', () => {
it.each(VISIBILITY_ONLY)('%s answers `disabled` with the boundary, not a bare refusal', (_n, schema, base) => {
const m = unknownKeyMessage(schema, { ...base, disabled: true });
expect(m).toContain('Editability is a FIELD-level concern');
Expand Down Expand Up @@ -128,7 +128,7 @@ describe('#7887 — the boundary prescription an author actually sees', () => {
for (const key of ['disabled', 'readonly', 'editable']) expect(m).toContain(`\`${key}\``);
});

it.each(VISIBILITY_ONLY)('%s still puts the history sentence last (the #5955 order survives the new set)', (_n, schema, base) => {
it.each(VISIBILITY_ONLY)('%s still puts the history sentence last (the fix-first order survives the new set)', (_n, schema, base) => {
const m = unknownKeyMessage(schema, { ...base, disabled: true });
const history = 'Before ADR-0089 D3a these were dropped silently';
expect(m.indexOf('Editability is a FIELD-level concern')).toBeLessThan(m.indexOf(history));
Expand All @@ -138,7 +138,7 @@ describe('#7887 — the boundary prescription an author actually sees', () => {
// ===========================================================================
// 2. It names `readonlyWhen` — and must never name `disabledWhen`
// ===========================================================================
describe('#7887 — the prescription points at a key that exists', () => {
describe('the prescription points at a key that exists', () => {
it.each(VISIBILITY_ONLY)('%s names the field-level `readonly` / `readonlyWhen` pair', (_n, schema, base) => {
const m = unknownKeyMessage(schema, { ...base, disabled: true });
expect(m).toContain('`readonly: true`');
Expand Down Expand Up @@ -168,7 +168,7 @@ describe('#7887 — the prescription points at a key that exists', () => {
// ===========================================================================
// 3. The field surface is UNCHANGED — the shared-table trap
// ===========================================================================
describe('#7887 — `FormFieldSchema` sees exactly what it saw before', () => {
describe('`FormFieldSchema` sees exactly what it saw before', () => {
it('`disabled` on a form field still renames onto `readonly`, with no boundary text', () => {
const m = unknownKeyMessage(FormFieldSchema, { ...FORM_FIELD, disabled: true });
expect(m).toContain('Did you mean `disabled` → `readonly`?');
Expand Down Expand Up @@ -217,7 +217,7 @@ describe('#7887 — `FormFieldSchema` sees exactly what it saw before', () => {
// ===========================================================================
// 4. Acceptance is byte-identical — a guidance string is not a key
// ===========================================================================
describe('#7887 — no acceptance change', () => {
describe('no acceptance change', () => {
it.each(VISIBILITY_ONLY)('%s still REJECTS every editability spelling', (_n, schema, base) => {
for (const key of EDITABILITY_KEYS) {
expect(
Expand Down Expand Up @@ -277,7 +277,7 @@ describe('#7887 — no acceptance change', () => {
// ===========================================================================
// 5. #8202 — every shape names ITSELF, so the two answers cannot be swapped
// ===========================================================================
describe('#8202 — the rejection says WHICH shape refused the key', () => {
describe('the rejection says WHICH shape refused the key', () => {
/** Each shape, a probe body, and the name its rejection must give itself. */
const NAMED: ReadonlyArray<[string, { safeParse: (v: unknown) => { success: boolean; error?: unknown } }, object, string]> = [
['FormFieldSchema', FormFieldSchema, FORM_FIELD, 'this form field'],
Expand Down Expand Up @@ -341,7 +341,7 @@ describe('#8202 — the rejection says WHICH shape refused the key', () => {
// ===========================================================================
// 6. #8201 — `SelectOptionSchema` inherits the ruling, with its OWN answer
// ===========================================================================
describe('#8201 — an option is offered or withheld, never shown-but-unselectable', () => {
describe('an option is offered or withheld, never shown-but-unselectable', () => {
const OPTION_TEXT = 'Editability is not a per-OPTION concern';

it('`disabled` on an option reaches the boundary, rendered as the template bullet', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/spec/src/shared/error-map.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ describe('formatZodError', () => {
// mistake = the same key reported N times, which is why `view.zod.ts`'s
// `submitBehavior` reached for `discriminatedUnion` in the first place. Both
// directions are pinned below.
describe('[#4971] formatZodError expands invalid_union branches', () => {
describe('formatZodError expands invalid_union branches', () => {
// The campaign's shape: a string form OR a closed object form.
//
// [#19581] The closed arm is a REAL PRODUCT DOOR — `NormalizedFilterSchema`,
Expand Down Expand Up @@ -402,7 +402,7 @@ describe('safeParsePretty', () => {
// `z.record` key schema there is `z.string()` or an enum — #5389's dormancy
// table), which is why these fixtures are local schemas: the defect is in the
// CONSUMER, and the consumer is reachable from any caller's schema.
describe('[#5389] formatZodError descends invalid_key / invalid_element', () => {
describe('formatZodError descends invalid_key / invalid_element', () => {
const SnakeKey = z
.string()
.regex(/^[a-z][a-z0-9_]*$/, "Invalid identifier. Must be lowercase snake_case (e.g. 'first_name').");
Expand Down
2 changes: 1 addition & 1 deletion packages/spec/src/shared/evaluated-expression.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function issuesOf(value: unknown) {
return result.success ? [] : result.error.issues.map((i) => ({ code: i.code, path: i.path.map(String).join('.'), message: i.message }));
}

describe('EvaluatedExpressionSchema — an evaluated slot requires a non-blank `source` (#15430)', () => {
describe('EvaluatedExpressionSchema — an evaluated slot requires a non-blank `source`', () => {
it('REFUSES an `ast`-only envelope: one issue, at `source`, the published sentence', () => {
expect(issuesOf(AST_ONLY)).toEqual([
{ code: 'invalid_type', path: 'source', message: EVALUATED_EXPRESSION_SOURCE_REQUIRED },
Expand Down
4 changes: 2 additions & 2 deletions packages/spec/src/shared/evaluated-slot-population.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function persistenceSchemaCodeLines(): string[] {
return hits;
}

describe('#15811 population — no declaring position still mounts the persistence schema', () => {
describe('evaluated-slot population — no declaring position still mounts the persistence schema', () => {
const hits = persistenceSchemaCodeLines();

it('LIT CONTROL — the scan does find the name where it legitimately lives', () => {
Expand Down Expand Up @@ -242,7 +242,7 @@ const POSITIONS: ReadonlyArray<readonly [string, () => z.ZodType]> = [
['system/settings-manifest.zod.ts:SettingsManifestSchema.visible', () => slot(SettingsManifestSchema, 'visible')],
];

describe('#15811 — every evaluated slot refuses the two shapes no engine can run', () => {
describe('every evaluated slot refuses the two shapes no engine can run', () => {
it('reaches exactly the 34 declaring positions the census enumerated', () => {
// A position that stops being reachable must red here rather than fall out
// of the table: that silent drop is the #17630 failure in another costume.
Expand Down
4 changes: 2 additions & 2 deletions packages/spec/src/shared/expression-dialect-docs.pin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function dialectRowsInDocTable(): string[] {
return names;
}

describe('[#6085] expression.zod.ts dialect table === ExpressionDialect', () => {
describe('expression.zod.ts dialect table === ExpressionDialect', () => {
const rows = dialectRowsInDocTable();

it('finds the table at all (anti-vacuity)', () => {
Expand All @@ -79,7 +79,7 @@ describe('[#6085] expression.zod.ts dialect table === ExpressionDialect', () =>
expect([...rows].sort()).toEqual([...ExpressionDialect.options].sort());
});

it('never re-advertises `js`, retired at #3278', () => {
it('never re-advertises `js`, retired in favour of ScriptBody', () => {
// The specific regression this pin was written for. `js` is not an
// expression dialect at all — procedural JavaScript is the L2 authoring
// surface (`ScriptBody { language: 'js' }`), so a row here would send an
Expand Down
4 changes: 2 additions & 2 deletions packages/spec/src/shared/external-errors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('External error codes (ADR-0015)', () => {
// REACHABLE by a client.
// ---------------------------------------------------------------------------

describe('[#7739] EXTERNAL_ERROR_HTTP_STATUS', () => {
describe('EXTERNAL_ERROR_HTTP_STATUS — each external error carries an HTTP status', () => {
it('covers every code in the family — no gate can leak as a bare 500', () => {
// The `satisfies Record<ExternalErrorCode, number>` makes a missing entry a
// compile error; this is the runtime twin, so a code added to the map but
Expand Down Expand Up @@ -112,7 +112,7 @@ describe('renderDiffMessage', () => {
* schema fact) and renders like every other kind: the raw kind name plus the
* carried error text, so an unknown-to-a-consumer entry is still loud.
*/
it('renders the `unreachable` kind with the carried error text (#11166)', () => {
it('renders the `unreachable` kind with the carried error text', () => {
const diffs: SchemaDiffEntry[] = [
{
kind: 'unreachable',
Expand Down
4 changes: 2 additions & 2 deletions packages/spec/src/shared/lazy-schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe('lazySchema × z.toJSONSchema identity', () => {
* real instance, so before the facade aliased it every lazy reference lost its
* `description` while `OS_EAGER_SCHEMAS=1` (no Proxy at all) kept it.
*/
describe('lazySchema × z.toJSONSchema metadata (#19101)', () => {
describe('lazySchema × z.toJSONSchema — a lazy reference keeps its metadata', () => {
it('a lazy reference converts exactly like the eager instance — nested and as the root', () => {
const factory = () => z.record(z.string(), z.unknown()).describe('lazy-described record');
const lazy = lazySchema(factory);
Expand Down Expand Up @@ -168,7 +168,7 @@ describe('lazySchema × z.toJSONSchema metadata (#19101)', () => {
* components gain 2 descriptions, the
* `os generate` IDE schema 445; description is the only key that moved.
*/
describe('lazy == eager on the real contract (#19101)', () => {
describe('lazy == eager on the real contract', () => {
const PKG_ROOT = fileURLToPath(new URL('../..', import.meta.url));
const CONTRACT = new URL('../api/contract.zod.ts', import.meta.url).href;
const METADATA_TYPES = new URL('../kernel/metadata-type-schemas.ts', import.meta.url).href;
Expand Down
2 changes: 1 addition & 1 deletion packages/spec/src/shared/mapping.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('FieldMappingSchema', () => {
// so without the tombstone an authored `transform` is either accepted or
// silently stripped — never named).

describe('[#5552] FieldMapping.transform is retired, and says so', () => {
describe('FieldMapping.transform is retired, and says so', () => {
const RETIRED = {
source: 'order_value',
target: 'order_total',
Expand Down
Loading
Loading