[Bug] Recipe ingredients are not automatically added to the product catalog #31
Labels
No labels
needs-gherkin
type/bug
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
psycodepath/hrp#31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Creating a recipe does not add its ingredients to the grocery product catalog automatically. Ingredients silently accumulate in the
pending_taxonomy_itemsqueue and only reach the catalog if someone manually runsbin/console grocery:process-taxonomy.Root cause: commit
070542d("queue taxonomy suggestions in SQLite and process asynchronously via CLI worker") changedRegisterRecipeIngredientsInCatalogListenerfrom a synchronous catalog write (TaxonomySuggestor::resolveOrSuggest(...)) to an enqueue-onlyINSERT INTO pending_taxonomy_items. The catalog insertion moved into thegrocery:process-taxonomyworker — but nothing runs that worker (no cron, systemd timer, compose service, or in-request trigger anywhere in the repo), so the queue is never drained.The rest of the pipeline is healthy:
Recipe::create()recordsRecipeCreated, the handler dispatches it, the listener is registered on the shared dispatcher, and enqueue/claim/save all resolve to the same per-tenant SQLite DB.Reproduction Steps
grocery:process-taxonomyworker is not running./grocery/catalog).Current Behavior
"Tomato" is absent from the catalog. The row sits unseen in
pending_taxonomy_itemsindefinitely.Expected Behavior
"Tomato" appears in the catalog immediately after the recipe is saved, and is later enriched (category, shelf life, canonical unit) by the background worker.
Test Scenarios (Gherkin)
Acceptance Criteria (When Fixed)
grocery:process-taxonomyautomatically in productionProposed Fix (hybrid)
CatalogProduct(name, stemmed name, recipe unit), deduped by stemmed name, then enqueue for enrichment. Catalog is correct instantly even if the worker/Gemini is down.grocery:process-taxonomyfrom create to enrich — load the existing product and update it in place via Gemini (category + shelf life + canonical unit). The pending queue is the "needs enrichment" marker.workerservice todocker-compose.ymlthat polls the command on an interval.Environment
Additional Context
070542d)Recipe::updateDetailsrecords no event); semantic ingredient consolidation beyond stemmed-name dedup; confirm worker tenant coverage (tenants.json, falls back todefault).Notes