# Overview
# How the pipeline is organized
# Stage summaries
01 · Capture
The input: a camera frame. The output: an image good enough to read. PM decision: treat a bad photo as a refusal to answer. The pipeline should prompt for a retake rather than returning a low-confidence result. Artifact: image-quality acceptance criteria (min resolution for the ingredients block, blur/glare thresholds, "panel fully in frame" checks, and retake prompt copy).
Failure exit: image unreadable → Unclear.
02 · Read
The input: image. The output: raw German text. PM decision: use cheap OCR by default and escalate to a vision-language model (VLM) only on low confidence. Artifact: escalation policy covering the confidence threshold, per-scan cost ceiling, and latency budget split (OCR path target under 3s, escalated path under 8s). Metric: escalation rate and blended cost per scan, where accuracy and margin compete. Failure exit: text confidence remains low even after escalation → Unclear.
03 · Understand
The input: raw German text. The output: matched ingredients with source flags. PM decision: perform lookup against a curated knowledge base rather than translating with a model. Artifact: knowledge base schema and coverage spec (ingredient text, German synonyms, E-number, animal-derived flag, source-confidence rating) plus a coverage target (95% coverage across top 200 eval products).
Failure exit: ingredient not found → Unclear.
04 · Decide
The input: matched ingredients. The output: one of six verdict categories (e.g., Non-Vegetarian, Vegetarian·Contains Egg, Vegan, Alcohol detected, Unclear).
Artifact: the rule spec written in plain language so non-technical reviewers can audit it (example rules map ingredients or E-numbers to categories). Metric: rule coverage — share of eval products where rules fire cleanly vs. fall through to Unclear. Failure exit: additive source ambiguous → Unclear.
05 · Explain
The input: verdict. The output: the shopper-facing explanation and confidence band.
Artifact: confidence formula combining text quality × knowledge base coverage × rule certainty, banded into High/Medium/Low, the result-screen spec, and the user feedback taxonomy (wrong OCR, wrong ingredient, wrong category, ambiguous source). Metric: confidence calibration — whether displayed bands correspond to real error rates.
# Practical pattern to reuse Structure product work as decisions + artifacts + metrics. Use deterministic fallbacks and explicit Unclear exits to avoid misleading users. Reserve expensive models for escalation points where they materially improve outcomes.