@ontrails/core 1.0.0-beta.42 → 1.0.0-beta.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -131,7 +131,7 @@ const wrappedMarkerSchemaTypes = new Set([
131
131
  'readonly',
132
132
  ]);
133
133
 
134
- // Schemas with a deterministic JSON-schema override (e.g. blobRefSchema) project
134
+ // Schemas with a deterministic JSON-schema override (e.g. blobRefSchema) derive
135
135
  // to a canonical descriptor, so the preflight accepts them without inspecting
136
136
  // the underlying custom Zod internals once runtime-only checks have been ruled
137
137
  // out.
@@ -176,7 +176,7 @@ const assertMarkerLiteralSupported = (
176
176
  def: Readonly<Record<string, unknown>>,
177
177
  path: readonly string[]
178
178
  ): void => {
179
- // The JSON-schema projection only emits the first literal value, so a
179
+ // The JSON-schema derivation only emits the first literal value, so a
180
180
  // multi-value literal (z.literal(['a', 'b'])) would hash identically to a
181
181
  // single-value literal and silently collide.
182
182
  const { values } = def;
@@ -345,7 +345,7 @@ const assertMarkerContentSupported = (
345
345
  const keys = Object.keys(record);
346
346
  if (keys.length === 0 && path.at(-1) !== 'properties') {
347
347
  throw new ValidationError(
348
- `Trail version marker content at ${markerValuePath(path)} contains an unsupported empty schema projection`
348
+ `Trail version marker content at ${markerValuePath(path)} contains an unsupported empty schema derivation`
349
349
  );
350
350
  }
351
351
 
@@ -428,14 +428,14 @@ export const deriveTrailVersionMarker = (content: unknown): string => {
428
428
  return hasher.digest('hex').slice(0, TRAIL_VERSION_MARKER_LENGTH);
429
429
  };
430
430
 
431
- const projectSchema = (schema: unknown, path: readonly string[]): unknown => {
431
+ const deriveSchema = (schema: unknown, path: readonly string[]): unknown => {
432
432
  assertMarkerSchemaSupported(schema, path);
433
433
  return canonicalizeTrailVersionMarkerContent(
434
434
  zodToJsonSchema(schema as never)
435
435
  );
436
436
  };
437
437
 
438
- const projectVersionDetours = (
438
+ const deriveVersionDetours = (
439
439
  entry: unknown
440
440
  ): readonly Record<string, unknown>[] | undefined => {
441
441
  const raw = entry as unknown as Record<string, unknown>;
@@ -459,7 +459,7 @@ const projectVersionDetours = (
459
459
  });
460
460
  };
461
461
 
462
- const projectVersionRuntimeRefs = (
462
+ const deriveVersionRuntimeRefs = (
463
463
  entry: unknown,
464
464
  field: 'composes' | 'resources'
465
465
  ): readonly string[] | undefined => {
@@ -494,16 +494,16 @@ export const deriveCurrentTrailVersionMarkerContent = (
494
494
  >
495
495
  ): Readonly<Record<string, unknown>> => {
496
496
  const content: Record<string, unknown> = {
497
- input: projectSchema(trail.input, ['input']),
497
+ input: deriveSchema(trail.input, ['input']),
498
498
  kind: 'current',
499
499
  ...(trail.output === undefined
500
500
  ? {}
501
- : { output: projectSchema(trail.output, ['output']) }),
501
+ : { output: deriveSchema(trail.output, ['output']) }),
502
502
  };
503
503
 
504
- const composes = projectVersionRuntimeRefs(trail, 'composes');
505
- const resources = projectVersionRuntimeRefs(trail, 'resources');
506
- const detours = projectVersionDetours(trail);
504
+ const composes = deriveVersionRuntimeRefs(trail, 'composes');
505
+ const resources = deriveVersionRuntimeRefs(trail, 'resources');
506
+ const detours = deriveVersionDetours(trail);
507
507
  if (composes !== undefined) {
508
508
  content['composes'] = composes;
509
509
  }
@@ -522,9 +522,9 @@ export const deriveTrailVersionEntryMarkerContent = (
522
522
  ): Readonly<Record<string, unknown>> => {
523
523
  const kind = getTrailVersionEntryKind(entry);
524
524
  const content: Record<string, unknown> = {
525
- input: projectSchema(entry.input, ['input']),
525
+ input: deriveSchema(entry.input, ['input']),
526
526
  kind,
527
- output: projectSchema(entry.output, ['output']),
527
+ output: deriveSchema(entry.output, ['output']),
528
528
  };
529
529
 
530
530
  if (kind === 'revision' && entry.transpose !== undefined) {
@@ -532,9 +532,9 @@ export const deriveTrailVersionEntryMarkerContent = (
532
532
  }
533
533
 
534
534
  if (kind === 'fork') {
535
- const composes = projectVersionRuntimeRefs(entry, 'composes');
536
- const resources = projectVersionRuntimeRefs(entry, 'resources');
537
- const detours = projectVersionDetours(entry);
535
+ const composes = deriveVersionRuntimeRefs(entry, 'composes');
536
+ const resources = deriveVersionRuntimeRefs(entry, 'resources');
537
+ const detours = deriveVersionDetours(entry);
538
538
  if (composes !== undefined) {
539
539
  content['composes'] = composes;
540
540
  }
@@ -599,7 +599,7 @@ export const assertUniqueTrailVersionMarkers = (
599
599
  for (const [marker, versions] of byMarker) {
600
600
  if (versions.length > 1) {
601
601
  throw new ValidationError(
602
- `Trail "${trailId}" versions ${versions.join(', ')} project the same marker ${marker}`
602
+ `Trail "${trailId}" versions ${versions.join(', ')} derive the same marker ${marker}`
603
603
  );
604
604
  }
605
605
  }