Skip to content

Cooklang scale (parked): persist scaled view in graph.json #599

Description

@drawmeanelephant

Status

Parked. Do not start unless a consumer cannot live with the S2 command and someone authorizes an IR bump. Not implied by S1–S3.

Parent: #554.

Why it is parked

S1 and S2 keep authored graph.json quantities as the strings the author wrote. The scaled view is derived and printed. That is load-bearing:

  • The 0.4 recipe facet schema is additionalProperties: false. Adding class / scaled on cookQuantity is a breaking schema change unless schemaVersion moves.
  • Putting a factor into every IR build would force every Cooklang compile to pick a factor (default 1 is noise; anything else is a new input).
  • The editor and other consumers can call boris recipe-scale when they want a scale.

If authorized later

  • Bump the recipe IR (likely 0.5.0) and the compiler id suffix contract.
  • Decide whether the persisted view is (a) classification only (empty / scalable / fixed on each amount) or (b) a scaled overlay that also records the factor.
  • Keep .cook canonical. Do not replace authored amounts with scaled ones in graph.json.
  • Update test-ir-schema, fixtures, and the editor adapter’s accepted IR versions.

Non-goals even then

  • Do not silently reshape 0.4.0.
  • Do not write scaled amounts back into source.

Default

Leave quantities as authored strings. Scale is a command, not a compile side effect.

Activity

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions