Atris

Compare two versions of a contract.
Done by an agent. Checked twice.

Every unmarked change the other side made, quoted from both versions and sorted into what alters the deal and what does not.

Have Atris do this for you›

1

Real files in

  • agreement_v1.md
    A 23 clause managed IT services agreement, the customer's own draft. 99 lines, 5 KB.
  • agreement_v2.md
    The same agreement as returned by the provider with no changes marked: one clause removed, one added, later clauses renumbered and edits of every size inside 17 others. 99 lines, 6 KB.

Sample data written by Atris. Not a real company.

2

Three steps

  1. 1.Line up the clauses
  2. 2.Find and sort every difference
  3. 3.Write the change list and the summary

Claude Sonnet 5.5, 1 min 13 s. No web. It never saw the check.

3

Checked twice

  • ✓Passed: 19 of 19 clauses that differ between the versions have one row, with 0 identical clauses listed by mistake
  • ✓Passed: 19 of 19 rows give the right kind of change and the right section number in each version
  • ✓Passed: 19 of 19 rows say correctly whether the change matters (16 do, 3 do not)
  • ✓Passed: 36 of 36 quotes are found word for word in the version and clause they name
  • ✓Passed: 17 of 17 changed clauses quote the sentence that holds the difference, from both versions
  • ✓Passed: summary.md gives the number of changes that matter (16) and names 16 of those 16 clauses, with 45 of 45 figures in it found in one of the two versions
  • ✓Passed: summary.md opens by saying it is a first pass for a person to decide and not legal advice

Second review by Claude Opus 5.5: pass.

Then we broke a copy of the output 6 ways on purpose. The check caught 6.

What it wrote. Lines 7 to 18 of summary.md, copied from the file.
- Term (v1 §2, v2 §2): 12 months -> 36 months.
- Renewal (v1 §3, v2 §3): 30 days notice -> 90 days notice.
- Fees (v1 §4, v2 §4): $4,500 per month -> $4,900 per month.
- Invoices and Payment (v1 §6, v2 §6): 45 days -> 15 days.
- Service Levels (v1 §7, v2 §7): "shall respond" within 1 hour; 99.9% availability -> "shall use reasonable efforts to respond" within 1 hour; 99.5% availability.
- Service Credits (v1 §8, v2 not present): 10% credit of that month's Fees when availability falls below the Section 7 level -> clause not present.
- Customer Responsibilities (v1 §9, v2 §8): Corvane IT Services LLC -> Corvaine IT Services LLC.
- Data Protection (v1 §11, v2 §10): 24 hours -> 72 hours.
- Data Ownership and Use (v1 §12, v2 §11): use only for providing the Services -> use for providing the Services and improving Provider's own products.
- Liability Cap (v1 §15, v2 §14): Fees for the prior 12 months -> Fees for the prior 3 months.
- Termination for Convenience (v1 §18, v2 §17): either party may terminate on 60 days notice -> only Provider may terminate on 60 days notice.
- Early Termination Fee (v1 not present, v2 §18): clause not present -> 50% of the Fees for the remaining months, due within 10 days.

How this was run

An AI agent on Claude Sonnet 5.5 was given a folder with the files below and a three-step flow, and nothing else. It had no web access and never saw the check. The check was written before the run and works the answer out again from the input files. Then Claude Opus 5.5 reviewed the result against the inputs. The input files are sample data written by Atris, with the problems a real week has planted in them.

Run 3 of 3 on 1 December 2026. The agent took 1 min 13 s. Run 1 passed both checks and the job was run again later. Run 2 did not pass the check. Each run starts clean. Between runs the written flow was made clearer, or a check was corrected or made stricter. Nobody edits the output.

What the second review verified

  • I diffed every clause by title. Exactly 19 clauses differ, and they are the same 19 that are in changes.csv. The 5 identical clauses (Services, Personnel, Subcontractors, Insurance, Force Majeure) are correctly left out, even though 3 of them were renumbered.
  • A script confirmed that all 37 quotes appear word for word in the named clause, and that every section number matches its version, for example Customer Responsibilities v1 §9 / v2 §8 ('Corvane' -> 'Corvaine') and Early Termination Fee v2 §18 only.
  • The three changes marked 'no' are correct. Fee Increases only rewrites 'sixty (60) days' as '60 days'. Confidentiality only adds a comma and changes 'duties' to 'Duties'. Termination for Cause changes the reference from Section 11 to Section 10, and both still point to Data Protection. Liability Cap is marked 'yes' because 'twelve (12)' became 'three (3)'; its reference change from Section 13 to 12 is noted.
  • summary.md opens with the exact required line. It says 19 clauses differ, 16 matter and 3 do not, which matches the 19 rows (16 'yes'). It only uses figures from the two versions ($4,500/$4,900, 99.9%/99.5%, 24/72 hours, Ohio/Georgia) and does not calculate any differences between them.

What this run does not show

  • Run 1 passed, then the check was made stricter to test the figures in the summary and the job was run again.
  • Run 2 failed only because one check line wrongly rejected a count followed by a full stop, which was fixed before run 3.
  • Whether a change matters is tested by rules about numbers, parties and removed clauses, so a subtle shift of meaning is left to the second review.

Would the check catch a wrong answer?

A check that cannot fail proves nothing. After the run we took a copy of the output, broke it one small way at a time and ran the check again. It caught 6 of 6.

Open every file

flow.md · the three steps the agent followed
# Compare two versions of a contract

function: legal
for: the person who must approve the other side's changes before the contract is signed
goal: Every difference between the two versions is listed with the words from each and the changes that alter the deal are separated from the ones that do not.

## 1. Line up the clauses
Read input/agreement_v1.md (our draft) and input/agreement_v2.md (the copy that came back with no
changes marked). Each clause is a numbered section with a title. Match clauses by title, not by
number, because numbers shift when a clause is added or removed. Ignore the version line at the top
of each file. This is a first pass for a person who decides. Do not give legal advice and do not say
whether a change should be accepted.

## 2. Find and sort every difference
Compare each matched pair of clauses word by word. Do not trust a quick read. A clause gets a row when
its words differ in any way, or when it is in only one version. A clause whose words are identical
gets no row, even if its number moved.
Decide whether each difference matters:
- `no` when the only differences are capital letters, punctuation, spacing, the way a number is
  written (thirty (30) days against 30 days) or a section number in a cross reference that still
  points to the same clause after renumbering.
- `yes` for everything else, however small: a number, amount, time, place, name or party that is
  different, a word added, removed or replaced, a clause added or removed.
If a clause has both kinds of difference, it is `yes`.

## 3. Write the change list and the summary
Write output/changes.csv with columns clause,change,matters,v1_section,v2_section,v1_quote,v2_quote,what_changed.
One row per clause that differs.
- clause: the clause title. change: `changed`, `added` (only in version 2) or `removed` (only in version 1).
- v1_section and v2_section: the section number in each version, empty when the clause is not there.
- v1_quote and v2_quote: the full sentence that holds the difference, copied character for character
  from each version. If more than one sentence changed, copy the sentence whose change matters most
  and describe the rest in what_changed. For an added or removed clause, copy its first sentence and
  leave the other quote empty.
- what_changed: one plain sentence giving the old words or number and the new.
Write output/summary.md for the approver. The first line must read exactly:
First pass for a person to decide. Not legal advice.
Then state how many differences matter and how many do not. Then one line for each difference that
matters: the clause title, its section number in each version, the old value and the new value. Then
one line for each difference that does not matter, saying why. Use only figures that appear in one
of the two versions, plus your own counts. Do not work out differences between figures.

## Done looks like
- Every clause that differs has one row and no identical clause is listed.
- Every quote can be found word for word in the version and clause it names.
- The counts in summary.md equal the rows in changes.csv.
input/agreement_v1.md · 99 lines, 5 KB
# Managed IT Services Agreement

Version 1. Customer's draft, sent to Provider on November 2, 2026.

This Managed IT Services Agreement (the "Agreement") is between Tamsin Ridge Dental Group, Inc., an Ohio corporation with its main office at 310 Marrow Street, Dayton, Ohio ("Customer"), and Corvane IT Services LLC, a Georgia limited liability company with its main office at 88 Pell Avenue, Atlanta, Georgia ("Provider").

## 1. Services

Provider shall provide the managed IT services described in Schedule A (the "Services") to Customer's nine dental offices. Provider shall perform the Services with reasonable skill and care and in line with good industry practice.

## 2. Term

This Agreement begins on January 1, 2027 and continues for twelve (12) months (the "Initial Term"), unless it is ended earlier under this Agreement.

## 3. Renewal

After the Initial Term, this Agreement renews for successive twelve (12) month periods unless either party gives written notice of non-renewal at least thirty (30) days before the end of the then-current term.

## 4. Fees

Customer shall pay Provider a fixed fee of $4,500 per month for the Services (the "Fees"). Work outside Schedule A is billed at $165 per hour and needs Customer's written approval before it starts.

## 5. Fee Increases

Provider may increase the Fees once in each renewal term by no more than 3%, and only after giving Customer sixty (60) days written notice of the increase.

## 6. Invoices and Payment

Provider shall invoice the Fees monthly in arrears. Customer shall pay each undisputed invoice within forty-five (45) days after receiving it. Late amounts bear interest at 1% per month.

## 7. Service Levels

Provider shall respond to each critical incident within one (1) hour and shall keep the hosted systems available at least 99.9% of each calendar month. Provider shall report its performance against these levels to Customer every month.

## 8. Service Credits

If availability in a calendar month falls below the level in Section 7, Customer receives a credit of 10% of that month's Fees against its next invoice. Service credits are not Customer's only remedy.

## 9. Customer Responsibilities

Customer shall give Provider the access, information and decisions that Provider reasonably needs to perform the Services. Customer shall name one person as its main contact for Corvane IT Services LLC.

## 10. Personnel

Provider shall assign staff who are trained for the work. Provider shall run a background check on every staff member before that person is given access to Customer's systems.

## 11. Data Protection

Provider shall protect Customer Data with safeguards that are appropriate for patient records. Provider shall notify Customer of any security incident affecting Customer Data within twenty-four (24) hours after becoming aware of it.

## 12. Data Ownership and Use

Customer owns all Customer Data. Provider shall not use Customer Data for any purpose other than providing the Services. Provider shall not move Customer Data outside the United States.

## 13. Confidentiality

Each party shall keep the other party's Confidential Information secret, shall use it only to perform this Agreement and shall protect it with reasonable care. These duties continue for three (3) years after this Agreement ends.

## 14. Subcontractors

Provider shall not use a subcontractor to perform the Services without Customer's prior written consent. Provider remains responsible for the work of every subcontractor.

## 15. Liability Cap

Each party's total liability under this Agreement is limited to the Fees paid or payable in the twelve (12) months before the claim arose. This limit does not apply to a breach of Section 13 or to a party's fraud.

## 16. Insurance

Provider shall maintain cyber liability insurance of at least $2,000,000 per claim during the term of this Agreement and shall give Customer a certificate of insurance on request.

## 17. Termination for Cause

Either party may terminate this Agreement by written notice if the other party materially breaches it and does not cure the breach within thirty (30) days after written notice of the breach. A breach of Section 11 is a material breach.

## 18. Termination for Convenience

Either party may terminate this Agreement for any reason by giving the other party sixty (60) days written notice.

## 19. Transition Assistance

When this Agreement ends for any reason, Provider shall help Customer move the Services to Customer or to a new provider for up to ninety (90) days. Provider shall give this help at no additional charge.

## 20. Force Majeure

Neither party is liable for a delay or failure caused by an event beyond its reasonable control, provided that it tells the other party promptly and resumes performance as soon as it can.

## 21. Governing Law

This Agreement is governed by the laws of the State of Ohio. The parties submit to the courts located in Montgomery County, Ohio.

## 22. Notices

Notices under this Agreement must be in writing and sent to the address of the other party stated above. A notice sent by email is effective only when the recipient confirms that it was received.

## 23. General

This Agreement is the entire agreement between the parties on its subject. It may be changed only in a writing signed by both parties. Neither party may assign this Agreement without the other party's prior written consent.

Schedule A (Services) is attached and is the same in both versions. It is not part of this comparison.
input/agreement_v2.md · 99 lines, 6 KB
# Managed IT Services Agreement

Version 2. Returned by Provider on November 20, 2026 as a clean copy with no changes marked.

This Managed IT Services Agreement (the "Agreement") is between Tamsin Ridge Dental Group, Inc., an Ohio corporation with its main office at 310 Marrow Street, Dayton, Ohio ("Customer"), and Corvane IT Services LLC, a Georgia limited liability company with its main office at 88 Pell Avenue, Atlanta, Georgia ("Provider").

## 1. Services

Provider shall provide the managed IT services described in Schedule A (the "Services") to Customer's nine dental offices. Provider shall perform the Services with reasonable skill and care and in line with good industry practice.

## 2. Term

This Agreement begins on January 1, 2027 and continues for thirty-six (36) months (the "Initial Term"), unless it is ended earlier under this Agreement.

## 3. Renewal

After the Initial Term, this Agreement renews for successive twelve (12) month periods unless either party gives written notice of non-renewal at least ninety (90) days before the end of the then-current term.

## 4. Fees

Customer shall pay Provider a fixed fee of $4,900 per month for the Services (the "Fees"). Work outside Schedule A is billed at $165 per hour and needs Customer's written approval before it starts.

## 5. Fee Increases

Provider may increase the Fees once in each renewal term by no more than 3%, and only after giving Customer 60 days written notice of the increase.

## 6. Invoices and Payment

Provider shall invoice the Fees monthly in arrears. Customer shall pay each undisputed invoice within fifteen (15) days after receiving it. Late amounts bear interest at 1% per month.

## 7. Service Levels

Provider shall use reasonable efforts to respond to each critical incident within one (1) hour and shall keep the hosted systems available at least 99.5% of each calendar month. Provider shall report its performance against these levels to Customer every month.

## 8. Customer Responsibilities

Customer shall give Provider the access, information and decisions that Provider reasonably needs to perform the Services. Customer shall name one person as its main contact for Corvaine IT Services LLC.

## 9. Personnel

Provider shall assign staff who are trained for the work. Provider shall run a background check on every staff member before that person is given access to Customer's systems.

## 10. Data Protection

Provider shall protect Customer Data with safeguards that are appropriate for patient records. Provider shall notify Customer of any security incident affecting Customer Data within seventy-two (72) hours after becoming aware of it.

## 11. Data Ownership and Use

Customer owns all Customer Data. Provider shall not use Customer Data for any purpose other than providing the Services and improving Provider's own products. Provider shall not move Customer Data outside the United States.

## 12. Confidentiality

Each party shall keep the other party's Confidential Information secret, shall use it only to perform this Agreement, and shall protect it with reasonable care. These Duties continue for three (3) years after this Agreement ends.

## 13. Subcontractors

Provider shall not use a subcontractor to perform the Services without Customer's prior written consent. Provider remains responsible for the work of every subcontractor.

## 14. Liability Cap

Each party's total liability under this Agreement is limited to the Fees paid or payable in the three (3) months before the claim arose. This limit does not apply to a breach of Section 12 or to a party's fraud.

## 15. Insurance

Provider shall maintain cyber liability insurance of at least $2,000,000 per claim during the term of this Agreement and shall give Customer a certificate of insurance on request.

## 16. Termination for Cause

Either party may terminate this Agreement by written notice if the other party materially breaches it and does not cure the breach within thirty (30) days after written notice of the breach. A breach of Section 10 is a material breach.

## 17. Termination for Convenience

Provider may terminate this Agreement for any reason by giving the other party sixty (60) days written notice.

## 18. Early Termination Fee

If Customer ends this Agreement before the end of the then-current term for any reason other than Provider's uncured material breach, Customer shall pay Provider 50% of the Fees for the months that remain in that term. Customer shall pay this amount within ten (10) days after the Agreement ends.

## 19. Transition Assistance

When this Agreement ends for any reason, Provider shall help Customer move the Services to Customer or to a new provider for up to ninety (90) days. Provider shall give this help at its then-current hourly rates.

## 20. Force Majeure

Neither party is liable for a delay or failure caused by an event beyond its reasonable control, provided that it tells the other party promptly and resumes performance as soon as it can.

## 21. Governing Law

This Agreement is governed by the laws of the State of Georgia. The parties submit to the courts located in Fulton County, Georgia.

## 22. Notices

Notices under this Agreement must be in writing and sent to the address of the other party stated above. A notice sent by email is effective when it is sent.

## 23. General

This Agreement is the entire agreement between the parties on its subject. It may be changed only in a writing signed by both parties. Neither party may assign this Agreement without the other party's prior written consent, except that Provider may assign it to an affiliate or to a buyer of its business.

Schedule A (Services) is attached and is the same in both versions. It is not part of this comparison.
output/changes.csv · written by the agent, 20 lines
clause,change,matters,v1_section,v2_section,v1_quote,v2_quote,what_changed
Term,changed,yes,2,2,"This Agreement begins on January 1, 2027 and continues for twelve (12) months (the ""Initial Term""), unless it is ended earlier under this Agreement.","This Agreement begins on January 1, 2027 and continues for thirty-six (36) months (the ""Initial Term""), unless it is ended earlier under this Agreement.",Initial Term changed from twelve (12) months to thirty-six (36) months.
Renewal,changed,yes,3,3,"After the Initial Term, this Agreement renews for successive twelve (12) month periods unless either party gives written notice of non-renewal at least thirty (30) days before the end of the then-current term.","After the Initial Term, this Agreement renews for successive twelve (12) month periods unless either party gives written notice of non-renewal at least ninety (90) days before the end of the then-current term.",Non-renewal notice period changed from thirty (30) days to ninety (90) days before the end of the term.
Fees,changed,yes,4,4,"Customer shall pay Provider a fixed fee of $4,500 per month for the Services (the ""Fees"").","Customer shall pay Provider a fixed fee of $4,900 per month for the Services (the ""Fees"").","Monthly fixed fee changed from $4,500 to $4,900."
Fee Increases,changed,no,5,5,"Provider may increase the Fees once in each renewal term by no more than 3%, and only after giving Customer sixty (60) days written notice of the increase.","Provider may increase the Fees once in each renewal term by no more than 3%, and only after giving Customer 60 days written notice of the increase.",Fee-increase notice written as 'sixty (60) days' in version 1 and '60 days' in version 2; only the way the number is written changed.
Invoices and Payment,changed,yes,6,6,Customer shall pay each undisputed invoice within forty-five (45) days after receiving it.,Customer shall pay each undisputed invoice within fifteen (15) days after receiving it.,Payment period for undisputed invoices changed from forty-five (45) days to fifteen (15) days.
Service Levels,changed,yes,7,7,Provider shall respond to each critical incident within one (1) hour and shall keep the hosted systems available at least 99.9% of each calendar month.,Provider shall use reasonable efforts to respond to each critical incident within one (1) hour and shall keep the hosted systems available at least 99.5% of each calendar month.,"Incident response changed from 'shall respond' to 'shall use reasonable efforts to respond' within one (1) hour, and availability changed from 99.9% to 99.5%."
Service Credits,removed,yes,8,,"If availability in a calendar month falls below the level in Section 7, Customer receives a credit of 10% of that month's Fees against its next invoice.",,Clause removed: version 1 gave Customer a credit of 10% of that month's Fees if monthly availability fell below the Section 7 level; version 2 has no such clause.
Customer Responsibilities,changed,yes,9,8,Customer shall name one person as its main contact for Corvane IT Services LLC.,Customer shall name one person as its main contact for Corvaine IT Services LLC.,Provider's name in the main-contact sentence changed from 'Corvane IT Services LLC' to 'Corvaine IT Services LLC'.
Data Protection,changed,yes,11,10,Provider shall notify Customer of any security incident affecting Customer Data within twenty-four (24) hours after becoming aware of it.,Provider shall notify Customer of any security incident affecting Customer Data within seventy-two (72) hours after becoming aware of it.,Security incident notice period changed from twenty-four (24) hours to seventy-two (72) hours.
Data Ownership and Use,changed,yes,12,11,Provider shall not use Customer Data for any purpose other than providing the Services.,Provider shall not use Customer Data for any purpose other than providing the Services and improving Provider's own products.,Version 2 adds 'and improving Provider's own products' to the permitted uses of Customer Data.
Confidentiality,changed,no,13,12,"Each party shall keep the other party's Confidential Information secret, shall use it only to perform this Agreement and shall protect it with reasonable care.","Each party shall keep the other party's Confidential Information secret, shall use it only to perform this Agreement, and shall protect it with reasonable care.",Only a comma was added after 'this Agreement' and 'duties' became 'Duties' (capital letter); no words changed.
Liability Cap,changed,yes,15,14,Each party's total liability under this Agreement is limited to the Fees paid or payable in the twelve (12) months before the claim arose.,Each party's total liability under this Agreement is limited to the Fees paid or payable in the three (3) months before the claim arose.,"Liability look-back period changed from twelve (12) months to three (3) months of Fees; the cross reference changed from Section 13 to Section 12, which still points to Confidentiality."
Termination for Cause,changed,no,17,16,A breach of Section 11 is a material breach.,A breach of Section 10 is a material breach.,"Cross reference changed from Section 11 to Section 10, which still points to Data Protection after renumbering."
Termination for Convenience,changed,yes,18,17,Either party may terminate this Agreement for any reason by giving the other party sixty (60) days written notice.,Provider may terminate this Agreement for any reason by giving the other party sixty (60) days written notice.,Right to terminate for convenience changed from 'Either party' to 'Provider' only.
Early Termination Fee,added,yes,,18,,"If Customer ends this Agreement before the end of the then-current term for any reason other than Provider's uncured material breach, Customer shall pay Provider 50% of the Fees for the months that remain in that term.","New clause: Customer pays 50% of the Fees for the remaining months if it ends early other than for Provider's uncured material breach, due within ten (10) days after the Agreement ends."
Transition Assistance,changed,yes,19,19,Provider shall give this help at no additional charge.,Provider shall give this help at its then-current hourly rates.,Transition help changed from 'at no additional charge' to 'at its then-current hourly rates'.
Governing Law,changed,yes,21,21,This Agreement is governed by the laws of the State of Ohio.,This Agreement is governed by the laws of the State of Georgia.,"Governing law changed from the State of Ohio to the State of Georgia, and the courts from Montgomery County, Ohio to Fulton County, Georgia."
Notices,changed,yes,22,22,A notice sent by email is effective only when the recipient confirms that it was received.,A notice sent by email is effective when it is sent.,Email notice effective 'only when the recipient confirms that it was received' in version 1 changed to 'when it is sent' in version 2.
General,changed,yes,23,23,Neither party may assign this Agreement without the other party's prior written consent.,"Neither party may assign this Agreement without the other party's prior written consent, except that Provider may assign it to an affiliate or to a buyer of its business.",Version 2 adds an exception letting Provider assign the Agreement to an affiliate or to a buyer of its business.
output/summary.md · written by the agent, 30 lines
First pass for a person to decide. Not legal advice.

19 clauses differ: 16 matter and 3 do not.

## Differences that matter

- Term (v1 §2, v2 §2): 12 months -> 36 months.
- Renewal (v1 §3, v2 §3): 30 days notice -> 90 days notice.
- Fees (v1 §4, v2 §4): $4,500 per month -> $4,900 per month.
- Invoices and Payment (v1 §6, v2 §6): 45 days -> 15 days.
- Service Levels (v1 §7, v2 §7): "shall respond" within 1 hour; 99.9% availability -> "shall use reasonable efforts to respond" within 1 hour; 99.5% availability.
- Service Credits (v1 §8, v2 not present): 10% credit of that month's Fees when availability falls below the Section 7 level -> clause not present.
- Customer Responsibilities (v1 §9, v2 §8): Corvane IT Services LLC -> Corvaine IT Services LLC.
- Data Protection (v1 §11, v2 §10): 24 hours -> 72 hours.
- Data Ownership and Use (v1 §12, v2 §11): use only for providing the Services -> use for providing the Services and improving Provider's own products.
- Liability Cap (v1 §15, v2 §14): Fees for the prior 12 months -> Fees for the prior 3 months.
- Termination for Convenience (v1 §18, v2 §17): either party may terminate on 60 days notice -> only Provider may terminate on 60 days notice.
- Early Termination Fee (v1 not present, v2 §18): clause not present -> 50% of the Fees for the remaining months, due within 10 days.
- Transition Assistance (v1 §19, v2 §19): at no additional charge -> at its then-current hourly rates.
- Governing Law (v1 §21, v2 §21): State of Ohio; Montgomery County, Ohio courts -> State of Georgia; Fulton County, Georgia courts.
- Notices (v1 §22, v2 §22): email notice effective only when recipient confirms receipt -> email notice effective when sent.
- General (v1 §23, v2 §23): no assignment without the other party's consent -> Provider may assign to an affiliate or a buyer of its business.

## Differences that do not matter

- Fee Increases (v1 §5, v2 §5): number written as 'sixty (60) days' in v1 and '60 days' in v2; same period.
- Confidentiality (v1 §13, v2 §12): only a comma added and 'duties' capitalised as 'Duties'; no words changed.
- Termination for Cause (v1 §17, v2 §16): cross reference changed from Section 11 to Section 10 after renumbering and still points to Data Protection.

Notes: clauses not listed have identical words in both versions, even where the number moved. The opening paragraph matched apart from the version line. Schedule A is stated to be the same in both versions and was not compared.
check.py · the check, written before the run
"""Compares the two versions clause by clause itself, then checks the agent's change list against that.

A difference "does not matter" only when the clauses are equal after ignoring capitals, punctuation,
spacing, number style (thirty (30) and 30) and cross references that follow a renumbered clause.
"""
import csv, re, sys
from collections import Counter
from pathlib import Path

root = Path(sys.argv[1]); ok = True
def say(passed, text):
    global ok; ok = ok and passed; print(("PASS " if passed else "FAIL ") + text)
def norm(s):
    s = (s or "").replace("“", '"').replace("”", '"').replace("’", "'").replace("‘", "'")
    return re.sub(r"\s+", " ", s).strip()

def clauses(name):
    parts = re.split(r"^## (\d+)\. (.+)$", (root / "input" / name).read_text(), flags=re.M)
    out = {}
    for i in range(1, len(parts), 3):
        body = parts[i + 2].split("\nSchedule A (Services) is attached")[0]
        out[parts[i + 1].strip()] = (parts[i], norm(body))
    return out
v1, v2 = clauses("agreement_v1.md"), clauses("agreement_v2.md")
def words(text, version):
    """The words and numbers that carry meaning, with style differences flattened."""
    title_of = {num: title for title, (num, _) in version.items()}
    t = re.sub(r"Section (\d+)", lambda m: " ref_" + title_of.get(m.group(1), m.group(1)).replace(" ", "_") + " ", text)
    t = re.sub(r"\b[A-Za-z]+(?:-[A-Za-z]+)? \((\d+)\)", r"\1", t)
    return re.findall(r"\d+(?:[.,]\d+)*|[a-z_]+(?:'[a-z]+)?", t.lower())

want = {}
for title in list(v2) + [t for t in v1 if t not in v2]:
    if title not in v1:
        want[title] = ("added", "yes", "", v2[title][0])
    elif title not in v2:
        want[title] = ("removed", "yes", v1[title][0], "")
    elif v1[title][1] != v2[title][1]:
        same = words(v1[title][1], v1) == words(v2[title][1], v2)
        want[title] = ("changed", "no" if same else "yes", v1[title][0], v2[title][0])

path = root / "output/changes.csv"
if not path.exists():
    say(False, "output/changes.csv was not written"); sys.exit(1)
rows = list(csv.DictReader(path.open(newline="")))
got = {}
for r in rows:
    got.setdefault(norm(r.get("clause")), []).append(r)
once = sum(1 for t in want if len(got.get(t, [])) == 1)
extra = [t for t in got if t not in want]
say(once == len(want) and not extra, f"{once} of {len(want)} clauses that differ between the versions have one row, with {len(extra)} identical clauses listed by mistake")
row = {t: (got.get(t) or [{}])[0] for t in want}
digits = lambda s: "".join(re.findall(r"\d+", s or ""))

kind = sum(1 for t, w in want.items() if norm(row[t].get("change")).lower() == w[0]
           and digits(row[t].get("v1_section")) == w[2] and digits(row[t].get("v2_section")) == w[3])
say(kind == len(want), f"{kind} of {len(want)} rows give the right kind of change and the right section number in each version")

yes = sum(1 for w in want.values() if w[1] == "yes")
sort = sum(1 for t, w in want.items() if norm(row[t].get("matters")).lower() == w[1])
say(sort == len(want), f"{sort} of {len(want)} rows say correctly whether the change matters ({yes} do, {len(want) - yes} do not)")

quotes = hits = 0
for t, w in want.items():
    for col, version in (("v1_quote", v1), ("v2_quote", v2)):
        q = norm(row[t].get(col)).strip('"').strip()
        if q:
            quotes += 1
            hits += 1 if (t in version and len(q) >= 20 and q in version[t][1]) else 0
expected_quotes = sum((1 if w[2] else 0) + (1 if w[3] else 0) for w in want.values())
say(quotes == expected_quotes and hits == quotes, f"{hits} of {expected_quotes} quotes are found word for word in the version and clause they name")

changed = [t for t, w in want.items() if w[0] == "changed"]
def shows(t):
    q1, q2 = norm(row[t].get("v1_quote")), norm(row[t].get("v2_quote"))
    if not q1 or not q2 or q1 == q2:
        return False
    a, b = words(q1, v1), words(q2, v2)
    if want[t][1] == "no":
        return a == b
    gone = Counter(words(v1[t][1], v1)) - Counter(words(v2[t][1], v2))
    new = Counter(words(v2[t][1], v2)) - Counter(words(v1[t][1], v1))
    return any(x in gone for x in a) or any(x in new for x in b)
shown = sum(1 for t in changed if shows(t))
say(shown == len(changed), f"{shown} of {len(changed)} changed clauses quote the sentence that holds the difference, from both versions")

summary = (root / "output/summary.md").read_text() if (root / "output/summary.md").exists() else ""
named = sum(1 for t, w in want.items() if w[1] == "yes" and t in summary)
counted = any(re.search(r"(?<![\d.,$])" + str(yes) + r"(?![\d%]|[.,]\d)", ln) and "matter" in ln.lower() for ln in summary.splitlines())
# Every figure of two or more digits in the summary must be in one of the two versions or be a count of the rows.
NUM = r"(?<![\w.-])\d(?:[\d,]*\d)?(?:\.\d+)?(?![\w-])"
both_versions = (root / "input/agreement_v1.md").read_text() + " " + (root / "input/agreement_v2.md").read_text()
known = {x.replace(",", "") for x in re.findall(r"\d[\d,]*(?:\.\d+)?", both_versions)} | {str(yes), str(len(want)), str(len(want) - yes)}
used = [x for x in re.findall(NUM, summary) if len(x) >= 2]
real = sum(1 for x in used if x.replace(",", "") in known)
say(named == yes and counted and real == len(used),
    f"summary.md gives the number of changes that matter ({yes}) and names {named} of those {yes} clauses, with {real} of {len(used)} figures in it found in one of the two versions")

first = next((ln.strip() for ln in summary.splitlines() if ln.strip()), "")
say(first == "First pass for a person to decide. Not legal advice.", "summary.md opens by saying it is a first pass for a person to decide and not legal advice")
sys.exit(0 if ok else 1)

agreement_v1.md: sample data written by Atris. Fingerprint e9f29ec61dde.

agreement_v2.md: sample data written by Atris. Fingerprint e8de8ee3c218.

changes.csv: written by the agent. Fingerprint 6f2980e3ea6d.

summary.md: written by the agent. Fingerprint abe3dfe13a03.


More contracts and compliance work, and every other desk job

For agentsGitHub
What is AtrisBlogApp StorePricingPrivacyTerms