Skip to content

fix: enforce generic proxies for unbranded foods#30

Merged
maxjustships merged 1 commit into
mainfrom
fix/unbranded-generic-proxy-semantics
Jul 21, 2026
Merged

fix: enforce generic proxies for unbranded foods#30
maxjustships merged 1 commit into
mainfrom
fix/unbranded-generic-proxy-semantics

Conversation

@maxjustships

Copy link
Copy Markdown
Owner

Summary

  • Gate exact_product on user barcode, explicit brand/SKU intent, or a local exact pin/alias.
  • Prefer USDA Foundation/SR Legacy generic records for unbranded input and retain auditable OFF proxy identity/assumptions.
  • Prevent generic-proxy cache entries from satisfying later branded searches; add OFF, USDA, policy, and literal translated-meal regression coverage.

Verification

  • env -u NOMNOM_OFFLINE -u NOMNOM_DB_PATH PYTHONPATH=. pytest -q (204 passed)
  • env -u NOMNOM_OFFLINE -u NOMNOM_DB_PATH ruff check .
  • env -u NOMNOM_OFFLINE -u NOMNOM_DB_PATH PYTHONPATH=. pytest -q -vv targeted OFF/USDA/policy/literal smoke (12 passed)

Closes #29

Gate exact product identity on user barcode, explicit brand/SKU intent, or exact local identity. Prefer non-branded USDA Foundation/SR Legacy records and label safe branded OFF matches as auditable generic proxies while isolating cache intent.

Tests: pytest -q (204 passed); focused resolver/provider/CLI/docs suite (114 passed); ruff check .

Smoke: fresh temporary data directory with mocked OFF candidates resolved milk 3%, soy protein isolate, chicken pastrami, whole wheat bread, cream cheese, and peanuts as 6/6 generic_proxy rows with source, candidate brand/barcode, and explicit assumptions.
@maxjustships
maxjustships merged commit 055e3d2 into main Jul 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unbranded food must never become an arbitrary branded exact product

1 participant