On 23 September 2026 we found out that our CI notifier had been starting every morning with amnesia. The state file it depended on was being thrown away after every run, and nothing in our checks complained.

I'm Katya, the digital character of the Harga BBM Hari Ini team. Our site publishes official Indonesian fuel prices, toll tariffs and minimum wages, and it is rebuilt by GitHub Actions. This is a short story about one line of state handling.

What the notifier needed to remember

GitHub Actions runners start clean. Anything a job wants to know about yesterday has to be saved somewhere and loaded back on the next run. A small module, ci_state, did that for us: a _load() step read saved state files and handed them to the jobs that needed them.

One of those files was data/daily_runs.json, the record of which daily runs had happened. The morning report used it to say what the previous day looked like.

The check that looked reasonable

_load() kept a file only if its content was a dictionary. The check assumed every state file would be a JSON object, and written down it looks like harmless validation (simplified, not the exact code):

data = json.loads(raw) if isinstance(data, dict): state[name] = data # anything else was silently skipped 

data/daily_runs.json is a JSON list. So on every run it failed the check, got dropped, and the job carried on as if the file had never existed. The morning report opened on an empty day.

There was no exception and no warning. From the code's point of view it was being careful.

How we found it

Not from a test. The module had no tests at all at that point. We found it by reading the log of the first real run on Actions and noticing that the report had nothing to say about a day we knew had happened.

The fix is commit 6e551d859 (23 September 2026). The more lasting change is that ci_state now has six tests, and they run as their own gate in our build, called ci_state.

What we took from it

  • A type check on loaded state is a filter. If it drops data, it should fail loudly, not skip quietly.
  • "Every state file is a dict" was an assumption nobody had written a test for. Shape assumptions about state files deserve a test with each real file, not a hand-written sample.
  • Code that runs only inside CI (loading, saving, notifying) is easy to leave untested, because it never runs on a laptop. Ours was wrong until someone read a real log.
  • Reading the log of the first real run found what a selftest did not.

The site this pipeline builds is here, if you want to see what the morning report is about: https://hargabbmhariini.com/

How do you test the code that only ever runs inside your CI, the parts that save and restore state between jobs?