Atris

Check salaries against pay bands.
Done by an agent. Checked twice.

Every pay record placed against its band on a full time basis, with each person outside it listed with the gap.

Have Atris do this for you›

1

Real files in

  • locations.csv
    Which pay zone each work location belongs to. 8 lines, 90 bytes.
  • pay_bands.csv
    Pay bands by level and pay zone, 17 bands with a minimum, midpoint and maximum. 18 lines, 525 bytes.
  • pay_policy.md
    The company's pay band policy: how to compare pay with a band, what counts as below or above and when a person cannot be checked. 47 lines, 2 KB.
  • payroll_export.csv
    Payroll export of 62 pay records for 60 people, with part time and hourly staff, hand-typed levels and amounts, repeated people and missing fields. 63 lines, 6 KB.

Sample data written by Atris. Not a real company.

2

Three steps

  1. 1.Read the policy, bands and export
  2. 2.Place every record against its band
  3. 3.Write the check and the list

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

3

Checked twice

  • ✓Passed: 62 of 62 pay records in the export appear once in band_check.csv
  • ✓Passed: 62 of 62 statuses equal the status rebuilt from the policy, with 8 below their band, 5 above and 7 that cannot be checked
  • ✓Passed: 53 of 53 full time equivalent pay figures equal the figure rebuilt from pay, pay basis and weekly hours
  • ✓Passed: 13 of 13 gaps to the band edge and costs to fix equal the rebuilt figures and 103 of 103 cells that should hold no gap or cost are empty
  • ✓Passed: 7 of 7 records that cannot be checked carry the reason the policy gives
  • ✓Passed: 62 of 62 rows carry the employee id, name, level, zone and band limits found in the input files
  • ✓Passed: 54 of 54 figures in outside_band.md equal a figure from the input files or the rebuilt check for the person named on the same line
  • ✓Passed: 20 of 20 people outside their band or not checkable are named in outside_band.md
  • ✓Passed: The yearly cost to bring everyone below their band up to the minimum is stated as 7,217 pounds, the rebuilt total

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 5 to 14 of outside_band.md, copied from the file.
## Below their band (largest gap first)

- E-2034 Jocasta Ravensworth (L3, zone B): FTE £33000 vs minimum £35000, gap £2000, cost to fix £1600
- E-2005 Juniper Yarrowby (L3, zone A): FTE £36500 vs minimum £38000, gap £1500, cost to fix £1500
- E-2007 Lavinia Oxenhope-Diaz (L4, zone C): FTE £39750 vs minimum £41000, gap £1250, cost to fix £1250
- E-2033 Hyacinth Wetherby-Oyelaran (L4, zone A): FTE £46200 vs minimum £47000, gap £800, cost to fix £800
- E-2037 Anselm Larkspur (L1, zone B): FTE £23205 vs minimum £24000, gap £795, cost to fix £795
- E-2003 Gideon Saltmarsh-Lund (L2, zone B): FTE £27900 vs minimum £28500, gap £600, cost to fix £600
- E-2027 Ulric Jessop-Varga (L1, zone A): FTE £25480 vs minimum £26000, gap £520, cost to fix £520
- E-2001 Emeka Netherby (L1, zone C): FTE £22620 vs minimum £23000, gap £380, cost to fix £152

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 1 of 1 on 1 December 2026. The agent took 52 seconds.

What the second review verified

  • Recomputed every full time equivalent pay figure and status by hand and got the same result on all 62 rows, e.g. R-024 30400x37.5/30=38000 is above the L2/B maximum of 36000 by 2000, and R-034 26400x37.5/30=33000 is below the L3/B minimum of 35000 by 2000, with a cost to fix of 2000x30/37.5=1600
  • Hourly paid staff: R-001 11.60x37.5x52=22620 sits 380 below the L1/C minimum of 23000, and the cost to fix is 380x15/37.5=152; R-037 11.90x1950=23205 has a gap of 795
  • Duplicate employees: R-010 is replaced by R-048 (2026-10-01) and R-059 (2026-03-01) is replaced by R-023 (2026-09-01). All 7 people who could not be checked have the right reason: R-009 bad_band (L5/C min 69000 > max 52000), R-020 and R-056 no_band, R-046 EUR, R-054 no level, R-058 no hours, R-060 Belfast
  • The total cost to fix is £7217, which matches the sum of the 8 below-band costs (1600+1500+1250+800+795+600+520+152). The counts are 8 below, 5 above, 7 could not be checked, 2 superseded and 40 in band, which makes 62

What this run does not show

  • The payroll export was written for this run with one clear reason behind each odd record, where a real export has records with several problems at once.
  • The check rebuilds every figure from the policy, so it shows the sums are right and cannot show that the policy itself is fair.
  • The plain word reasons in the write up are 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 6 of 6. 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 salaries against pay bands

function: people
for: the head of people who runs the yearly pay review
goal: Every pay record on the payroll export is compared with the band for its level and zone so that everyone outside their band is listed with the size of the gap.

## 1. Read the policy, bands and export
Read input/pay_policy.md first. It holds every rule: how to turn pay into a full time equivalent
figure, where a person sits against a band, when a person cannot be checked and how to treat a
person who appears more than once. Then read input/pay_bands.csv, input/locations.csv and
input/payroll_export.csv. Load the files with python3. Do not read figures off the screen.

## 2. Place every record against its band
For each row of the export, in the order the policy gives:
- If the person has a later row, the status is `superseded`. Stop there.
- If a reason in the policy means the person cannot be checked, the status is `cannot_check`
  with that reason. Stop there.
- Otherwise work out the full time equivalent pay, find the band and set the status to `below`,
  `in_band` or `above`. Work out the gap and the cost to fix as the policy says.
Do every sum in python3, never in your head. Do not guess a missing value and do not repair a
band that looks wrong.

## 3. Write the check and the list
Write output/band_check.csv with one row per row of the export in the same order. Its columns are
record_id,employee_id,name,level,zone,fte_pay,band_min,band_max,status,gap,cost_to_fix,reason.
Write level as L and the number. Write money as whole pounds with no sign and no comma. Leave gap
empty unless the status is `below` or `above`. Leave cost_to_fix empty unless the status is
`below`. `reason` holds the policy's reason word for `cannot_check` rows and is empty otherwise.
Write output/outside_band.md for the head of people with three lists: people below their band
(largest gap first), people above their band and people who could not be checked with the reason
in plain words. Name each person by employee_id and name. Give the gap for each person outside
their band. End with one line that states the total yearly cost to bring everyone below their
band up to the minimum.

## Done looks like
- Every row of the export has one row in band_check.csv with a status.
- Every person below or above their band is in outside_band.md with their gap.
- The total cost to fix equals the sum of the cost_to_fix column.
input/locations.csv · 8 lines, 90 bytes
location,zone
London,A
Bristol,B
Leeds,B
Glasgow,B
Remote UK,C
Cardiff,C
Lisbon,C
input/pay_bands.csv · 18 lines, 525 bytes
level,zone,band_min,band_mid,band_max,currency
L1,A,26000,29000,32000,GBP
L2,A,31000,35000,39000,GBP
L3,A,38000,43500,49000,GBP
L4,A,47000,54500,62000,GBP
L5,A,60000,70000,80000,GBP
L6,A,78000,91500,105000,GBP
L1,B,24000,26750,29500,GBP
L2,B,28500,32250,36000,GBP
L3,B,35000,40000,45000,GBP
L4,B,43000,50000,57000,GBP
L5,B,55000,64000,73000,GBP
L6,B,72000,84000,96000,GBP
L1,C,23000,25500,28000,GBP
L2,C,27000,30500,34000,GBP
L3,C,33000,37750,42500,GBP
L4,C,41000,47500,54000,GBP
L5,C,69000,60500,52000,GBP
input/pay_policy.md · 47 lines, 2 KB
# Pay band policy

Company: Thistlewick Marine Instruments
Owner: Head of People
Applies to: the yearly pay review

## 1. Bands
Every job has a level from L1 to L6. Every work location sits in a pay zone (see locations.csv).
Each level and zone has a pay band with a minimum and a maximum (see pay_bands.csv). Bands are
yearly pay in pounds for a full time week of 37.5 hours.

## 2. Compare like with like
Before comparing anyone with a band, work out their full time equivalent yearly pay:
- Salaried: yearly salary x 37.5 / weekly hours. For a full time person this is the salary itself.
- Hourly paid: hourly rate x 37.5 x 52, whatever hours they work.
Round to the nearest pound.

## 3. Where a person sits
- `below`: full time equivalent pay is under the band minimum.
- `above`: full time equivalent pay is over the band maximum.
- `in_band`: anything else. Pay exactly on the minimum or the maximum is in band.

## 4. The gap
For a person below the band the gap is the minimum less their full time equivalent pay. For a
person above the band it is their full time equivalent pay less the maximum.

## 5. Cost to fix
For a person below the band, the cost to fix is what it would really cost the company each year
to bring them to the minimum: gap x weekly hours / 37.5, rounded to the nearest pound. Nobody's
pay is cut, so there is no cost to fix for a person above the band.

## 6. When a person cannot be checked
Do not guess. Mark the person `cannot_check` with the first reason that applies, in this order:
1. `no_level`: the level is empty.
2. `unknown_location`: the location is not in locations.csv.
3. `other_currency`: pay is not in pounds. Do not convert it.
4. `no_hours`: weekly hours are empty.
5. `no_band`: pay_bands.csv has no band for the level and zone.
6. `bad_band`: the band's minimum is above its maximum. That is a mistake in the table. Do not
   use the band and do not swap the figures.

## 7. About the payroll export
- The export has one row per pay record, not per person. When an employee_id has more than one
  row, the row with the latest effective_date is their pay today. The other rows are `superseded`
  and are not compared with any band.
- Levels are typed by hand. "L3", "l3", "Level 3" and "3" all mean L3.
- Amounts are typed by hand and may carry a pound sign or a comma.
input/payroll_export.csv · 63 lines, 6 KB
record_id,employee_id,name,job_title,level,location,weekly_hours,pay_basis,pay_amount,currency,effective_date
R-001,E-2001,Emeka Netherby,Assembly Operative,L1,Cardiff,15,hourly,11.60,GBP,2026-04-01
R-002,E-2002,Leontyne Kettlewell-Adeyemi,Customer Support Advisor,L1,Remote UK,20,hourly,12.00,GBP,2026-04-01
R-003,E-2003,Gideon Saltmarsh-Lund,Production Planner,L2,Leeds,37.5,salary,27900,GBP,2026-04-01
R-004,E-2004,Lorcan Netherby,Finance Business Partner,L4,Bristol,37.5,salary,49000,GBP,2025-10-01
R-005,E-2005,Juniper Yarrowby,Calibration Engineer,L3,London,37.5,salary,36500,GBP,2026-04-01
R-006,E-2006,Winifred Ashgrove-Mbeki,Calibration Engineer,L3,Bristol,37.5,salary,40200,GBP,2026-04-01
R-007,E-2007,Lavinia Oxenhope-Diaz,Senior Design Engineer,L4,Remote UK,37.5,salary,39750,GBP,2026-04-01
R-008,E-2008,Quillon Dunwiddie-Okafor,Quality Lead,L4,Bristol,37.5,salary,43000,GBP,2026-04-01
R-009,E-2009,Orla Gallowglass,Engineering Manager,L5,Cardiff,37.5,salary,61000,GBP,2026-04-01
R-010,E-2010,Maeve Quernmore-Singh,Test Engineer,L3,London,37.5,salary,37200,GBP,2026-04-01
R-011,E-2011,Ivo Inglethorpe,Accounts Assistant,L2,Glasgow,37.5,salary,33650,GBP,2026-04-01
R-012,E-2012,Evander Wetherby-Oyelaran,Customer Support Advisor,L1,Glasgow,37.5,salary,28050,GBP,2026-04-01
R-013,E-2013,Greta Jessop-Varga,Service Technician,L2,Cardiff,37.5,salary,31750,GBP,2026-07-01
R-014,E-2014,Cuthbert Quernmore-Singh,Finance Business Partner,L4,Glasgow,37.5,salary,54700,GBP,2025-10-01
R-015,E-2015,Gervase Mossgiel-Tanaka,Buyer,L3,Cardiff,37.5,salary,38800,GBP,2026-04-01
R-016,E-2016,Niall Hartsease-Kim,Assembly Operative,L1,Remote UK,37.5,salary,24500,GBP,2026-04-01
R-017,E-2017,Bronagh Eversleigh,Accounts Assistant,L2,London,37.5,salary,41200,GBP,2026-04-01
R-018,E-2018,Delphine Jessop-Varga,Quality Lead,L4,London,37.5,salary,"£52,300",GBP,2026-04-01
R-019,E-2019,Drusilla Dunwiddie-Okafor,Senior Design Engineer,L4,Cardiff,37.5,salary,47700,GBP,2026-04-01
R-020,E-2020,Tamsin Tolpuddle,Head of Operations,L6,Remote UK,37.5,salary,84000,GBP,2026-04-01
R-021,E-2021,Kwabena Larkspur,Production Planner,l2,Cardiff,37.5,salary,35100,GBP,2026-04-01
R-022,E-2022,Piers Netherby,Buyer,L3,Leeds,37.5,salary,38150,GBP,2026-04-01
R-023,E-2023,Fintan Wetherby-Oyelaran,Quality Lead,L4,Leeds,37.5,salary,58400,GBP,2026-09-01
R-024,E-2024,Septimus Zennor-Halloran,Service Technician,L2,Leeds,30,salary,30400,GBP,2026-04-01
R-025,E-2025,Sunniva Carrowmore,Buyer,L3,Remote UK,37.5,salary,36250,GBP,2026-04-01
R-026,E-2026,Kit Vantongeren,Senior Design Engineer,L4,Cardiff,37.5,salary,49550,GBP,2026-04-01
R-027,E-2027,Ulric Jessop-Varga,Customer Support Advisor,L1,London,37.5,salary,25480,GBP,2026-04-01
R-028,E-2028,Zenobia Farthingale-Nwosu,Customer Support Advisor,L1,Bristol,37.5,salary,27150,GBP,2026-04-01
R-029,E-2029,Perpetua Farthingale-Nwosu,Production Planner,L2,Remote UK,37.5,salary,31400,GBP,2025-10-01
R-030,E-2030,Wystan Farthingale-Nwosu,Sales Manager,L5,Bristol,37.5,salary,76500,GBP,2026-04-01
R-031,E-2031,Nerys Vantongeren,Service Technician,L2,London,37.5,salary,31350,GBP,2026-04-01
R-032,E-2032,Thaddeus Blackthorn-Sato,Calibration Engineer,L3,Glasgow,37.5,salary,36800,GBP,2026-04-01
R-033,E-2033,Hyacinth Wetherby-Oyelaran,Quality Lead,Level 4,London,37.5,salary,46200,GBP,2026-04-01
R-034,E-2034,Jocasta Ravensworth,Calibration Engineer,L3,Bristol,30,salary,26400,GBP,2026-04-01
R-035,E-2035,Rafferty Tolpuddle,Test Engineer,L3,Glasgow,22.5,salary,24000,GBP,2026-04-01
R-036,E-2036,Idris Umberleigh-Chen,Buyer,3,Remote UK,37.5,salary,37000,GBP,2026-04-01
R-037,E-2037,Anselm Larkspur,Customer Support Advisor,L1,Glasgow,37.5,hourly,11.90,GBP,2026-04-01
R-038,E-2038,Rosalind Hartsease-Kim,Sales Manager,L5,London,37.5,salary,63000,GBP,2026-07-01
R-039,E-2039,Bettina Wetherby-Oyelaran,Test Engineer,L3,Cardiff,37.5,salary,40500,GBP,2025-10-01
R-040,E-2040,Merrick Farthingale-Nwosu,Buyer,L3,Cardiff,37.5,salary,37400,GBP,2026-07-01
R-041,E-2041,Ignatius Jessop-Varga,Buyer,L3,Cardiff,37.5,salary,37050,GBP,2026-04-01
R-042,E-2042,Ngozi Vantongeren,Calibration Engineer,L3,London,37.5,salary,42650,GBP,2026-04-01
R-043,E-2043,Undine Zennor-Halloran,Production Planner,L2,Cardiff,37.5,salary,28300,GBP,2025-10-01
R-044,E-2044,Fenella Ashgrove-Mbeki,Service Technician,L2,London,37.5,salary,35050,GBP,2026-04-01
R-045,E-2045,Jessamy Hartsease-Kim,Assembly Operative,L1,Bristol,37.5,salary,28250,GBP,2026-04-01
R-046,E-2046,Hesper Jessop-Varga,Test Engineer,L3,Lisbon,37.5,salary,41000,EUR,2026-04-01
R-047,E-2047,Damaris Jessop-Varga,Buyer,L3,Cardiff,37.5,salary,39850,GBP,2026-04-01
R-048,E-2010,Maeve Quernmore-Singh,Buyer,L3,London,37.5,salary,39500,GBP,2026-10-01
R-049,E-2048,Valentin Larkspur,Senior Design Engineer,L4,Bristol,37.5,salary,55750,GBP,2026-04-01
R-050,E-2049,Florimel Mossgiel-Tanaka,Senior Design Engineer,L4,London,37.5,salary,58850,GBP,2026-04-01
R-051,E-2050,Cormac Gallowglass,Buyer,L3,Cardiff,37.5,salary,38450,GBP,2026-04-01
R-052,E-2051,Kester Inglethorpe,Accounts Assistant,L2,Remote UK,37.5,salary,29550,GBP,2026-07-01
R-053,E-2052,Verity Quernmore-Singh,Calibration Engineer,L3,Bristol,37.5,salary,"41,500",GBP,2026-04-01
R-054,E-2053,Briony Pennywhistle,Finance Business Partner,,Bristol,37.5,salary,52000,GBP,2026-04-01
R-055,E-2054,Honora Wetherby-Oyelaran,Assembly Operative,L1,Leeds,37.5,hourly,13.20,GBP,2026-04-01
R-056,E-2055,Montague Quernmore-Singh,Director of Product,L7,London,37.5,salary,118000,GBP,2026-04-01
R-057,E-2056,Aurelio Kettlewell-Adeyemi,Customer Support Advisor,L1,Leeds,37.5,salary,28400,GBP,2025-10-01
R-058,E-2057,Fintan Larkspur,Production Planner,L2,Glasgow,,salary,29800,GBP,2026-04-01
R-059,E-2023,Fintan Wetherby Oyelaren,Senior Design Engineer,L4,Leeds,37.5,salary,55000,GBP,2026-03-01
R-060,E-2058,Cosmo Eversleigh,Service Technician,L2,Belfast,37.5,salary,30500,GBP,2026-04-01
R-061,E-2059,Alaric Ravensworth,Head of Engineering,L6,Leeds,37.5,salary,74700,GBP,2026-04-01
R-062,E-2060,Eamon Ravensworth,Customer Support Advisor,L1,Remote UK,37.5,salary,28000,GBP,2026-04-01
output/band_check.csv · written by the agent, 63 lines
record_id,employee_id,name,level,zone,fte_pay,band_min,band_max,status,gap,cost_to_fix,reason
R-001,E-2001,Emeka Netherby,L1,C,22620,23000,28000,below,380,152,
R-002,E-2002,Leontyne Kettlewell-Adeyemi,L1,C,23400,23000,28000,in_band,,,
R-003,E-2003,Gideon Saltmarsh-Lund,L2,B,27900,28500,36000,below,600,600,
R-004,E-2004,Lorcan Netherby,L4,B,49000,43000,57000,in_band,,,
R-005,E-2005,Juniper Yarrowby,L3,A,36500,38000,49000,below,1500,1500,
R-006,E-2006,Winifred Ashgrove-Mbeki,L3,B,40200,35000,45000,in_band,,,
R-007,E-2007,Lavinia Oxenhope-Diaz,L4,C,39750,41000,54000,below,1250,1250,
R-008,E-2008,Quillon Dunwiddie-Okafor,L4,B,43000,43000,57000,in_band,,,
R-009,E-2009,Orla Gallowglass,L5,C,,,,cannot_check,,,bad_band
R-010,E-2010,Maeve Quernmore-Singh,L3,A,,,,superseded,,,
R-011,E-2011,Ivo Inglethorpe,L2,B,33650,28500,36000,in_band,,,
R-012,E-2012,Evander Wetherby-Oyelaran,L1,B,28050,24000,29500,in_band,,,
R-013,E-2013,Greta Jessop-Varga,L2,C,31750,27000,34000,in_band,,,
R-014,E-2014,Cuthbert Quernmore-Singh,L4,B,54700,43000,57000,in_band,,,
R-015,E-2015,Gervase Mossgiel-Tanaka,L3,C,38800,33000,42500,in_band,,,
R-016,E-2016,Niall Hartsease-Kim,L1,C,24500,23000,28000,in_band,,,
R-017,E-2017,Bronagh Eversleigh,L2,A,41200,31000,39000,above,2200,,
R-018,E-2018,Delphine Jessop-Varga,L4,A,52300,47000,62000,in_band,,,
R-019,E-2019,Drusilla Dunwiddie-Okafor,L4,C,47700,41000,54000,in_band,,,
R-020,E-2020,Tamsin Tolpuddle,L6,C,,,,cannot_check,,,no_band
R-021,E-2021,Kwabena Larkspur,L2,C,35100,27000,34000,above,1100,,
R-022,E-2022,Piers Netherby,L3,B,38150,35000,45000,in_band,,,
R-023,E-2023,Fintan Wetherby-Oyelaran,L4,B,58400,43000,57000,above,1400,,
R-024,E-2024,Septimus Zennor-Halloran,L2,B,38000,28500,36000,above,2000,,
R-025,E-2025,Sunniva Carrowmore,L3,C,36250,33000,42500,in_band,,,
R-026,E-2026,Kit Vantongeren,L4,C,49550,41000,54000,in_band,,,
R-027,E-2027,Ulric Jessop-Varga,L1,A,25480,26000,32000,below,520,520,
R-028,E-2028,Zenobia Farthingale-Nwosu,L1,B,27150,24000,29500,in_band,,,
R-029,E-2029,Perpetua Farthingale-Nwosu,L2,C,31400,27000,34000,in_band,,,
R-030,E-2030,Wystan Farthingale-Nwosu,L5,B,76500,55000,73000,above,3500,,
R-031,E-2031,Nerys Vantongeren,L2,A,31350,31000,39000,in_band,,,
R-032,E-2032,Thaddeus Blackthorn-Sato,L3,B,36800,35000,45000,in_band,,,
R-033,E-2033,Hyacinth Wetherby-Oyelaran,L4,A,46200,47000,62000,below,800,800,
R-034,E-2034,Jocasta Ravensworth,L3,B,33000,35000,45000,below,2000,1600,
R-035,E-2035,Rafferty Tolpuddle,L3,B,40000,35000,45000,in_band,,,
R-036,E-2036,Idris Umberleigh-Chen,L3,C,37000,33000,42500,in_band,,,
R-037,E-2037,Anselm Larkspur,L1,B,23205,24000,29500,below,795,795,
R-038,E-2038,Rosalind Hartsease-Kim,L5,A,63000,60000,80000,in_band,,,
R-039,E-2039,Bettina Wetherby-Oyelaran,L3,C,40500,33000,42500,in_band,,,
R-040,E-2040,Merrick Farthingale-Nwosu,L3,C,37400,33000,42500,in_band,,,
R-041,E-2041,Ignatius Jessop-Varga,L3,C,37050,33000,42500,in_band,,,
R-042,E-2042,Ngozi Vantongeren,L3,A,42650,38000,49000,in_band,,,
R-043,E-2043,Undine Zennor-Halloran,L2,C,28300,27000,34000,in_band,,,
R-044,E-2044,Fenella Ashgrove-Mbeki,L2,A,35050,31000,39000,in_band,,,
R-045,E-2045,Jessamy Hartsease-Kim,L1,B,28250,24000,29500,in_band,,,
R-046,E-2046,Hesper Jessop-Varga,L3,C,,,,cannot_check,,,other_currency
R-047,E-2047,Damaris Jessop-Varga,L3,C,39850,33000,42500,in_band,,,
R-048,E-2010,Maeve Quernmore-Singh,L3,A,39500,38000,49000,in_band,,,
R-049,E-2048,Valentin Larkspur,L4,B,55750,43000,57000,in_band,,,
R-050,E-2049,Florimel Mossgiel-Tanaka,L4,A,58850,47000,62000,in_band,,,
R-051,E-2050,Cormac Gallowglass,L3,C,38450,33000,42500,in_band,,,
R-052,E-2051,Kester Inglethorpe,L2,C,29550,27000,34000,in_band,,,
R-053,E-2052,Verity Quernmore-Singh,L3,B,41500,35000,45000,in_band,,,
R-054,E-2053,Briony Pennywhistle,,B,,,,cannot_check,,,no_level
R-055,E-2054,Honora Wetherby-Oyelaran,L1,B,25740,24000,29500,in_band,,,
R-056,E-2055,Montague Quernmore-Singh,L7,A,,,,cannot_check,,,no_band
R-057,E-2056,Aurelio Kettlewell-Adeyemi,L1,B,28400,24000,29500,in_band,,,
R-058,E-2057,Fintan Larkspur,L2,B,,,,cannot_check,,,no_hours
R-059,E-2023,Fintan Wetherby Oyelaren,L4,B,,,,superseded,,,
R-060,E-2058,Cosmo Eversleigh,L2,,,,,cannot_check,,,unknown_location
R-061,E-2059,Alaric Ravensworth,L6,B,74700,72000,96000,in_band,,,
R-062,E-2060,Eamon Ravensworth,L1,C,28000,23000,28000,in_band,,,
output/outside_band.md · written by the agent, 36 lines
# People outside their pay band

Checked 62 export rows: 2 superseded, 7 could not be checked, 8 below, 5 above, 40 in band. Pay is compared as full time equivalent (FTE) yearly pay.

## Below their band (largest gap first)

- E-2034 Jocasta Ravensworth (L3, zone B): FTE £33000 vs minimum £35000, gap £2000, cost to fix £1600
- E-2005 Juniper Yarrowby (L3, zone A): FTE £36500 vs minimum £38000, gap £1500, cost to fix £1500
- E-2007 Lavinia Oxenhope-Diaz (L4, zone C): FTE £39750 vs minimum £41000, gap £1250, cost to fix £1250
- E-2033 Hyacinth Wetherby-Oyelaran (L4, zone A): FTE £46200 vs minimum £47000, gap £800, cost to fix £800
- E-2037 Anselm Larkspur (L1, zone B): FTE £23205 vs minimum £24000, gap £795, cost to fix £795
- E-2003 Gideon Saltmarsh-Lund (L2, zone B): FTE £27900 vs minimum £28500, gap £600, cost to fix £600
- E-2027 Ulric Jessop-Varga (L1, zone A): FTE £25480 vs minimum £26000, gap £520, cost to fix £520
- E-2001 Emeka Netherby (L1, zone C): FTE £22620 vs minimum £23000, gap £380, cost to fix £152

## Above their band (largest gap first)

- E-2030 Wystan Farthingale-Nwosu (L5, zone B): FTE £76500 vs maximum £73000, gap £3500
- E-2017 Bronagh Eversleigh (L2, zone A): FTE £41200 vs maximum £39000, gap £2200
- E-2024 Septimus Zennor-Halloran (L2, zone B): FTE £38000 vs maximum £36000, gap £2000
- E-2023 Fintan Wetherby-Oyelaran (L4, zone B): FTE £58400 vs maximum £57000, gap £1400
- E-2021 Kwabena Larkspur (L2, zone C): FTE £35100 vs maximum £34000, gap £1100

## Could not be checked

- E-2009 Orla Gallowglass: the band in the table has its minimum above its maximum (table error; band not used)
- E-2020 Tamsin Tolpuddle: no pay band exists for this level and zone
- E-2046 Hesper Jessop-Varga: paid in a currency other than pounds (not converted)
- E-2053 Briony Pennywhistle: no level recorded
- E-2055 Montague Quernmore-Singh: no pay band exists for this level and zone
- E-2057 Fintan Larkspur: weekly hours are missing
- E-2058 Cosmo Eversleigh: work location is not in the locations list

Notes: E-2010 and E-2023 each appear twice; only the latest row is checked and the older row is superseded. The two E-2023 rows spell the name differently; the latest row name is used.

Total yearly cost to bring everyone below their band up to the minimum: £7217.
check.py · the check, written before the run
"""Rebuilds every record's band position from the policy, bands, locations and export, then compares the output with it."""
import csv, re, sys
from decimal import Decimal, ROUND_HALF_UP
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 rows(p): return list(csv.DictReader(p.open(encoding="utf-8")))
def money(s):
    s = re.sub(r"[£,\s]", "", s or "")
    try: return Decimal(s)
    except Exception: return None
def pounds(d): return int(d.quantize(Decimal("1"), rounding=ROUND_HALF_UP))
FULL = Decimal("37.5")
bands = {(b["level"].strip().upper(), b["zone"].strip()): (int(b["band_min"]), int(b["band_max"])) for b in rows(root/"input/pay_bands.csv")}
zones = {l["location"].strip(): l["zone"].strip() for l in rows(root/"input/locations.csv")}
export = rows(root/"input/payroll_export.csv")
latest = {}
for r in export:
    e = r["employee_id"]
    if e not in latest or r["effective_date"] > latest[e]["effective_date"]: latest[e] = r
want = {}
for r in export:
    w = {"status": "", "reason": "", "fte": None, "gap": None, "cost": None, "id": r["employee_id"]}
    lv = re.search(r"\d+", r["level"]); zone = zones.get(r["location"].strip()); hrs = money(r["weekly_hours"])
    w["level"] = "L" + lv.group() if lv else ""; w["zone"] = zone or ""; w["band"] = bands.get((w["level"], w["zone"]))
    w["names"] = {r["name"].strip(), latest[r["employee_id"]]["name"].strip()}; w["src"] = r
    if latest[r["employee_id"]] is not r: w["status"] = "superseded"
    elif not lv: w.update(status="cannot_check", reason="no_level")
    elif zone is None: w.update(status="cannot_check", reason="unknown_location")
    elif r["currency"].strip().upper() != "GBP": w.update(status="cannot_check", reason="other_currency")
    elif hrs is None: w.update(status="cannot_check", reason="no_hours")
    elif ("L" + lv.group(), zone) not in bands: w.update(status="cannot_check", reason="no_band")
    elif bands[("L" + lv.group(), zone)][0] > bands[("L" + lv.group(), zone)][1]: w.update(status="cannot_check", reason="bad_band")
    else:
        lo, hi = bands[("L" + lv.group(), zone)]; amt = money(r["pay_amount"])
        fte = pounds(amt * FULL * 52) if r["pay_basis"].strip().lower() == "hourly" else pounds(amt * FULL / hrs)
        w["fte"] = fte
        if fte < lo: w.update(status="below", gap=lo - fte, cost=pounds(Decimal(lo - fte) * hrs / FULL))
        elif fte > hi: w.update(status="above", gap=fte - hi)
        else: w["status"] = "in_band"
    want[r["record_id"]] = w
cpath, mpath = root/"output/band_check.csv", root/"output/outside_band.md"
if not cpath.exists():
    say(False, "output/band_check.csv was not written"); sys.exit(1)
got = {}
out = rows(cpath)
for r in out: got.setdefault((r.get("record_id") or "").strip(), r)
def num(r, col):
    m = money(r.get(col)); return None if m is None else pounds(m)
once = sum(1 for k in want if sum(1 for r in out if (r.get("record_id") or "").strip() == k) == 1)
say(once == len(want) and len(out) == len(want), f"{once} of {len(want)} pay records in the export appear once in band_check.csv")
def status(k): return (got[k].get("status") or "").strip().lower() if k in got else ""
st = sum(1 for k, w in want.items() if status(k) == w["status"]); cnt = lambda s: sum(1 for w in want.values() if w["status"] == s)
say(st == len(want), f"{st} of {len(want)} statuses equal the status rebuilt from the policy, with {cnt('below')} below their band, {cnt('above')} above and {cnt('cannot_check')} that cannot be checked")
placed = [k for k, w in want.items() if w["fte"] is not None]
fo = sum(1 for k in placed if k in got and num(got[k], "fte_pay") == want[k]["fte"])
say(fo == len(placed), f"{fo} of {len(placed)} full time equivalent pay figures equal the figure rebuilt from pay, pay basis and weekly hours")
outside = [k for k, w in want.items() if w["status"] in ("below", "above")]
go = sum(1 for k in outside if k in got and num(got[k], "gap") == want[k]["gap"] and (want[k]["cost"] is None or num(got[k], "cost_to_fix") == want[k]["cost"]))
blank = lambda r, col: not (r.get(col) or "").strip()
rest = [(k, col) for k, w in want.items() for col, v in (("gap", w["gap"]), ("cost_to_fix", w["cost"])) if v is None]
eo = sum(1 for k, col in rest if k in got and blank(got[k], col))
say(go == len(outside) and eo == len(rest), f"{go} of {len(outside)} gaps to the band edge and costs to fix equal the rebuilt figures and {eo} of {len(rest)} cells that should hold no gap or cost are empty")
cant = [k for k, w in want.items() if w["status"] == "cannot_check"]
co = sum(1 for k in cant if k in got and (got[k].get("reason") or "").strip().lower() == want[k]["reason"])
say(co == len(cant), f"{co} of {len(cant)} records that cannot be checked carry the reason the policy gives")
def cell_ok(r, col, right, may_be_blank):
    v = (r.get(col) or "").strip()
    return (may_be_blank and not v) or (v.upper() == right if isinstance(right, str) else money(v) is not None and pounds(money(v)) == right)
def row_ok(k):
    if k not in got: return False
    r, w = got[k], want[k]; placed_row = w["fte"] is not None; loose = w["status"] == "superseded"
    if (r.get("employee_id") or "").strip() != w["id"] or (r.get("name") or "").strip() not in w["names"]: return False
    if not cell_ok(r, "level", w["level"], loose) or not cell_ok(r, "zone", w["zone"], loose): return False
    if not placed_row and w["band"] is None: return blank(r, "band_min") and blank(r, "band_max")
    return cell_ok(r, "band_min", w["band"][0], not placed_row) and cell_ok(r, "band_max", w["band"][1], not placed_row)
ro = sum(1 for k in want if row_ok(k))
say(ro == len(want), f"{ro} of {len(want)} rows carry the employee id, name, level, zone and band limits found in the input files")
md = mpath.read_text(encoding="utf-8") if mpath.exists() else ""
def nums(text): return [Decimal(x.replace(",", "")) for x in re.findall(r"(?<![A-Za-z0-9.-])\d[\d,]*(?:\.\d+)?(?![A-Za-z])", text)]
by_emp = {}
for k, w in want.items():
    s = by_emp.setdefault(w["id"], {Decimal("37.5"), Decimal(52), Decimal(sum(1 for x in want.values() if x["id"] == w["id"]))})
    s.update(nums(" ".join(w["src"].values()))); s.update(Decimal(x) for x in re.findall(r"\d+", w["src"]["level"] + " " + w["src"]["effective_date"]))
    s.update(Decimal(x) for x in (w["fte"], w["gap"], w["cost"]) + (w["band"] or ()) if x is not None)
    if w["fte"] is None and money(w["src"]["pay_amount"]) is not None and w["src"]["currency"].strip().upper() == "GBP" and money(w["src"]["weekly_hours"]):
        a = money(w["src"]["pay_amount"]); s.add(Decimal(pounds(a * FULL * 52 if w["src"]["pay_basis"].strip().lower() == "hourly" else a * FULL / money(w["src"]["weekly_hours"]))))
statuses = [w["status"] for w in want.values()]
general = {Decimal(len(want)), Decimal(len(latest)), Decimal(len(bands)), Decimal(len(zones)), Decimal("37.5"), Decimal(52), Decimal(len(want) - len(latest)),
           Decimal(sum(w["cost"] or 0 for w in want.values())), Decimal(sum(w["gap"] for w in want.values() if w["status"] == "below")), Decimal(sum(w["gap"] for w in want.values() if w["status"] == "above"))}
general |= {Decimal(statuses.count(s)) for s in set(statuses)} | {Decimal(sum(1 for w in want.values() if w["reason"] == x)) for x in {w["reason"] for w in want.values()}}
general |= {Decimal(cnt("below") + cnt("above")), Decimal(cnt("below") + cnt("above") + cnt("cannot_check"))}
fa = fo2 = 0
for ln in md.split("\n"):
    ids = [e for e in by_emp if re.search(r"\b" + re.escape(e) + r"\b", ln)]
    allowed = set().union(*(by_emp[e] for e in ids)) if ids else general
    for x in nums(ln): fa += 1; fo2 += x in allowed
say(fo2 == fa and fa > 0, f"{fo2} of {fa} figures in outside_band.md equal a figure from the input files or the rebuilt check for the person named on the same line")
listed = [k for k in outside + cant]
lo_ = sum(1 for k in listed if re.search(r"\b" + re.escape(want[k]["id"]) + r"\b", md))
total = sum(w["cost"] for w in want.values() if w["cost"] is not None)
has_total = bool(re.search(r"(?<![\d,.])" + f"{total:,}".replace(",", ",?") + r"(?![\d,]*\d)", md))
say(lo_ == len(listed), f"{lo_} of {len(listed)} people outside their band or not checkable are named in outside_band.md")
say(has_total, f"The yearly cost to bring everyone below their band up to the minimum is stated as {total:,} pounds, the rebuilt total")
sys.exit(0 if ok else 1)

locations.csv: sample data written by Atris. Fingerprint 1291005a0827.

pay_bands.csv: sample data written by Atris. Fingerprint 10f59d205d55.

pay_policy.md: sample data written by Atris. Fingerprint a3baab2f107d.

payroll_export.csv: sample data written by Atris. Fingerprint 28a502a02e75.

band_check.csv: written by the agent. Fingerprint 291a1a2fe332.

outside_band.md: written by the agent. Fingerprint 175f48b81e25.


More hiring and people work, and every other desk job

For agentsGitHub
What is AtrisBlogApp StorePricingPrivacyTerms