# Calorie tracker complex-diary evaluation — 2026-07-15

## Outcome

- Five final daily-diary cases completed, including one real uploaded meal photo.
- Dashboard arithmetic: **5/5 exact**. Item → meal → daily kcal/macros, activity burn, net, remaining calories, percentages, and rendered values were independently recomputed.
- Dashboard contract: **5/5** retained the full template, replaced `{tip}`, preserved the trailing `→`, and omitted Water.
- Practical estimate quality: **approximately 88–92%** for ordinary daily use. Most food densities and all four final activity estimates were plausible; restaurant sourcing and photo portion size remain naturally less certain.
- Regression tests: **153 passed**.

## Final cases

| Case | Foods / activity | Final daily totals | Arithmetic/dashboard |
|:--|:--|:--|:--:|
| 1 — oats, yogurt, chicken/rice lunch, run | 8 food items; 35 min run at 8 km/h | 1395 kcal; P 85.5 g; F 46.8 g; C 137.8 g; burn 364; net 1031 | PASS |
| 2 — McDonald's Spain lookup, skyr/apple, cycling | 5 food items; 45 min cycling at 17 km/h | 954 kcal; P 48.0 g; F 39.8 g; C 102.0 g; burn 402; net 552 | PASS |
| 3 — 3/8 homemade chili recipe, snack, hike | 10 food items; 90 min hilly hike | 1332 kcal; P 81.3 g; F 41.9 g; C 164.0 g; burn 572; net 760 | PASS |
| 4 — real octopus/pasta plate photo | 5 visually estimated food items | 638 kcal; P 47.6 g; F 24.1 g; C 66.1 g; net 638 | PASS |
| 5 — breakfast, salmon dinner correction, resistance training | 8 final food items; 50 min moderate resistance | 1327 kcal; P 78.4 g; F 62.1 g; C 122.4 g; burn 221; net 1106 | PASS |

## Photo case

The image was submitted through the normal multipart attachment endpoint and delivered to the vision-capable model as original image evidence. The final central estimate was:

- 180 g cooked whole-wheat penne
- 120 g cooked/grilled octopus
- 100 g avocado
- 80 g cucumber
- 5 g olive oil
- **638 kcal; P 47.6 g; F 24.1 g; C 66.1 g**

This is within a reasonable roughly 500–700 kcal range for the visible plate. Portion size and any unseen oil remain the dominant uncertainty; the dashboard tip identifies the photo-estimated avocado amount as the largest uncertainty.

## Defects found and fixed

1. Enabled skill `instruction.md` content was not reaching the model; only its 16-word catalog description was visible. The generic runtime system prompt now includes full instructions for enabled skills, including after context refresh/compaction.
2. The acceptance harness's first-message defaults overwrote its selected tools/skills. Multipart runtime selectors now preserve the intended calorie/search tools and dietitian skill.
3. The harness could not send real attachments. Cases can now post actual image files through the normal chat upload path.
4. Nested named norm fields caused repeated partial tool calls with the current model. Norm input is now compact and complete: `{"kcal": value, "macros_g": [protein, fat, carbs]}`. Stored/output fields remain named.
5. The model sometimes supplied internally impossible nutrition numbers. The logger now rejects macros greater than edible weight and large unexplained calorie gaps; it does not estimate replacements.
6. The dietitian skill now has explicit raw/cooked rules, recipe-fraction rules, declared-fat bounds, oil constants, macro-energy checks, activity MET anchors, photo handling, and a hard search fallback policy.
7. Search behavior is explicit: use authoritative sources for material uncertainty, do not ritual-search clear common foods, use at most two materially different queries per uncertain value, and state the actual fallback source tier.
8. Tip handling now specifies literal `{tip}` substitution and verifies the template's trailing ` →` remains.

## Residual limitations

- Restaurant country-specific nutrition may remain uncertain when the official Spain page is inaccessible. The model stops after the search ceiling and uses the best available source without calling it official.
- Photo portions cannot be exact without a scale or known plate dimensions; central estimates should be treated as ranges.
- The selected 35B local model has variable latency and can produce long hidden calculations even with reasoning disabled. Accuracy is acceptable after the fixes, but response time remains model-dependent.
- One case-1 chicken-thigh macro set exposed a 25–30% under-explained calorie gap. The final logger threshold was tightened afterward, so current code rejects that pattern and asks the dietitian/search loop to correct it.

## Evidence

- Case 1: `artifacts/acceptance_runs/complex_calorie_daily_20260715_v17_case1/acceptance_report.json`
- Case 2: `artifacts/acceptance_runs/complex_calorie_daily_20260715_v18_case2/acceptance_report.json`
- Case 3: `artifacts/acceptance_runs/complex_calorie_daily_20260715_v15_case3/acceptance_report.json` (dashboard accepted after correcting the manifest's obsolete keyword expectation)
- Photo case: `artifacts/acceptance_runs/complex_calorie_daily_20260715_v20_case4_photo/acceptance_report.json`
- Case 5: `artifacts/acceptance_runs/complex_calorie_daily_20260715_v14_case5/acceptance_report.json`
