fix(kitchen): applyScale scales a reference's quoted quantity (audit C1) #68
No reviewers
Labels
No labels
bug
discussion
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gram-lang/gram!68
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/audit-c1"
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?
Audit C1, present since 1.3.0. The documented parity
applyScale(compile(ast), k) == compile(ast, { scaleFactor: k })was false forUse &mix{100g}: applyScale left the quantity quoted in the step at 100 where compile gave 200.Cause:
applyScale's walk over step content only handled tokens with anidand notype(plain ingredients/cookware) ortype: "alternative". A reference to an intermediate is created withtype: "reference"(processor.ts), so it was skipped.compile({ scaleFactor })scales it through another path, hence the gap.Fix: include
type: "reference"in that walk.it.todoof the B11 property test becomes a real invariant over the seeded random recipesci (1325 tests) and conformance 98/98 pass.