const AI_CLICHES = [
  "delve",
  "landscape",
  "game-changer",
  "unlock",
  "leverage",
  "in today's fast-paced",
  "revolutionize",
  "revolutionizing",
  "cutting-edge",
  "synergy",
  "paradigm",
];

export interface HumanValidationResult {
  valid: boolean;
  issues: string[];
  clichéCount: number;
}

/** Lightweight authenticity check — expand with LLM scoring later. */
export function validateHumanWriting(text: string): HumanValidationResult {
  const lower = text.toLowerCase();
  const found = AI_CLICHES.filter((c) => lower.includes(c));
  const issues: string[] = [];

  if (found.length) {
    issues.push(`AI clichés detected: ${found.join(", ")}`);
  }
  if (text.length < 100) {
    issues.push("Caption may be too short for story structure.");
  }
  if ((text.match(/\b\w+\b/g) ?? []).length < 40) {
    issues.push("Word count low — may lack narrative depth.");
  }

  return {
    valid: issues.length === 0,
    issues,
    clichéCount: found.length,
  };
}
