Book a Systems Strategy SessionBook a session

Essay

The run ledger.

October 2026 · 4 min read

Every operational pipeline makes a claim, implicitly, every time it runs: it says the data is current, the job finished, nothing was lost. Most pipelines cannot back that claim up. Ours can, because every run writes its own record before anyone asks a question, and the record, not a person's memory of how last night felt, is what we point to when a claim needs checking.

The scraping infrastructure behind TenderPulse runs dozens of government portal sources on a schedule, every one of them liable to hang, change its layout, or drop the connection mid-download. We documented the engineering that keeps that pipeline alive in an earlier essay on hostile ingestion. This one is about a narrower piece of that system: the ledger a cron job writes on every run, and why that ledger, not the code, is what makes the pipeline's claims checkable.

A cron job and a lockfile are not an answer

The scheduler layer is unremarkable on purpose: cron starts the orchestrator, a lockfile stops two runs from overlapping, and the orchestrator isolates each source in its own process under a time budget. None of that answers the question an operator actually asks the next morning, which is not did the job start but what happened while it ran. A lockfile tells you a run was exclusive. It does not tell you what that run found, lost, or skipped. For that you need a record written by the run itself, not inferred after the fact from logs scattered across thirty-nine portal connectors.

That record is the run ledger, written as the system's job, not bolted on afterward for debugging. Every source's process reports into it: how long the run took, how many documents it touched, whether it finished, checkpointed, or was terminated. Termination escalates politely, a graceful signal before a hard kill, and that escalation is ledgered too, so a slow portal shows up as a slow portal, not a silent gap in the data.

Discovered, deduplicated, new: three numbers, not one

A pipeline that only reports "it ran" is not reporting enough to be trusted. The ledger behind TenderPulse's ingestion keeps three separate counts for every run: how many tender records a source returned, how many of those survived deduplication against what the pipeline already holds, and how many were genuinely new. One fleet run in July 2026 discovered and deduplicated 18,270 records across thirty-nine sources and surfaced 5,500 or more as new. Those three numbers, sitting next to each other in the same record, are what let anyone ask whether a source is actually producing new tenders or just resending the same ones, without opening a single log file.

Idempotency is what makes those counts meaningful rather than just large. A source can be re-scraped after a failed run, or re-run by hand after a fix, and deduplication guarantees the ledger's new-record count still means new, not re-counted. A ledger without idempotent jobs underneath it is just a bigger log file. The two have to be built together, or the numbers stop being trustworthy exactly when you need them most, after a failure and a retry.

The ledger is how a measured claim stays measured

We say, in the documentation for this system, that no data has been lost since the upload queue was rebuilt on a write-ahead-log store. That is a measured claim, not a hope. It is measured because the ledger records every run through every restart and every portal failure since the rebuild, and the claim is simply a read of that record, not a recollection. Before the rebuild, the queue was a JSON file that corrupted under concurrent writes. After the rebuild, the same class of failure is something the ledger would show if it happened again, and so far it has not.

This is the test worth applying to any pipeline you depend on: if a source failed silently last Tuesday, could you find that out today without reconstructing it from memory or scattered logs. If the answer is yes, you have a ledger, whether or not you call it that. If the answer is no, you have a system that works until the one night it does not, and no way to know when that night was.

What this costs, and what it replaces

Writing a ledger entry per run, per source, is cheap: a row in a table, a handful of counts, a status. What it replaces is expensive: the ritual of someone checking a dashboard by eye each morning, the debugging session that starts from "something feels off" instead of from a number, and the slow erosion of trust that happens when a pipeline's operators cannot tell you, with evidence, that last night went fine. The ledger does not make the pipeline more reliable by itself. Process isolation, checkpointing, and the write-ahead-log queue do that work. What the ledger does is make the reliability visible and arguable, which is a different property and an equally necessary one.

If you operate a pipeline and cannot point to the record that answers what happened last night, you do not have a pipeline. You have a hope that ran on schedule. The full architecture, including the queue rebuild and the process isolation the ledger depends on, is documented at /work/tender-scraper.

All essays

Next step

Find out how much you need.

Thirty minutes with the studio. We map what you run on today and say what we would build, roughly what it takes, and whether we are the right fit.

Sometimes the answer is a platform. Sometimes it is a layer around what you have. Possibly nothing yet.

Book a Systems Strategy Session