Status: accepted · Date: 2026-11-06 · Related: ADR-0005, ADR-0015
Enforcement: contract tests that run against both the fake and the live adapter's recorded fixtures; a test that a learned-code row has no household column.
The kit is built by scanning barcodes. Product data comes from outside, and scanning must work in development and tests without a network.
Decision
- One adapter interface,
lookup(ean) → product | not found, with two implementations: Open Food Facts for production and a deterministic fake for development and tests. - Open Food Facts data is ODbL. The app shows the attribution ("Contains information from Open Food Facts, available under the ODbL") and share-alike obligations are met for any derived database we publish.
- Learned codes are anonymous. When a household corrects or adds a product, the server stores the code, name and suggested area, with no household id, device id or timestamp finer than a day.
- The lookup sends only the code. Nothing identifies the household; requests go through our API, not straight to a third party from the phone, so the user's IP does not reach it.
Consequences
- Free tier limits scans to 30 a month; the adapter is called only when a scan misses the local cache.
- If Open Food Facts changes terms or is unavailable, the adapter is replaced without touching the kit.