INNER CODE UNIT · TypeScript
sameJson
runvendo/vendo · packages/vendo/src/actions/sync/index.ts:112
function sameJson(left: unknown, right: unknown): boolean {
if (left === undefined || right === undefined) return left === right;
return canonicalJson(left) === canonicalJson(right);
}
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;