/** * cli:derive-job-specs — validate.ts */ import { DeriveJobSpecsInputSchema, type DeriveJobSpecsInput } from './types.js' export interface ValidationResult { valid: boolean errors: string[] spec?: DeriveJobSpecsInput } export function validate(raw: unknown): ValidationResult { const parsed = DeriveJobSpecsInputSchema.safeParse(raw) if (!parsed.success) { return { valid: false, errors: parsed.error.issues.map(i => `[${i.path.join('.')}] ${i.message}`) } } return { valid: true, errors: [], spec: parsed.data } }