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
12 changes: 6 additions & 6 deletions packages/spec/src/data/default-value-shape.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
} from './default-value-shape';
import { DEFAULT_VALUE_TOKENS } from './default-value-tokens';

describe('#7127 discriminateDefaultValueShape — engine-parity classification', () => {
describe('discriminateDefaultValueShape — engine-parity classification', () => {
const CASES: Array<{ label: string; dv: unknown; shape: DefaultValueShape }> = [
// ── Expression envelopes: the engine's structural predicate, verbatim ────
{ label: 'canonical CEL envelope', dv: { dialect: 'cel', source: 'today()' }, shape: 'expression' },
Expand Down Expand Up @@ -87,7 +87,7 @@ describe('#7127 discriminateDefaultValueShape — engine-parity classification',
});
});

describe('#7127 checkLiteralDefaultValue — the shared stored-form literal check', () => {
describe('checkLiteralDefaultValue — the shared stored-form literal check', () => {
it('refuses a literal that cannot satisfy the stored contract, with the contract\'s own detail', () => {
const v = checkLiteralDefaultValue({ type: 'number' }, 'abc');
expect(v.ok).toBe(false);
Expand Down Expand Up @@ -130,7 +130,7 @@ describe('#7127 checkLiteralDefaultValue — the shared stored-form literal chec
// also be wrong. Each case below asserts BOTH halves: the prescription is
// present, AND the half that was being shown instead is gone. Without the
// second the pin cannot see a regression back to the positional read.
it('#16077 prefers the rename over a MISSING-member type error (location)', () => {
it('prefers the rename over a MISSING-member type error (location)', () => {
const v = checkLiteralDefaultValue({ type: 'location' }, { latitude: 1, longitude: 2 });
expect(v.ok).toBe(false);
// Positionally this rejection reads
Expand All @@ -148,7 +148,7 @@ describe('#7127 checkLiteralDefaultValue — the shared stored-form literal chec
// discarding it cost the author the whole thing.
});

it('#16077 prefers the rename over a WRONG-TYPED-member error (address)', () => {
it('prefers the rename over a WRONG-TYPED-member error (address)', () => {
const v = checkLiteralDefaultValue({ type: 'address' }, { street: 5, postal_code: '98101' });
expect(v.ok).toBe(false);
// Every member of `address` is optional, which rules out a MISSING-member
Expand All @@ -158,7 +158,7 @@ describe('#7127 checkLiteralDefaultValue — the shared stored-form literal chec
expect(v.detail).not.toContain('expected string, received number');
});

it('#16077 leaves the already-correct case exactly as it was (the asymmetry is gone)', () => {
it('leaves the already-correct case exactly as it was (the asymmetry is gone)', () => {
// No member error to sort ahead, so this one was always right. Pinning it
// beside the two above is what states the property: the diagnosis no
// longer depends on whether an unrelated member happened to also be wrong.
Expand All @@ -169,7 +169,7 @@ describe('#7127 checkLiteralDefaultValue — the shared stored-form literal chec
expect(unlucky.detail).toContain('`postal_code` \u2192 `postalCode`');
});

it('#16077 is a NO-OP for a class that cannot emit `unrecognized_keys`', () => {
it('the rename preference is a NO-OP for a class that cannot emit `unrecognized_keys`', () => {
// The sweep over all sixteen classes `valueSchemaFor(def, 'stored')`
// covers found only `location` and `address` backed by a `strictObject`,
// so only they can emit the issue the preference looks for. For the other
Expand Down
2 changes: 1 addition & 1 deletion packages/spec/src/data/default-value-tokens.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
isAppResolvedDefaultToken,
} from './default-value-tokens.js';

describe('defaultValue runtime tokens (#4560)', () => {
describe('defaultValue runtime tokens — one vocabulary the engine and the DDL both read', () => {
it('declares the complete family, and every member is described', () => {
expect([...DEFAULT_VALUE_TOKENS]).toEqual(['NOW()', 'current_user']);
for (const token of DEFAULT_VALUE_TOKENS) {
Expand Down
4 changes: 2 additions & 2 deletions packages/spec/src/data/document.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ describe('ESignatureConfigSchema', () => {
// pin, the tsc `never` channel and the ADR-0087 registration — lives in
// `esignature-deadline-keys-retirement.test.ts`; these two are the family
// tests' one-line refusal witnesses (the #14477 house shape).
it('REFUSES an authored `expirationDays` — a retiredKey() tombstone since #14477 (ADR-0049)', () => {
it('REFUSES an authored `expirationDays` — a retiredKey() tombstone, since nothing ever read it (ADR-0049)', () => {
const wellFormed = {
provider: 'custom',
signers: [{ email: 'test@example.com', name: 'Test', role: 'Test', order: 1 }],
Expand All @@ -252,7 +252,7 @@ describe('ESignatureConfigSchema', () => {
expect(parsed).not.toHaveProperty('expirationDays');
});

it('REFUSES an authored `reminderDays` — a retiredKey() tombstone since #14477 (ADR-0049)', () => {
it('REFUSES an authored `reminderDays` — a retiredKey() tombstone, since nothing ever read it (ADR-0049)', () => {
const wellFormed = {
provider: 'docusign',
signers: [{ email: 'test@example.com', name: 'Test', role: 'Test', order: 1 }],
Expand Down
2 changes: 1 addition & 1 deletion packages/spec/src/data/driver-nosql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ describe('NoSQL Driver Protocol', () => {
// never on a bare `toThrow()`. The shape is not strict, so without the
// tombstone a query authored with `timeout` would have run with NO deadline at
// all — the failure a driver timeout exists to prevent — and reported nothing.
describe('NoSQLQueryOptions.timeout carries its unit (#15680)', () => {
describe('NoSQLQueryOptions.timeout carries its unit', () => {
it('REFUSES the retired `timeout` with the rename in the message', () => {
const result = NoSQLQueryOptionsSchema.safeParse({ timeout: 5000 });
expect(result.success).toBe(false);
Expand Down
10 changes: 5 additions & 5 deletions packages/spec/src/data/driver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ describe('DriverCapabilitiesSchema', () => {
// Retired capability bits (#4634, ADR-0049 enforce-or-remove)
// ===========================================================================

describe('[#4634] the 31 inert capability bits are tombstoned, not stripped', () => {
describe('the 31 inert capability bits are tombstoned, not stripped', () => {
it.each(RETIRED_BITS)('REJECTS an authored `%s`, with the prescription in the message', (bit) => {
const value = bit === 'isolationLevels' ? ['read-committed'] : true;
expect(() => DriverCapabilitiesSchema.parse({ [bit]: value })).toThrow(
new RegExp(`DriverCapabilities\\.${bit}.*removed.*Delete the key`, 's'),
);
});

it('the streaming prescription carries the #4484 findStream story and the paged-find fix', () => {
it('the streaming prescription names the removed findStream and the paged-find fix', () => {
expect(() => DriverCapabilitiesSchema.parse({ streaming: true })).toThrow(
/DriverCapabilities\.streaming.*removed.*findStream.*`find\(\)` with `limit`\/`offset`.*Delete the key/s,
);
Expand Down Expand Up @@ -163,7 +163,7 @@ describe('[#4634] the 31 inert capability bits are tombstoned, not stripped', ()
// so the load-bearing tsc-channel proof is the compiler-API test below, with
// anti-vacuity guards; sabotage-verified in the PR (S1: re-adding a live
// `streaming: z.boolean()` turns it red).
describe('[#4634] tsc channel: the retired bits are unwritable in DriverCapabilities', () => {
describe('tsc channel: the retired bits are unwritable in DriverCapabilities', () => {
it('types every retired bit as authored-unwritable and every live bit as writable', async () => {
const ts = (await import('typescript')).default;
const { resolve, dirname } = await import('node:path');
Expand Down Expand Up @@ -396,7 +396,7 @@ describe('DriverInterfaceSchema', () => {
// else; the unit now lives in the key name. Tombstoned (the shape is not
// strict, so a bare deletion would strip the old key in silence) and
// registered as `data/DriverOptions:timeout` under protocol 18.
describe('DriverOptions.timeout → DriverOptions.timeoutMs (#14478)', () => {
describe('DriverOptions.timeout → DriverOptions.timeoutMs: the key carries its unit', () => {
it('REFUSES the retired `timeout` spelling with the rename in the message', () => {
const result = DriverOptionsSchema.safeParse({ timeout: 5000 });
expect(result.success).toBe(false);
Expand Down Expand Up @@ -425,7 +425,7 @@ describe('DriverOptions.timeout → DriverOptions.timeoutMs (#14478)', () => {
// [#18063] driverSupportsTransactions — the one definition of the gate
// ===========================================================================

describe('[#18063] driverSupportsTransactions', () => {
describe('driverSupportsTransactions — a driver that cannot honour transactions says so', () => {
const withMethod = { beginTransaction: async () => ({}) };

it('is false for a driver with no beginTransaction — the pre-existing gate, unchanged', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function expectTombstoneRefusal(site: Pick<RetiredSite, 'qualified' | 'schema' |
expect(issue!.message).not.toMatch(/os migrate meta/);
}

describe('[#14477] ESignatureConfig deadline pair retirement — refusal at every site', () => {
describe('ESignatureConfig deadline pair retirement — refusal at every site', () => {
for (const site of SITES) {
it(`REJECTS an authored \`${site.qualified}\` at path \`${site.issuePath.join('.')}\`, carrying the prescription`, () => {
expectTombstoneRefusal(site);
Expand Down Expand Up @@ -169,7 +169,7 @@ describe('[#14477] ESignatureConfig deadline pair retirement — refusal at ever
});
});

describe('[#14477] no-materialize: parsed configurations carry neither key and neither former default', () => {
describe('no-materialize: parsed configurations carry neither key and neither former default', () => {
it('on the base schema', () => {
const parsed = ESignatureConfigSchema.parse(CONFIG);
expect(parsed).not.toHaveProperty('expirationDays');
Expand All @@ -187,7 +187,7 @@ describe('[#14477] no-materialize: parsed configurations carry neither key and n
});
});

describe('[#14477] the tsc channel: the input type of both retired keys is `never`', () => {
describe('the tsc channel: the input type of both retired keys is `never`', () => {
it('fails tsc at both authoring sites', () => {
const config: ESignatureConfig = {
...CONFIG,
Expand Down Expand Up @@ -215,7 +215,7 @@ describe('[#14477] the tsc channel: the input type of both retired keys is `neve
});
});

describe('[#14477] ADR-0087 registration', () => {
describe('ADR-0087 registration', () => {
it('declares both sites under major 18, with the D3 semantic entry wired and no D2 conversion', () => {
for (const site of SITES) {
expect(RETIRED_KEYS_BY_MAJOR[18], `${site.registered} must be declared`).toContain(site.registered);
Expand Down
6 changes: 3 additions & 3 deletions packages/spec/src/data/external-lookup-retirement.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import {
// Form follows #4988 / #5055: resolved symbol identity over every public entry
// via the build-time `export-origins/` artifact, plus the file-deletion probe
// in the #4988 direction (whole-file retirement, no surviving occupant).
describe('[#8075] data/ external-lookup family retirement', () => {
describe('data/ external-lookup family retirement', () => {
/** The 8 names the three retired defs exported (3 schema consts + 5 types). */
const RETIRED_NAMES = [
'ExternalDataSourceSchema', 'ExternalDataSource',
Expand Down Expand Up @@ -86,7 +86,7 @@ describe('[#8075] data/ external-lookup family retirement', () => {

// ── ABSENCE (every entry, not just ./data) ────────────────────────────
for (const name of RETIRED_NAMES) {
expect(holdersOf(name), `${name} must have zero holders after #8075`).toEqual([]);
expect(holdersOf(name), `${name} must have zero holders after the external-lookup retirement`).toEqual([]);
}

// ── SURVIVAL ──────────────────────────────────────────────────────────
Expand Down Expand Up @@ -127,7 +127,7 @@ describe('[#8075] data/ external-lookup family retirement', () => {
}
};
walk(srcRoot);
expect(importers, 'a resurrected import means the retirement is being undone — re-read #8075').toEqual([]);
expect(importers, 'a resurrected import means the retirement is being undone — the family had no consumer and accepted inline credentials').toEqual([]);
});

it('runtime namespace agrees with the compiler view', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/spec/src/data/feed.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('FeedItemType', () => {
});
});

describe('SYS_ACTIVITY_BUILTIN_TYPES (#11807)', () => {
describe('SYS_ACTIVITY_BUILTIN_TYPES — the built-in activity types, published by the spec', () => {
/**
* Mechanical invariants only. The semantic pin — every entry has a recorded
* writer disposition — lives with the object that declares the column:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { z } from 'zod';
import { FieldSchema } from './field.zod';
import { DEFAULT_AUTONUMBER_FORMAT, resolveAutonumberFormat } from './autonumber-format';

describe('FieldSchema.autonumberFormat — the declared contract default (#6555)', () => {
describe('FieldSchema.autonumberFormat — the declared contract default', () => {
it('declares `{0000}` as the JSON-Schema default for the key', () => {
const js = z.toJSONSchema(FieldSchema as unknown as z.ZodType, {
unrepresentable: 'any',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function minimalField(type: string): Record<string, unknown> {
return input;
}

describe('#13894 — autonumber defaults to unique: organization', () => {
describe('autonumber defaults to unique: organization', () => {
it("materializes 'organization' when the author omits `unique`", () => {
const parsed = FieldSchema.parse({ type: 'autonumber' });
expect(parsed.unique).toBe('organization');
Expand Down Expand Up @@ -101,7 +101,7 @@ describe('#13894 — autonumber defaults to unique: organization', () => {
expect(text.indexOf('unique')).toBe(text.indexOf('multiple') + 1);
});

it('is idempotent — parse(parse(x)) is byte-identical (the #9689 class)', () => {
it('is idempotent — parse(parse(x)) is byte-identical', () => {
for (const input of [{ type: 'autonumber' }, { type: 'autonumber', unique: false }, { type: 'text' }]) {
const once = FieldSchema.parse(input);
const twice = FieldSchema.parse(once);
Expand Down
4 changes: 2 additions & 2 deletions packages/spec/src/data/field-autonumber-readonly.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import { describe, it, expect } from 'vitest';
import { Field, FieldSchema, RUNTIME_OWNED_FIELD_TYPES } from './field.zod';

describe('#5628 — Field.autonumber injects readonly: true', () => {
describe('Field.autonumber injects readonly: true', () => {
it('declares the field read-only', () => {
const f = Field.autonumber({ label: 'Auto Number' });
expect(f.type).toBe('autonumber');
Expand Down Expand Up @@ -79,7 +79,7 @@ describe('#5628 — Field.autonumber injects readonly: true', () => {
});
});

describe('#5628 / #5503 — RUNTIME_OWNED_FIELD_TYPES is the protocol vocabulary', () => {
describe('RUNTIME_OWNED_FIELD_TYPES is the protocol vocabulary — the types whose value the runtime owns', () => {
it('names `autonumber`', () => {
expect(RUNTIME_OWNED_FIELD_TYPES.has('autonumber')).toBe(true);
});
Expand Down
6 changes: 3 additions & 3 deletions packages/spec/src/data/field-currency-scale-refused.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function expectRuledRemedy(message: string): void {
expect(message).not.toMatch(/currencyConfig|precision/);
}

describe('#19629 — `scale` on a `currency` field is refused at parse', () => {
describe('`scale` on a `currency` field is refused at parse', () => {
it('refuses the designer-produced shape, located at `scale`, with the ruled remedy: delete the key, and no other key named', () => {
const result = FieldSchema.safeParse({ name: 'amount', label: 'Amount', type: 'currency', scale: 3 });
expect(result.success).toBe(false);
Expand Down Expand Up @@ -103,7 +103,7 @@ describe('#19629 — `scale` on a `currency` field is refused at parse', () => {
});
});

describe('#19629 — CONTROLS: what the refusal must leave alone', () => {
describe('CONTROLS: what the refusal must leave alone', () => {
it('a currency field without `scale` parses, and its parse output re-parses unchanged', () => {
const once = FieldSchema.parse({ name: 'amount', label: 'Amount', type: 'currency', min: 0 });
expect('scale' in once).toBe(false);
Expand Down Expand Up @@ -204,7 +204,7 @@ function rowsNamed(form: unknown, key: string): Array<{ path: string; row: FormR
return out;
}

describe('#19629 — no registered metadata form OFFERS `scale` on a currency field', () => {
describe('no registered metadata form OFFERS `scale` on a currency field', () => {
it('CONTROLS: the walk reaches exactly the two `scale` rows the registered forms declare, and the object form is the registered one', () => {
// A lit roster, so an empty result below is a measured zero rather than a
// walk that found nothing to judge; a new `scale` row anywhere turns this
Expand Down
8 changes: 4 additions & 4 deletions packages/spec/src/data/field-default-value.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const CASES: Case[] = [
// while these value contracts were `.strip`: an author's undeclared key on a
// structured default was admitted silently. Refused by name now.
{
label: 'address + literal carrying an undeclared key (the #13388 seed spelling)',
label: 'address + literal carrying an undeclared key (`postal_code`, as the showcase seed once wrote it)',
field: { type: 'address', defaultValue: { street: '1 Main St', postal_code: '98101' } },
accepted: false,
contains: ['`postal_code`', '`postalCode`'],
Expand All @@ -113,14 +113,14 @@ const CASES: Case[] = [
// they never wrote. `notContains` names the half that was shown instead —
// without it the row cannot see a regression back to the positional read.
{
label: '#16077 location + the RENAMED legacy pair (a missing-member error sorts ahead)',
label: 'location + the RENAMED legacy pair (the rename is named over the missing-member error that sorts ahead)',
field: { type: 'location', defaultValue: { latitude: 37.77, longitude: -122.42 } },
accepted: false,
contains: ['`latitude` \u2192 `lat`', '`longitude` \u2192 `lng`'],
notContains: ['expected number, received undefined'],
},
{
label: '#16077 address + a renamed key beside a WRONG-TYPED declared one',
label: 'address + a renamed key beside a WRONG-TYPED declared one (the rename is named over the type error)',
field: { type: 'address', defaultValue: { street: 5, postal_code: '98101' } },
accepted: false,
contains: ['`postal_code` \u2192 `postalCode`'],
Expand Down Expand Up @@ -267,7 +267,7 @@ const CASES: Case[] = [
},
];

describe('#7127 FieldSchema.defaultValue — three shapes, each judged on its own terms', () => {
describe('FieldSchema.defaultValue — three shapes, each judged on its own terms', () => {
for (const { label, field, accepted, contains, notContains } of CASES) {
it(`${accepted ? 'accepts' : 'rejects'}: ${label}`, () => {
const issue = defaultValueIssue(field);
Expand Down
Loading
Loading