Interface Commitment
- All Known Implementing Classes:
DefaultCommitment
A commitment is created when an agent makes a promise or accepts a request. The performer is obligated to fulfill the commitment to the requester.
Lifetime — a commitment does not outlive the process that tracks it. It
lives in the tracking agent's memory, so a restart loses it and nothing will move it to
CommitmentState.VIOLATED afterwards, however overdue it becomes. A commitment is an
observable promise within a running dialogue, not an audit record: anything that must
be auditable belongs in the agent's own persistent state. See ADR-031.
Commitments in a terminal state are swept after a retention window (default 5 minutes), and deadline violations are detected by the same sweep — so a violated commitment stays readable for at least one interval after it is marked.
- Since:
- 0.5.0
-
Method Details
-
getId
String getId()- Returns:
- unique identifier for this commitment
-
getPerformer
String getPerformer()- Returns:
- the agent who must fulfill the commitment
-
getRequester
String getRequester()- Returns:
- the agent who requested and awaits fulfillment
-
getState
CommitmentState getState()- Returns:
- the current state of this commitment
-
getContent
Object getContent()- Returns:
- the content/terms of the commitment
-
getConversationId
String getConversationId()- Returns:
- the conversation in which this commitment was created
-
getCreatedAt
Instant getCreatedAt()- Returns:
- when this commitment was created
-
getDeadline
- Returns:
- optional deadline by which the commitment must be fulfilled
-
getHistory
List<CommitmentEvent> getHistory()- Returns:
- history of state transitions
-
isActive
default boolean isActive()- Returns:
- true if this commitment is still active (not terminal)
-
isOverdue
default boolean isOverdue()- Returns:
- true if the deadline has passed
-