Skip to content

The missing record that closed a valid case

Failure story 11, in time, ownership and inter-agency data.

Last night’s partner file had no rows for 4,000 cases that were active yesterday. Were those cases closed?

Assumption Value
Partner A county system that sends a nightly file of every active case, about 52,000 rows
Importer rule A case in yesterday’s file and absent from tonight’s is closed
What closing does Stops the case’s payments and sends the household a closure notice
Transfer Secure file transfer; the job reports success if a file arrives
Step What happens
1 11:40 p.m.: the county’s export starts writing the file.
2 11:52 p.m.: the county server restarts for patching. The export stops after 48,000 rows.
3 Midnight: the transfer job finds a file and sends it. It’s a valid file: every row parses.
4 2 a.m.: the importer compares it with yesterday’s: 4,000 cases are absent, so it closes them.
5 6 a.m.: 4,000 closure notices are queued for printing and payments for those households are stopped.

In a full-snapshot feed, absence is the only way a closure is expressed. That makes the importer’s correctness depend on the file being complete, and nothing checked that it was. “A file arrived and parsed” is evidence that a file exists, not that it’s the whole snapshot. A truncated file, a filter bug on the partner’s side or an export run against the wrong environment all look exactly like a mass closure.

Aspect Design A: absence means closed Design B: manifest, completeness and explicit deletion
What proves the snapshot is complete Nothing A manifest: snapshot ID, as-of time, expected row count and a checksum, written by the partner after the export finishes
Incomplete file Processed Rejected; yesterday’s state is kept and someone is alerted
How closures are expressed Absence Explicitly, as closed rows with a reason, or by absence only from a snapshot proven complete
Unusual volume Processed Closing more than a threshold, such as 1% of cases, waits for a person to approve

The manifest has to be written last and checked first:

county-cases-2026-11-21.csv
county-cases-2026-11-21.manifest ← written after the CSV is complete
snapshot_id: 2026-11-21
as_of: 2026-11-21T23:59:59-06:00
row_count: 52,118
sha256: 9f1c…

The importer refuses to start until the manifest exists, the row count matches and the checksum matches.

  1. An incomplete snapshot closes nothing. Feed a file with 48,000 of 52,118 rows and a manifest saying 52,118. Expected: zero cases closed, the import rejected, an alert raised.
  2. A complete snapshot still works. Feed a complete file in which one case is legitimately absent. Expected: that one case is closed.
  3. A mass closure waits. Feed a complete, valid file in which 3% of cases are absent. Expected: the closures are held for approval, not executed.

Check 2 matters as much as check 1. A design that never closes anything passes check 1 trivially and is useless.

This check is in the checks catalog as test templates in Java and Python.

  • The feed is small enough to compare by eye, and a person reviews every closure before it takes effect.
  • Closing is harmless and instantly reversible, such as hiding a record from a search page, not stopping payments.

Discussion question. Who should be accountable for a wrong closure here: the county, the transfer team or the importer’s owner? What does your answer imply about where the checks belong?

Exercise. The county runs a legacy system and can’t produce a manifest, at least for a year. What can the importer do on its own, and what does each safeguard cost?

Worked answer

Options, which combine well: Compare with history, rejecting a file whose row count differs from yesterday’s by more than a tolerance such as 2%; this catches truncation but not a small, silent loss. Look for a trailer: many legacy exports end with a footer record, and a missing footer means a truncated file. Require absence twice: mark a case pending closure the first night it’s absent, and close it only if it’s still absent the next night; this delays every legitimate closure by a day, which needs a policy decision, not only an engineering one. Cap the blast radius with the approval threshold. In the meantime, ask the county for explicit closure rows; that’s the change that turns absence from a guess into a fact.

Written and edited by Abhinav Taduka, enterprise software architect.