← plans · north_os · DESIGN.md2 juil. 2026

MatterBench — Agentic Legal Benchmark — design spec

Status: Draft — design approved in brainstorm, awaiting spec review · Author: Christophe · Date: 2026-07-02 · Repo: new standalone repo (working name matterbench); this spec lives in north_os
Related: packages/agent-runtime/src/skills/ (160 procedural legal skills), packages/agent-runtime/src/agents/legal-assistant/, packages/document-authoring, north_os_content/forma-study/07-real-estate-clause-ontology.md, HSE interview corpus in north_os_content/research/

The ask. Existing legal AI benchmarks are poor: LegalBench is 162 toy classification tasks, contaminated and saturated; vendor benchmarks (Harvey's BigLaw Bench, the Vals Legal AI Report) are closed and LLM-judge-graded, so nobody trusts the numbers. None of them measures what a legal AI agent actually does on a matter: read many documents, use tools, produce a clean edit that doesn't break the document's layout, cite only things that exist. MatterBench fixes this with agentic tasks grounded in real law-firm practice and verifiable-first scoring — every task ships programmatic verifiers ("contre-vérifié"); an LLM judge grades only the residue that genuinely cannot be checked by code.

0. Decisions locked (brainstorm 2026-07-01/02)

QuestionDecision
PurposePublic + internal. Published credibility asset (open, unlike BigLaw Bench) and the internal eval harness gating North's agent quality.
ScopeAgentic legal work — end-to-end matter tasks, not doctrinal Q&A.
What it must fixNot-real-lawyer-work tasks · no agentic measurement · shallow binary grading · contamination/saturation · and positively: exploit North's growing corpus of real attorney scenarios from HSE.
Form (v1)Standalone dataset + harness repo. Leaderboard site later.
ConfidentialityHybrid. Public set is fully synthetic, authored from real practice patterns. Private held-out split of 2–3 worlds derived from anonymized real HSE material — never released, used for contamination detection and transfer validation.
ValidationTeam-authored, attorney-sampled. Team + Claude author tasks/rubrics from interview evidence and matter content; HSE attorneys sample-review ~20%.
Who is rankedModels inside a fixed reference agent (the SWE-bench model). One scaffold, swap the model. Reproducible by anyone.
AnatomyPyramid on shared matter-worlds (Approach 3), with a precision requirement: fine-grained, deterministically verified checks — e.g. document edits that must not break layout.

1. Thesis

An open benchmark for agentic legal work with verifiable-first scoring. Three claims, each a direct answer to a failure of the existing benchmarks:

  1. Real work. Tasks mirror what attorneys at a working firm actually do on matters — sourced from HSE practice patterns (NY affordable-housing real estate for v1), a corpus that grows as North operates.
  2. Agentic. The unit of evaluation is a matter environment plus a tool-using agent trajectory, not a prompt/response pair. Multi-document, multi-step, real file formats.
  3. Verified, not vibed. Scores come primarily from deterministic verifiers with binary, enumerable invariants. A model cannot rubric-charm its way past a broken document or a fabricated citation.

2. Anatomy — pyramid on shared matter-worlds

A matter-world is a self-contained fictional matter: a document corpus in real formats, a cast of parties, a factual timeline, and a set of gold artifacts. Authoring a world is expensive (days); deriving task instances from an existing world is cheap. So worlds are shared and instances tiered:

TierCount (full)Count (v1)ShapeExample
1 — Atomic~150~60Single-skill task inside a world, 1–3 documents"Extract the renewal option terms from the lease"; "compute the cure deadline for this default notice"
2 — Composite~60~24Multi-document, multi-step"Review the lease against the regulatory agreement and flag conflicts"; "build a chronology from these 30 emails"
3 — Capstone~12 (1/world)4–6Full end-to-end matter task"New matter landed; here is the file. Prepare the closing checklist and a first-draft estoppel."

The tier structure is also the publication story: a model that aces Tier 1 and collapses at Tier 3 is exactly the finding that makes the benchmark worth citing.

2.1 Splits

2.2 Real formats, real formatting complexity — a hard requirement

World documents are authored as the artifacts they claim to be: .docx with Word paragraph styles, multi-level list numbering, field-code cross-references, tables, headers/footers, and where relevant a tracked-changes history; PDFs (some scanned-image pages in later versions); .eml email threads with attachments. Never markdown pretending to be a lease. The layout-preservation verifiers (§3) are only meaningful when there is real layout to break — this is what keeps the "clean edit" claim honest.

3. Scoring — two-layer architecture (the core)

3.1 Layer 1 — deterministic verifiers

Every task declares a set of invariants checked by code. Each verifier returns an enumerated list of violations, never a scalar vibe. The catalog:

VerifierChecksSeverity
Clean-edit (flagship)Agent edits a .docx; diff at OOXML level asserts: only authorized spans changed; paragraph styles, numbering schemes, tables, headers/footers untouched; no reflow of unrelated content; tracked changes used where the task requires redlining.Per-invariant; unauthorized content change = critical
Cross-reference integrityEvery "Section 4.2(b)" in the output resolves to a real section; every capitalized defined term used is defined; renumbering after insertion cascades correctly.Major
Citation existenceEvery statute / case / document cited exists in the matter corpus or the task's fixed authority list.Critical — hard gate. A fabricated citation zeroes the instance regardless of everything else.
Exact extractionDates, dollar amounts, party names, section refs vs gold answers, with normalization (formats, casing) but no "close enough".Per-field
Chronology / checklistF1 against gold (date, event, source-doc) triples; checklist items matched against gold set.Graded (F1)
TrajectoryThe agent actually opened the documents its answer relies on; no fabricated tool outputs; no references to documents that don't exist in the world.Fabrication = critical
Arithmetic / date-mathRent escalations, notice periods, cure deadlines computed exactly (business-day and calendar-day rules as the instrument specifies).Major

3.2 Layer 2 — rubric judge (bounded residue)

Only qualities that genuinely cannot be programmatic: legal judgment, advice quality, tone, organization. Severity-weighted rubrics authored per task family, judged by LLM, calibrated against the attorney-sampled 20% (judge/attorney agreement is measured and published). The judge's contribution to an instance score is bounded (target: ≤30%), so verifier performance dominates.

3.3 Instance score

score = hard_gates(critical verifiers all pass ? 1 : 0)
        × ( w_v · verifier_score + w_j · judge_score )      // w_j ≤ 0.3

Reported per tier, per task family, and per verifier class — the per-verifier breakdown ("model X fails layout preservation 40% of the time") is the actionable output, for the leaderboard and for North's own agents alike.

4. Task families

Eight families, each declaring which verifiers apply. All are recognizable attorney work:

  1. Clean document editing & redlining — clean-edit, cross-ref, trajectory
  2. Clause / data extraction — exact extraction, trajectory
  3. Chronology construction — chronology F1, citation existence, trajectory
  4. Conflict review (lease vs regulatory agreement, OA vs term sheet) — citation existence, exact extraction, judge
  5. Drafting from template (estoppels, notices, amendments) — clean-edit, cross-ref, exact extraction, judge
  6. Defined-terms & cross-ref hygiene — cross-ref (pure)
  7. Email triage — checklist match, exact extraction (deadlines), judge
  8. Closing checklist assembly — checklist match, citation existence, date-math

v1 ships 4 families: 1, 2, 3, 5 — they exercise every verifier class including the flagship, and map directly onto what North's own agents do today.

5. Harness architecture

Standalone repo, TypeScript + Bun (matches the North stack; verifier code may shell out where a mature library wins). Components:

matterbench/
  worlds/<world-id>/          # documents (docx/pdf/eml), world.json (cast, timeline)
  tasks/<task-id>/            # task.json: brief, world ref, tier, family,
                              #   verifier config, gold data, rubric
  packages/
    harness/                  # task loader, run orchestration, sandbox, reporting
    reference-agent/          # fixed scaffold: the agent loop + toolset
    adapters/                 # anthropic / openai / google model adapters
    verifiers/                # one package per verifier class
    fixtures/                 # known-good + known-broken artifacts for verifier tests
  results/                    # versioned run outputs (JSON), report generator (HTML)

5.1 The clean-edit verifier — build first

OOXML diffing is the hardest single piece of engineering in the project and also the moat. Approach: parse both docx packages; align w:p/w:r trees; classify each delta as (a) inside an authorized edit span, (b) formatting-preserving whitespace/rsid noise (ignored), or (c) violation — with violations reported as human-readable statements ("numbering of §7 list changed from legal to decimal"). It gets built and unit-tested against fixtures before any world authoring, to prove the concept and de-risk the schedule.

5.2 North internal wiring

North's own agents are evaluated by running them as an alternative scaffold against the same tasks and verifiers (internal-only results; the public leaderboard stays models-in-reference-agent). This is the internal quality gate: a release of agent-runtime that regresses the clean-edit pass rate is visible before it ships.

6. World authoring pipeline

  1. Pattern harvest — from HSE interviews, the real-estate clause ontology, and (with care) real matter shapes: what documents exist on a matter of type X, what tasks recur, where the traps are (mismatched defined terms, stale cross-refs, conflicting dates between lease and regulatory agreement).
  2. World bible — fictional parties, property, deal economics, timeline; internally consistent numbers (rents, dates, escalations) generated from a seed so gold answers are derivable, not hand-maintained.
  3. Document generation — templates + the world bible produce the docx/pdf/eml corpus; deliberate injected defects (a broken cross-ref, a conflicting date) become task targets with known gold answers.
  4. Task + verifier config derivation — atomic tasks largely derive mechanically from the bible; composite/capstone tasks are hand-authored.
  5. Attorney sample review — ~20% of tasks/rubrics reviewed by HSE attorneys; disagreements fix the task or the rubric, and the review rate is published.

Because worlds are seeded-synthetic, new worlds (and refreshed releases) are cheap to mint as HSE content grows — this is the renewable-data answer to contamination.

7. Releases & contamination

8. v1 scope

Out of v1: leaderboard website, OCR/scanned-PDF tasks, open agent track, task families 4/6/7/8, jurisdictions beyond NY affordable-housing RE.

9. Verification — how we prove the benchmark itself is right

10. Risks & open questions