serve_token may transition through states - from participation through outcome and settlement.
It ensures each serve_token transitions in one direction only, making settlement and verification deterministic. Operators implement their own state handling logic as long as these protocol guarantees are met.
1. TL;DR
The AIP state machine defines allowed state transitions and invariants for decision lifecycle tracking, ensuring no event is double-counted or reversed. Operators implement their own detection, verification, and enforcement logic.
2. Why it matters
In legacy systems, duplicate events, repeated interactions, or delayed outcomes often lead to inaccurate settlement. AIP eliminates this by defining protocol-level state constraints - each serve token can only exist in one state at a time, with defined allowed transitions. This makes every transaction:- Verifiable
- Reproducible
- Auditable
3. State diagram
Each state represents a settlement condition. The protocol guarantees that once a token moves forward, it cannot regress. Operators implement their own state detection and transition logic to enforce these constraints.4. State transitions
The protocol defines allowed transitions and constraints. Operators implement their own detection, verification, and enforcement logic.| From | To | Trigger | Verification Responsibility |
|---|---|---|---|
| PENDING | EXPOSURE_SHOWN | exposure_shown event | Operator (may use platform signals) |
| EXPOSURE_SHOWN | INTERACTION_STARTED | interaction_started event | Operator (may use platform signals) |
| EXPOSURE_SHOWN | DELEGATION_STARTED | delegation_started event | Operator (canonical producer; may use platform consent and brand-agent availability signals) |
| INTERACTION_STARTED | TASK_COMPLETED | task_completed event | Operator (may use brand agent signals) |
| DELEGATION_STARTED | TASK_COMPLETED | task_completed event | Operator (may use brand agent signals) |
| EXPOSURE_SHOWN | SETTLED | Operator-defined expiration window | Operator |
| INTERACTION_STARTED | SETTLED | Operator-defined expiration window | Operator |
| DELEGATION_STARTED | SETTLED | Operator-defined expiration window | Operator |
| TASK_COMPLETED | SETTLED | Operator-defined settlement processing | Operator |
| Any State | REFUNDED | Operator-defined refund or reversal action | Operator |
- Transitions are one-directional
- No regression once a higher state is reached
- At most one billable terminal state per
serve_token
5. Example lifecycles
Recommend mode - full lifecycle
- Selection completes,
serve_tokengenerated → state = PENDING - Operator verifies a exposure_shown event → state = EXPOSURE_SHOWN
- Operator verifies an interaction_started event → state = INTERACTION_STARTED
- Operator verifies a task_completed event → state = TASK_COMPLETED
- Operator finalizes settlement → state = SETTLED
Delegate mode - full lifecycle
- Selection completes,
serve_tokengenerated → state = PENDING - Operator verifies a exposure_shown event → state = EXPOSURE_SHOWN
- User consents, the Operator confirms brand-agent availability, and delegation_started is recorded → state = DELEGATION_STARTED
- User completes task, task_completed event verified → state = TASK_COMPLETED
- Operator finalizes settlement → state = SETTLED
Recommend mode - participation only
- Selection completes → state = PENDING
- exposure_shown verified → state = EXPOSURE_SHOWN
- No further events within attribution window
- Operator settles CPX → state = SETTLED
6. How it prevents double billing
The protocol constrains allowed transitions:- Two exposure_shown events for the same token cannot both transition the state forward
- An interaction_started without prior exposure_shown state is not a valid transition
- A task_completed without a verified prior state is not a valid transition
7. Ledger integration
Operators maintain ledgers that record state transitions and final states, ensuring:- Immutable event chains
- Deterministic reconciliation
- Verified settlement records
8. Guarantees
The protocol guarantees:- State transitions are one-directional and irreversible.
- No regression once a higher state is reached.
- At most one billable terminal state per
serve_token. - Settled states are immutable and audit-safe.
- Both recommend and delegate mode follow the same state machine with branching at EXPOSURE_SHOWN.
Summary
The AIP state machine defines protocol-level constraints that ensure a single source of truth for every decision lifecycle - preventing duplicates, enforcing fairness, and keeping the ecosystem financially clean. Operators implement their own state management systems to enforce these constraints.