Check a data room against requests.
Done by an agent. Checked twice.
A status for all 48 diligence requests, with the missing years, drafts, unsigned copies and stale files named.
Real files in
- data_room_index.csv
The seller's data room index: 71 files with folder, file name, the request each file answers, period, version, signature and date.. 72 lines, 6 KB. - request_list.csv
The buyer's due diligence request list for an invented software company: 48 requests with the years needed, whether a final or signed copy is required and how recent the file must be.. 49 lines, 3 KB.
Sample data written by Atris. Not a real company.
Three steps
- 1.Sort the files
- 2.Test each request
- 3.Write the gap list
Claude Sonnet 5.5, 1 min 6 s. No web. It never saw the check.
Checked twice
- Passed: 48 of 48 requests appear exactly once in the gap list
- Passed: 48 of 48 statuses equal the status worked out from the index (26 complete, 9 needs_fix, 5 partial, 8 missing)
- Passed: 48 of 48 requests list exactly the files that answer them (64 files counted)
- Passed: 7 of 7 requests with a missing year name exactly the right years and no other request names one
- Passed: 10 of 10 requests with a draft, unsigned or old file name exactly the right files and no other request names one
- Passed: 7 of 7 files are set aside with the right reason and 0 files are set aside wrongly
- Passed: summary.md gives 4 of 4 status counts correctly
- Passed: 56 of 56 figures in summary.md (counts, statuses, dates, years and folder numbers) agree with the request list and the index
Second review by Claude Opus 5.5: pass.
Then we broke a copy of the output 8 ways on purpose. The check caught 8.
### Corporate - DD-1.7 (missing): Nothing received for this request; send it. - DD-1.3 (needs_fix): DR-004 is dated 2026-03-14, before the required 2026-09-01; send a current copy. - DD-1.5 (needs_fix): DR-008 is unsigned; send the signed copy. ### Tax - DD-3.3 (missing): Nothing received for this request; send it covering FY2025. - DD-3.5 (missing): Nothing received for this request; send it. - DD-3.1 (partial): Send the missing year(s): FY2023. ### Commercial - DD-4.2 (missing): Nothing received for this request; send it. - DD-4.7 (partial): Send the missing year(s): FY2026. - DD-4.4 (needs_fix): DR-035 is unsigned; send the signed copy. DR-036 is draft and unsigned; send the final signed version.
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 made stricter after it. It 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 6 s. Run 1 passed both checks and the job was run again later. Run 2 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
- Status counts recomputed from gap_list.csv: 48 rows = complete 26, needs_fix 9, partial 5, missing 8, matching summary.md exactly
- Every file counted once or set aside: 64 distinct doc_ids in gap_list + 7 in set_aside = 71 index rows, no overlap
- Set-aside rules: DR-024 is an exact duplicate of DR-023; DR-066 is named FY2024 but its period is FY2025 (mislabelled); DR-033/DR-069 have an empty ref and DR-048 (DD-5.9), DR-070 (DD-9.1), DR-071 (DD-1.7x) refs are not on the list; no other file name has a mismatched FY
- Status logic spot-checked: DD-1.3 DR-004 dated 2026-03-14 < 2026-09-01 is needs_fix; DD-3.1 lacks FY2023 (FY2021 file covers nothing) so partial; DD-8.3 lacks FY2025 once DR-066 is set aside so partial; DD-2.2 draft DR-015 is fine because there is no must_be; DD-1.4 newest DR-005 2026-10-20 passes
What this run does not show
- The request list and the index were written for this run with tidy columns, so a real data room will be messier.
- The check works from the index alone and cannot tell whether what is inside a file answers the request.
- The wording of the notes to the seller is read only by 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 8 of 8. The check was made stricter after the first try at this, and the same untouched output was graded again.
Open every file
flow.md · the three steps the agent followed
# Check a data room against requests function: research for: the deal associate who tracks what the seller has and has not sent goal: Every request on the list has a status backed by named files, so the seller gets one exact list of what is still owed. ## 1. Sort the files Read input/request_list.csv (what the buyer asked for) and input/data_room_index.csv (what the seller uploaded). A file answers a request only when its request_ref equals a request_id on the list. Never match by file name or folder. Set a file aside and do not count it anywhere when: - `no_request`: its request_ref is empty or is not a request_id on the list. - `duplicate`: another row has the same file_name, request_ref, period and doc_date. Keep the first copy and set aside the later one. - `mislabelled`: its file name carries a fiscal year (FY and four digits) that is not in its period column. ## 2. Test each request Work through all the requests with python3. For each request, take the files that answer it and were not set aside. - Years: when years_needed is filled, each year needs a file whose period includes it. One file can cover several years. A year with no file is a missing year. That holds for a request with no files at all too. A file for a year nobody asked for is still listed but covers nothing. - must_be `final`: a file with version `draft` is a problem file. - must_be `signed`: a file with version `draft` or signed `no` is a problem file. Signed `na` means the file is not the kind that gets signed (a schedule or a spreadsheet) and is fine. - not_older_than: test only the newest file for the request, or the newest for each needed year. It is a problem file when its doc_date is before that date. Older copies are ignored. Then give one status, the first that fits: 1. `missing`: no file answers the request. 2. `partial`: at least one needed year has no file. 3. `needs_fix`: there is at least one problem file. 4. `complete`: none of the above. ## 3. Write the gap list Write output/gap_list.csv with columns request_id,status,docs,missing_years,problem_docs,note, one row per request in list order. docs is every doc_id that answers the request and was not set aside. missing_years and problem_docs hold what step 2 found. Join several values with a semicolon and leave a column empty when there is nothing to put in it. note says in plain words what the seller must send or fix. Leave it empty for `complete`. Write output/set_aside.csv with columns doc_id,reason,note, one row per file set aside. In note, say where the file most likely belongs if the index gives a clue, as a guess for a person to confirm. Write output/summary.md with the four counts in the form `complete: 12`, `needs_fix: 3`, `partial: 2`, `missing: 1`, the number of files set aside and a short list for the seller grouped by area, most serious first. Count from the finished files, not from memory. ## Done looks like - Every request has exactly one status and every file is either counted once or set aside. - No request is called complete on the strength of a draft, an unsigned copy or an old file. - The counts in summary.md equal the rows in gap_list.csv.
input/data_room_index.csv · 72 lines, 6 KB
doc_id,folder,file_name,request_ref,period,version,signed,doc_date DR-001,01 Corporate,Certificate_of_Incorporation_2014.pdf,DD-1.1,,final,na,2014-03-11 DR-002,01 Corporate,Certificate_of_Amendment_2021.pdf,DD-1.1,,final,na,2021-06-02 DR-003,01 Corporate,Bylaws_Amended_and_Restated.pdf,DD-1.2,,final,na,2021-06-02 DR-004,01 Corporate,Good_Standing_Certificate.pdf,DD-1.3,,final,na,2026-03-14 DR-005,01 Corporate,Quillmere_Cap_Table_Oct2026.xlsx,DD-1.4,,final,na,2026-10-20 DR-006,01 Corporate,Quillmere_Cap_Table_Jan2026.xlsx,DD-1.4,,final,na,2026-01-15 DR-007,01 Corporate,Board_Minutes_FY2024.pdf,DD-1.5,FY2024,final,yes,2025-01-28 DR-008,01 Corporate,Board_Minutes_FY2025_unsigned.pdf,DD-1.5,FY2025,final,no,2026-01-30 DR-009,01 Corporate,Shareholders_Agreement_Series_A.pdf,DD-1.6,,final,yes,2021-06-02 DR-010,01 Corporate,Investor_Rights_Agreement.pdf,DD-1.6,,final,yes,2021-06-02 DR-011,02 Financial,Audited_Financial_Statements_FY2023.pdf,DD-2.1,FY2023,final,yes,2024-04-18 DR-012,02 Financial,Audited_Financial_Statements_FY2024.pdf,DD-2.1,FY2024,final,yes,2025-04-22 DR-013,02 Financial,Financial_Statements_FY2025_DRAFT.pdf,DD-2.1,FY2025,draft,no,2026-04-09 DR-014,02 Financial,Management_Accounts_FY2025.xlsx,DD-2.2,FY2025,final,na,2026-01-20 DR-015,02 Financial,Management_Accounts_FY2026_YTD_Sep.xlsx,DD-2.2,FY2026,draft,na,2026-10-12 DR-016,02 Financial,Budget_FY2026_Board_Approved.xlsx,DD-2.3,FY2026,final,na,2025-12-05 DR-017,02 Financial,AR_Aging_2026-10-31.xlsx,DD-2.4,,final,na,2026-10-31 DR-018,02 Financial,AP_Aging_2026-06-30.xlsx,DD-2.5,,final,na,2026-06-30 DR-019,02 Financial,Term_Loan_Agreement_Calderwick_Bank.pdf,DD-2.6,,final,yes,2023-09-15 DR-020,02 Financial,Debt_Schedule.xlsx,DD-2.6,,final,na,2026-10-31 DR-021,02 Financial,Bank_Statements_Jan2025_Sep2026.pdf,DD-2.7,FY2025;FY2026,final,na,2026-10-05 DR-022,02 Financial,Revenue_by_Customer_FY2024.xlsx,DD-2.8,FY2024,final,na,2025-02-10 DR-023,02 Financial,Revenue_by_Customer_FY2025.xlsx,DD-2.8,FY2025,final,na,2026-02-12 DR-024,02 Financial,Revenue_by_Customer_FY2025.xlsx,DD-2.8,FY2025,final,na,2026-02-12 DR-025,03 Tax,Federal_Tax_Return_FY2021.pdf,DD-3.1,FY2021,final,yes,2022-09-14 DR-026,03 Tax,Federal_Tax_Return_FY2022.pdf,DD-3.1,FY2022,final,yes,2023-09-12 DR-027,03 Tax,Federal_Tax_Return_FY2024.pdf,DD-3.1,FY2024,final,yes,2025-09-10 DR-028,03 Tax,State_Tax_Return_FY2023.pdf,DD-3.2,FY2023,final,yes,2024-09-16 DR-029,03 Tax,State_Tax_Return_FY2024.pdf,DD-3.2,FY2024,final,yes,2025-09-15 DR-030,03 Tax,Tax_Authority_Notice_2025-03.pdf,DD-3.4,,final,na,2025-03-07 DR-031,03 Tax,Reply_to_Tax_Notice_2025-04.pdf,DD-3.4,,final,yes,2025-04-02 DR-032,04 Commercial,Master_Services_Agreement_Template_v7.docx,DD-4.1,,final,na,2026-02-01 DR-033,04 Commercial,Customer_Contract_Summary.xlsx,,,final,na,2026-10-14 DR-034,04 Commercial,Customer_List_FY2025.xlsx,DD-4.3,FY2025,final,na,2026-02-12 DR-035,04 Commercial,Supplier_Agreement_Brennick_Hosting.pdf,DD-4.4,,final,no,2024-05-20 DR-036,04 Commercial,Supplier_Agreement_Tessaly_Data.docx,DD-4.4,,draft,no,2025-11-03 DR-037,04 Commercial,Price_List_2026.pdf,DD-4.5,,final,na,2026-02-01 DR-038,04 Commercial,Open_Opportunities_2026-10-31.xlsx,DD-4.6,,final,na,2026-10-31 DR-039,04 Commercial,Complaints_Log_FY2025.xlsx,DD-4.7,FY2025,final,na,2026-01-08 DR-040,05 People,Employee_Census_2026-10-15.xlsx,DD-5.1,,final,na,2026-10-15 DR-041,05 People,Employment_Agreement_Chief_Executive.pdf,DD-5.2,,final,yes,2021-06-02 DR-042,05 People,Employment_Agreement_Chief_Financial_Officer.pdf,DD-5.2,,final,yes,2023-02-13 DR-043,05 People,Employment_Agreement_Chief_Technology_Officer.pdf,DD-5.2,,final,no,2024-08-01 DR-044,05 People,Employee_Handbook_2026_DRAFT.docx,DD-5.3,,draft,na,2026-08-19 DR-045,05 People,Stock_Option_Plan_2021.pdf,DD-5.4,,final,yes,2021-06-02 DR-046,05 People,Option_Grant_Ledger.xlsx,DD-5.4,,final,na,2026-10-20 DR-047,05 People,Contractor_Agreement_Design_Studio.pdf,DD-5.6,,final,yes,2025-03-03 DR-048,05 People,Contractor_Agreement_QA_Testing.pdf,DD-5.9,,final,yes,2025-07-21 DR-049,06 Technology and IP,Patent_and_Trademark_Schedule.xlsx,DD-6.1,,final,na,2026-09-30 DR-050,06 Technology and IP,Invention_Assignment_Agreements_All_Staff.pdf,DD-6.2,,final,yes,2026-05-11 DR-051,06 Technology and IP,Security_Audit_Report_FY2025.pdf,DD-6.4,FY2025,final,na,2025-11-18 DR-052,06 Technology and IP,Security_Audit_FY2026_Preliminary_Findings.pdf,DD-6.4,FY2026,draft,na,2026-10-27 DR-053,06 Technology and IP,Inbound_License_Mapping_Library.pdf,DD-6.5,,final,yes,2022-10-10 DR-054,06 Technology and IP,Inbound_License_Charting_Toolkit.pdf,DD-6.5,,final,yes,2024-01-22 DR-055,06 Technology and IP,Data_Protection_Policy_v4.pdf,DD-6.6,,final,na,2026-03-01 DR-056,06 Technology and IP,Quilmere_Data_Protection_Policy_v3.pdf,DD-6.6,,final,na,2025-03-01 DR-057,07 Legal,Business_Licenses_and_Permits.pdf,DD-7.2,,final,na,2026-01-12 DR-058,07 Legal,Regulator_Letter_2025-06.pdf,DD-7.3,FY2025,final,na,2025-06-19 DR-059,07 Legal,Regulator_Reply_2026-02.pdf,DD-7.3,FY2026,final,yes,2026-02-03 DR-060,07 Legal,Settlement_Agreement_Former_Reseller_FY2024.pdf,DD-7.4,FY2024,final,yes,2024-11-08 DR-061,07 Legal,Settlement_Agreement_Staff_Claim_FY2026.pdf,DD-7.4,FY2026,final,no,2026-06-17 DR-062,08 Property and insurance,Office_Lease_Harbor_Street.pdf,DD-8.1,,final,yes,2022-04-01 DR-063,08 Property and insurance,Office_Lease_First_Amendment.pdf,DD-8.1,,final,yes,2025-04-01 DR-064,08 Property and insurance,Insurance_Policy_Binder_FY2026_DRAFT.pdf,DD-8.2,FY2026,draft,na,2026-01-09 DR-065,08 Property and insurance,Insurance_Claims_FY2024.xlsx,DD-8.3,FY2024,final,na,2025-01-14 DR-066,08 Property and insurance,Insurance_Claims_FY2024.xlsx,DD-8.3,FY2025,final,na,2026-01-13 DR-067,08 Property and insurance,Insurance_Claims_FY2026_YTD.xlsx,DD-8.3,FY2026,final,na,2026-10-06 DR-068,08 Property and insurance,Fixed_Asset_Register_2026-09-30.xlsx,DD-8.4,,final,na,2026-09-30 DR-069,00 Unsorted,Scan_0042.pdf,,,final,na,2026-10-02 DR-070,08 Property and insurance,Warehouse_Sublease_Offer.pdf,DD-9.1,,draft,no,2026-07-30 DR-071,01 Corporate,Quillmere_Company_Overview_Deck.pdf,DD-1.7x,,final,na,2026-09-01
input/request_list.csv · 49 lines, 3 KB
request_id,area,request,years_needed,must_be,not_older_than DD-1.1,Corporate,Certificate of incorporation and all amendments,,final, DD-1.2,Corporate,Current bylaws,,final, DD-1.3,Corporate,Certificate of good standing,,,2026-09-01 DD-1.4,Corporate,Capitalization table,,,2026-10-01 DD-1.5,Corporate,Minutes of board meetings,FY2024;FY2025,signed, DD-1.6,Corporate,Shareholder agreements,,signed, DD-1.7,Corporate,Chart of legal entities and ownership,,, DD-2.1,Financial,Audited financial statements,FY2023;FY2024;FY2025,final, DD-2.2,Financial,Monthly management accounts,FY2025;FY2026,, DD-2.3,Financial,Annual budget and forecast,FY2026;FY2027,, DD-2.4,Financial,Accounts receivable aging,,,2026-10-01 DD-2.5,Financial,Accounts payable aging,,,2026-10-01 DD-2.6,Financial,Loan agreements and schedule of debt,,signed, DD-2.7,Financial,Bank statements for all accounts,FY2025;FY2026,, DD-2.8,Financial,Revenue by customer,FY2024;FY2025,, DD-3.1,Tax,Federal income tax returns,FY2022;FY2023;FY2024,final, DD-3.2,Tax,State income tax returns,FY2023;FY2024,final, DD-3.3,Tax,Sales tax filings,FY2025,, DD-3.4,Tax,Letters to and from tax authorities,,, DD-3.5,Tax,Transfer pricing study,,final, DD-4.1,Commercial,Standard customer contract template,,final, DD-4.2,Commercial,Signed contracts with the five largest customers,,signed, DD-4.3,Commercial,Customer list with annual revenue,FY2025,, DD-4.4,Commercial,"Supplier contracts above 50,000 a year",,signed, DD-4.5,Commercial,Current price list,,,2026-01-01 DD-4.6,Commercial,Report of open sales opportunities,,,2026-10-01 DD-4.7,Commercial,Customer complaints log,FY2025;FY2026,, DD-5.1,People,"Employee census with role, start date and pay",,,2026-10-01 DD-5.2,People,Employment agreements for officers,,signed, DD-5.3,People,Employee handbook,,final, DD-5.4,People,Stock option plan and grant ledger,,final, DD-5.5,People,Benefit plan documents,FY2026,, DD-5.6,People,Contractor agreements,,signed, DD-6.1,Technology and IP,Schedule of patents and trademarks,,, DD-6.2,Technology and IP,Invention assignment agreements,,signed, DD-6.3,Technology and IP,Inventory of open source software in the product,,, DD-6.4,Technology and IP,Independent security audit report,FY2025;FY2026,final, DD-6.5,Technology and IP,Inbound software license agreements,,, DD-6.6,Technology and IP,Data protection policy,,final, DD-7.1,Legal and compliance,Schedule of pending and threatened litigation,,,2026-10-01 DD-7.2,Legal and compliance,Material permits and licenses,,, DD-7.3,Legal and compliance,Letters to and from regulators,FY2025;FY2026,, DD-7.4,Legal and compliance,Settlement agreements,FY2024;FY2025;FY2026,signed, DD-8.1,Property and insurance,Office lease agreements,,signed, DD-8.2,Property and insurance,Insurance policies in force,FY2026,final, DD-8.3,Property and insurance,Insurance claims history,FY2024;FY2025;FY2026,, DD-8.4,Property and insurance,Fixed asset register,,,2026-07-01 DD-8.5,Property and insurance,Equipment lease agreements,,signed,
output/gap_list.csv · written by the agent, 49 lines
request_id,status,docs,missing_years,problem_docs,note DD-1.1,complete,DR-001;DR-002,,, DD-1.2,complete,DR-003,,, DD-1.3,needs_fix,DR-004,,DR-004,"DR-004 is dated 2026-03-14, before the required 2026-09-01; send a current copy." DD-1.4,complete,DR-005;DR-006,,, DD-1.5,needs_fix,DR-007;DR-008,,DR-008,DR-008 is unsigned; send the signed copy. DD-1.6,complete,DR-009;DR-010,,, DD-1.7,missing,,,,Nothing received for this request; send it. DD-2.1,needs_fix,DR-011;DR-012;DR-013,,DR-013,DR-013 is draft; send the final version. DD-2.2,complete,DR-014;DR-015,,, DD-2.3,partial,DR-016,FY2027,,Send the missing year(s): FY2027. DD-2.4,complete,DR-017,,, DD-2.5,needs_fix,DR-018,,DR-018,"DR-018 is dated 2026-06-30, before the required 2026-10-01; send a current copy." DD-2.6,complete,DR-019;DR-020,,, DD-2.7,complete,DR-021,,, DD-2.8,complete,DR-022;DR-023,,, DD-3.1,partial,DR-025;DR-026;DR-027,FY2023,,Send the missing year(s): FY2023. DD-3.2,complete,DR-028;DR-029,,, DD-3.3,missing,,FY2025,,Nothing received for this request; send it covering FY2025. DD-3.4,complete,DR-030;DR-031,,, DD-3.5,missing,,,,Nothing received for this request; send it. DD-4.1,complete,DR-032,,, DD-4.2,missing,,,,Nothing received for this request; send it. DD-4.3,complete,DR-034,,, DD-4.4,needs_fix,DR-035;DR-036,,DR-035;DR-036,DR-035 is unsigned; send the signed copy. DR-036 is draft and unsigned; send the final signed version. DD-4.5,complete,DR-037,,, DD-4.6,complete,DR-038,,, DD-4.7,partial,DR-039,FY2026,,Send the missing year(s): FY2026. DD-5.1,complete,DR-040,,, DD-5.2,needs_fix,DR-041;DR-042;DR-043,,DR-043,DR-043 is unsigned; send the signed copy. DD-5.3,needs_fix,DR-044,,DR-044,DR-044 is draft; send the final version. DD-5.4,complete,DR-045;DR-046,,, DD-5.5,missing,,FY2026,,Nothing received for this request; send it covering FY2026. DD-5.6,complete,DR-047,,, DD-6.1,complete,DR-049,,, DD-6.2,complete,DR-050,,, DD-6.3,missing,,,,Nothing received for this request; send it. DD-6.4,needs_fix,DR-051;DR-052,,DR-052,DR-052 is draft; send the final version. DD-6.5,complete,DR-053;DR-054,,, DD-6.6,complete,DR-055;DR-056,,, DD-7.1,missing,,,,Nothing received for this request; send it. DD-7.2,complete,DR-057,,, DD-7.3,complete,DR-058;DR-059,,, DD-7.4,partial,DR-060;DR-061,FY2025,DR-061,Send the missing year(s): FY2025. DR-061 is unsigned; send the signed copy. DD-8.1,complete,DR-062;DR-063,,, DD-8.2,needs_fix,DR-064,,DR-064,DR-064 is draft; send the final version. DD-8.3,partial,DR-065;DR-067,FY2025,,Send the missing year(s): FY2025. DD-8.4,complete,DR-068,,, DD-8.5,missing,,,,Nothing received for this request; send it.
output/set_aside.csv · written by the agent, 8 lines
doc_id,reason,note DR-024,duplicate,"Same file name, request, period and date as an earlier row; likely a repeat upload of the first copy." DR-033,no_request,Request ref is empty. Likely belongs to DD-4.2 (contracts with the five largest customers) or DD-4.3; seller to confirm. A summary would not replace the signed contracts. DR-048,no_request,Request ref DD-5.9 is not on the list. Likely belongs to DD-5.6 (contractor agreements); seller to confirm. DR-066,mislabelled,File name says FY2024 but period column says FY2025. Likely the FY2025 file for DD-8.3 with a wrong file name; seller to confirm and re-send. DR-069,no_request,"No request ref, and the file name and folder (00 Unsorted) give no clue. Seller must say what this scan is." DR-070,no_request,"Request ref DD-9.1 is not on the list. A draft, unsigned sublease offer; possibly related to DD-8.1 or DD-8.5 (leases), seller to confirm." DR-071,no_request,"Request ref DD-1.7x is not a request id. Company overview deck in folder 01 Corporate; possibly meant for DD-1.7 (entity chart), but a deck may not be the chart asked for. Seller to confirm."
output/summary.md · written by the agent, 60 lines
# Data room gap summary Requests on list: 48 - complete: 26 - needs_fix: 9 - partial: 5 - missing: 8 Files set aside: 7 (see set_aside.csv) ## Still owed, by area (most serious first) ### Corporate - DD-1.7 (missing): Nothing received for this request; send it. - DD-1.3 (needs_fix): DR-004 is dated 2026-03-14, before the required 2026-09-01; send a current copy. - DD-1.5 (needs_fix): DR-008 is unsigned; send the signed copy. ### Tax - DD-3.3 (missing): Nothing received for this request; send it covering FY2025. - DD-3.5 (missing): Nothing received for this request; send it. - DD-3.1 (partial): Send the missing year(s): FY2023. ### Commercial - DD-4.2 (missing): Nothing received for this request; send it. - DD-4.7 (partial): Send the missing year(s): FY2026. - DD-4.4 (needs_fix): DR-035 is unsigned; send the signed copy. DR-036 is draft and unsigned; send the final signed version. ### People - DD-5.5 (missing): Nothing received for this request; send it covering FY2026. - DD-5.2 (needs_fix): DR-043 is unsigned; send the signed copy. - DD-5.3 (needs_fix): DR-044 is draft; send the final version. ### Property and insurance - DD-8.5 (missing): Nothing received for this request; send it. - DD-8.3 (partial): Send the missing year(s): FY2025. - DD-8.2 (needs_fix): DR-064 is draft; send the final version. ### Technology and IP - DD-6.3 (missing): Nothing received for this request; send it. - DD-6.4 (needs_fix): DR-052 is draft; send the final version. ### Legal and compliance - DD-7.1 (missing): Nothing received for this request; send it. - DD-7.4 (partial): Send the missing year(s): FY2025. DR-061 is unsigned; send the signed copy. ### Financial - DD-2.3 (partial): Send the missing year(s): FY2027. - DD-2.1 (needs_fix): DR-013 is draft; send the final version. - DD-2.5 (needs_fix): DR-018 is dated 2026-06-30, before the required 2026-10-01; send a current copy. ## Files set aside, for the seller to clarify - DR-024 (duplicate): Same file name, request, period and date as an earlier row; likely a repeat upload of the first copy. - DR-033 (no_request): Request ref is empty. Likely belongs to DD-4.2 (contracts with the five largest customers) or DD-4.3; seller to confirm. A summary would not replace the signed contracts. - DR-048 (no_request): Request ref DD-5.9 is not on the list. Likely belongs to DD-5.6 (contractor agreements); seller to confirm. - DR-066 (mislabelled): File name says FY2024 but period column says FY2025. Likely the FY2025 file for DD-8.3 with a wrong file name; seller to confirm and re-send. - DR-069 (no_request): No request ref, and the file name and folder (00 Unsorted) give no clue. Seller must say what this scan is. - DR-070 (no_request): Request ref DD-9.1 is not on the list. A draft, unsigned sublease offer; possibly related to DD-8.1 or DD-8.5 (leases), seller to confirm. - DR-071 (no_request): Request ref DD-1.7x is not a request id. Company overview deck in folder 01 Corporate; possibly meant for DD-1.7 (entity chart), but a deck may not be the chart asked for. Seller to confirm.
check.py · the check, written before the run
"""Works out every request's status from the request list and the data room index, then compares."""
import csv, re, sys
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 read(p): return list(csv.DictReader(p.open(newline=""))) if p.exists() else []
split = lambda s: {x.strip() for x in re.split(r"[;,\s]+", s or "") if x.strip()}
reqs = read(root/"input/request_list.csv"); docs = read(root/"input/data_room_index.csv")
ids = {r["request_id"] for r in reqs}
aside, seen, dup_pairs = {}, {}, []
for d in docs:
key = (d["file_name"], d["request_ref"], d["period"], d["doc_date"])
if d["request_ref"] not in ids: aside[d["doc_id"]] = "no_request"
elif key in seen: aside[d["doc_id"]] = "duplicate"; dup_pairs.append((seen[key], d["doc_id"]))
elif set(re.findall(r"FY\d{4}", d["file_name"])) - split(d["period"]) and re.findall(r"FY\d{4}", d["file_name"]): aside[d["doc_id"]] = "mislabelled"
else: seen[key] = d["doc_id"]
want = {}
for r in reqs:
mine = [d for d in docs if d["request_ref"] == r["request_id"] and d["doc_id"] not in aside]
years = sorted(split(r["years_needed"])); missing = [y for y in years if not any(y in split(d["period"]) for d in mine)]
bad = set()
for d in mine:
if r["must_be"] in ("final", "signed") and d["version"] == "draft": bad.add(d["doc_id"])
if r["must_be"] == "signed" and d["signed"] == "no": bad.add(d["doc_id"])
if r["not_older_than"]:
for group in ([[d for d in mine if y in split(d["period"])] for y in years] if years else [mine]):
if group:
newest = max(group, key=lambda d: d["doc_date"])
if newest["doc_date"] < r["not_older_than"]: bad.add(newest["doc_id"])
status = "missing" if not mine else "partial" if missing else "needs_fix" if bad else "complete"
want[r["request_id"]] = (status, {d["doc_id"] for d in mine}, set(missing), bad)
rows = read(root/"output/gap_list.csv")
if not rows:
say(False, "output/gap_list.csv was not written or has no rows"); sys.exit(1)
got = {}
for r in rows: got.setdefault((r.get("request_id") or "").strip(), []).append(r)
once = sum(1 for i in ids if len(got.get(i, [])) == 1)
say(once == len(ids) and len(rows) == len(ids), f"{once} of {len(ids)} requests appear exactly once in the gap list")
row = lambda i: got.get(i, [{}])[0]
swap = {b: a for a, b in dup_pairs} # either copy of a duplicate may be the one kept
same = lambda cell, s: {swap.get(x, x) for x in split(cell)} == s
st = sum(1 for i, w in want.items() if (row(i).get("status") or "").strip().lower() == w[0])
n = {k: sum(1 for w in want.values() if w[0] == k) for k in ("complete", "needs_fix", "partial", "missing")}
say(st == len(want), f"{st} of {len(want)} statuses equal the status worked out from the index ({n['complete']} complete, {n['needs_fix']} needs_fix, {n['partial']} partial, {n['missing']} missing)")
dc = sum(1 for i, w in want.items() if same(row(i).get("docs"), w[1])); counted = sum(len(w[1]) for w in want.values())
say(dc == len(want), f"{dc} of {len(want)} requests list exactly the files that answer them ({counted} files counted)")
my = [i for i, w in want.items() if w[2]]; my_ok = sum(1 for i in want if split(row(i).get("missing_years")) == want[i][2])
say(my_ok == len(want), f"{sum(1 for i in my if split(row(i).get('missing_years')) == want[i][2])} of {len(my)} requests with a missing year name exactly the right years and no other request names one")
pd = [i for i, w in want.items() if w[3]]; pd_ok = sum(1 for i in want if same(row(i).get("problem_docs"), want[i][3]))
say(pd_ok == len(want), f"{sum(1 for i in pd if same(row(i).get('problem_docs'), want[i][3]))} of {len(pd)} requests with a draft, unsigned or old file name exactly the right files and no other request names one")
sa = {(r.get("doc_id") or "").strip(): (r.get("reason") or "").strip().lower() for r in read(root/"output/set_aside.csv")}
first = {a: b for a, b in dup_pairs}
sa = {first.get(k, k) if v == "duplicate" else k: v for k, v in sa.items()}
sa_ok = sum(1 for k, v in aside.items() if sa.get(k) == v)
say(sa_ok == len(aside) and len(sa) == len(aside), f"{sa_ok} of {len(aside)} files are set aside with the right reason and {len(set(sa) - set(aside))} files are set aside wrongly")
summary = (root/"output/summary.md").read_text().lower() if (root/"output/summary.md").exists() else ""
c = sum(1 for k, v in n.items() if re.search(rf"{k}\W{{0,6}}{v}\b", summary))
say(c == 4, f"summary.md gives {c} of 4 status counts correctly")
# every figure the summary restates is looked up in the row of the request or file named on its line
raw_sum = (root/"output/summary.md").read_text() if (root/"output/summary.md").exists() else ""
rowtext = {r["request_id"]: " ".join(v or "" for v in r.values()) for r in reqs}; rowtext.update({d["doc_id"]: " ".join(v or "" for v in d.values()) for d in docs})
known = {len(reqs), len(docs), counted, len(aside), len(reqs) - n["complete"], *n.values()}
labels = {"complete", "needs_fix", "partial", "missing", "no_request", "duplicate", "mislabelled"}
tot = good = 0
for ln in raw_sum.splitlines():
named = [i for i in re.findall(r"DD-\d+\.\d+|DR-\d+", ln) if i in rowtext]
for i, s in re.findall(r"(DD-\d+\.\d+|DR-\d+)\s*\((\w+)\)", ln):
if s.lower() in labels: tot += 1; good += s.lower() == (want[i][0] if i in want else aside.get(i) or aside.get(first.get(i, ""), ""))
for k, v in re.findall(r"(complete|needs_fix|partial|missing|set aside)\W{0,3}(\d+)\b", ln.lower()):
tot += 1; good += int(v) == (len(aside) if k == "set aside" else n[k])
for t in re.findall(r"\d{4}-\d{2}-\d{2}|FY\d{4}|(?<![\w.-])\d[\d,]*(?:\.\d+)?(?![\w-])", re.sub(r"DD-\d+\.\d+\w*|DR-\d+", " ", ln)):
tot += 1
if named: good += any(re.search(r"(?<![\w.-])" + re.escape(t) + r"(?![\w-])", rowtext[i]) for i in named)
else: good += len(t) == 1 or (t.isdigit() and int(t) in known)
say(tot > 0 and good == tot, f"{good} of {tot} figures in summary.md (counts, statuses, dates, years and folder numbers) agree with the request list and the index")
sys.exit(0 if ok else 1)
data_room_index.csv: sample data written by Atris. Fingerprint 79984b7bd6e6.
request_list.csv: sample data written by Atris. Fingerprint c642ebd00042.
gap_list.csv: written by the agent. Fingerprint bf2bc05d9c9f.
set_aside.csv: written by the agent. Fingerprint 6c7ca6d37590.
summary.md: written by the agent. Fingerprint 22775809ac95.