---
title: "Contract review"
url: https://services.dev/docs/examples/legal/contract-review
captured: [legal-build.txt, legal-fill.txt, legal-region.txt, talk-held.txt]
---
# Contract review

URL: https://services.dev/docs/examples/legal/contract-review

> The client consents before any attorney reads a name, advice the AI drafts waits for the attorney to adopt it, the advice is ratified in three states, and the attorney's fee is the attorney's own, at the same checkout.

*legal's words: matter is a job, asset is a subject, review is a task, signer is a member, network is a pool, outcome is a end (examples/legal/brand.ts).*

The client consents first, so no attorney reads a party's name before she agrees. The AI flags the contract and an adversarial review attacks the flags. Then an attorney admitted where the client is writes the advice, stamped. The rules ratify that advice in three states, and the attorney's fee is the attorney's own.

```bash
cat services/contract-review.ts
```

```txt title="magic values: none"
  roles: { attorney: { pool: attorneys, pay: 50 } },
  talk: { adopt: 'attorney' },
    consent: { ask: 'client', to: 'consent', expires: '7d' },
    flag: 'ai',
    attack: { review: 'adversarial' },
    advise: { by: 'attorney', stamp: true, est: '45min', checklist: ['every flag is addressed', 'the memo answers the goals'] },
  price: { usd: 99, release: 'accept' },
```

[The whole file](https://services.dev/docs/examples/legal/build.md#the-other-three), and `check` after it.

## Three ratified states

The `advise` row lists the states it's ratified in. An order from Florida is refused before any work, and charges nothing:

```txt
→ POST /matters {"service":"contract-review","contract":{"url":"data:text/plain,A%20lease.","name":"lease.pdf"},"client":{"name":"Ada Lovelace","email":"ada@example.com"},"client_region":"US-FL","max_usd":99,"key":"lease-fl"}
```

```txt title="403 · magic values: none"
  "code": "region_not_ratified",
  "reason": "advise is ratified in US-CA, US-NY, US-TX under rules 2026-10, and this order's region is US-FL.",
← GET /owner/events: no matter.ordered and no charge: $0
```

Its `next` is the Service's waitlist:

```txt
→ POST /contract-review/waitlist {"email":"ada@example.com"}   # the next the refusal named
```

```txt title="magic values: none"
← 200 {"object":"waitlist","service":"contract-review","status":"live","position":1,"simulated":true}
```

The same order from California runs:

```txt
→ POST /matters {"service":"contract-review","contract":{"url":"data:text/plain,A%20lease.","name":"lease.pdf"},"client":{"name":"Ada Lovelace","email":"ada@example.com"},"client_region":"US-CA","max_usd":99,"key":"lease-ca"}
```

```txt title="202 · job_7Hq2 · working · $99.00 held · magic values: none"
← 202 · job_7Hq2 · working · $99.00 held
```

## Held advice

`talk: { adopt: 'attorney' }` lets the client ask in the matter's thread. The AI answers at once, unless the answer is in an advice class the rules reserve. Then it's held, and posted to the attorney on the matter, whose fee for `advise` covers up to three such answers:

```txt
→ POST /matters/job_7Hq2/messages {"text":"Should I sign this lease?","metadata":{"sandbox":{"talk":"advice"}}}
```

```txt title="magic values: client.email = signs@example.test, metadata.sandbox.talk = advice"
← 200 msg_7Hq3 · AI · answer · held · advice: A professional is reviewing this answer.
  14:02 · task.posted · tsk_7Hq3 · $0.00 · dispatch direct · to mbr_7Hq2
  14:02 · task.offered · tsk_7Hq3 · mbr_7Hq2 · client
```

The client reads that a professional is reviewing it, and nothing of the draft:

```txt
→ GET /matters/job_7Hq2/messages   # what the client reads
```

```txt title="200 · magic values: client.email = signs@example.test, metadata.sandbox.talk = advice"
  msg_7Hq2 · the client · message · sent: Should I sign this lease?
  msg_7Hq3 · AI · answer · held · advice: A professional is reviewing this answer.
```

The attorney reads the question and the draft in the review's packet, and adopts it as written. The record freezes who adopted it, their credential, where, the rules version and the hash:

```txt
→ POST /reviews/tsk_7Hq3/attest {}   # as mbr_7Hq2: adopts it as written
```

```txt title="magic values: client.email = signs@example.test, metadata.sandbox.talk = advice"
← 200 tsk_7Hq3 · done · attorney · advise · US-CA · $0.00 · attested · no estimate · due 2026-10-27 14:02
  14:02 · message.adopted · msg_7Hq3 · tsk_7Hq3 · mbr_7Hq2 · bar admission · US-CA · rules 2026-10 · sha256:dbcc5338…
  14:02 · message.sent · msg_7Hq3 · advice advise · re msg_7Hq2 · mbr_7Hq2 · bar admission · US-CA · sha256:dbcc5338…

  attested {"member":"mbr_7Hq2","credential":"bar admission","region":"US-CA","rules":"2026-10","hash":"sha256:dbcc53388ecb26c6797659e769f83e8b6d54dad66659e9813588234320772a9a"}
```

## Two sellers

The brand sells the review and the attorney sells the advice, on the attorney's own rail. The ledger never counts the attorney's fee as the brand's. Here the fill ladder had raised it to $55 before a member claimed it:

```txt
→ POST /matters/job_7Hq2/accept
```

```txt title="magic values: client.email = signs@example.test"
← job_7Hq2 · accepted · flags.pdf · memo.pdf · $99.00 final
  ledger  +$99.00 · attorney's fee $55.00, sold by the attorney (rail member) · brand $44.00 · AI $1.26 · you $42.74
```

[Talk](https://services.dev/docs/service/talk.md) covers threads and advice classes. The attorney's fee lands on their own account, at the same checkout, so the receipt names two sellers.

---

- Up: [The legal example](https://services.dev/docs/examples/legal.md)
- Previous: [Provisional patent application](https://services.dev/docs/examples/legal/provisional-patent.md)
- Next: [Demand letter](https://services.dev/docs/examples/legal/demand-letter.md)
