Abilities and use¶
An ability definition says what kind of work is available and where it comes from. An ability instance says which occurrence is currently being resolved. A use record says that the profile’s particular use condition happened. Those three objects should not be merged into a single “ability activated” flag.
Read resources and payment, object operations and priority and completion for the surrounding procedures. This chapter follows the reference profile’s explicit ability categories and timing assumptions.
Identify the source and the participant performing the work¶
Definitions carry a kind, source, controller, structured instructions and activity metadata. A source can name a current object or a rule. A granted ability uses its recipient as the source under the relevant source relation; source ownership does not automatically determine the controller or executor of every instruction.
The instruction sequence is a sequence of admitted instruction identifiers. It is not arbitrary prose that this module parses. Permission, effective activity, target legality, cost satisfaction and scheduling enter through their own contracts or supplied providers. A player’s observation must still omit concealed metadata even when the internal model can evaluate it.
An instance frame captures the source, source zone, instruction sequence and caller, then tracks a cursor and completion flags:
reference-profile · input revision 2 · CC0 1.0
OpenAbilityResolution9(id,kind,source,sourceZone,instructions,caller) ==
[id |-> id,kind |-> kind,source |-> source,sourceZone |-> sourceZone,instructions |-> instructions,
caller |-> caller,cursor |-> 1,phase |-> "Ready",firstImminent |-> FALSE,lastFinished |-> FALSE,
detached |-> FALSE,complete |-> FALSE,returned |-> FALSE]Definition and resolved references · Exact module download · Source bundle and reproduction instructions
The captured definition gives this occurrence a stable basis for its work. It does not authorize retargeting an old object reference to a new copy, or interpreting a later registry revision as though it had been present when this occurrence began.
Distinguish a category from an interrupt condition¶
The profile distinguishes static, paid, conditional, play and procedure abilities. Static abilities have a different instruction-shape contract from abilities that execute an instruction sequence. An interrupt condition is another classification: the relevant flag or supplied instruction structure can make interrupt handling necessary.
For a paid ability, a matching all-paid trigger receipt can detach the instance before its instructions begin. A conditional instance instead has to pass its current recognition, activity and resolution guards before becoming imminent. The scheduler determines when those stages may proceed; a true payment fact alone does not drain every associated reaction window.
Follow DetachPaidAbility9 and BeginAbilityInstructions9 for the smaller frame relations. Their supplied eligibility and scheduling inputs remain obligations of the caller.
Finish the instruction that the cursor actually names¶
An instruction becomes imminent, passes its interrupt boundary and resolves. Its completion receipt must name both this instance and the instruction at its current cursor:
reference-profile · input revision 2 · CC0 1.0
FinishAbilityInstruction9(before,after,actualInstructionReceipt) ==
/\ before.phase = "Resolving" /\ ~before.complete
/\ actualInstructionReceipt.abilityInstance = before.id
/\ actualInstructionReceipt.instruction = before.instructions[before.cursor] /\ actualInstructionReceipt.complete
/\ after = IF before.cursor = Len(before.instructions)
THEN [before EXCEPT !.phase = "Complete",!.lastFinished = TRUE,!.complete = TRUE]
ELSE [before EXCEPT !.phase = "Between"]Definition and resolved references · Exact module download · Source bundle and reproduction instructions
As an authored example, instance 31 can have instructions <<41, 42>>. A complete receipt for instance 31, instruction 42, does not finish the first instruction while the cursor still names 41. A receipt for instance 32 does not finish either instruction of 31. These examples illustrate identity guards; they are not retained checker traces.
After a nonfinal instruction, the frame waits between instructions. Advancing the cursor needs the required checkpoint and newer chains to have completed. After the final instruction, the frame becomes complete, but its final checkpoint and chains still govern its return to the recorded caller.
Count use at the profile’s actual boundary¶
The use condition depends on the ability category and what actually happened:
reference-profile · input revision 2 · CC0 1.0
AbilityUseDue9(kind,entirelyMandatory,actualTriggerCostPaid,actualOptionalEffectsResolved,actualOtherOptionalChoiceComplete) ==
CASE kind = "Paid" -> actualTriggerCostPaid
[] kind = "Conditional" -> ~entirelyMandatory /\ actualOptionalEffectsResolved
[] OTHER -> ~entirelyMandatory /\ actualOtherOptionalChoiceCompleteDefinition and resolved references · Exact module download · Source bundle and reproduction instructions
A paid ability’s use is tied to paying its trigger cost. A conditional ability’s use depends on optional effects actually resolving, rather than merely recognizing its trigger. The helper excludes entirely mandatory cases from those optional-use branches. Other categories consume their separately supplied optional-choice completion fact.
An authored example is a paid trigger with an accepted zero-valued payment. The payment can satisfy the paid-use condition while leaving the numerical balance unchanged. A recognized conditional instance that never executes an optional effect does not satisfy the conditional-use condition merely by appearing in a window.
The more detailed RecordConditionalExecutionUse96 checks the actual executed part identifiers against the definition and records the first relevant optional execution. It is stronger than trusting a user-interface selection or a prediction of what an effect might accomplish.
Keep use history separate from current availability¶
Use events carry fresh use identifiers, instance identity, source and participant. A turn-use record additionally associates the use with a turn and the relevant ability/source. Passing priority, reopening a window or withdrawing a registry entry should not erase that historical occurrence.
This matters when payment uses a specially permitted source or hosted counters. The supplied permission witness must identify the payment and the actual paid counters. A balance total by itself cannot identify which source permission was exercised. Movement or loss of a host can also affect current targets without undoing an already recorded use.
Return only after the surrounding work is complete¶
Completion of the final instruction and return are distinct predicates. ReturnAbility9 waits for the final checkpoint and chains and checks the caller. A source leaving play is not, by itself, a replacement return protocol for detached work.
The abilities evidence states which assertions and finite procedures were checked and how supplied providers were treated. These contracts do not establish an unrestricted parser or interpreter for all ability text. The ability reference develops the individual guards; availability and lifetime follows recognition through source loss, restoration and detached continuation.