Atris

Build a renewal calendar for vendor contracts.
Done by an agent. Checked twice.

The last day to give notice on every vendor contract, sorted by date, so nothing renews by accident.

Have Atris do this for you›

1

Real files in

  • as_of.txt
    The date to treat as today. 1 lines, 11 bytes.
  • vendor_contracts.csv
    Summaries of 32 vendor contracts: start date, term, renewal terms, notice days and annual value. Two are entered twice under different spellings, three have a field missing, one date and one amount are typed in a different style. 33 lines, 3 KB.

Sample data written by Atris. Not a real company.

2

Three steps

  1. 1.Read the summaries and clean them
  2. 2.Work out the dates
  3. 3.Write the calendar and the summary

Claude Sonnet 5.5, 49 seconds. No web. It never saw the check.

3

Checked twice

  • ✓Passed: 32 of 32 contracts appear once in calendar.csv and 32 of 32 carry the vendor and annual value from the summaries
  • ✓Passed: 32 of 32 statuses equal the status worked out from the summaries
  • ✓Passed: 27 of 27 current term end dates equal the date worked out from start date and term
  • ✓Passed: 22 of 22 notice deadlines and days left equal the recomputed values, weekends moved to Friday, earliest first
  • ✓Passed: 6 of 6 notes are right: 4 missed contracts give the date the renewed term ends and 2 duplicates name the contract kept
  • ✓Passed: summary.md states the annual value up for a decision now (56,210) and the annual value locked in by a missed deadline (28,900), with 17 of 17 figures in it found in the summaries or worked out from them
  • ✓Passed: summary.md names 17 of 17 contracts that need action or repair and opens by saying it is a first pass 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 1 to 11 of calendar.csv, copied from the file.
contract_id,vendor,term_end,notice_deadline,days_left,status,annual_value,note
VC-126,Lindgren Uniforms,2027-01-19,2026-10-21,-41,missed,7300,"Notice date has passed, so the contract will renew and the renewed term will end 2028-01-19."
VC-120,Northmoor Fleet,2026-12-01,2026-10-30,-32,missed,11040,"Notice date has passed, so the contract will renew and the renewed term will end 2027-12-01."
VC-105,Castellan Waste,2026-12-15,2026-11-13,-18,missed,4680,"Notice date has passed, so the contract will renew and the renewed term will end 2027-12-15."
VC-110,Quillon Security,2027-01-29,2026-11-30,-1,missed,5880,"Notice date has passed, so the contract will renew and the renewed term will end 2028-01-29."
VC-102,Marlow & Finch Payroll,2026-12-31,2026-12-01,0,act_now,21600,Current term ends 2026-12-31; give notice by 2026-12-01.
VC-111,Fennimore Hosting,2026-12-04,2026-12-02,1,act_now,2340,Current term ends 2026-12-04; give notice by 2026-12-02.
VC-123,Zennor Translation,2026-12-22,2026-12-08,7,act_now,2750,Current term ends 2026-12-22; give notice by 2026-12-08.
VC-121,Pellham Leasing,2027-02-09,2026-12-11,10,act_now,6720,Current term ends 2027-02-09; give notice by 2026-12-11.
VC-106,Halvorsen Print Co,2027-01-18,2026-12-18,17,act_now,8400,Current term ends 2027-01-18; give notice by 2026-12-18.
VC-116,Estwick Cloud,2027-03-31,2026-12-31,30,act_now,14400,Current term ends 2027-03-31; give notice by 2026-12-31.

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 2 of 2 on 1 December 2026. The agent took 49 seconds. Run 1 passed both checks and the job was run again later. 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

  • Recomputed all 22 auto-renewing dates by hand. Example: VC-126 Lindgren starts 2024-01-20 and has rolled forward to a term ending 2027-01-19; minus 90 days gives 2026-10-21, a Wednesday, so days_left is -41 and status is missed. The renewed term would end 2028-01-19, which matches the note.
  • Weekend fixes: VC-105's deadline falls on Sunday 2026-11-15 and moves to Friday 2026-11-13 (-18 days). VC-124's falls on Sunday 2027-01-10 and moves to Friday 2027-01-08 (38 days). VC-106's falls on Saturday 2026-12-19 and moves to Friday 2026-12-18 (17 days). VC-120's falls on Sunday 2026-11-01 and moves to Friday 2026-10-30 (-32 days).
  • Duplicates and missing information: VC-113 is a duplicate of VC-106 (same first word 'Halvorsen', same service, start date and value 8400). VC-128 is a duplicate of VC-103 ('Pinecrest', 15600). Brambleton VC-104 and VC-127 are correctly kept apart because their services and values differ. VC-107 is missing notice_days, VC-117 is missing start_date and VC-125 has 'TBD' as its initial term.
  • Summary totals: act_now is 21600+2340+2750+6720+8400+14400 = 56210 and missed is 7300+11040+4680+5880 = 28900. Both match calendar.csv. The status counts (4/6/4/8/3/2/3/2) add up to the 32 rows, and each contract appears once.

What this run does not show

  • The dates come from one line summaries of each contract, so nothing here proves what a signed contract says.
  • Run 1 passed and run 2 is a fresh run under a stricter check that also tests copied values and summary figures.
  • The vendor list is a sample and the weekend rule takes no account of public holidays.

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
# Build a renewal calendar for vendor contracts

function: legal
for: the contracts or operations lead who decides which vendor contracts to keep, renegotiate or cancel
goal: Every vendor contract has its current term end and the last day to give notice, so no contract renews by accident.

## 1. Read the summaries and clean them
Read input/vendor_contracts.csv and take today's date from input/as_of.txt. Dates are written year,
month, day. A date typed as month/day/year means the same day. Ignore capital letters in the renewal
column and ignore currency signs and commas in annual_value. Before any date work, set aside two
kinds of row:
- `duplicate`: two rows are the same contract when service, start_date and annual_value are equal and
  the vendor names start with the same word, ignoring capital letters. Keep the lower contract_id.
  Mark the other one `duplicate`.
- `needs_info`: start_date or initial_term_months is missing or not a number, or renewal is `auto` and
  renewal_term_months or notice_days is missing. Do not guess the missing value.

## 2. Work out the dates
For every other contract:
- A term of N months that starts on a date ends on the day before the same day of the month N months
  later. A 12 month term starting 2025-03-15 ends 2026-03-14.
- The first term is the initial term. When renewal is `auto` and a term has ended before today, the
  contract has already renewed: add renewal terms one at a time until the term end is today or later.
  That is the current term end. Contracts with renewal `none` or `mutual` never roll forward.
- For `auto` contracts the notice deadline is the current term end minus notice_days. If that day is a
  Saturday or Sunday, use the Friday before. days_left is the notice deadline minus today.
Then give each contract one status:
- `auto`: `missed` when days_left is below 0, `act_now` for 0 to 30, `upcoming` for 31 to 90 and
  `later` above 90.
- `none` or `mutual`: `expired` when the term end is before today, otherwise `ends`. These have no
  notice deadline and no days_left.

## 3. Write the calendar and the summary
Write output/calendar.csv with columns contract_id,vendor,term_end,notice_deadline,days_left,status,annual_value,note.
Dates as year-month-day. annual_value as a plain number. Leave term_end, notice_deadline and days_left
empty for `duplicate` and `needs_info`. Put the contracts that have a notice deadline first, earliest
deadline first, then the rest by contract_id. note is one plain sentence with any date written
year-month-day: for `missed`, the date the renewed term will end; for `duplicate`, the contract_id that was kept; for `needs_info`, the field
that is missing.
Write output/summary.md for the lead. The first line must read exactly:
First pass for a person to decide. Not legal advice.
Then say that the dates come from the summaries and the signed contract should be read before notice
is sent. Then the number of contracts with each status. Then the `act_now` contracts with deadline
and annual value and their total annual value. Then the `missed` contracts and their total annual
value. Then every `needs_info`, `duplicate` and `expired` contract by contract_id with the reason.

## Done looks like
- Every contract in the file appears once in calendar.csv.
- Every date can be worked out again from the summaries and the rules above.
- The totals in summary.md equal the sums in calendar.csv.
input/as_of.txt · 1 lines, 11 bytes
2026-12-01
input/vendor_contracts.csv · 33 lines, 3 KB
contract_id,vendor,service,start_date,initial_term_months,renewal,renewal_term_months,notice_days,annual_value,owner
VC-101,Orrin Data Systems,Network support,2021-06-15,12,auto,12,90,31200,IT
VC-102,Marlow & Finch Payroll,Payroll service,2024-01-01,12,auto,12,30,21600,Finance
VC-103,Pinecrest Telecom,Mobile plan,2024-12-10,36,none,,,15600,IT
VC-104,Brambleton Software,Practice management software,2026-02-16,12,auto,12,45,38500,IT
VC-105,Castellan Waste,Waste collection,2023-12-16,12,auto,12,30,4680,Facilities
VC-106,Halvorsen Print Co,Managed printers,2025-01-19,12,auto,12,30,8400,Office
VC-107,Calloway Records Storage,Offsite file storage,2025-05-12,12,auto,12,,5400,Legal
VC-108,Wexcombe Analytics,Reporting dashboards,9/22/2025,24,auto,12,90,17500,Finance
VC-109,Holloway Signs,Sign maintenance,2025-11-01,12,none,,,2200,Facilities
VC-110,Quillon Security,Alarm monitoring,2026-01-30,12,auto,12,60,5880,Facilities
VC-111,Fennimore Hosting,Website hosting,2025-08-05,12,auto,1,2,2340,Marketing
VC-112,Dovecote Cleaning,Office cleaning,2026-04-01,12,auto,12,30,26400,Facilities
VC-113,HALVORSEN PRINT COMPANY,Managed printers,2025-01-19,12,auto,12,30,8400,Office
VC-114,Garnet Ridge Telecom,Phone lines,2025-03-01,36,auto,12,120,"$18,000",IT
VC-115,Idris & Vane Architects,Space planning retainer,2024-07-01,24,mutual,12,,30000,Facilities
VC-116,Estwick Cloud,Backup storage,2025-04-01,12,auto,12,90,14400,IT
VC-117,Merriweather Pest Control,Pest control,,12,auto,12,30,1560,Facilities
VC-118,Kelsall Legal Research,Research database,2026-09-01,12,auto,12,60,12800,Legal
VC-119,Sable Harbor Insurance Brokers,Broker services,2023-05-02,12,auto,12,60,9000,Finance
VC-120,Northmoor Fleet,Vehicle tracking,2024-12-02,12,auto,12,30,11040,Operations
VC-121,Pellham Leasing,Copier lease,2023-02-10,36,auto,12,60,6720,Office
VC-122,Yarrow Consulting,Benefits review,2025-12-02,12,none,,,24000,People
VC-123,Zennor Translation,Document translation,2025-12-23,12,auto,12,14,2750,Legal
VC-124,Tidewell Water,Water coolers,2025-03-12,12,Auto,12,60,1920,Office
VC-125,Stroud Elevator,Lift maintenance,2024-09-03,TBD,auto,12,60,8900,Facilities
VC-126,Lindgren Uniforms,Uniform rental,2024-01-20,12,auto,12,90,7300,Operations
VC-127,Brambleton Software,Patient text reminders,2026-02-16,12,auto,12,45,4200,IT
VC-128,"Pinecrest Telecom, Inc.",Mobile plan,2024-12-10,36,none,,,15600,IT
VC-129,Ashgrove Training,Compliance courses,2025-12-01,12,auto,12,60,6500,People
VC-130,Ravensworth Couriers,Courier account,2025-10-08,6,auto,6,30,3900,Operations
VC-131,Thornbury Catering,Staff lunches,2026-04-20,12,mutual,12,,19800,People
VC-132,Umberfield Coffee,Coffee machines,2026-07-01,12,auto,12,30,3120,Office
output/calendar.csv · written by the agent, 33 lines
contract_id,vendor,term_end,notice_deadline,days_left,status,annual_value,note
VC-126,Lindgren Uniforms,2027-01-19,2026-10-21,-41,missed,7300,"Notice date has passed, so the contract will renew and the renewed term will end 2028-01-19."
VC-120,Northmoor Fleet,2026-12-01,2026-10-30,-32,missed,11040,"Notice date has passed, so the contract will renew and the renewed term will end 2027-12-01."
VC-105,Castellan Waste,2026-12-15,2026-11-13,-18,missed,4680,"Notice date has passed, so the contract will renew and the renewed term will end 2027-12-15."
VC-110,Quillon Security,2027-01-29,2026-11-30,-1,missed,5880,"Notice date has passed, so the contract will renew and the renewed term will end 2028-01-29."
VC-102,Marlow & Finch Payroll,2026-12-31,2026-12-01,0,act_now,21600,Current term ends 2026-12-31; give notice by 2026-12-01.
VC-111,Fennimore Hosting,2026-12-04,2026-12-02,1,act_now,2340,Current term ends 2026-12-04; give notice by 2026-12-02.
VC-123,Zennor Translation,2026-12-22,2026-12-08,7,act_now,2750,Current term ends 2026-12-22; give notice by 2026-12-08.
VC-121,Pellham Leasing,2027-02-09,2026-12-11,10,act_now,6720,Current term ends 2027-02-09; give notice by 2026-12-11.
VC-106,Halvorsen Print Co,2027-01-18,2026-12-18,17,act_now,8400,Current term ends 2027-01-18; give notice by 2026-12-18.
VC-116,Estwick Cloud,2027-03-31,2026-12-31,30,act_now,14400,Current term ends 2027-03-31; give notice by 2026-12-31.
VC-104,Brambleton Software,2027-02-15,2027-01-01,31,upcoming,38500,Current term ends 2027-02-15; give notice by 2027-01-01.
VC-127,Brambleton Software,2027-02-15,2027-01-01,31,upcoming,4200,Current term ends 2027-02-15; give notice by 2027-01-01.
VC-124,Tidewell Water,2027-03-11,2027-01-08,38,upcoming,1920,Current term ends 2027-03-11; give notice by 2027-01-08.
VC-112,Dovecote Cleaning,2027-03-31,2027-03-01,90,upcoming,26400,Current term ends 2027-03-31; give notice by 2027-03-01.
VC-119,Sable Harbor Insurance Brokers,2027-05-01,2027-03-02,91,later,9000,Current term ends 2027-05-01; give notice by 2027-03-02.
VC-130,Ravensworth Couriers,2027-04-07,2027-03-08,97,later,3900,Current term ends 2027-04-07; give notice by 2027-03-08.
VC-101,Orrin Data Systems,2027-06-14,2027-03-16,105,later,31200,Current term ends 2027-06-14; give notice by 2027-03-16.
VC-132,Umberfield Coffee,2027-06-30,2027-05-31,181,later,3120,Current term ends 2027-06-30; give notice by 2027-05-31.
VC-108,Wexcombe Analytics,2027-09-21,2027-06-23,204,later,17500,Current term ends 2027-09-21; give notice by 2027-06-23.
VC-118,Kelsall Legal Research,2027-08-31,2027-07-02,213,later,12800,Current term ends 2027-08-31; give notice by 2027-07-02.
VC-129,Ashgrove Training,2027-11-30,2027-10-01,304,later,6500,Current term ends 2027-11-30; give notice by 2027-10-01.
VC-114,Garnet Ridge Telecom,2028-02-29,2027-11-01,335,later,18000,Current term ends 2028-02-29; give notice by 2027-11-01.
VC-103,Pinecrest Telecom,2027-12-09,,,ends,15600,Term ends 2027-12-09 and the contract does not renew.
VC-107,Calloway Records Storage,,,,needs_info,5400,Missing or not a number: notice_days.
VC-109,Holloway Signs,2026-10-31,,,expired,2200,Term ended 2026-10-31 and the contract does not renew.
VC-113,HALVORSEN PRINT COMPANY,,,,duplicate,8400,"Same contract as VC-106, which is kept."
VC-115,Idris & Vane Architects,2026-06-30,,,expired,30000,Term ended 2026-06-30 and was not rolled forward because renewal is mutual.
VC-117,Merriweather Pest Control,,,,needs_info,1560,Missing or not a number: start_date.
VC-122,Yarrow Consulting,2026-12-01,,,ends,24000,Term ends 2026-12-01 and the contract does not renew.
VC-125,Stroud Elevator,,,,needs_info,8900,Missing or not a number: initial_term_months.
VC-128,"Pinecrest Telecom, Inc.",,,,duplicate,15600,"Same contract as VC-103, which is kept."
VC-131,Thornbury Catering,2027-04-19,,,ends,19800,Term ends 2027-04-19; renewal is by mutual agreement.
output/summary.md · written by the agent, 44 lines
First pass for a person to decide. Not legal advice.

The dates come from the contract summaries in the file, not the signed contracts. Read the signed contract before any notice is sent.

As of 2026-12-01. 32 contracts in total.

## Contracts by status

- missed: 4
- act_now: 6
- upcoming: 4
- later: 8
- ends: 3
- expired: 2
- needs_info: 3
- duplicate: 2

## act_now (notice deadline within 30 days)

- VC-102 Marlow & Finch Payroll: deadline 2026-12-01 (0 days left), annual value 21600
- VC-111 Fennimore Hosting: deadline 2026-12-02 (1 days left), annual value 2340
- VC-123 Zennor Translation: deadline 2026-12-08 (7 days left), annual value 2750
- VC-121 Pellham Leasing: deadline 2026-12-11 (10 days left), annual value 6720
- VC-106 Halvorsen Print Co: deadline 2026-12-18 (17 days left), annual value 8400
- VC-116 Estwick Cloud: deadline 2026-12-31 (30 days left), annual value 14400
- Total annual value: 56210

## missed (notice deadline already passed)

- VC-126 Lindgren Uniforms: deadline was 2026-10-21; Notice date has passed, so the contract will renew and the renewed term will end 2028-01-19. Annual value 7300
- VC-120 Northmoor Fleet: deadline was 2026-10-30; Notice date has passed, so the contract will renew and the renewed term will end 2027-12-01. Annual value 11040
- VC-105 Castellan Waste: deadline was 2026-11-13; Notice date has passed, so the contract will renew and the renewed term will end 2027-12-15. Annual value 4680
- VC-110 Quillon Security: deadline was 2026-11-30; Notice date has passed, so the contract will renew and the renewed term will end 2028-01-29. Annual value 5880
- Total annual value: 28900

## needs_info, duplicate and expired

- VC-107 (needs_info): Missing or not a number: notice_days.
- VC-117 (needs_info): Missing or not a number: start_date.
- VC-125 (needs_info): Missing or not a number: initial_term_months.
- VC-113 (duplicate): Same contract as VC-106, which is kept.
- VC-128 (duplicate): Same contract as VC-103, which is kept.
- VC-109 (expired): Term ended 2026-10-31 and the contract does not renew.
- VC-115 (expired): Term ended 2026-06-30 and was not rolled forward because renewal is mutual.
check.py · the check, written before the run
"""Works out every term end, notice deadline and status again from the contract summaries, then compares."""
import csv, re, sys
from datetime import date, timedelta
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 day(s):
    s = (s or "").strip()
    m = re.fullmatch(r"(\d{4})-(\d{1,2})-(\d{1,2})", s)
    if m:
        return date(int(m.group(1)), int(m.group(2)), int(m.group(3)))
    m = re.fullmatch(r"(\d{1,2})/(\d{1,2})/(\d{4})", s)
    return date(int(m.group(3)), int(m.group(1)), int(m.group(2))) if m else None
def whole(s):
    s = (s or "").strip()
    return int(s) if re.fullmatch(r"\d+", s) else None
def money(s):
    s = re.sub(r"[$,\s]", "", s or "")
    return float(s) if re.fullmatch(r"\d+(\.\d+)?", s) else None
def add_months(d, n):
    m = d.month - 1 + n
    return date(d.year + m // 12, m % 12 + 1, d.day)

today = day((root / "input/as_of.txt").read_text())
src = list(csv.DictReader((root / "input/vendor_contracts.csv").open(newline="")))
want, seen = {}, {}
for r in sorted(src, key=lambda r: r["contract_id"]):
    cid, renewal = r["contract_id"], r["renewal"].strip().lower()
    key = (r["service"].strip().lower(), day(r["start_date"]), money(r["annual_value"]), r["vendor"].split()[0].lower().strip(",."))
    start, first, again, notice = day(r["start_date"]), whole(r["initial_term_months"]), whole(r["renewal_term_months"]), whole(r["notice_days"])
    w = {"status": "", "term_end": None, "deadline": None, "left": None, "value": money(r["annual_value"]), "renewed_to": None, "kept": None}
    if key in seen and key[1] is not None:
        w["status"], w["kept"] = "duplicate", seen[key]
    elif start is None or first is None or (renewal == "auto" and (again is None or notice is None)):
        w["status"] = "needs_info"
    else:
        seen[key] = cid
        end = add_months(start, first) - timedelta(days=1)
        if renewal == "auto":
            while end < today:
                end = add_months(end + timedelta(days=1), again) - timedelta(days=1)
            dl = end - timedelta(days=notice)
            dl -= timedelta(days={5: 1, 6: 2}.get(dl.weekday(), 0))
            left = (dl - today).days
            w.update(term_end=end, deadline=dl, left=left,
                     status="missed" if left < 0 else "act_now" if left <= 30 else "upcoming" if left <= 90 else "later",
                     renewed_to=add_months(end + timedelta(days=1), again) - timedelta(days=1))
        else:
            w.update(term_end=end, status="expired" if end < today else "ends")
    want[cid] = w

path = root / "output/calendar.csv"
if not path.exists():
    say(False, "output/calendar.csv was not written"); sys.exit(1)
rows = list(csv.DictReader(path.open(newline="")))
got = {}
for r in rows:
    got.setdefault((r.get("contract_id") or "").strip(), []).append(r)
once = sum(1 for c in want if len(got.get(c, [])) == 1)
row = {c: (got.get(c) or [{}])[0] for c in want}
by_id = {r["contract_id"]: r for r in src}
copied = sum(1 for c, w in want.items() if (row[c].get("vendor") or "").strip() == by_id[c]["vendor"].strip() and money(row[c].get("annual_value")) == w["value"])
say(once == len(want) and set(got) == set(want) and copied == len(want),
    f"{once} of {len(want)} contracts appear once in calendar.csv and {copied} of {len(want)} carry the vendor and annual value from the summaries")

right = sum(1 for c, w in want.items() if (row[c].get("status") or "").strip() == w["status"])
say(right == len(want), f"{right} of {len(want)} statuses equal the status worked out from the summaries")

dated = [c for c, w in want.items() if w["term_end"]]
ends = sum(1 for c in dated if day(row[c].get("term_end")) == want[c]["term_end"])
say(ends == len(dated), f"{ends} of {len(dated)} current term end dates equal the date worked out from start date and term")

timed = [c for c, w in want.items() if w["deadline"]]
def deadline_ok(c):
    try:
        left = int((row[c].get("days_left") or "").strip())
    except ValueError:
        return False
    return day(row[c].get("notice_deadline")) == want[c]["deadline"] and left == want[c]["left"]
dls = sum(1 for c in timed if deadline_ok(c))
listed = [day(r.get("notice_deadline")) for r in rows if (r.get("notice_deadline") or "").strip()]
in_order = listed == sorted(listed, key=lambda d: d or date.min) and all(
    (r.get("notice_deadline") or "").strip() for r in rows[:len(listed)])
say(dls == len(timed) and in_order, f"{dls} of {len(timed)} notice deadlines and days left equal the recomputed values, weekends moved to Friday, earliest first")

fix = [c for c, w in want.items() if w["status"] in ("missed", "duplicate")]
def note_ok(c):
    note = row[c].get("note") or ""
    return (want[c]["renewed_to"].isoformat() in note) if want[c]["status"] == "missed" else (want[c]["kept"] in note)
notes = sum(1 for c in fix if note_ok(c))
missed = [c for c, w in want.items() if w["status"] == "missed"]
say(notes == len(fix), f"{notes} of {len(fix)} notes are right: {len(missed)} missed contracts give the date the renewed term ends and {len(fix) - len(missed)} duplicates name the contract kept")

summary = (root / "output/summary.md").read_text() if (root / "output/summary.md").exists() else ""
nums = {round(float(n.replace(",", "")), 2) for n in re.findall(r"\d[\d,]*(?:\.\d+)?", summary)}
total = lambda st: round(sum(w["value"] for w in want.values() if w["status"] == st), 2)
# Every figure of two or more digits in the summary must be in the summaries or be one this check worked out.
NUM = r"(?<![\w.-])\d(?:[\d,]*\d)?(?:\.\d+)?(?![\w-])"
flat = lambda x: round(float(x.replace(",", "")), 2)
known = {flat(x) for x in re.findall(r"\d[\d,]*(?:\.\d+)?", (root / "input/vendor_contracts.csv").read_text().replace(",", " "))}
known |= {float(len(want)), total("act_now"), total("missed")} | {float(abs(w["left"])) for w in want.values() if w["left"] is not None}
known |= {float(sum(1 for w in want.values() if w["status"] == st)) for st in {w["status"] for w in want.values()}} | {30.0, 90.0}
used = [x for x in re.findall(NUM, re.sub(r"\d{4}-\d{2}-\d{2}", " ", summary)) if len(x) >= 2]
real = sum(1 for x in used if flat(x) in known)
say(total("act_now") in nums and total("missed") in nums and real == len(used),
    f"summary.md states the annual value up for a decision now ({total('act_now'):,.0f}) and the annual value locked in by a missed deadline ({total('missed'):,.0f}), "
    f"with {real} of {len(used)} figures in it found in the summaries or worked out from them")

must = [c for c, w in want.items() if w["status"] in ("act_now", "missed", "needs_info", "duplicate", "expired")]
named = sum(1 for c in must if c in summary)
first = next((ln.strip() for ln in summary.splitlines() if ln.strip()), "")
say(named == len(must) and first == "First pass for a person to decide. Not legal advice.",
    f"summary.md names {named} of {len(must)} contracts that need action or repair and opens by saying it is a first pass and not legal advice")
sys.exit(0 if ok else 1)

as_of.txt: sample data written by Atris. Fingerprint d3346a60677d.

vendor_contracts.csv: sample data written by Atris. Fingerprint a3acf11e3581.

calendar.csv: written by the agent. Fingerprint dd0180af72d8.

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


More contracts and compliance work, and every other desk job

For agentsGitHub
What is AtrisBlogApp StorePricingPrivacyTerms