fix(analyzer): resolve ingredient db entries by slug #40

Merged
abiwab merged 2 commits from fix/db-lookup-slug-normalization into main 2026-09-29 13:31:20 +02:00
Owner

Fixes #27.

Ingredients whose ingredients.yaml key isn't exactly slugify(name) (e.g. huile-dolive for "Huile d'olive", compiled as huile-d-olive) were missed by the analyzer: the alias index only lowercased names, so density conversion and nutrition were skipped.

  • One shared index (buildIngredientIndex) normalizing key, name and aliases with slugify; priority key > name > alias
  • db-merger reuses it instead of its own copy
  • gram db lint flags identifiers that collide once slugified
  • Tests, conformance case db-007-non-canonical-db-key, patch changeset
Fixes #27. Ingredients whose `ingredients.yaml` key isn't exactly `slugify(name)` (e.g. `huile-dolive` for "Huile d'olive", compiled as `huile-d-olive`) were missed by the analyzer: the alias index only lowercased names, so density conversion and nutrition were skipped. - One shared index (`buildIngredientIndex`) normalizing key, name and aliases with `slugify`; priority key > name > alias - `db-merger` reuses it instead of its own copy - `gram db lint` flags identifiers that collide once slugified - Tests, conformance case `db-007-non-canonical-db-key`, patch changeset
fix(analyzer): resolve ingredient db entries by slug
All checks were successful
CI / Build, Test & Publish (pull_request) Successful in 2m42s
48c856d326
Merge branch 'main' into fix/db-lookup-slug-normalization
All checks were successful
CI / Build, Test & Publish (pull_request) Successful in 2m23s
699c8d18d8
abiwab scheduled this pull request to auto merge when all checks succeed 2026-09-29 13:31:11 +02:00
abiwab merged commit 5280aeb943 into main 2026-09-29 13:31:20 +02:00
abiwab deleted branch fix/db-lookup-slug-normalization 2026-09-29 13:31:20 +02:00
Sign in to join this conversation.
No description provided.