INNER CODE UNIT · TypeScript

typeNames

runvendo/vendo · packages/vendo/src/actions/sync/index.ts:117

function typeNames(value: unknown): string[] {
  const values = Array.isArray(value) ? value : value === undefined ? [] : [value];
  return values.filter((entry): entry is string => typeof entry === "string");
}

export function inputNarrowed(previous: ExtractedTool, next: ExtractedTool): boolean {
  // The JUDGE'S FILL is not a narrowing. A tool whose input nobody could read
  // carried a fail-closed placeholder; the run that infers it replaces that
  // placeholder wholesale, which trips every rule below. Reporting that as
  // breaking makes `vendoSync({ strict: true })` THROW on the judge's own
  // work. Only inference is exempt: a blind input turning `declared` means the
  // host added a real validator, which IS a breaking change worth reporting.
  if (schemaIsBlind(previous.inputSchemaSource) && next.inputSchemaSource === "inferred") return false;

  const oldSchema = objectValue(previous.inputSchema);
  const newSchema = objectValue(next.inputSchema);
  const oldRequired = new Set(arrayValue(oldSchema.required).filter((value): value is string => typeof value === "string"));
  const newRequired = arrayValue(newSchema.required).filter((value): value is string => typeof value === "string");

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…