/** * Pass 2 public thinking is a complete product sentence, never a CoT fragment. * This gate only accepts or rejects. It must not rewrite, strip, or splice. */ const CJK_RE = /[\u4e00-\u9fff]/; const SENTENCE_RE = /[。!?]/; export const THINK_STEP_TEXT_MIN = 8; export const THINK_STEP_TEXT_MAX = 400; export function acceptThinkStepText(text: string): string | null { const trimmed = text.replace(/\s+/g, " ").trim(); if (trimmed.length < THINK_STEP_TEXT_MIN || trimmed.length > THINK_STEP_TEXT_MAX) return null; if (!CJK_RE.test(trimmed)) return null; if (!SENTENCE_RE.test(trimmed)) return null; return trimmed; }