Visitar URL original
Regenerate component bindings for WIT 3.3.0 (cost-number gains `compound` case) · Issue #234 · rustledger/rustfava · GitHub
Skip to content

Regenerate component bindings for WIT 3.3.0 (cost-number gains compound case) #234

Closed

Description

@robcohen

rustledger#1700 (fixed in rustledger#1704) adds a fourth cost-number case to the WIT contract — rustledger:ledger 3.2.0 → 3.3.0:

variant cost-number {
  per-unit(string),
  total(string),
  per-unit-from-total(tuple<string, string>),
  /// Compound cost as written, e.g. `{5.00 # 10.00 USD}` — (per-unit,
  /// lump-total); the cost totals `N * per-unit + lump-total`.
  compound(tuple<string, string>),
}

What rustfava needs

  1. Regenerate the wasmtime-py bindings against the 3.3.0 WIT once an engine release ships it (next release after rustledger#1704; the component's runtime version() reports 3.3).
  2. Handle the new kind anywhere cost numbers are branched on (marshalling/display). Note the semantics: compound's second element is only the LUMP component — the effective per-unit is (N*a + b)/N and is NOT derivable from the cost-number alone. Post-booking egress never carries it (booking rewrites to per-unit-from-total with the combined total), so it only appears on pre-booking surfaces.

Urgency: low

Additive change — existing bindings keep working for every ledger that parses today. The new case only crosses the boundary for pre-booking egress of {a # b} cost specs, which the engine previously mis-parsed anyway (rustledger#1700: wrong weights AND wrong cost bases), so no correct behavior regresses in the interim.

Refs: rustledger/rustledger#1700, rustledger/rustledger#1704

🤖 Generated with Claude Code

Activity

  1. added a commit that references this issue on Jul 4, 2026
    6c5d271
  2. added a commit that references this issue on Oct 25, 2026
    9d15eda
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