IdeaFragmentsIdeaFragments
Field notes/AI in the pipeline/Where AI Gets a Vote, and Where It Doesn’t
Nov 24, 2026 · 4 min read
AI in the pipelineNov 24, 2026· 4 min read

Where AI Gets a Vote, and Where It Doesn’t

◆ Thesis

AI’s answer is non-deterministic. Much like a single human’s response to the same question can have subtle differences, an AI agent’s answer can vary from one run to the next. Our checks and SOPs never do. Every number passes the same tests every time, so what reaches the user is predictable, even though the AI isn’t.

S
SamEngineer · IdeaFragments
Nov · 2026

Where we let AI in

Lots of grocery products aren’t in any nutrition database, or they’re in one with only partial data. So we added an ability in FreshLedger to let users photograph the label and other relevant pieces of data present on a product’s packaging. That’s not risk-free. Change never is. A wrong number here goes straight into someone’s nutrition data, skewing the overall results. So we decided up front exactly where the AI is to be trusted in this flow.

First, a person checks the scanned text of the label before any AI sees it. Then the AI does what it’s good at: turning messy and unstructured OCR text into clean, structured data. The AI doesn’t get the last word. Plain rules in the code check its work.

Anything that fails goes back to a person. And the AI’s own confidence score never counts as a pass.

“That’s two human steps. Why?” That’s a fair thing to question. For now and for this flow, this works. However, if volume grows, the first step is the one to automate: AI reads the photo, and our own verification steps check that reading before anything gets structured. The final human review stays, because that’s where the judgment is.

Predictable checks around an unpredictable AI

AI’s answer is non-deterministic, which can have real consequences for live systems. The problem can then spiral as a small chain-link of non-determinism can then create a chain reaction of unpredictable ramifications as that AI output becomes mutated inputs as it flows deeper and deeper into said systems. In a world where agentic integrations can process inputs faster than a human can process its outputs, there’s a strong need for guardrails and circuit breakers that put a hard pause on any output that doesn’t fit within a defined structured set of criteria.

Having said that, unpredictable output that doesn’t fit that criteria shouldn’t always be taken as trash. Sometimes the criteria is too small a box to fit the different possibilities that are valid for a given system. These possibilities need to be evaluated as well, but in a controlled environment. As more details arise, there may be needs to adjust that box and its set of deterministic tests.

Software development isn’t about preventing change, but rather building guarded flexibilities that allow continued servicing to the end-user, all the while learning and improvements are taking place.

Under the hood

The flow, step by step
Scan a barcode
     │
     ▼
Found in a nutrition database, with a complete label? ── yes ──▶ Graded
     │ no
     ▼
User photographs the barcode, nutrition panel and ingredients
     │
     ▼
PERSON   Admin runs OCR on the photos and checks the text
     │
     ▼
AI       Reads the checked text into a structured, per-serving label
     │
     ▼
CODE     Converts to per 100 g or 100 ml and normalizes units
     │
     ▼
CODE     Runs the checks ───── pass ─────▶ Scored
     │ fail
     ▼
PERSON   Admin corrects the values, or marks the label unscoreable

When the admin corrects a label, they enter what’s printed on the package, and the same math runs. The softer checks aren’t re-run on a person’s input: human judgment supersedes. Every record notes whether it was structured by the AI or by a person.

What the AI does, and what it never does
The AI does
Plain code always does
Reads the label text into per-serving values
Converts per serving to per 100 g or 100 ml
Names the food group from a fixed list of about 17
Normalizes units (kJ and kcal, sodium and salt, ml and g)
Works out the fruit, vegetable and legume share from the food group and ingredients
Calculates the Nutri-Score

If the AI can’t produce a clean reading, the label goes to a person rather than guessing its way to a score.

The checks

Strict checks. Any one failure sends the label to a person.

Check
Serving unit is correct and within the set of normalized units understood by the system
Ensuring all necessary data for score calculation is present
Catching possible label misreads like a decimal point in the wrong place.
Nothing physically impossible. The macro nutrients have to make sense collectively

Soft checks. These flag a label when they fire (at launch, a single soft flag is enough).

Check
The Atwater factors. A big mismatch means a number was misread.
Catching an invented number. Its limit: it can’t catch a real number assigned to the wrong nutrient. The other checks partly cover that.
etc.
etc.
AI in the pipeline
S
— Written by

Sam

I’m drawn to projects that start with a good question, not just a feature request. Most of the people I enjoy working with have ideas they care deeply about, but also the clarity to stay grounded in why those ideas matter in the first place.

◆ Subscribe

One essay, when there’s something worth saying.

Roughly twice a month. No tracking. Unsubscribe in one click.