fix(kitchen): resolve an @& reference whatever the case of the ingredient #323

Merged
abiwab merged 3 commits from fix/referenceable-case into main 2026-11-29 20:55:27 +01:00
Owner

Summary

@&flour looked for an ingredient written earlier by its name as written, so after @Flour{100 g} it raised an UNDEFINED_REFERENCE error, although the shopping list already merges @Flour and @flour (same registry id). gram format lowercases ingredient ids, so formatting made the error vanish: a change of meaning, found by the fuzzer (format-preserves-meaning) while checking the pre-release 1.6 work.

  • packages/kitchen/src/processor.ts: the names seen so far are kept by registry id (slug), as everywhere else.
  • New referenceable-case.test.ts (2 of 3 tests fail without the fix) and fuzz/regressions/referenceable-case.gram.
  • No conformance golden changes (142/142, 24/24).

The fuzz input mixed CR-only line endings into it, but they play no part: the minimal case is Add @Flour{100 g}. then Mix @&flour..

Type of change

  • Bug fix (non-breaking change fixing an issue)

Quality checklist

  • Code formatted with Biome (bun run lint:fix)
  • TypeScript types validated (bun run typecheck)
  • Package tests passing (bun test)
  • Golden conformance suite passing (bun run conformance)
  • If changing a published package, a changeset is included (bun run change)
  • Rebuilt packages before testing downstream packages (bun run build)
## Summary `@&flour` looked for an ingredient written earlier by its name as written, so after `@Flour{100 g}` it raised an `UNDEFINED_REFERENCE` error, although the shopping list already merges `@Flour` and `@flour` (same registry id). `gram format` lowercases ingredient ids, so formatting made the error vanish: a change of meaning, found by the fuzzer (`format-preserves-meaning`) while checking the pre-release 1.6 work. - `packages/kitchen/src/processor.ts`: the names seen so far are kept by registry id (slug), as everywhere else. - New `referenceable-case.test.ts` (2 of 3 tests fail without the fix) and `fuzz/regressions/referenceable-case.gram`. - No conformance golden changes (142/142, 24/24). The fuzz input mixed CR-only line endings into it, but they play no part: the minimal case is `Add @Flour{100 g}.` then `Mix @&flour.`. ## Type of change - [x] Bug fix (non-breaking change fixing an issue) ## Quality checklist - [x] Code formatted with Biome (`bun run lint:fix`) - [x] TypeScript types validated (`bun run typecheck`) - [x] Package tests passing (`bun test`) - [x] Golden conformance suite passing (`bun run conformance`) - [x] If changing a published package, a changeset is included (`bun run change`) - [x] Rebuilt packages before testing downstream packages (`bun run build`)
fix(kitchen): resolve an @& reference whatever the case of the ingredient
Some checks failed
CI / Build & Test (pull_request) Failing after 1m51s
543bb2374a
chore: remove a stray debugging script
All checks were successful
CI / Build & Test (pull_request) Successful in 5m59s
eee3a1d43e
Merge branch 'main' into fix/referenceable-case
All checks were successful
CI / Build & Test (pull_request) Successful in 5m12s
e72f223543
abiwab merged commit 80c12a1791 into main 2026-11-29 20:55:27 +01:00
Sign in to join this conversation.
No description provided.