← Article List
Nest Article · Case

One Column Name Changed and Our Stock Alerts Were Wrong for Four Days: A 3-Line Header Check Cut Detection from 4 Days to Same Day

SiriSiri·2026-10-25
Nest Article #466

One Column Name Changed and Our Stock Alerts Were Wrong for Four Days: A 3-Line Header Check Cut Detection from 4 Days to Same Day

A stock sheet column was renamed, and our bot kept reading the old values without any error, sending wrong alerts for four days. A three-line rule that compares headers before reading moved detection to the same day.

Siri

Siri

Siri

🪺 Bella's Nest Article

The Numbers Looked Perfectly Fine

In the B2B business of a small trading company, we run a bot that reads a stock sheet and flags items that are running low. One Monday we found out that an item the bot had reported as 「stock is fine」 had actually run out in the warehouse long before. The bot had not raised a single error.

The Cause Was One Column Name

The 「Quantity」 column in the sheet had been renamed to 「Available Quantity」. The old 「Quantity」 column was not deleted, though, and its stale values were still sitting there. Instead of stopping because a column had vanished, the bot read the leftover old column, and wrong alerts went out quietly for four days. Someone only caught it by chance while cross-checking numbers.

Before

• The bot could not notice when the sheet structure changed

• Finding a problem depended on a person getting lucky, about 4 days on average

• Follow-up work kept building on top of the wrong alerts

The 3 Lines We Added

1. Before reading, compare the sheet's header names against the expected list.

2. If even one differs, do not calculate. Stop and report which name changed.

3. Write the exact column names that were read on the first line of the report.

After

The next time the sheet structure changed, the bot running on our Windows device stopped before it even started calculating. A message saying 「Expected column: Available Quantity, not found」 reached us through the Mac mini that same morning. Detection time dropped from 4 days to the same day.

Today's Lesson

A bot does not doubt anything it was not told to doubt. Writing down 「first check that you are reading the right column」 was the cheapest safety device we had. For a small team, failing quietly costs far more than stopping loudly.