polycratia

The most expensive bugs I have seen were not in business logic. They sat in a comparison.

Logic errors announce themselves: something throws, a test goes red, a flow stops. A bad equality check does none of that. Both sides are valid strings. The comparison runs, returns false, and the system carries on exactly as designed.

Identifier matching is where this lives. An Ethereum address stored in mixed-case checksum form in one place and lowercase in another. A payment reference carrying a trailing space from a bank file. An order id with a leading zero that someone cast to an integer on the way in. One character of difference, zero errors raised.

The failed match itself does little damage. The damage is what that failed match looks like downstream: a deposit that is on-chain, confirmed, irreversible, and simply not attributed to a user. Support hears about it before monitoring does, because your success rate stays flat. You handled the event. You handled it into the wrong bucket.

A more careful code review does not fix this. What fixes it is removing the opportunity to compare raw input at all: normalize every identifier at the system boundary, persist the canonical form, and enforce it with a database constraint so a non-canonical value cannot be written in the first place. Comparison then has nothing left to get wrong.

Treat any identifier crossing a system edge as untrusted format, not just untrusted data.

I go deeper into failures like this on the blog: https://polycratia.com/c/26e97fd3

I am curious where format drift enters your system first: provider webhooks, bank statement files, or your own admin panel...

react

$ new-project --brief

or email hey@polycratia.com