<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Miaodui Engineering]]></title><description><![CDATA[Miaodui Engineering]]></description><link>https://miaodui.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Dec 2026 20:09:33 GMT</lastBuildDate><atom:link href="https://miaodui.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Stop LLMs From Hallucinating Invoice Math & Breaking RAG Tables in n8n (Free MIT Blueprints)]]></title><description><![CDATA[When you ship production AI Agent, n8n, or Make.com workflows for real businesses, LLMs consistently fail at two deterministic tasks: Asking a second LLM…]]></description><link>https://miaodui.hashnode.dev/stop-llms-from-hallucinating-invoice-math-breaking-rag-tables-in-n8n-free-mit-blueprints</link><guid isPermaLink="true">https://miaodui.hashnode.dev/stop-llms-from-hallucinating-invoice-math-breaking-rag-tables-in-n8n-free-mit-blueprints</guid><category><![CDATA[RAG ]]></category><category><![CDATA[AI]]></category><category><![CDATA[n8n]]></category><category><![CDATA[automation]]></category><dc:creator><![CDATA[Miaodui Engineering]]></dc:creator><pubDate>Wed, 02 Dec 2026 09:51:07 GMT</pubDate><content:encoded><![CDATA[<p>When you ship production AI Agent, <strong>n8n</strong>, or <strong>Make.com</strong> workflows for real businesses, LLMs consistently fail at two deterministic tasks:</p>
<ol>
<li><strong>Invoice arithmetic hallucinations</strong>: An LLM extracts PDF text accurately, then confidently outputs <code>quantity: 3</code>, <code>unit_price: 19.99</code>, <code>line_total: 65.00</code> instead of <code>$59.97</code> — or silently drops the negative sign on a <code>(50.00)</code> credit note.</li>
<li><strong>Slicing RAG tables in half</strong>: Standard <code>RecursiveCharacterTextSplitter</code> breaks Markdown and HTML pricing/financial tables mid-row so downstream chunks embed orphan numbers without column headers.</li>
</ol>
<p>Asking a second LLM call to "verify math" or "clean tables" burns tokens and stays non-deterministic.</p>
<hr />
<h3>Two Zero-Scraping, Pure-Compute Deterministic MCP &amp; API Guardrails</h3>
<p>We built two stateless, zero-proxy, pure-compute Actors on Apify Store (accepting zero external URLs — zero SSRF risk) plus <strong>free MIT-licensed n8n &amp; Make.com blueprints</strong>:</p>
<h4>1. Structured Invoice &amp; PO Deterministic Validator (<code>$0.004 / invoice</code>)</h4>
<ul>
<li>Exact <code>BigInt</code> minor-unit integer math across line items, subtotals, tax-inclusive/exclusive math, discounts, and grand totals across 20+ ISO-4217 currencies.</li>
<li>Catches duplicate OCR lines, reversed dates, and validates EU/UK VAT, US EIN, and Taiwan GUI / ROC dates.</li>
<li><strong>Live 3-second example catching 4 cascading LLM math errors</strong>: <a href="https://apify.com/snowy_divide_r1t/structured-invoice-line-validator/examples/catch-llm-math-hallucinations-in-b2b-invoice-live-example">https://apify.com/snowy_divide_r1t/structured-invoice-line-validator/examples/catch-llm-math-hallucinations-in-b2b-invoice-live-example</a></li>
<li><strong>Apify Store</strong>: <a href="https://apify.com/snowy_divide_r1t/structured-invoice-line-validator">https://apify.com/snowy_divide_r1t/structured-invoice-line-validator</a></li>
<li><strong>n8n Setup Guide</strong>: <a href="https://mcp.miaodui.workers.dev/n8n-invoice-ocr-validation">https://mcp.miaodui.workers.dev/n8n-invoice-ocr-validation</a></li>
</ul>
<h4>2. RAG Table-Aware Markdown &amp; HTML Chunker (<code>$0.002 / document</code>)</h4>
<ul>
<li>Keeps tables intact within <code>maxTokens</code>, splits oversized tables strictly along row boundaries, and <strong>auto-repeats the original header row</strong> on every continuation chunk (<code>tableSplitPart: "1/N"</code>).</li>
<li>Injects hierarchical <code>H1 &gt; H2 &gt; H3</code> breadcrumbs and calculates CJK + English token counts (<code>o200k</code>, <code>cl100k</code>, <code>claude</code>, <code>gemini</code>).</li>
<li><strong>Live 1-second financial Markdown report example</strong>: <a href="https://apify.com/snowy_divide_r1t/rag-table-aware-chunker/examples/split-financial-markdown-report-without-breaking-tables">https://apify.com/snowy_divide_r1t/rag-table-aware-chunker/examples/split-financial-markdown-report-without-breaking-tables</a></li>
<li><strong>Apify Store</strong>: <a href="https://apify.com/snowy_divide_r1t/rag-table-aware-chunker">https://apify.com/snowy_divide_r1t/rag-table-aware-chunker</a></li>
<li><strong>RAG Chunker Guide</strong>: <a href="https://mcp.miaodui.workers.dev/rag-markdown-table-chunker">https://mcp.miaodui.workers.dev/rag-markdown-table-chunker</a></li>
</ul>
<hr />
<h3>Free Ready-to-Import MIT Blueprints (Zero Signup Needed)</h3>
<ul>
<li><strong>n8n Invoice OCR + Deterministic Guardrail JSON</strong>: <a href="https://mcp.miaodui.workers.dev/templates/n8n-invoice-ocr-deterministic-audit.json">https://mcp.miaodui.workers.dev/templates/n8n-invoice-ocr-deterministic-audit.json</a></li>
<li><strong>n8n Table-Safe RAG Ingestion JSON</strong>: <a href="https://mcp.miaodui.workers.dev/templates/n8n-rag-table-safe-chunking.json">https://mcp.miaodui.workers.dev/templates/n8n-rag-table-safe-chunking.json</a></li>
<li><strong>Make.com HTTP + Router Blueprint &amp; MCP Config JSON</strong>: <a href="https://mcp.miaodui.workers.dev/templates/make-invoice-audit-and-mcp-config.json">https://mcp.miaodui.workers.dev/templates/make-invoice-audit-and-mcp-config.json</a></li>
<li><strong>GitHub MIT Repository</strong>: <a href="https://github.com/miaoduitw-creator/miaodui-mcp-templates">https://github.com/miaoduitw-creator/miaodui-mcp-templates</a></li>
<li><strong>Claude Desktop &amp; Cursor MCP Setup Guide</strong>: <a href="https://mcp.miaodui.workers.dev/apify-mcp-server-claude-cursor">https://mcp.miaodui.workers.dev/apify-mcp-server-claude-cursor</a></li>
</ul>
<p>Test both deterministic engines 100% client-side in your browser (zero login, zero data uploaded) at:
<a href="https://mcp.miaodui.workers.dev/">https://mcp.miaodui.workers.dev/</a></p>
]]></content:encoded></item><item><title><![CDATA[How I Built a 200MB Streaming JSONL Eval Diff Viewer for VS Code and Cursor With Zero Runtime Dependencies]]></title><description><![CDATA[When you iterate on LLM prompts, RAG pipelines, or local model quantizations, your most important artifact is usually two .jsonl files: baseline.jsonl and…]]></description><link>https://miaodui.hashnode.dev/how-i-built-a-200mb-streaming-jsonl-eval-diff-viewer-for-vs-code-and-cursor-with-zero-runtime-dependencies</link><guid isPermaLink="true">https://miaodui.hashnode.dev/how-i-built-a-200mb-streaming-jsonl-eval-diff-viewer-for-vs-code-and-cursor-with-zero-runtime-dependencies</guid><category><![CDATA[AI]]></category><category><![CDATA[llm]]></category><category><![CDATA[vscode]]></category><category><![CDATA[open source]]></category><dc:creator><![CDATA[Miaodui Engineering]]></dc:creator><pubDate>Wed, 02 Dec 2026 09:48:26 GMT</pubDate><content:encoded><![CDATA[<p>When you iterate on LLM prompts, RAG pipelines, or local model quantizations, your most important artifact is usually two <code>.jsonl</code> files: <code>baseline.jsonl</code> and <code>candidate.jsonl</code>.</p>
<p>Yet inspecting what actually regressed between those two files inside an editor is surprisingly painful:</p>
<ol>
<li><strong>Webview OOM freezes</strong>: Naive extensions <code>fs.readFileSync()</code> a 120MB JSONL file, <code>JSON.parse()</code> every row, and shove the entire array into <code>webview.postMessage()</code>. The renderer stalls or crashes.</li>
<li><strong>Dirty real-world logs</strong>: Long eval runs crash mid-write, leaving trailing truncated JSON lines. Standard parsers throw on line 4,812 and refuse to render the other 4,811 valid cases.</li>
<li><strong>XSS inside eval datasets</strong>: Safety and red-team benchmarks routinely contain <code>&lt;script&gt;alert("xss")&lt;/script&gt;</code> payloads in prompts and completions.</li>
<li><strong>Cloud privacy blockers</strong>: Teams in healthcare, finance, or enterprise software cannot upload customer prompts to hosted cloud eval dashboards.</li>
</ol>
<p>To solve this, we built <strong>EvalDiff</strong> (<code>v0.2.0</code>)—a <strong>Verified Publisher</strong> extension on Open VSX with <strong>zero third-party runtime npm dependencies</strong>, strictly read-only file handling, and zero background telemetry.</p>
<ul>
<li><strong>One-Click Install (Cursor / Windsurf / Antigravity / VSCodium)</strong>: <a href="https://open-vsx.org/extension/miaodui/evaldiff-workbench">https://open-vsx.org/extension/miaodui/evaldiff-workbench</a></li>
<li><strong>Direct <code>.vsix</code> Download for Official VS Code</strong>: <a href="https://github.com/miaoduitw-creator/evaldiff-workbench/releases/download/v0.2.0/evaldiff-workbench-0.2.0.vsix">https://github.com/miaoduitw-creator/evaldiff-workbench/releases/download/v0.2.0/evaldiff-workbench-0.2.0.vsix</a></li>
<li><strong>Live Interactive Browser Preview (Zero Install)</strong>: <a href="https://evaldiff.miaodui.workers.dev/">https://evaldiff.miaodui.workers.dev/</a></li>
<li><strong>MIT Source Code (12 zero-dependency tests)</strong>: <a href="https://github.com/miaoduitw-creator/evaldiff-workbench">https://github.com/miaoduitw-creator/evaldiff-workbench</a></li>
</ul>
<hr />
<h3>1. Streaming Line-by-Line With Three Circuit Breakers</h3>
<p><code>src/diffEngine.js</code> relies exclusively on Node.js built-ins (<code>fs.createReadStream</code> + <code>readline</code>) with three explicit guards:</p>
<ol>
<li>Pre-read file size guard (<code>maxFileSizeMB</code>, default 200MB)</li>
<li>Per-field truncation (<code>maxFieldChars</code>, default 8,000 chars)</li>
<li>Buffered memory circuit breaker (<code>maxBufferedBytes</code>, default 64MB) that cleanly closes streams inside <code>finally</code> instead of triggering V8 OOM</li>
</ol>
<p>Corrupted lines are isolated with exact line numbers and a 160-char preview without aborting valid rows.</p>
<h3>2. Extension Host Owns the Dataset; Webview Renders 50 Rows Per Page</h3>
<p>All filtering (<code>regression | improvement | unchanged | added | removed</code>), search, sorting, and human Pass/Fail tagging stay inside the Extension Host. The Webview only receives a <code>&lt;2KB</code> KPI summary plus one paginated 50-row slice per query.</p>
<h3>3. Strictly Read-Only + Nonce CSP + XSS Escaping</h3>
<p>Source <code>.jsonl</code> files are never opened for writing (verified by SHA-256 hash tests). Review annotations live separately in VS Code <code>workspaceState</code>, and every rendered or exported field is strictly HTML-escaped under a nonce CSP.</p>
<h3>4. Framework-Specific Guides</h3>
<ul>
<li>OpenAI Evals JSONL Viewer: <a href="https://evaldiff.miaodui.workers.dev/openai-evals-jsonl-viewer">https://evaldiff.miaodui.workers.dev/openai-evals-jsonl-viewer</a></li>
<li>Promptfoo Local Regression Diff: <a href="https://evaldiff.miaodui.workers.dev/promptfoo-regression-diff">https://evaldiff.miaodui.workers.dev/promptfoo-regression-diff</a></li>
<li>Inspect AI Log Viewer: <a href="https://evaldiff.miaodui.workers.dev/inspect-ai-log-viewer">https://evaldiff.miaodui.workers.dev/inspect-ai-log-viewer</a></li>
<li>lm-evaluation-harness Q4 vs Q8 Diff: <a href="https://evaldiff.miaodui.workers.dev/lm-eval-harness-diff">https://evaldiff.miaodui.workers.dev/lm-eval-harness-diff</a></li>
<li>Cursor AI Eval Workflow: <a href="https://evaldiff.miaodui.workers.dev/cursor-ai-eval-workflow">https://evaldiff.miaodui.workers.dev/cursor-ai-eval-workflow</a></li>
<li>Offline Alternative to LangSmith: <a href="https://evaldiff.miaodui.workers.dev/langsmith-offline-alternative">https://evaldiff.miaodui.workers.dev/langsmith-offline-alternative</a></li>
</ul>
<h3>5. Honest Open-Core Pricing</h3>
<ul>
<li><strong>Free (MIT Core)</strong>: Unlimited single-file <code>.jsonl</code> inspector, side-by-side diff up to 100 cases, malformed line diagnostics, local Pass/Fail review, and 1-click Markdown PR Regression Badge.</li>
<li><strong>Optional Pro via Polar.sh</strong> (<a href="https://buy.polar.sh/polar_cl_nMSyyPwti0sOEmPtdC78FyS0rcU7BnEvuJz0f3VQXpq">Solo $29/yr</a> | <a href="https://buy.polar.sh/polar_cl_mOSAPBcVhNeTAbunDHuWjUvrujdvKykymqEDk2nmSat">Team 5-Seat $99/yr</a>): Unlimited dataset diffing and 1-click standalone offline HTML/CSV audit report exports. License activation uses Polar's public Customer Portal API once and caches offline in VS Code <code>globalState</code>.</li>
</ul>
]]></content:encoded></item></channel></rss>