| name | choice-semantics |
| description | Trigger Pattern Always required for DAML audits - Inject Into Breadth agents, depth-state-trace, depth-edge-case |
CHOICE_SEMANTICS Skill (DAML)
Trigger Pattern: Always required for DAML audits
Inject Into: Breadth agents, depth-state-trace, depth-edge-case
Finding prefix: [DML-CHS-N]
Rules referenced: R8, R10, R12, R14
In DAML a "write" is a choice that archives a contract and creates a successor. The consume-mode of a choice determines whether the contract survives the exercise: a consuming choice (the default) archives the contract on the first exercise; a nonconsuming choice leaves it active. Misusing consume-mode is the DAML analog of double-spend: a value-moving choice marked nonconsuming can be exercised repeatedly on the same contract. Pre/postconsuming ordering bugs (self-fetch after archive), value-conservation gaps across split/merge/transfer, accumulator/cap drift across transactions, and cancel/abort paths that leave consequences un-unwound round out this class.
1. Consume-Mode Inventory
For EVERY choice, record its consume-mode and whether the action should be one-shot:
| Template.Choice | Consume-Mode | Moves Value / Mutates State? | Should Be One-Shot? | Mismatch? |
|---|
{T.C} | consuming/nonconsuming/preconsuming/postconsuming | YES/NO | YES/NO | [DML-CHS-N] if nonconsuming + should-be-one-shot |
Critical patterns to flag:
- A
nonconsuming choice that transfers, mints, splits, or withdraws value → exercisable repeatedly on the same active contract (, double-spend).