Free · Daily brief + weekly playbookDaily 60-sec AI Voice Brief + Weekly Production AI Agent PlaybookGet the brief →
ReleaseInsight · On RadarHabr AI→ original

A source check caught 6 of 6 errors in an AI report; a number search caught 1 of 6

The summary shows 20 orders and a 5% conversion rate, but the 5% is from last week; this week's rate was 4%. Searching the table for the number does not reveal the substitution. The author of the Habr write-up does not let the model write figures: it selects a fact ID, and the code checks the week and channel and inserts the value itself. Of the 6 erroneous cases, this check rejected all 6, while matching values alone caught only the invented number 9.99. The lesson: verify where a figure comes from, not merely whether it exists.

AI-processed from Habr AI; edited by Hamidun News
A source check caught 6 of 6 errors in an AI report; a number search caught 1 of 6
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
Key metric #120 orders on 500 sessions gives 4%, while 20 orders on 400 sessions gives 5%
Averaging by day misleads11% and 6% average to 8.5%, but the honest figure is 20 out of 250, or 8%
Key metric #3The validator rejects another week, another channel, a wrong unit, and a missing metric

On Monday a manager receives a summary of web orders: 20 orders and a 5% conversion rate (the share of sessions that end in a payment). Both numbers do appear in the calculations, but the 5% belongs to the previous week, while this week's conversion was 4%. If the report is checked by searching the table for the number, the error gets through: the figure is real, just from the wrong period. Tech Lead Sergey Proshchaev, in his Habr write-up, showed how to build a weekly report with AI and how to verify not the value itself, but where each indicator came from (a KPI, or key performance indicator, such as orders or conversion).

The model picks the reference, and the code inserts the number

The scheme works as follows. SQL and Python compute sums by week and channel, and each result is assigned a fact identifier (fact_id) in the form 2026-11-16/web/conversion: the start of the week, the channel, and the metric. The value and the unit of measurement live in a facts table. The model does not return text with numbers. It returns a short card: the type of statement, the metric, the unit, and the fact_id. The card has no field with a ready-made number at all.

Next, the validator checks the card against the publication task. The week and the channel are set independently of the model; otherwise the same error could slip into both the reference and the period used to check it. A release is rejected if the fact is unknown, if the week or channel is wrong, if the unit does not match, if a metric is duplicated, or if a required one is missing.

Only after the check does the code generate the text and insert the number. For two metrics a template would suffice, but when several suitable observations have to be selected from dozens of permissible ones for a specific audience, the model becomes useful, and the validator gives it room to choose while guarding against mistakes.

What the test run on control cases showed

The author assembled seven cases: one correct summary and six erroneous ones. Among the errors were the same number from another week, the same number from another channel, a wrong unit, a missing metric, a forbidden causal explanation ("conversion fell because of advertising"), and a fabricated reference to a nonexistent fact. Value matching accepted the correct summary but missed five of the six erroneous ones: it rejected only the invented number 9.99. Card matching rejected all six and accepted the correct one.

Separately, the substitution of last week's conversion (a wrong-scope error), a duplicated metric, and an extra text field were tested. An important caveat: the cards in the demo were composed by hand. This is a test of acceptance rules, not an assessment of the quality of any particular model. To evaluate a model, its real outputs and independent labeling are needed.

Pitfalls the validator will not close on its own

The first is which sessions to count. If sessions are selected by start date and orders by payment date, a session that starts on Sunday with a payment on Monday lands in the numerator and denominator of different weeks. Fix the attribution window, the rule for late payments, and the method of assigning channels, and include such a session, along with a session without a purchase, in the control set.

The second is weighting. In the mobile channel, by day there are 11 orders from 100 sessions and 9 from 150, that is, 11% and 6%. The simple average gives 8.5%, while the correct calculation, 20 out of 250, gives 8%. Add up the counts, not the percentages. Calculate changes the same way: a drop from 5% to 4% is one percentage point, or a 20% decline relative to the previous value, and it should be computed from the underlying counts, not from rounded figures. Two different conversion rates can both display as 4.00%, and subtracting the displayed numbers makes the difference disappear.

The third is data completeness. The author notes separately that the completeness of the export, the quality of events, and the definition of metrics require their own checks of the source. A zero session count (where conversion is undefined) must be distinguished from a loading failure, and recent sessions may still receive purchases, so an early release should be marked as preliminary and the snapshot date should be stored.

There is also a minor technical point. json.loads in Python keeps the last value when a field name repeats, so a key-duplication check will no longer see it. If the format must reject such responses, configure rejection through object_pairs_hook.

Where to start

Take one regular report and give each metric an identifier made from its week, channel, and name. Then insert into the card a fact from the adjacent week with the same value: the validator must stop the release. Only after that add segments and comparisons, each together with its own control cases.

Story

Key Questions Answered

What are the key details on The model picks the reference, and the code inserts the number?

The scheme works as follows. SQL and Python compute sums by week and channel, and each result is assigned a fact identifier (fact_id) in the form 2026-11-16/web/conversion: the start of the week, the channel, and the metric. The value and the unit of measurement live in a facts table. The model does not return text with numbers. It returns a short card: the type of statement, the metric, the unit, and the fact_id. The card has no field with a ready-made number at all.

What the test run on control cases showed?

The author assembled seven cases: one correct summary and six erroneous ones. Among the errors were the same number from another week, the same number from another channel, a wrong unit, a missing metric, a forbidden causal explanation ("conversion fell because of advertising"), and a fabricated reference to a nonexistent fact. Value matching accepted the correct summary but missed five of the six erroneous ones: it rejected only the invented number 9.99.

What are the key details on Pitfalls the validator will not close on its own?

The first is which sessions to count. If sessions are selected by start date and orders by payment date, a session that starts on Sunday with a payment on Monday lands in the numerator and denominator of different weeks. Fix the attribution window, the rule for late payments, and the method of assigning channels, and include such a session, along with a session without a purchase, in the control set. The second is weighting.

ZK
Zhemal Khamidun — Head of AI at Alpina Digital · MIPT (academic supervisor of the Tech Entrepreneurship department). Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

Test Frontier LLMs & Autonomous Agents in One Workspace

Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.

Try Nomad AI →Launch Nomad Agent
Jemal Hamidun

Editor-in-chief · Cite this analysis

Jemal Hamidun

Head of AI at Alpina Digital · Academic Supervisor of the Tech Entrepreneurship Department at MIPT

Head of AI & CPO of AlpinaGPT at Alpina Digital, Academic Lead of Tech Entrepreneurship at MIPT. Founder of Hamidun News and Vibe Academy.

Ready-to-paste citation for journalists, blogs and Telegram channels

Source: Hamidun News — A source check caught 6 of 6 errors in an AI report; a number search caught 1 of 6 https://news.hamidun.com/en/news/18719/a-source-check-caught-6-of-6-errors-in-an-ai-report-a-number

What do you think?
Loading comments…