Architecture Note · Finance & Legal
Deterministic eDiscovery, Verbatim Deposition Impeachment, and Attorney-Gated Privilege Logs
How SHA-256 deduplicated Bates ingestion, 1-hour raw upload wiping, substring-verified exhibit citations, and SQLite-locked attorney sign-off gates prevent privilege waiver and ungrounded testimony checks.
The Operational Problem
Cross-border litigation requires discovery teams to review Bates-numbered emails, Slack exports, Git commit logs, board memoranda, and system audit records simultaneously across US S.D.N.Y. Rule 34, UK CPR 31 / PD 57AD, EU GDPR Art. 48, and APAC venues. Counsel must cross-reference sworn deposition transcripts at exact Tr. Page:Line citations against contemporaneous exhibits to surface impeachment contradictions, assemble UTC-normalized fact timelines, and produce court-ready privilege logs under FRCP 26(b)(5) and CPR 31.19 without exposing client payloads or inadvertently waiving privilege.
Why Naive AI Wrappers Fail
Generic LLM review tools break under adversarial scrutiny along four predictable fault lines:
- Unanchored quotes and fabricated impeachment: Summarizing exhibits or witness testimony without verifying exact substring spans allows models to paraphrase dates, dollar figures, or email instructions, creating unusable or sanctionable impeachment citations.
- Lingering raw document exposure: Retaining uploaded production bundles indefinitely on multi-tenant cloud storage increases cross-border transfer exposure under GDPR Art. 48 and widens breach blast radius.
- Automated privilege determinations without counsel sign-off: Letting an AI classifier write directly to a privilege log risks omitting mandatory non-waiving subject descriptions or misclassifying legal advice, triggering subject-matter waiver challenges.
- Mutable coding history and weak deduplication: Without cryptographic content hashing and append-only sign-off records, review teams duplicate effort across custodians and cannot prove which licensed attorney attested to each withheld Bates range.
The Deterministic Architecture That Fixes It
Our reference implementation uses an isolated FastAPI and SQLite (WAL mode) service protected by scoped invite tokens (Authorization: Bearer or X-Invite-Token with SHA-256 hashed secrets, per-token sliding-window rate limits returning HTTP 429, and TTL quotas) paired with deterministic verification gates:
- Bates-indexed ingestion and 1-hour raw upload wipe:
POST /api/matters/ingestindexes cross-jurisdiction bundles (US-SDNY,UK-CPR,EU-GDPR) and deduplicates identical payloads bycontent_sha256, reportingindexed_count,deduplicated_count, andduplicate_bates. Temporary raw uploads written toraw_uploads/(0700directory,0600files) are overwritten and deleted afterRAW_UPLOAD_TTL_SECONDS = 3600via a backgroundasyncioloop, opportunistic request sweeps, andPOST /api/uploads/wipe(with live cleanup telemetry viaGET /api/uploads/status) while retaining indexed metadata and audit logs in SQLite. - Substring-verified classification:
POST /api/review/classifyrunsDeterministicReviewAdapterby default (LLM_MODE=deterministic, requiring zero external API keys) or an OpenAI-compatible model. Every suggestion must supply a non-emptyverbatim_quoteverified as an exact substring ofraw_textatquote_start:quote_end; ungrounded or paraphrased quotes fail closed with HTTP422before persistence. - Contradiction detection and UTC fact timelines:
POST /api/matters/{id}/contradictionscross-references sworn deposition testimony against contemporaneous emails, board minutes, Slack logs, and forensic system records, classifying divergences asCritical Impeachment,Material Variance, orTimeline Gap, whileGET /api/matters/{id}/timeline(aliased to/exhibits) sorts verified events chronologically by ISO UTC timestamp with SHA-256 manifest digests. Across our three synthetic cross-border matters, review-team QC benchmarks track134–162docs/hr,91.4%–93.1%inter-reviewer Cohen’s Kappa, and94.2%–95.0%first-pass precision. - Mandatory licensed attorney sign-off gate:
POST /api/review/{id}/codeblocksattorney_client_privilegeorwork_productdeterminations unless counsel suppliesattorney_name,bar_number(at least three characters),bar_jurisdiction, a non-waiving subject description, andattorney_attestation: true. Approved entries write to an immutableattorney_signoffstable protected by SQLiteBEFORE UPDATEandBEFORE DELETEtriggers.GET /api/matters/{id}/privilege-logexports FRCP 26(b)(5) JSON or CSV strictly from signed-off items, reportingpending_signoff_countandpending_bateswhile returning HTTP409 Conflictunderstrict=trueif unsigned privilege items remain.
Operational Takeaway
Litigation AI earns trust only when classification stays advisory and deterministic code enforces custody, grounding, and bar-credentialed sign-off. Hashing exhibits on ingest, wiping raw files after one hour, rejecting unverified quotes at HTTP 422, and gating privilege-log exports behind immutable SQLite attorney attestations gives counsel speed without surrendering courtroom defensibility.