fix: bulb converts like head for garlic; cook footer names a to-taste food once (#866, #867) #881
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.48) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 514 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.374
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #881"
general
weight: 0.35
claude[bot]
Summary
Two small follow-ups to the unit-conversion PR #857.
2 cloves garlicagainst a pantry rowgarlic 2 bulbused to come backimprecisebecausebulbwas not a recognised unit. It is now read as a head, so the line is ready, flagged approximate, and deducts about 10 g (5 g a clove, 50 g a head, per ADR 0005).Not deducted: to taste (salt, salt); now(salt).What changes
ai-service/bubbly_chef/domain/normalizer.py:bulb/bulbsadded to the unit vocabulary as synonyms ofhead. Same typical weight as head (50 g for garlic), still flagged approximate.nextjs/src/components/recipes/CookReviewBody.tsx: the to-taste name list is de-duplicated by display name, case-insensitively, keeping first-appearance order and casing.Verify
Backend and a small render fix, so verified by fixture and jest. No production build was run.
| | main | this PR |
|---|---|---|
|
2 cloves garlicvsgarlic 2 bulb|imprecise|ready, approximate, 10 g, 1.8 bulbs left (stored-base and derived-base) ||
normalize_unit("bulb")|bulb|head|| two to-taste
saltlines |(salt, salt)|(salt)||
salt, Pepper, Salt, salt, pepper| all five |(salt, Pepper)|Not covered by a screenshot: the cook route would need a mocked authenticated cook flow on a production build for a one-line text change, so #867 is covered by jest only. Nothing hit live Gemini or Ollama.
Tests
unit_conversion_cases.pygainedcloves-off-two-bulbs(runs the real cook matcher anddeduct_pantry_item, in both stored-base and derived-base modes), plusnormalize_unitspelling cases forbulb/bulbs. 4 failures before the fix.cook-to-taste.test.tsx"names a food once when two to-taste lines repeat it, ignoring case". Before the fix it rendered(salt, Pepper, Salt, salt, pepper).Decisions
bulbis a global synonym ofheadin the unit vocabulary, not a garlic-only special case. The issue says "garlic (and shallots)", and a global alias is the smallest way to cover both. Alternative rejected: a per-food alias table, which is more machinery for the same result.bulbrow became a package unit likehead, so the ADR 0003 piece-vs-package guard must treat it as one. The first commit missed this (the guard read raw units without aliases), so2 cloves shallotsagainstshallots 3 bulbcame out ready and deducted 2 whole bulbs. The guard's raw-unit table is now derived from the unit aliases, so a spelling can no longer resolve to a piece/package unit while slipping the guard.2 cloves shallotsvs3 bulbis now imprecise with nothing deducted, same as aheadrow;2 cloves garlicvs2 bulbstill converts;1 bulb fennelvs a fennelheadrow matches as the same unit (the recipe-line parser now readsbulbas a unit too).tin(s),pack(s),packet(s),carton(s),tub(s),canister(s)(to can/package/container) andpiece(s)/each(to item). Before, e.g.4 slices breadagainst1 tingave a bogus shortfall.item/itemswere already guarded as the package unititem. A parametrized test asserts guard andnormalize_unitagree for every alias. Rejected alternative: adding onlybulb, which leaves the others open.bulbget the same-unit match but no cross-unit conversion (consistent with ADR 0005's "only citable figures").Out of scope
Fixes #866
Fixes #867
🤖 Generated with Claude Code