Invental/Review lessons/Code that silently does the wrong thing

Code that silently does the wrong thing

A skipped check is not a passed check

“Could not check” is not “checked and fine”: return a third state for skipped AI or validation calls so nothing caches it as a pass.

01 · Before and afterThe pattern

TypeScript
type Screen = { flagged: boolean | null }; // null = not evaluated

if (overQuota) return { flagged: null };   // before: { flagged: false }

// client
if (res.flagged !== null) cache.set(key, res); // only cache real verdicts

02 · Run it on your appThe check

When your AI or fraud check is skipped (quota, timeout, rate limit), does the caller know it was skipped, or does it look like a pass?

If the honest answer is no or not sure, this is worth a look before it reaches production.

Want this checked on your code?

Tell us what you are building and what worries you. We match a senior reviewer to your code and confirm scope before anything starts.

— Get in touch
hi@invental.co ↗
— Or
— What to include

A link or short description of the code or system, what you want checked, your stack, and when you need the answer. No repository access is needed until scope is agreed.

— Or leave a note
We reply within one business day.