Skip to content

About

Evidence-first back-office checks on synthetic data: freight detention & carrier invoice audit, PT authorization worklist, utility bill exceptions. Python stdlib.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

86 Commits

Folders and files

Repository files navigation

workflow-checks

Three small programs that do the checking a back-office person does by hand, and show their evidence for every call.

Live sample outputs: https://jacobmetoyer.com/workflow-checks/ (generated by running the code below on its sample data)

Synthetic data, not deployed for any client. Every company, person, patient, account and amount in this repository is invented by a seeded generator. These are demos of an approach, not products, and no savings or accuracy figures are claimed for real data.

What each check catches

Demo Who it is for It catches You get
Freight packets Carrier and broker billing / settlement staff Billable detention from geofence or tracking times (free time, grace, increments, caps); late arrivals; carrier invoice lines that don't match the rate con (linehaul, fuel, accessorials, totals); duplicate invoices; missing POD; carrier fines backed by evidence, with a 7-day dispute window One draft packet per load with the calculation and evidence timeline, invoice_flags.csv, settlement.csv (READY / HOLD and net payable), an exception queue
PT authorizations Authorization specialists at multi-clinic outpatient PT groups Scheduled visits outside any approved auth; completed visits with no auth; re-auths due by visits-left or days-left per payer rule; pending auths with visits coming up; annual visit caps; unknown payers A prioritized daily worklist (P1/P2/P3) with submit-by dates and the payer's checklist, a printable digest, an auth ledger
Utility bills AP staff paying utility bills across a multifamily portfolio Usage spikes against the same month last year (so seasonal swings aren't flagged), rate jumps, duplicate bills, overlapping periods, missing bills, late fees, payment mismatches, unpaid past-due bills, usage at vacant units flags.csv, an exception queue, a payment-approval queue (nothing is paid), a one-file HTML report

Every decision is written to an append-only audit.jsonl with a file:row pointer to the input that caused it. Anything the rules can't judge goes to a person, not a guess.

Sample input → output

Utility bills. Two input rows from utility_watch/sample_data/bills.csv (synthetic), the same gas account a year apart:

bill_id,account_no,vendor_invoice_no,period_start,period_end,usage,usage_unit,amount,late_fee,prior_balance,due_date,received_date
B50020,SYN-7002,GULF-50020,2025-04-01,2025-04-30,1480.65,therm,1640.56,0.0,0.0,2025-06-05,2025-05-03
B50032,SYN-7002,GULF-50032,2026-04-01,2026-04-30,2780.11,therm,3058.42,0.0,0.0,2026-06-06,2026-05-04

Output rows from flags.csv:

B50032  Cypress Court (synthetic)  gas    USAGE_SPIKE           92.7 therm/day vs 49.4 same month last year (x1.88)   bills.csv:33 bills.csv:21
B50125  Bayou Flats (synthetic)    water  PAYMENT_MISMATCH      owed $4,232.12; 2 payment(s) totalling $8,464.24       bills.csv:126 payments.csv:120 payments.csv:121
B50087  Bayou Flats (synthetic)    elec.  LATE_FEE_OR_PAST_DUE  late fee $179.02, prior balance $3,222.36 on the bill  bills.csv:88

Freight. Output row from invoice_flags.csv:

CAL-7101  LD260907  LINEHAUL_MISMATCH  linehaul: invoiced $1,532.00 vs rate-con $1,382.00  variance $150.00  carrier_invoices.csv:row6; RC-48001.txt

PT. Output row from worklist.csv:

P1  SYN-1014  Medicare Advantage Plan (placeholder)  AUTH-70039  UNCOVERED_VISIT|REAUTH_BY_VISITS  1 of 7 visits left (payer threshold 4); 8 scheduled visits outside any approved auth

The full outputs, including the HTML packets and reports, are on the sample outputs site.

Run it in 60 seconds

Needs Python 3.10+. The demos use only the standard library; pytest is for the tests.

git clone https://github.com/Jacob-Met/workflow-checks && cd workflow-checks
cd utility_watch && python -m uwatch run --data sample_data --out out --as-of 2026-09-28 && cd ..
# open utility_watch/out/report.html
cd freight_packets && python -m freightpkt run --data sample_data --out out && cd ..
# open freight_packets/out/packets/*.html, or browse it: python -m freightpkt serve --data sample_data --out out  (http://127.0.0.1:8765)
cd pt_auth && python -m ptauth run --data sample_data --out out --as-of 2026-09-28 && cd ..
# open pt_auth/out/digest.html, or: python -m ptauth serve --data sample_data --out out  (http://127.0.0.1:8766)

Tests (130 in total):

pip install pytest
(cd freight_packets && python -m pytest -q)
(cd pt_auth && python -m pytest -q)
(cd utility_watch && python -m pytest -q)

On Windows PowerShell, .\demo.ps1 freight|pt|utility|test does the same. python scripts/build_pages.py runs the tests and rebuilds the sample outputs site in docs/.

How it is built

  • Synthetic data only. Seeded generators write an independent answer key (expected.json) that the tests check against.
  • Deterministic rules first. Anything uncertain goes to a human exception queue, and nothing is sent, filed, paid or submitted.
  • No paid APIs, no network calls, no model calls. The local UIs are single pages with no CDN and bind to 127.0.0.1.

What the tests do and do not show

  • They show internal consistency. Each generator writes the synthetic data and an expected.json answer key from the same seed, and the tests check the engine against that key plus hand-written edge cases (see each HARDENING.md). A green run means the rules do what the README says on data built to exercise them.
  • They do not show real-world accuracy, savings or time saved. No result here was measured on a real company's exports, so none is claimed. Any figure in a demo script (for example a detention total) is a property of the synthetic sample, not a typical or expected result.
  • A real pilot starts from a baseline. The per-PoC READMEs list what a pilot needs: the client's own exports, their real rules, and a manual audit to compare against. Claims about a pilot would be limited to what that comparison measured, for that client and period.

Status, support and contributions

  • Demos, provided as-is. No warranty, no support commitment and no maintenance schedule. They are not production software and must not be pointed at real patient, financial or personal data as they stand (see pt_auth/README.md for the HIPAA gaps).
  • Not accepting outside contributions for now. Issues may be read but are not guaranteed a reply.
  • Licensed under the MIT License (see LICENSE). The runtime has no third-party dependencies; pytest (MIT) is a test-only dependency and is not distributed here.

Contact

Interested in a scoped pilot on your own redacted exports? See jacobmetoyer.com.

About

Evidence-first back-office checks on synthetic data: freight detention & carrier invoice audit, PT authorization worklist, utility bill exceptions. Python stdlib.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages