diff --git a/packages/api/src/llm/fo-blog-pipeline.ts b/packages/api/src/llm/fo-blog-pipeline.ts index d9c4692..945a907 100644 --- a/packages/api/src/llm/fo-blog-pipeline.ts +++ b/packages/api/src/llm/fo-blog-pipeline.ts @@ -2351,8 +2351,8 @@ Article: export const STEP8b_REDUCTION = `You are running the FLEXOPTIX REDUCTION ENGINE on this article. -Target length: 700–1,000 words. This is the gold zone for a Flexoptix technical blog post. -DO NOT go below 600 words. DO NOT exceed 1,300 words (warning threshold). +Target length: 1,200–1,600 words. This is the gold zone for a Flexoptix technical blog post. +DO NOT go below 1,000 words. DO NOT exceed 2,000 words (warning threshold). This is a 5-pass refinement. Apply all passes in sequence: @@ -2408,10 +2408,11 @@ Read the final text out loud (mentally). Fix anything that sounds like it was ge ════════════════════════════════════════════════════════ LENGTH TARGETS (apply after all 5 passes): - Short article: 600–700 words (opinion piece, market note) - Standard article: 700–1,000 words (technical analysis, guide) ← DEFAULT TARGET - Long article: 1,000–1,300 words (deep-dive, migration tutorial) ← only if content demands it - Warning zone: 1,300+ words — something wasn't cut enough, revisit Pass 1. + Short article: 1,000–1,200 words (opinion piece, market note) + Standard article: 1,200–1,600 words (technical analysis, guide) ← DEFAULT TARGET + Long article: 1,600–2,000 words (deep-dive, migration tutorial) ← only if content demands it + Warning zone: 2,000+ words — something wasn't cut enough, revisit Pass 1. + HARD MINIMUM: 1,000 words. If below 1,000 words — expand Pass 3 bridges, do not submit. ════════════════════════════════════════════════════════ DO NOT add section headers. DO NOT add new facts. DO NOT change the writing voice. diff --git a/packages/api/src/routes/blog.ts b/packages/api/src/routes/blog.ts index 29453fc..1fe7253 100644 --- a/packages/api/src/routes/blog.ts +++ b/packages/api/src/routes/blog.ts @@ -333,11 +333,12 @@ function validateArticle(content: string): string[] { } // Check minimum depth const wordCount = content.split(/\s+/).length; - if (wordCount < 800) { - issues.push(`Too short: ${wordCount} words (minimum 800 for template, 1200 for LLM)`); + if (wordCount < 1200) { + issues.push(`Too short: ${wordCount} words (minimum 1200)`); } - // Check for power budget section in troubleshooting articles - if (content.toLowerCase().includes("troubleshoot") && !content.toLowerCase().includes("power budget")) { + // Check for power budget only in articles primarily about troubleshooting (title contains it) + const titleLine = content.split("\n")[0]?.toLowerCase() || ""; + if (titleLine.includes("troubleshoot") && !content.toLowerCase().includes("power budget")) { issues.push("Missing power budget section"); } @@ -1208,7 +1209,7 @@ async function runLlmPipeline( const wordsAfter = step8b.text.split(/\s+/).length; const wordsBefore = step8.text.split(/\s+/).length; const pctChange = Math.round((1 - wordsAfter / wordsBefore) * 100); - console.log(` After reduction: ${wordsAfter} words (was ${wordsBefore}, −${pctChange}%) ${wordsAfter > 1300 ? "⚠ WARNING: >1300 words" : wordsAfter < 600 ? "⚠ WARNING: <600 words" : "✓ in target range"}`); + console.log(` After reduction: ${wordsAfter} words (was ${wordsBefore}, −${pctChange}%) ${wordsAfter > 2000 ? "⚠ WARNING: >2000 words" : wordsAfter < 1000 ? "⚠ WARNING: <1000 words" : "✓ in target range"}`); // ═══ STEP AEM: Auto-Editor Mode (Senior Engineer voice polish) ═══ console.log(" Step 12/16: Auto-Editor Mode (senior engineer voice polish)...");