Review candidate disagreements between two English documents that are supposed
to agree. Every finding is two exact source passages. The model never writes
text about your documents. Everything runs on your device, and you stay the
reviewer. Findings contain paired verbatim source spans. Paste text or open
.txt, .md, or a text-layer PDF. MiniLM retrieves
related passages, DeBERTa NLI scores meaning in both directions, and rules compare
extracted values and subjects. These flags need checking; a quiet result does
not establish agreement.
Confirm, dismiss, re-link, or resolve findings. Corrections survive reruns and reloads in browser IndexedDB and can be imported/exported as JSON (1 MB limit). Reports export as JSON or Markdown with literal source passages and offsets. The About and Evaluation pages explain the models, limits, and measured results. This is a reading aid, not legal advice.
TwoTruths was built for SLAY HACKS by Johan Vaz with AI coding agents. The application code, tests, synthetic evaluation data and documentation were written by AI coding agents (OpenAI GPT-6.1 Sol and Anthropic Claude Opus 5.5) under direction and review in an agent-orchestration workflow. Models used inside the product: all-MiniLM-L6-v2 and nli-deberta-v3-xsmall, both open models running in your browser.
The application code, documentation and synthetic corpus share the MIT licence, copyright 2026 Johan Vaz. Dependencies and model weights retain their own licences; see THIRD_PARTY.md for compatibility and retained notices.
Node 22.12+ and npm are required. No account, key, payment, hosted inference, or system-wide installation is needed. Static model assets download from pinned Hugging Face revisions; documents stay on the device. First downloads require network access and can take several minutes. The pipeline uses one live model session at a time, with a Web Worker and single-threaded WASM.
npm ci
mkdir -p .cache/tmp
TMPDIR="$PWD/.cache/tmp" PLAYWRIGHT_BROWSERS_PATH=.cache/ms-playwright npx playwright install chromium --only-shell
npm run devThe restrictive production CSP needs wasm-unsafe-eval for ONNX WASM compilation.
The Vite development server's injected inline refresh script may be blocked by
this production policy; use the production preview below for full acceptance.
VITE_BASE_PATH=/twotruths/ npm run build
node scripts/serve.mjs
# http://127.0.0.1:4173/twotruths/The base path is configurable (default /twotruths/). The example static server also
serves /twotruths/. Build generates the dependency inventory and full runtime
licence texts/notices under dist/licenses/, linked from About.
npm run typecheck
npm run lint
npm test
npm run test:eval
VITE_BASE_PATH=/twotruths/ npm run build
npm run test:e2e
npm run release:checkPlaywright runs one browser at a time against the production build. Tests cover
real model loading/inference, pinned requests, CSP, correction replay, corrupt
storage recovery, file inputs, literal exports, and the deployed base path.
The hidden /#/runtime-gate route measures model feasibility separately.
All evaluation data are synthetic. The corpus and labels were written by an AI agent with same-model review only, not independent human adjudication. The rental demo is not part of the evaluation. These results say nothing about real documents or real users.
One held-out run evaluated both tiers (easy: 16 pairs; hard: 12 pairs) with all six adapters and frozen dev-selected settings. The shipped detector is hybrid. No thresholds, detector logic or scoring rules changed for this run. See the audit log, full generated results, and exact JSON.
The following rows quote the generated output exactly. P/R/F1 and marginal 95% confidence intervals are percentages; false alarms retain counts and denominators. An absent denominator is unavailable, not zero.
easy held-out tier
| Adapter | Precision [95% CI] | Recall [95% CI] | F1 [95% CI] | Near-miss false alarms | Consistent-pair false alarms |
|---|---|---|---|---|---|
| nli-only | 71.21% [63.64%, 79.41%] | 73.44% [62.50%, 82.81%] | 72.31% [64.06%, 79.11%] | 18.75% (9/48) | unavailable (0/0) |
| hybrid | 74.24% [67.94%, 81.25%] | 76.56% [68.75%, 84.38%] | 75.38% [69.42%, 80.62%] | 18.75% (9/48) | unavailable (0/0) |
hard held-out tier
| Adapter | Precision [95% CI] | Recall [95% CI] | F1 [95% CI] | Near-miss false alarms | Consistent-pair false alarms |
|---|---|---|---|---|---|
| nli-only | 40.48% [21.74%, 53.49%] | 45.95% [27.27%, 61.54%] | 43.04% [26.09%, 53.77%] | 2.38% (1/42) | 100.00% (3/3) |
| hybrid | 41.07% [26.32%, 54.93%] | 62.16% [52.00%, 71.15%] | 49.46% [35.71%, 60.43%] | 2.38% (1/42) | 100.00% (3/3) |
Findings are candidate disagreements to check. On the synthetic hard held-out tier, the shipped hybrid scored precision 41.07%, recall 62.16% and F1 49.46%, and flagged all three fully consistent hard pairs. Hybrid-minus-NLI-only paired confidence intervals include zero on both tiers; these results do not show that the hybrid is more accurate. The simpler NLI-evidence variant scored hard F1 51.69%, above the shipped hybrid. Selection was fixed before the held-out run, so it was not switched afterwards. A quiet result does not establish agreement.
Paired hybrid minus NLI-only micro F1 differences (generated output):
easy: F1 difference 3.08 percentage points; paired 95% CI [-0.94, 7.89] pp; includes zero: no significant difference shown. 16 pairs, 2000 shared-index resamples.
hard: F1 difference 6.42 percentage points; paired 95% CI [-3.30, 18.02] pp; includes zero: no significant difference shown. 12 pairs, 2000 shared-index resamples.
All intervals use 2,000 pair-cluster percentile-bootstrap resamples, seed 20261109; paired differences share sampled pair indices in both arms. Both source spans need IoU ≥0.5 for a match. These small synthetic samples share an author and templates; bootstrap intervals do not capture that uncertainty. The systems use different candidates/settings, so this is not a controlled ablation. An interval including zero does not show a significant difference.
Dev scores were used for configuration selection and carry threshold-selection optimism; they are preserved separately in dev results. The predeclared objective used mean tier F1 subject to ≤20% labelled near-miss false alarms on each dev tier, with mean precision and trial order as tie-breaks. See the procedure and configuration decision.
The published held-out result has already been run once. Public evaluation bytes are copied from the generated evidence by node src/ui/copy-evaluation.mjs; publication does not rerun inference. Held-out mode requires an explicit tier selection.
Two documents, English only, at most 60,000 characters each. No OCR. Tables, conditions, implicit terms, ambiguous subjects, and long documents can be missed or misread. Retrieval, NLI, and rule comparison budgets disclose omitted checks; no findings does not establish agreement. Scores rank candidates and are not probabilities of truth. Rule-only fallback is explicitly labelled no AI. Storage is local to the browser; export corrections for a backup. Corrupt saved work is validated before use and offers an explicit reset action.
src/core/ contains the pure pipeline and invariants; src/models/ the real
model adapters; src/worker/ the worker protocol; src/ui/ the app; eval/ the
real-model harness; tests/ the production browser checks; docs/evidence/ the
command-generated evidence. The Node evaluation uses real ONNX WASM because
this Intel Mac's installed native ORT package lacks a darwin/x64 binding. Raw
vector/probability caches stay in .cache/; decisions always execute afresh.
The text-only sharp override deliberately disables unused image processing.
See third-party software for versions and notices.