Allergy Tracking - JRAdams472/LENA2 GitHub Wiki
Allergy Tracking
LENA tracks each household member's allergies and dietary restrictions and warns before anyone cooks something risky — on recipe pages, meal plans, grocery lists, and food events, on both web and mobile.
Recording your allergies
Every member edits their own records — warnings always name the member so nobody has to guess who a flag is for.
On the web, open Profile in the sidebar and find Allergies & dietary restrictions. Every allergen in the registry gets a tri-state toggle:
- None — no record (the default)
- Dietary — a preference or restriction, not a medical allergy (vegetarian-adjacent flags like pork or gelatin live here)
- Allergy — a true allergy; warnings against confirmed allergens escalate to red

The medical & allergen disclaimer
The first time you record an allergy or dietary restriction — on web or mobile — LENA asks you to accept the medical & allergen disclaimer once. It states plainly that allergen flags are a convenience, not medical advice, that records can be incomplete or out of date, and that the product's physical label is always authoritative. Acceptance is stored once per user and covers every device.
- Recording requires acceptance. Setting a record to Dietary or Allergy without the disclaimer on file opens the consent prompt; accepting writes your record right away. The server enforces the same rule, so no client can skip it.
- Clearing never requires it. Switching back to None is always allowed, disclaimer or not.
- Warnings keep working either way. Flags you've already recorded — and warnings other members see — are never gated.

The full text lives on the public disclaimer page (linked from the site footer and the mobile caption lines). Recipe pages and mobile cook mode also carry a short "always check the product's label" caption near the allergen flags — see Mobile Allergy Tracking for the phone version.
On mobile, the same tri-state editor lives under the People tab — see Allergy Tracking on Mobile.
Where warnings appear
When a recipe, meal slot, grocery line, or event dish conflicts with someone's records, LENA says so inline:
- Recipe detail — an alert banner naming the member, the allergen, and the kind of conflict (E2E User — milk (allergy; contains)). Confirmed-allergen +
containsconflicts are red; dietary restrictions andmay_containflags stay amber. - Lists and cards — meal plans, grocery lists, and event pages show a small "N allergy warnings" chip; hover (web) or tap (mobile) for the member-by-member breakdown.
On the web, the banner sits at the top of the recipe page:

On mobile, warning icons ride along on grocery lines, meal-plan slots, recipe pages, and event dishes — see Allergy Tracking on Mobile.
Warnings are advisory — LENA flags the conflict and lets your household decide; nothing is blocked or hidden.
"No allergen information" is not "no allergens." Flag coverage is curated and still growing, so an entity that shows No allergen information simply has no data yet — it is never a statement that the food is safe.
Curating allergen data (web, admins)
Warnings come from flags on the catalog, managed on the web:
- The registry — Inventory → Allergens lists the taxonomy (milk, eggs, peanuts, tree nuts, wheat, gluten, soy, sesame, fish, shellfish, sulfites, corn, dietary entries like pork/beef/gelatin, and more). Admins can add, rename, or deactivate entries; an inactive allergen stops producing warnings everywhere at once.
- Flags — item and ingredient editors carry contains / may contain flag controls.
containsmeans the food has the allergen;may containis advisory (shared equipment, processing risk). Ingredient flags flow to every recipe line that references them — and a household's ingredient override wins over the catalog mapping, so flagging stays correct even when your household re-maps a product.

AI-suggested flags (web, admins)
Flagging a whole catalog by hand is tedious, so the assistant can propose flags for you — never applying them automatically. On Inventory → Allergen Suggestions:
- Pick a recipe and hit Suggest flags — the assistant reads its ingredients and proposes target + allergen + kind (
contains/may_contain) with a short rationale. - Proposals land in the review queue, filtered by pending / accepted / dismissed. Re-running the suggester can't stack duplicates — one open proposal per target + allergen.
- Accept writes the real flag under your name; Dismiss records the rejection for the audit trail. Either way the row keeps its provenance (which recipe produced it, who reviewed it, when).

Because every proposal needs a human accept, a wrong guess (and small local models do guess) never becomes a false warning — it just sits in the queue until you dismiss it.
← Back to Home