FREE OPEN-SOURCE CLI + LIVE RUST WASM · MIT LICENSE
What actually changed between these two filings or contracts?
redline strips HTML tags, CSS restyling, and re-wrapped whitespace, then returns exact [start, end) byte spans in the original files for every numeric edit or clause change. The live demo below runs the compiled @cmdrvl/web Rust WebAssembly engine right inside your browser tab.
Two real changes surfaced: base salary rose from $450,000 to $475,000 and a $100,000 signing bonus clause was added.
The amendment changed CSS fonts, renamed <b> to <strong>, added paragraph classes, and re-wrapped lines. redline grouped all layout noise into formatting_only and returned exact [start, end) byte offsets for the two real changes.
| Hunk | Class | Original byte spans | Change (--explicit) |
|---|---|---|---|
| hunk-002 | numeric_changednumeric: true | old[781, 788) new[800, 807) | - 450,000 + 475,000 |
| hunk-003 | clause_addednumeric: true | old[843, 843) new[862, 928) | + Ms. Avery will also receive a one-time signing bonus of $100,000. |
Runs on your device · Zero uploads (works with Wi-Fi off)
Adjust mode, redaction & inspect redline.report.v1 JSON
REDLINE
CHANGES FOUND
Compared: 8k_old.htm -> 8k_new.htm
Mode: html-text
Hunks: 2 semantic (1 clause_added, 0 clause_removed, 1 numeric_changed, 0 text_modified), 2 formatting_only
Tokens: old=103 new=114 churn=6.57%
hunk-001 formatting_only old[0,703) new[0,722) tokens 61 -> 61
hunk-002 numeric_changed old[781,788) new[800,807) tokens 1 -> 1 numeric
- 450,000
+ 475,000
hunk-003 clause_added old[843,843) new[862,928) tokens 0 -> 16 numeric
+ Ms. Avery will also receive a one-time signing bonus of $100,000.
hunk-004 formatting_only old[843,1177) new[928,1280) tokens 0 -> 0Run locally
redline 8k_old.htm 8k_new.htm --mode auto --explicit --jsonClient-side redline.report.v1 fallback (loading @cmdrvl/web WASM): Renders initial redline output while the compiled @cmdrvl/web Rust WebAssembly module loads in browser memory with zero uploads.
Claude Artifacts · @cmdrvl/web
Build a zero-upload filing & contract redliner inside Claude
Paste this prompt into Claude.ai to generate a private document redliner backed by @cmdrvl/web's compiled redline_compare Rust WASM engine. Strips HTML and CSS noise while keeping exact original byte spans.
Build an interactive React Claude Artifact called "CMD+RVL Filing & Contract Redliner (redline)" that compares two UTF-8 text or HTML documents completely in browser memory with zero server uploads.
Follow CMD+RVL's redline.report.v1 contract (https://github.com/cmdrvl/redline) and @cmdrvl/web's compiled redline_compare(oldBytes, newBytes, mode, explicit) Rust WASM API (https://github.com/cmdrvl/web):
1. Include 3 built-in presets (Form 8-K amendment with CSS restyling plus $450,000 -> $475,000 numeric change and $100,000 signing bonus clause_added, a formatting-only HTML pair returning NO_SEMANTIC_CHANGE, and a mixed HTML vs plain-text pair triggering E_MODE_AMBIGUOUS in auto mode) plus an offline Step 4 file upload/paste editor.
2. Separate formatting_only hunks from semantic hunks (numeric_changed, clause_added, clause_removed, text_modified) and display exact half-open [start, end) byte offsets into the original files alongside numeric: true flags.
3. Include a --mode selector (auto, html-text, whitespace, raw) and a zero-retention Redacted vs --explicit toggle (redacted emits byte spans, hunk classes, and blake3-keyed digests with zero raw prose).
4. Lead with a plain-English verdict headline and compact hunk table, keeping the CLI text and redline.report.v1 JSON inside a collapsed inspector drawer.Run it locally
Install redline
Install redline via Homebrew or run it through cmdrvl diff (which routes HTML, XML, Markdown, and plain text to redline automatically).
redline CLI (v0.1.0)
Compares two 5.5 MB SEC 10-K filings in about half a second offline, stripping CSS, tags, <script>, <style>, and <ix:header> noise while preserving exact raw byte offsets.
1. Install via Homebrew
brew install cmdrvl/tap/redline2. Run locally
redline 8k_old.htm 8k_new.htm --explicit- Output schema
- redline.report.v1 (exact [start, end) byte spans)
- Browser engine
- Live @cmdrvl/web Rust WASM (redline_compare)
- Modes
- auto (default), html-text, whitespace, raw
- Privacy default
- Redacted by default (spans + blake3-keyed digests); --explicit reveals text
For scripts and CI: standalone redline binary, exit codes, and refusal codes
cmdrvl diff or standalone CI pipelines
View @cmdrvl/web Rust WASM ->Pass --exit-zero-on-change in set -e scripts, or use --json to filter numeric hunks with jq without exposing raw prose.
Install standalone binary
brew install cmdrvl/tap/cmdrvlInvoke directly
redline old.htm new.htm --json | jq -c '.hunks[] | select(.numeric)'Exit codes & verdicts
NO_SEMANTIC_CHANGE
Exit 0
Inputs are byte-identical, or every difference is formatting_only under the chosen mode (also exit 0 on CHANGES_FOUND when --exit-zero-on-change is passed).
CHANGES_FOUND
Exit 1
At least one semantic hunk (numeric_changed, clause_added, clause_removed, or text_modified) was found. Normal finding, not an error.
REFUSAL
Exit 2
Typed refusal such as E_EMPTY_INPUT, E_BINARY_INPUT, E_MODE_UNSUPPORTED, or E_MODE_AMBIGUOUS.
Common refusal & finding codes
| Code | When it fires | Remediation |
|---|---|---|
| E_IO | An input file could not be read | Verify the file path and local read permissions |
| E_EMPTY_INPUT | One or both inputs contain zero bytes | Pass non-empty UTF-8 text or HTML files |
| E_BINARY_INPUT | Input is binary or non-UTF-8 (PDF, image, UTF-16) | Extract UTF-8 text upstream (e.g. pdftotext -layout) and diff the extracted text |
| E_MODE_UNSUPPORTED | Requested --mode is not shipped in v0.1.0 | Choose auto, raw, whitespace, or html-text |
| E_MODE_AMBIGUOUS | auto mode saw mixed HTML/text or an HTML fragment | Re-run with --mode html-text or --mode whitespace explicitly |
Learning progression
Move forward or back in the workflow.
redline is the prose and HTML twin of rvl. Compare filings or contracts with redline, ground quoted figures with verify ground, and seal the report into an offline-verifiable evidence pack.
- 01rvlSee what moved
- 02shapeCheck compatibility
- 03profileScope columns
- 04verifyEnforce rules
- 05packSeal proof
- 06veilGuard privacy
Tabular twin
rvl (for spreadsheets & CSVs)
Use rvl to isolate the smallest set of numeric cells explaining 95%+ of change across CSV, Parquet, or Excel tapes.
Next step
verify (ground quotes & lock.v0)
Check every extracted quote and dollar scale against pinned document bytes with verify ground.
What redline handles
- Projects every diff hunk back to half-open [start, end) byte spans in the original files so you can slice raw filings directly
- Separates formatting_only restyling (CSS fonts, tags, , reflowed lines) from numeric_changed, clause_added, clause_removed, and text_modified hunks
- Tags every hunk touching a number with numeric: true so agents and analysts can jump straight to financial edits
- Redacts prose by default and emits blake3-keyed span digests derived from the full file hash so short values like 5.25% cannot be brute-forced
- Compiles to zero-unsafe wasm32-unknown-unknown inside @cmdrvl/web with identical redline.report.v1 JSON output
Explicit boundaries & limits
- Does not parse PDFs or .docx directly; extract UTF-8 text upstream and diff the extracted files.
- Markdown, XML, --region/--section targeting, and --lock integration are planned for later releases and refuse with E_MODE_UNSUPPORTED today.
- Does not detect moved paragraphs (reported as a removal plus an addition) and does not decide materiality.
- Cairn roles
- Software factory
- Evidence roles
- Citation, Checks and support
- Semantic context
- Source meaning
- Contribution
- Compare two prose or HTML filing revisions deterministically and return exact [start, end) original byte spans for numeric and clause changes.
- Limit
- Byte spans locate textual and numeric edits; materiality and legal meaning remain human judgments.
Questions this tool can support
- Can I keep the records behind this comparison?
Locate semantic prose and numeric edits between two filing or contract revisions as exact original byte spans while filtering HTML/CSS restyling. A byte span locates text changes; it does not establish materiality.
Potential use, not demonstrated here
Open-source starter -> Paid lineage stack
Start free on local files. License the paid stack for warehouse-wide lineage.
Open-source Rust CLIs and @cmdrvl/web browser engines cut document token spend 10x to 100x locally and work alongside any AI assistant or hosted workspace (Rogo, Hebbia, Harvey, Claude, ChatGPT, or Codex). When your firm needs end-to-end lineage across Snowflake or your cloud warehouse (Reveal catalog, paid MCP servers, Evidence MCP receipts, x402 APIs, and offline twinning and evals), license the paid stack or start with a $500 half-day founder workshop.
Complete open-source CLI suite (17 interactive offline demos)
Explore every deterministic tool in the spine.
Intake & identity
Compare & validate
Reconcile, decide & seal
Workstation guardrails (CLI-only)
Common questions
- Does the /tools/redline/ browser demo actually run compiled Rust WebAssembly?
- Yes. Once the page hydrates, the demo loads the compiled @cmdrvl/web v0.2.0 WebAssembly binary (redline_compare) directly in your browser tab with zero server requests and zero file uploads.
- Why does redline return original byte spans instead of diffing converted text?
- Converting HTML to plain text discards byte positions, so you can no longer slice or audit where a clause appeared in the filed document. redline builds a source map during normalization so every [start, end) span indexes the original file bytes.
- How does redline stay safe for zero-retention AI agents?
- By default, redline omits document prose and outputs only byte spans, hunk classes, token counts, and blake3-keyed span digests. Pass --explicit only when an operator or authorized workflow is allowed to read the changed text.
- Can redline diff two PDFs directly?
- No. Binary PDFs are refused with E_BINARY_INPUT. Extract UTF-8 text upstream (for example with pdftotext -layout), keep the extracted files, and pass them to redline --mode whitespace.
Related tools & reading