Skip to content

cooklang format drops the = scaling-lock marker #702

Closed

Description

@drawmeanelephant

Suggested labels: bug, area: cli


Discovery audit finding M5 (medium) — cooklang/cookcli @ 7c2f48b (v0.38.1), audited 2026-10-12. Repro verified. Round-trip corruption.

Summary

--format cooklang drops the = scaling-lock marker.

Where

crates/format/src/cooklang_source.rs:259-300 (ComponentFormatter never emits = for scalable: false).

Repro

@egg{=2} → @egg{2}; reparse gives scalable: true — scaling the round-tripped recipe ×10 gives 20 eggs instead of 2.

Expected

The = lock survives the round trip; the quantity stays non-scalable.

Actual

The marker is dropped; the quantity silently becomes scalable.

Acceptance criteria (red → green)

  • Red: @egg{=2} formats to @egg{2} and reparses with scalable: true.
  • Green: the output keeps @egg{=2} and reparses with scalable: false.

Verification

Executed repro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions