feat(blog): Reduction Engine v1.0 + LaTeX/connector hard fails
- Replace STEP8b_REDUCTION with 5-pass Reduction Engine:
Pass 1: Repetition Kill (one concept, one home)
Pass 2: Tech Prune (LaTeX hard delete, SKU removal, formula prose replacement)
Pass 3: Flow Rebuild (close gaps after cuts, no new content)
Pass 4: Weight Correction (title/content alignment throughout)
Pass 5: Humanization (rhythm variation, hedge removal, punch ending)
Target: 700-1000 words (600-1300 range, warnings outside)
- System prompt + STEP9 QA: add hard fails for
LaTeX formulas (\[...\], \frac{}, \text{} etc) — destroys blog flow
DR4 connector error (DR4=MPO-12, not LC duplex; FR4=LC duplex)
Title/content mismatch (title topic must be the spine, not just the intro)
- Gold Standard 5: market alert / pricing article template
(correct title alignment, no LaTeX, DR4=MPO-12, ending on topic)
- WRONG PATTERNS extended with 4 new entries covering above failures
- blog.ts: step log messages updated to 11-14/14; word count
output shows % reduction and range warning (>1300 or <600)
This commit is contained in:
parent
b180fe57ee
commit
4eddbfbc7c
@ -5,6 +5,9 @@ Types: FEAT · FIX · UI · DATA · AI · INFRA
|
||||
|
||||
---
|
||||
|
||||
{"d":"2026-04-04","t":"AI","m":"Blog Engine v5: STEP8b replaced with Reduction Engine v1.0 (5-pass: Repetition Kill → Tech Prune → Flow Rebuild → Weight Correction → Humanization); target 700-1000 words; LaTeX hard delete in Pass 2; title/content alignment in Pass 4; word count range enforcement 600-1300 with warnings"}
|
||||
{"d":"2026-04-04","t":"DATA","m":"Blog calibration: Gold Standard 5 added (market alert / pricing article — 2026-04-04; title matches body throughout; no LaTeX; DR4 = MPO-12 not LC duplex; ending lands on title topic not generic close)"}
|
||||
{"d":"2026-04-04","t":"AI","m":"Blog Engine v5: system prompt + STEP9 QA hardened with LaTeX hard fail (\\[...\\] destroys flow), DR4 connector hard fail (DR4=MPO-12, FR4=LC duplex), title/content alignment check (12d); WRONG PATTERNS extended with 4 new entries"}
|
||||
{"d":"2026-04-04","t":"AI","m":"Blog Engine v5: STEP4b Narrative Control (4-correction pass after draft — root cause assignment, anti-FUD filter, reality reframe, Flexoptix voice check); minimum words 1500→2500; reduction pass 25-35%→15-25%; pipeline now 14 steps, version v5-narrative-control"}
|
||||
{"d":"2026-04-04","t":"AI","m":"Blog Engine v5: STEP_LINKEDIN_POST — generates LinkedIn post ≤2800 chars from final article (hook + 3-5 insights + CTA + hashtags); stored in blog_drafts.linkedin_post + linkedin_char_count; hard truncation at 2800 if LLM exceeds limit"}
|
||||
{"d":"2026-04-04","t":"DATA","m":"Blog calibration: Gold Standard 4 added (compatible vs OEM narrative correction — 2026-04-04; optic = not root problem, exposes existing issues; correct Flexoptix framing: validation responsibility shifts to operator)"}
|
||||
|
||||
@ -116,6 +116,9 @@ BANNED STRUCTURAL PATTERNS:
|
||||
- Power numbers like "1kW per port" or "upwards of 1kW" — HARD FAIL. 400G ≈ 10-15W/port, 800G ≈ 15-25W/port. A fully-loaded 32-port 400G switch draws 1-2 kW total, not per port.
|
||||
- OEM pricing for compatible optics — "400G DR4 at $2,000-5,000" is OEM pricing. Compatible vendor range (Flexoptix, FS, ProLabs) is typically $200-600. Always specify OEM vs compatible.
|
||||
- Markdown headers (##, ###, ####, **bold headers**) anywhere in the article body — write in plain text. No hash symbols, no asterisk headers. Section titles as plain sentence or not at all.
|
||||
- LaTeX formulas (\[...\], \(...\), $$...$$, $...$, \frac{}, \text{}) anywhere in the article — HARD FAIL. These destroy reading flow instantly. No reader of a technical blog expects or wants LaTeX. Replace with plain prose: "the available budget is roughly 4.8 dB" — not "\[ \text{Budget} = TX_{min} - RX_{sens} \]".
|
||||
- DR4 described as using LC duplex connectors — HARD FAIL. DR4 = MPO-12 (8-fiber parallel). LC duplex is FR4 (2-fiber CWDM4). These are completely different connectors on completely different physical interfaces. Confusing them destroys engineering credibility instantly.
|
||||
- Title claims one topic but article body covers something else — title/content mismatch. If the title says "prices are moving", the article must stay on pricing throughout. Do not drift into generic deployment advice and then try to reconnect to the title in the last paragraph.
|
||||
|
||||
DATA INTEGRITY RULES (ABSOLUTE — harder than anything else on this list):
|
||||
- EVERY price, part number, and product designation in the article MUST come from the CONTEXT DATA block below, tagged [VERIFIED PRICE] or [PRODUCT].
|
||||
@ -742,6 +745,22 @@ CALIBRATION FAILS (auto-reject — fix before returning):
|
||||
→ REPLACE with "power budget", "power consumption per port", "thermal headroom", "cooling capacity"
|
||||
12. DR4 MISLABELING: Search for "DR4 (Direct Attach)" or "DR4 direct attach".
|
||||
→ REPLACE with "DR4 (500m SMF, 8 parallel fibers)" — DR4 is NOT Direct Attach. DAC is Direct Attach Copper.
|
||||
12b. DR4 CONNECTOR ERROR (HARD FAIL): Search for "DR4" followed by or associated with "LC duplex" or "LC connector".
|
||||
→ DR4 uses MPO-12 (8-fiber parallel). LC duplex = FR4 (CWDM4, 2km). These are completely different form factors.
|
||||
→ REPLACE: "400G DR4 uses MPO-12 connectors (8 fibers, parallel optics)"
|
||||
→ REPLACE: "400G FR4 uses LC duplex connectors (2 fibers, CWDM4)"
|
||||
→ This is a credibility-destroying technical error — fix it before anything else.
|
||||
12c. LATEX FORMULAS (HARD FAIL): Search for \[, \(, $$, \frac, \text{, \cdot, \approx in the article body.
|
||||
→ ALL LaTeX must be removed. Blog articles are not academic papers.
|
||||
→ REPLACE formula blocks with plain prose: "the available budget works out to roughly 4.8 dB"
|
||||
→ REPLACE inline math with natural language: "just over 4 dB of margin"
|
||||
→ If a calculation is important: cite only the conclusion in one plain sentence. Never show the LaTeX.
|
||||
12d. TITLE/CONTENT ALIGNMENT: Read the article title. Identify the article's actual central topic.
|
||||
→ If the title promises pricing analysis, does pricing appear throughout — or only in the intro and conclusion?
|
||||
→ If the title says "migration guide", is migration the spine of every section?
|
||||
→ If there is drift — the article started on topic but then wandered into generic deployment advice — flag it.
|
||||
→ FIX: Either rewrite drifting sections to match the title, or rewrite the title to match the body.
|
||||
→ The ending must land on the title's topic. A "prices are moving" article cannot end with "validate your process".
|
||||
13. ZR/DR4 CONFLATION: If ZR and DR4 appear together without clear separation, split them:
|
||||
→ "DR4: DC leaf-spine, 500m, parallel optics, 12W | ZR: DCI/coherent, 80-120km, single fiber, 15-20W"
|
||||
14. CHECKLIST ENDING: If the last section is a 4+ item bullet list, rewrite as 2-3 direct sentences.
|
||||
@ -1212,6 +1231,53 @@ KEY ELEMENTS OF THIS STYLE B EXAMPLE 4:
|
||||
- Zero section headers, zero bullet lists
|
||||
- Reader conclusion: "I need better validation" — not "I need OEM"
|
||||
|
||||
━━━ STYLE B GOLD EXAMPLE 5 (2026-04-04 validated — Market Alert, Price Movement Article) ━━━
|
||||
Topic: Price war / pricing movement article. Title must match body. No LaTeX. DR4 = MPO-12.
|
||||
This example was generated after feedback on title/content mismatch, LaTeX formula block, and wrong DR4 connector.
|
||||
|
||||
"400G prices are moving. Not slowly.
|
||||
|
||||
In the last quarter, compatible 400G DR4 pricing from multiple vendors dropped meaningfully — not the kind of variance you see between quotes, but a structural shift. OEM pricing held, as it usually does. The gap widened.
|
||||
|
||||
This changes a few things.
|
||||
|
||||
The business case for compatible optics in new deployments just got stronger. Not because compatible optics are new — they've been reliable for years — but because the price delta has crossed a threshold where the ROI calculation stops being nuanced.
|
||||
|
||||
At 30x the price difference, you're not talking about a premium for peace of mind. You're talking about a significant portion of your optics budget going to a vendor margin, not to your infrastructure.
|
||||
|
||||
The question was never 'do compatible optics work?' They do. The question was always 'is the price difference worth the validation overhead?'
|
||||
|
||||
At current pricing, that question answers itself.
|
||||
|
||||
That said, the savings don't show up automatically. Compatible optics — 400G DR4 in particular, which uses MPO-12 connectors and parallel optics across 8 fibers — are less forgiving of marginal physical layers than their 100G predecessors. Dirty connectors. Untested polarity. Patch panels from a previous generation.
|
||||
|
||||
None of those are optics problems. But all of them show up faster at 400G than at 100G.
|
||||
|
||||
So the practical question isn't 'OEM or compatible?'. It's 'is our physical layer ready for 400G at all?' If it is — compatible optics make clear financial sense. If it isn't — no optic solves that.
|
||||
|
||||
Prices are dropping. The savings are real.
|
||||
Whether you capture them depends on everything that has nothing to do with the optic."
|
||||
|
||||
KEY ELEMENTS OF THIS STYLE B EXAMPLE 5:
|
||||
- Title "prices are moving" matched throughout — pricing is the spine, not a paragraph
|
||||
- NO LaTeX formulas — technical facts stated in plain prose
|
||||
- DR4 connector correctly stated as MPO-12, not LC duplex
|
||||
- Reduction principle: one thread (pricing → savings → readiness) — no tangents
|
||||
- Ends on the article's topic (capturing savings) — not on generic "validate your setup"
|
||||
- 340 words — demonstrates how compact a market alert can be without losing depth
|
||||
|
||||
━━━ WHAT TRIGGERED GOLD STANDARD 5 (learn from the failure) ━━━
|
||||
WRONG version had three problems:
|
||||
1. Title/content drift: "prices are moving" title, but body became a generic 400G deployment guide after paragraph 3
|
||||
2. LaTeX formula block: \[ \text{Budget} = TX_{min} - RX_{sens} = (-2.9\,\text{dBm}) - (-7.7\,\text{dBm}) = 4.8\,\text{dB} \]
|
||||
→ Broke reading flow completely. Looks like a university exam, not a Flexoptix blog.
|
||||
3. DR4 connector stated as "LC duplex" — DR4 is MPO-12. LC duplex = FR4. Credibility-destroying error.
|
||||
|
||||
CORRECT version:
|
||||
- Pricing stays the spine from title to ending
|
||||
- Technical facts in plain prose ("roughly 4.8 dB of available budget" — no formula)
|
||||
- DR4 connector named correctly: MPO-12 parallel
|
||||
|
||||
━━━ WHAT TRIGGERED THIS GOLD STANDARD (learn from the failure) ━━━
|
||||
WRONG version wrote: "compatible optics = hidden costs, extra QA, complex validation"
|
||||
→ This is OEM FUD. It implies compatible = risky by default.
|
||||
@ -1235,6 +1301,10 @@ WRONG PATTERNS (both styles — never produce):
|
||||
❌ "400G DR4 at $2,000-5,000" without specifying OEM — compatible pricing is $200-600.
|
||||
❌ ## or ### section headers inside the article — plain text only, always.
|
||||
❌ 8+ sections in one article — looks assembled, not written.
|
||||
❌ LaTeX formulas (\[...\], \(...\), $$...$$, \frac{}, \text{}, \approx) anywhere in blog body — immediate hard fail. Plain prose only.
|
||||
❌ "DR4 uses LC duplex connectors" — DR4 = MPO-12 parallel. LC duplex = FR4. Mixing these up destroys engineering credibility.
|
||||
❌ Title promises pricing analysis but body becomes a generic deployment guide — title/content mismatch. The title's topic must be the article's spine.
|
||||
❌ Article ends on "validate your process" when title was about market pricing — the ending must land on the title topic, not redirect to a generic close.
|
||||
❌ Cleaning explained in "hidden costs" AND again in "cabling reality" — pick one home.
|
||||
❌ "The discussion around X is often framed as a question of Y versus Z." — consulting opening, not engineer voice.
|
||||
❌ "In production, failures rarely come from a single obvious source." — vague academic framing.
|
||||
@ -1343,31 +1413,73 @@ Article:
|
||||
// repeated concepts, and "assembled" rather than written)
|
||||
// ═══════════════════════════════════════════════════════
|
||||
|
||||
export const STEP8b_REDUCTION = `Cut this article by 15–25%.
|
||||
export const STEP8b_REDUCTION = `You are running the FLEXOPTIX REDUCTION ENGINE on this article.
|
||||
|
||||
This is not optional. After the previous passes, the article has grown and accumulated some padding.
|
||||
The goal is a tighter, more natural text — not a shorter version of the same article.
|
||||
Target: the final article should be 1500–2000 words. Do not cut below 1500 words.
|
||||
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).
|
||||
|
||||
WHAT TO REMOVE:
|
||||
- Any concept explained more than once (pick its best version, cut the rest)
|
||||
- Sentences that restate what the previous sentence already said
|
||||
- Paragraphs that add length without adding new information or new angle
|
||||
- "Setting up" sentences that don't earn their space ("This is something engineers often overlook...")
|
||||
- Transition sentences that bridge to the same point you already made
|
||||
- The weakest scenario or example if there are more than three
|
||||
- Any section that reads like a template ("Hidden Costs:", "When Not To Use:", etc.) — either integrate into narrative or cut
|
||||
This is a 5-pass refinement. Apply all passes in sequence:
|
||||
|
||||
WHAT TO KEEP:
|
||||
- The single strongest version of each key insight
|
||||
- Real-world moments that feel like something that actually happened
|
||||
- Specific numbers, values, and examples — these carry weight
|
||||
- Any line that a senior engineer would share or quote
|
||||
════════════════════════════════════════════════════════
|
||||
PASS 1 — REPETITION KILL
|
||||
════════════════════════════════════════════════════════
|
||||
Find every concept that appears more than once.
|
||||
Pick its single strongest expression. Delete everything else.
|
||||
No mercy. If two paragraphs say the same thing with different words, cut the weaker one.
|
||||
Watch for: connector cleaning (often explained twice), MPO polarity (often set up and then re-explained), power budget (often introduced and then repeated in a different section).
|
||||
|
||||
TONE RULE: After cutting, the article should feel tighter and MORE confident — not less. Shorter = stronger.
|
||||
════════════════════════════════════════════════════════
|
||||
PASS 2 — TECH PRUNE
|
||||
════════════════════════════════════════════════════════
|
||||
Hard delete ALL of the following — no exceptions:
|
||||
- LaTeX formulas: \[...\], \(...\), $$...$$, $...$, \frac{}, \text{}, \cdot, \approx — ALL GONE.
|
||||
Replace with plain prose: "the available budget is roughly 4.8 dB" — not a formula block.
|
||||
- Inline dBm lane calculations: "TX_min = -2.9 dBm, RX_sensitivity = -7.7 dBm, Budget = 4.8 dB" — these feel like a textbook, not field experience. Keep the CONCLUSION (4.8 dB available) in one sentence max, or cut entirely.
|
||||
- Product SKUs inline in narrative: "FX-QSFPDD-400G-DR4" etc. — replace with "400G DR4 optic" or cut.
|
||||
- "For example," as a sentence opener — rephrase or cut.
|
||||
- "In conclusion", "To summarize", "In summary" — cut these and the sentence after them.
|
||||
- Any sentence that ends with ". This is why X matters." — that's an AI filler sentence. Cut it.
|
||||
|
||||
DO NOT change the writing style or tone. Do not add new content. Do not add section headers.
|
||||
Return only the reduced article — no commentary, no explanation of what you cut.
|
||||
════════════════════════════════════════════════════════
|
||||
PASS 3 — FLOW REBUILD
|
||||
════════════════════════════════════════════════════════
|
||||
After cutting, the article will have gaps. Close them:
|
||||
- Remaining paragraphs must connect — reader should not notice what was removed.
|
||||
- Short bridge sentences (1 line) are OK to add if they make the flow natural.
|
||||
- Do NOT add new content or new insights — only smooth the transitions.
|
||||
- Kill any paragraph that still feels like a standalone module. Either connect it or cut it.
|
||||
|
||||
════════════════════════════════════════════════════════
|
||||
PASS 4 — WEIGHT CORRECTION
|
||||
════════════════════════════════════════════════════════
|
||||
Read the article title. Now read the article body.
|
||||
- Does the title promise something the body delivers throughout — or only at the start and end?
|
||||
- If the article title is about pricing, pricing must be the spine of the article — not a paragraph.
|
||||
- If the article title is about migration, migration must drive every section.
|
||||
- Fix any drift: rewrite paragraphs that lost the thread. Cut sections that belong in a different article.
|
||||
- The ending must land on the title's topic — not on a generic "validate your setup" close.
|
||||
|
||||
════════════════════════════════════════════════════════
|
||||
PASS 5 — HUMANIZATION
|
||||
════════════════════════════════════════════════════════
|
||||
Read the final text out loud (mentally). Fix anything that sounds like it was generated:
|
||||
- Perfectly parallel sentence structures → vary the rhythm.
|
||||
- Every paragraph same length → break one up, extend another.
|
||||
- Soft hedges: "may", "can sometimes", "often tends to" → cut or convert to assertion.
|
||||
- Academic connectors: "Furthermore", "Additionally", "Consequently" → cut.
|
||||
- "This is one of the most underestimated..." → say what it is, not that it's underestimated.
|
||||
- Ending that summarizes instead of landing → replace with a single punch line that sticks.
|
||||
|
||||
════════════════════════════════════════════════════════
|
||||
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.
|
||||
════════════════════════════════════════════════════════
|
||||
|
||||
DO NOT add section headers. DO NOT add new facts. DO NOT change the writing voice.
|
||||
Return only the reduced, refined article — no commentary, no word count, no explanation.
|
||||
|
||||
Article:
|
||||
{{ARTICLE}}`;
|
||||
|
||||
@ -1173,19 +1173,22 @@ async function runLlmPipeline(
|
||||
);
|
||||
stepsCompleted = 9;
|
||||
|
||||
// ═══ STEP 8b: Reduction Pass ═══
|
||||
console.log(" Step 10/13: Reduction Pass (remove 15-25%, keep ≥1500 words)...");
|
||||
setProgress(draftId, 10, "Step 10/13: Reduction Pass");
|
||||
// ═══ STEP 8b: Reduction Engine (5-pass: Repetition Kill → Tech Prune → Flow Rebuild → Weight Correction → Humanization) ═══
|
||||
console.log(" Step 10/14: Reduction Engine (5-pass, target 700-1000 words)...");
|
||||
setProgress(draftId, 10, "Step 10/14: Reduction Engine");
|
||||
const step8b = await generate(systemPrompt,
|
||||
STEP8b_REDUCTION.replace("{{ARTICLE}}", step8.text),
|
||||
LLM_REFINE
|
||||
);
|
||||
stepsCompleted = 10;
|
||||
console.log(` After reduction: ${step8b.text.split(/\s+/).length} words (was ${step8.text.split(/\s+/).length})`);
|
||||
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"}`);
|
||||
|
||||
// ═══ STEP 8c: Style Lock ═══
|
||||
console.log(" Step 11/13: Style Lock (tone consistency + scope/SKU fixes)...");
|
||||
setProgress(draftId, 11, "Step 11/13: Style Lock");
|
||||
console.log(" Step 11/14: Style Lock (tone consistency + scope/SKU fixes)...");
|
||||
setProgress(draftId, 11, "Step 11/14: Style Lock");
|
||||
const step8c = await generate(systemPrompt,
|
||||
STEP8c_STYLE_LOCK.replace("{{ARTICLE}}", step8b.text),
|
||||
LLM_REFINE
|
||||
@ -1193,8 +1196,8 @@ async function runLlmPipeline(
|
||||
stepsCompleted = 11;
|
||||
|
||||
// ═══ STEP 9: QA Check ═══
|
||||
console.log(" Step 12/13: QA Check...");
|
||||
setProgress(draftId, 12, "Step 12/13: QA Check");
|
||||
console.log(" Step 12/14: QA Check...");
|
||||
setProgress(draftId, 12, "Step 12/14: QA Check");
|
||||
const step9 = await generate(systemPrompt,
|
||||
STEP9_QA_CHECK.replace("{{ARTICLE}}", step8c.text),
|
||||
LLM_REFINE
|
||||
@ -1202,8 +1205,8 @@ async function runLlmPipeline(
|
||||
stepsCompleted = 12;
|
||||
|
||||
// ═══ STEP 10: Quality Score ═══
|
||||
console.log(" Step 13/13: Quality Score...");
|
||||
setProgress(draftId, 13, "Step 13/13: Quality Score");
|
||||
console.log(" Step 13/14: Quality Score...");
|
||||
setProgress(draftId, 13, "Step 13/14: Quality Score");
|
||||
let autoQaScore: Record<string, unknown> | null = null;
|
||||
try {
|
||||
const step10 = await generate(systemPrompt,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user