Expand description
ADR-103 Amendment 1: deterministic cost_unit for the per-dispatch
audit-row resource payload enrichment.
cost_unit = base_weight(verb) + per_item_weight(verb) x item_count x model_count, computed with checked i64 arithmetic and clamped to
i64::MAX on overflow rather than omitted (ADR-103 Amendment 1 Part 1).
Amendment 1 commits only to the formula’s shape and to
per_item_weight(verb) = 0 for every verb outside its closed
embedding-bearing family. The base_weight / per_item_weight
magnitudes are left as “deterministic, hand-set constants … fixed at
implementation time and not measured”. This module ships base_weight = 1 uniformly across every verb and per_item_weight = 1 for every
embedding-bearing verb, as the documented default pending a dedicated
per-verb weights table (see the PR body that introduced this module).
Functions§
- base_
resource_ payload - Build the
resourcepayload object for a dispatch that did not resolveOk:{"work_class": "interactive"}, with nocost_unitkey. - cost_
unit_ for_ dispatch - Compute
resource.cost_unitfor one successful dispatch. - resource_
payload - Build the
resourcepayload object,{"work_class": "interactive", "cost_unit": N}, for one successful verb dispatch.