Repository navigation
Conversation
- Migration for GRIT's food tables (foods, barcodes, servings, nutrients, names, sources) with a trigram search index, nutrient snapshots on food logs, and food links on remembered and favourite foods - Food search from GRIT's own data first, barcodes looked up locally (UPC-E aware) and saved when found live, Smart log matched to measured foods, and a fix for alcohol's calories in estimates - Nutrients by day and week against US Dietary Reference Intakes, a coach line and a 'running low' check-in - App: serving picker, Verified labels, Nutrients screen, often-low card and a food data sources screen - Start of the importer package (writer and shared record code)
- Search keeps exact matches and the user's memories when a ranking query fails or times out, puts the user's own foods first after the typo search, and matches memories on their name - Smart log checks calories for branded matches too (a dry pack isn't cooked rice), matches plain foods on whole words within 20%, links remembered foods to the database, and keeps the link when an older app doesn't send it; it now sends the phone's country - A calorie edit scales a log's grams with its nutrient snapshot - Logs only raise a food's shared popularity with 'Improve GRIT's food data' on - Food names are capped at 200 characters, serving labels lose weight-first text, and small nutrient amounts keep two figures - The coach isn't told 'nothing often low' on too little data, and the Nutrients screen shows sodium and saturated fat on days without vitamin data
- yoghurt = yogurt, courgette = zucchini, prawn = shrimp and a few more single-word synonyms in search and Smart log matching - Food data sources lists USDA, Open Food Facts and the UK's CoFID; the other national tables join when they're imported - ROADMAP, the Phase 7 plan's as-built notes, README, trust and safety (licences, nutrient wording, food-data consent) and the device testing checklist
A common word matches hundreds of thousands of products, and ranking them all took over a second (p95 1.3 s on 3.4 million foods). Foods now have a coreText column, searched in full: generic foods, dishes, and products GRIT users have logged or scanned. Other products are sampled, and the user's own foods are always included. Ranking gives more weight to quality and verified data. p95 is now 131 ms on 3.4 million foods. The food database tests use made-up barcodes, so real imported data can't collide with them.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The test logged its workout at 9am today, which the helper moves to yesterday when run before 9am UTC, before the challenge had started. It now logs the workout a minute ago, or at midnight UTC.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 7 of
docs/PLAN_PHASES_5_TO_9.md: GRIT's own food database, search and barcodes on it, and micronutrients from measured values.What's in it
Food database and importers (
packages/food-data, new)DIRECT_URLsecret, and afood-dataCI job tests the package.Search, barcodes and logging
FOOD_LIVE_SEARCH) until its full import.Micronutrients (measured and label values only)
GET /nutrients/dayand/nutrients/weekagainst US Dietary Reference Intakes, with how much of the day's calories have data. Today is never called low.Docs: ROADMAP, the plan's as-built notes, README, trust and safety (licences, wording, consent) and the device testing checklist.
Database
Two additive migrations, both already applied to Supabase and recorded in
_prisma_migrations:20261109120000_phase7_food_database20261109130000_food_core_searchThe food tables are empty in production until the import runs.
Checks
After merging
DIRECT_URLrepository secret (Supabase session pooler, port 5432), then run the Food data workflow forfdcandcofid(about 90 MB, within the Free plan).Not in this PR: