LegalOSS133.3ktracked
Document Automation · Contracts & Analysis

clausebox

sboghossian/clausebox

Remix contracts like stems. A deterministic linter keeps defined terms and cross-references coherent — the key+BPM matching of drafting. AGPL-3.0.

Document AutomationContracts & Analysisagplcontractslegallegaltechlinter

Clausebox

Remix contracts like stems. Pull clauses from different agreements, drag them together, and a deterministic linter keeps your defined terms and cross-references coherent — the key-and-BPM matching of contract drafting.

It flags and proposes. It never rewrites the legal text. A human decides.

Where this came from

In an interview about AI and creativity, the producer Hit-Boy demoed an "open-source album": dump every stem from a track — snare, bass, vocal, melody — and let anyone recombine components across songs while software matched key and BPM in real time, so the new arrangement actually held together.

That mechanic isn't about music. It's: components + recombine + a coherence layer that reconciles them. Point it at contracts and the coherence layer changes from "key + BPM" to "defined terms + cross-references." Everything else is the same primitive — the engine itself is the sibling project remix-core (MIT), which also ships a music adapter to prove the point.

What the linter catches

When you recombine clauses, the prose reads fine but the wiring breaks:

Check Severity Example
dangling-reference error a clause uses "Confidential Information" but nothing defines it
governing-law-conflict error a New York clause and an England & Wales clause in the same draft
duplicate-definition warning two clauses both define "Fees"
unused-definition info "Agreement" is defined but never referenced yet

Try it: add Confidentiality on its own and watch three references dangle; add Definitions and watch them resolve. Add Limitation of Liability without Fees & Payment and you'll be told the liability cap leans on a "Fees" nothing defines.

Run it

npm install
npm run dev       # http://localhost:5173
npm test          # the legal coherence linter, unit-tested
npm run build     # typecheck + production build

How it's built

  • src/engine/ — the domain-agnostic remix primitive (vendored from remix-core).
  • src/legal/adapter.tsClauseMeta (introduces / references / roles / governingLaw) and the deterministic legalCoherence linter.
  • src/seeds/clauses.ts — the pre-chopped clause "stems", each wired with its defined terms.
  • src/components/ — palette, draft, coherence panel. Vite + React + Tailwind.

No model, no API key, no backend for the core. The whole linter is pure functions over a symbol table — runs in your browser, instantly.

Optional: AI repair (BYO key)

A clearly-gated extra. Paste your own Anthropic API key (kept in your browser's localStorage, sent directly to Anthropic via a zero-dependency fetch) and the "Suggest a repair" button asks Claude to propose the minimal edits that resolve the linter's issues. It is strictly advisory — the model proposes, nothing is applied to your draft automatically, and the deterministic linter remains the load-bearing part. The core app works fully without it.

Status & disclaimer

v0.1 — a working proof of concept, not a contract automation platform. The seed clause text is illustrative only and is not legal advice.

License

AGPL-3.0-or-later. The engine it builds on (remix-core) is MIT.