fix(ai): validate generated model data before builds

This commit is contained in:
Armin Ronacher
2026-07-20 22:28:48 +02:00
parent ff992261e2
commit c8c3cd499f
14 changed files with 700 additions and 103 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env node
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { validateGeneratedModelData } from "./model-data.ts";
const packageRoot = join(dirname(fileURLToPath(import.meta.url)), "..");
try {
validateGeneratedModelData(packageRoot);
console.log("Generated model data is valid.");
} catch (error) {
console.error(error instanceof Error ? error.message : String(error));
console.error("\nModel data is missing or stale. Run `npm run hydrate:model-data` from the repository root.");
process.exitCode = 1;
}