Show HN: 用确定性 .py 引擎取代 5 万美元的手动取证审计

2作者: cd_mkdir5 个月前
我是一名软件架构师,最近构建了 Exit Protocol (<a href="https:&#x2F;&#x2F;exitprotocols.com" rel="nofollow">https:&#x2F;&#x2F;exitprotocols.com</a>),这是一个针对高冲突诉讼的自动化法务会计引擎。 问题: 如果你离婚了,需要证明在高度混合的联名银行账户中的 25 万美元是你的“单独财产”(例如,来自婚前的创业公司退出),那么举证责任完全是数学上的。过去,这意味着要支付给法务注册会计师每小时 500 美元,将多年模糊的银行 PDF 文件导入 Excel,并手动追踪每一美元。这需要数周时间,通常花费超过 5 万美元。 我研究了法院用于此的法律标准——最低中间余额规则(LIBR),并意识到这并不是一个会计问题。它是一个分布式系统状态机问题。 为什么我们没有直接“用 AI 解决”? 目前有一百家法律科技初创公司正在尝试使用 LLM 来总结银行数据。在法庭上,生成式 AI 是致命的负债。如果 LLM 幻觉出单个交易,整个账本在 Daubert 标准下将不被采纳。 为了使其适用于法庭,我们必须构建一个严格的确定性流程: 1. 视觉原生摄取(超越 Tesseract) 银行对账单是 OCR 的最终 Boss(合并的单元格、重叠的借方/贷方列)。标准的线性 OCR 会灾难性地失败。我们构建了一个空间网格 OCR 流程(使用 Azure Document Intelligence 和本地 Surya OCR 备用方案),它映射了页面的几何结构。即使是来自多代“地狱 PDF”的文件,它也能完美地重建表格账本。 2. 确定性引擎(LIBR) LIBR 算法充当单向棘轮。如果账户余额降至低于你的单独财产索赔金额,你的索赔将永久限制在该新下限。随后的婚姻存款不会补充它(“补充谬论”)。引擎按时间顺序重放数千笔交易,持续评估 S\_t = min(S\_t-1, B\_t)。 3. 解决时间戳歧义 银行 PDF 文件提供日期,而不是时间戳。如果 1 万美元的存款和 1 万美元的提款发生在同一天,顺序很重要。我们构建了一个模拟切换,强制“最坏情况”(先处理提款)与“最佳情况”排序,为和解谈判建立了数学上无可辩驳的“真相区域”。 4. 密码学监管链和主权模式 律师们害怕云 SaaS 泄露。我们通过 Docker 将整个单体应用(Django 5.0/Postgres/Celery)容器化,以便企业公司可以在自己的硬件上以气隙方式运行它(主权模式)。此外,每个生成的 PDF 档案都使用底层数据快照的 SHA-256 哈希值进行密封,向法官证明自生成以来输出未被篡改。 如果你想看看实际的数学运算,我们设置了一个“演示沙盒”,其中填充了一个合成的、高度复杂的 3 年混合账本。你可以在这里自己运行引擎(推荐桌面端):<a href="https:&#x2F;&#x2F;exitprotocols.com&#x2F;simulation&#x2F;uplink&#x2F;" rel="nofollow">https:&#x2F;&#x2F;exitprotocols.com&#x2F;simulation&#x2F;uplink&#x2F;</a> 这是它从原始 PDF 或法务审计档案中生成的确切的“律师工作成果”——<a href="https:&#x2F;&#x2F;exitprotocols.com&#x2F;static&#x2F;documents&#x2F;Forensic_Audit_Sample_Vinay_MKT2026.pdf" rel="nofollow">https:&#x2F;&#x2F;exitprotocols.com&#x2F;static&#x2F;documents&#x2F;Forensic_Audit_Sa...</a> 我希望从 HN 社区获得关于架构的反馈——特别是处理边缘情况数据摄取和在 B2B 企业部署中维护密码学完整性。 谢谢!
查看原文
I’m a software architect, and I recently built Exit Protocol (<a href="https:&#x2F;&#x2F;exitprotocols.com" rel="nofollow">https:&#x2F;&#x2F;exitprotocols.com</a>), an automated forensic accounting engine for high-conflict litigation.<p>Problem: If you get divorced and need to prove that a specific $250k in a heavily commingled joint bank account is your &quot;separate property&quot; (e.g., from a pre-marital startup exit), the burden of proof is strictly mathematical. Historically, this meant paying a forensic CPA $500&#x2F;hour to dump years of blurry bank PDFs into Excel and manually trace every dollar. It takes weeks and routinely costs over $50,000.<p>I looked at the legal standard courts use for this—the Lowest Intermediate Balance Rule (LIBR)—and realized it wasn’t an accounting problem. It is a Distributed Systems state-machine problem.<p>Why we didn&#x27;t just &quot;Throw AI at it&quot;?<p>There are a hundred legal-tech startups right now trying to use LLMs to summarize bank data. In a courtroom, GenAI is a fatal liability. If an LLM hallucinates a single transaction, the entire ledger is inadmissible under the Daubert standard.<p>To make this court-ready, we had to build a strictly deterministic pipeline:<p>1. Vision-Native Ingestion (Beating Tesseract) Bank statements are the final boss of OCR (merged cells, overlapping debit&#x2F;credit columns). Standard linear OCR fails catastrophically. We built a spatial-grid OCR pipeline (using Azure Document Intelligence with a local Surya OCR fallback) that maps the geometric structure of the page. It reconstructs tabular ledgers perfectly, even from multi-generational &quot;PDFs from hell.&quot;<p>2. The Deterministic Engine (LIBR) The LIBR algorithm acts as a one-way ratchet. If an account balance drops below your separate property claim amount, your claim is permanently capped at that new floor. Subsequent marital deposits do not refill it (the &quot;replenishment fallacy&quot;). The engine replays thousands of transactions chronologically, continuously evaluating S_t = min(S_t-1, B_t).<p>3. Resolving Timestamp Ambiguity Bank PDFs give you dates, not timestamps. If a $10k deposit and $10k withdrawal happen on the same day, order matters. We built a simulation toggle that forces &quot;Worst Case&quot; (withdrawals process first) vs &quot;Best Case&quot; sorting, establishing a mathematically irrefutable &quot;Zone of Truth&quot; for settlement negotiations.<p>4. Cryptographic Chain of Custody &amp; Sovereign Mode Lawyers are terrified of cloud SaaS breaches. We containerized the entire monolith (Django 5.0&#x2F;Postgres&#x2F;Celery) via Docker so enterprise firms can run it air-gapped on their own hardware (Sovereign Mode). Furthermore, every generated PDF dossier is sealed with a SHA-256 hash of the underlying data snapshot, proving to a judge that the output hasn&#x27;t been tampered with since generation.<p>If you want to see the math in action, we set up a &quot;Demo Sandbox&quot; populated with a synthetic, highly complex 3-year commingled ledger. You can run the engine yourself here (Desktop recommended): <a href="https:&#x2F;&#x2F;exitprotocols.com&#x2F;simulation&#x2F;uplink&#x2F;" rel="nofollow">https:&#x2F;&#x2F;exitprotocols.com&#x2F;simulation&#x2F;uplink&#x2F;</a><p>Here is the exact &quot;Attorney Work Product&quot; it generates from raw PDF or Forensic Audit Dossier our system generates- <a href="https:&#x2F;&#x2F;exitprotocols.com&#x2F;static&#x2F;documents&#x2F;Forensic_Audit_Sample_Vinay_MKT2026.pdf" rel="nofollow">https:&#x2F;&#x2F;exitprotocols.com&#x2F;static&#x2F;documents&#x2F;Forensic_Audit_Sa...</a><p>I&#x27;d love feedback from the HN crowd on the architecture—specifically handling edge-case data ingestion and maintaining cryptographic integrity in B2B enterprise deployments.<p>Cheers!