mutations
Generated by the pinned ess generate --kind docs from ess. Structural validation establishes consistency; behaviour, storage and cross-record predicates remain implementation obligations.
Host-owned mutation attempt ledger with a private local binding; not a public mutation API.
connectors.mutations is one of connectors's bounded contexts. Back to the index.
Types
ApprovalMode
connectors.mutations.ApprovalMode is one of not_required, required and event_claim.
AttemptId
connectors.mutations.AttemptId wraps Uuid and is not interchangeable with one: the whole value of naming it separately is the crossings the model then refuses.
CredentialCustody
connectors.mutations.CredentialCustody is a record of two fields:
custody—connectors.mutations.CustodyOutcomeconnection—Optional<String>, which may be absent
Every value satisfies (not (custody == stored) or defined(connection)) and (not (custody == failed) or not (defined(connection))).
CustodyOutcome
connectors.mutations.CustodyOutcome is one of stored and failed.
EffectDeclaration
connectors.mutations.EffectDeclaration is a record of three fields:
profile—Stringeffects—List<connectors.mutations.ExecutableEffect>semantic_effects—List<connectors.mutations.SemanticEffect>
EffectKnowledge
connectors.mutations.EffectKnowledge is one of not_attempted, refused, applied and unknown.
ExecutableEffect
connectors.mutations.ExecutableEffect is one of external_write, network, process, local_system, send_external and session_establishment.
IdempotencyKind
connectors.mutations.IdempotencyKind is one of none, natural and keyed.
Observation
connectors.mutations.Observation is a record of three fields:
attempt_id—Optional<connectors.mutations.AttemptId>, which may be absentclassification—connectors.mutations.EffectKnowledgecause—Optional<String>, which may be absent
SemanticEffect
connectors.mutations.SemanticEffect is one of human_visible, billable and irreversible.
SessionEstablishmentObservation
connectors.mutations.SessionEstablishmentObservation is a record of two fields:
mutation—connectors.mutations.Observationready_session—Optional<connectors.sessions.SessionId>, which may be absent
Every value satisfies (not (defined(ready_session)) or mutation.classification == applied).
SettlementClockInterval
connectors.mutations.SettlementClockInterval is a record of two fields:
lower_unix_ms—Integerupper_unix_ms—Integer
Four of the types above are reached by nothing else in this system: connectors.mutations.CredentialCustody, connectors.mutations.EffectDeclaration, connectors.mutations.SessionEstablishmentObservation and connectors.mutations.SettlementClockInterval. No entity, view, command, event, error or crossing names them, so it is either vocabulary something outside this specification uses or a leftover — and only a person can tell which.
Entities
An entity is what this context is about: something with an identity that outlives any one request, a shape, and a lifecycle. The lifecycle is exhaustive — a move that is not drawn below is a move this specification does not permit, and that is the only way it says so. Every move is labelled with the command that takes it, because a move nothing can trigger is refused rather than drawn.
AttemptRecord
connectors.mutations.AttemptRecord.
An instance is identified by attempt_id, a connectors.mutations.AttemptId. The name is part of the model and not a convention: a view projects the identity under that name, so a projection inventing its own would disagree with the view.
It holds:
instance_id—Stringrequest_id—Stringoperation_id—Stringconnection_ref—Optional<String>, which may be absentinput_digest—Stringrequest_fingerprint—connectors.idempotency.RequestFingerprintapproval_mode—connectors.mutations.ApprovalModeapproval_ref—Optional<String>, which may be absentapproval_subject—Optional<connectors.delegation.CanonicalApprovalSubject>, which may be absentidempotency_key—Optional<String>, which may be absentowner_nonce—Uuidpublication_fence—Stringsettled_at—Optional<Timestamp>, which may be absentterminal_result_json—Optional<String>, which may be absent
It references at most one connectors.declarations.ServiceConfiguration, as instance, carried by AttemptRecord.instance_id. It references at most one connectors.auth_bindings.Connection, as connection, carried by AttemptRecord.connection_ref.
Every instance satisfies request_fingerprint.canonicalization_version == "adapter-v1-canonical-json", (state == Aborted or state == Completed or state == Failed or not (defined(settled_at))) and (state == Prepared or state == Dispatching or state == Indeterminate or defined(settled_at)) — a predicate over this entity's own fields, checked against them rather than stored as a sentence, so an invariant reading something the entity does not have is refused instead of documented.
Its state is a connectors.mutations.AttemptRecord.State, one of Aborted, Completed, Dispatching, Failed, Indeterminate and Prepared. That enum is synthesised from the lifecycle rather than declared beside it, so the states a view's filter compares and the states drawn below cannot disagree.
An instance is created in Prepared. Aborted, Completed, Failed and Indeterminate are terminal, so an instance may rest there forever. That is declared rather than inferred from having no way out: an entity that cannot leave a state is either finished or stuck, and only its author knows which.
Each move is taken by a declared command outcome, and a move nothing takes is refused as missing_causation rather than left as a state change nobody can trigger:
open_dispatch— taken byconnectors.mutations.OpenDispatchon itsopenedoutcomeabort— taken byconnectors.mutations.AbortPreparedon itsabortedoutcomecomplete— taken byconnectors.mutations.RecordCompletionon itscompletedoutcomerefuse— taken byconnectors.mutations.RecordRefusalon itsrefusedoutcomelose_outcome— taken byconnectors.mutations.RecordUncertaintyon itsindeterminateoutcome
An instance is brought into existence by connectors.mutations.PrepareAttempt on its prepared outcome.
Illegal transitions are illegal by absence: no rule forbids them, there is simply no arrow, because a rule would be a second place for the same truth to live. A diagram cannot show an absence, so the pairs it does not connect are listed here, derived from the same transitions — anything named below is a move this specification does not permit.
Abortedmay not becomeCompletedAbortedmay not becomeDispatchingAbortedmay not becomeFailedAbortedmay not becomeIndeterminateAbortedmay not becomePreparedCompletedmay not becomeAbortedCompletedmay not becomeDispatchingCompletedmay not becomeFailedCompletedmay not becomeIndeterminateCompletedmay not becomePreparedDispatchingmay not becomeAbortedDispatchingmay not becomePreparedFailedmay not becomeAbortedFailedmay not becomeCompletedFailedmay not becomeDispatchingFailedmay not becomeIndeterminateFailedmay not becomePreparedIndeterminatemay not becomeAbortedIndeterminatemay not becomeCompletedIndeterminatemay not becomeDispatchingIndeterminatemay not becomeFailedIndeterminatemay not becomePreparedPreparedmay not becomeCompletedPreparedmay not becomeFailedPreparedmay not becomeIndeterminate
Two views project it: AttemptSettlements and AttemptStates.
Views
A view is what the outside world is promised it can observe. Each one says which instances it contains and how soon it reflects a command that has already returned, because "you can read this" without "how soon" is the promise every flaky suite is built on.
AttemptSettlements
connectors.mutations.AttemptSettlements.
It reads AttemptRecord.
It contains every instance of that entity: no filter narrows it, which is a decision somebody made and not a line somebody omitted.
It exposes:
attempt_id—connectors.mutations.AttemptIdrequest_fingerprint—connectors.idempotency.RequestFingerprintapproval_mode—connectors.mutations.ApprovalModeapproval_subject—Optional<connectors.delegation.CanonicalApprovalSubject>, which may be absentsettled_at—Optional<Timestamp>, which may be absentstate—connectors.mutations.AttemptRecord.State
It declares no order, so the rows come back in whatever order the implementation has, and two reads may disagree.
Read-your-writes: it is current the moment the command that changed it returns. A caller that has just created an invoice and cannot see it in here has been told a lie about what it did.
A generated scenario asserts it once, immediately after the command: a view promising this and not keeping the promise has to fail the suite rather than be retried until it passes.
AttemptStates
connectors.mutations.AttemptStates.
It reads AttemptRecord.
It contains every instance of that entity: no filter narrows it, which is a decision somebody made and not a line somebody omitted.
It exposes:
attempt_id—connectors.mutations.AttemptIdapproval_mode—connectors.mutations.ApprovalModeinstance_id—Stringrequest_id—Stringoperation_id—Stringconnection_ref—Optional<String>, which may be absentinput_digest—Stringapproval_ref—Optional<String>, which may be absentidempotency_key—Optional<String>, which may be absentpublication_fence—Stringstate—connectors.mutations.AttemptRecord.State
It declares no order, so the rows come back in whatever order the implementation has, and two reads may disagree.
Read-your-writes: it is current the moment the command that changed it returns. A caller that has just created an invoice and cannot see it in here has been told a lie about what it did.
A generated scenario asserts it once, immediately after the command: a view promising this and not keeping the promise has to fail the suite rather than be retried until it passes.
Commands
AbortPrepared
connectors.mutations.AbortPrepared.
It takes:
attempt_id—connectors.mutations.AttemptIdsettled_at—Timestampterminal_result_json—String
It has two outcomes.
aborted — The default branch, taken when no other outcome's condition matched. It moves a connectors.mutations.AttemptRecord from Prepared to Aborted, along the declared move abort. The instance is the one named by the input field attempt_id. It emits connectors.mutations.AttemptAborted. It sets settled_at from input.settled_at and terminal_result_json from input.terminal_result_json. A test reaches it by constructing an input that satisfies no other outcome's condition.
wrong-state — Taken when the subject is resting in a state none of this command's moves start from — a connectors.mutations.AttemptRecord in Aborted, Completed, Dispatching, Failed and Indeterminate, which is what is left of the lifecycle once this command's own moves are taken away. The document lists none of it. No entity in this specification changes. It reports connectors.mutations.AttemptStateConflict, carrying state. It emits nothing. A test reaches it by driving an instance into one of those states and then issuing the command, because no input selects this branch.
OpenDispatch
connectors.mutations.OpenDispatch.
It takes:
attempt_id—connectors.mutations.AttemptId
It has three outcomes.
subject-missing — Taken when the existing subject's stored fields satisfy (approval_mode == required and not (defined(approval_subject.format))). No entity in this specification changes. It reports connectors.mutations.ApprovalSubjectMissing, carrying attempt_id. It emits nothing. A test establishes and independently observes the subject enum fact before selecting this branch.
opened — The default branch, taken when no other outcome's condition matched. It moves a connectors.mutations.AttemptRecord from Prepared to Dispatching, along the declared move open_dispatch. The instance is the one named by the input field attempt_id. It emits connectors.mutations.DispatchOpened. A test reaches it by constructing an input that satisfies no other outcome's condition.
wrong-state — Taken when the subject is resting in a state none of this command's moves start from — a connectors.mutations.AttemptRecord in Aborted, Completed, Dispatching, Failed and Indeterminate, which is what is left of the lifecycle once this command's own moves are taken away. The document lists none of it. No entity in this specification changes. It reports connectors.mutations.AttemptStateConflict, carrying state. It emits nothing. A test reaches it by driving an instance into one of those states and then issuing the command, because no input selects this branch.
PrepareAttempt
connectors.mutations.PrepareAttempt.
It takes:
instance_id—Stringrequest_id—Stringoperation_id—Stringconnection_ref—Optional<String>, which may be absentinput_digest—Stringrequest_fingerprint—connectors.idempotency.RequestFingerprintapproval_mode—connectors.mutations.ApprovalModeapproval_ref—Optional<String>, which may be absentapproval_subject—Optional<connectors.delegation.CanonicalApprovalSubject>, which may be absentidempotency_key—Optional<String>, which may be absentowner_nonce—Uuidpublication_fence—String
It has one outcome.
prepared — The default branch, taken when no other outcome's condition matched. It creates a connectors.mutations.AttemptRecord, which starts in Prepared. The new instance's identity is published as attempt_id on connectors.mutations.AttemptPrepared. It emits connectors.mutations.AttemptPrepared. It sets instance_id from input.instance_id, request_id from input.request_id, operation_id from input.operation_id, connection_ref from input.connection_ref, input_digest from input.input_digest, request_fingerprint from input.request_fingerprint, approval_mode from input.approval_mode, approval_ref from input.approval_ref, approval_subject from input.approval_subject, idempotency_key from input.idempotency_key, owner_nonce from input.owner_nonce and publication_fence from input.publication_fence. A test reaches it by constructing an input that satisfies no other outcome's condition.
RecordCompletion
connectors.mutations.RecordCompletion.
It takes:
attempt_id—connectors.mutations.AttemptIdsettled_at—Timestampterminal_result_json—String
It has two outcomes.
completed — The default branch, taken when no other outcome's condition matched. It moves a connectors.mutations.AttemptRecord from Dispatching to Completed, along the declared move complete. The instance is the one named by the input field attempt_id. It emits connectors.mutations.AttemptCompleted. It sets settled_at from input.settled_at and terminal_result_json from input.terminal_result_json. A test reaches it by constructing an input that satisfies no other outcome's condition.
wrong-state — Taken when the subject is resting in a state none of this command's moves start from — a connectors.mutations.AttemptRecord in Aborted, Completed, Failed, Indeterminate and Prepared, which is what is left of the lifecycle once this command's own moves are taken away. The document lists none of it. No entity in this specification changes. It reports connectors.mutations.AttemptStateConflict, carrying state. It emits nothing. A test reaches it by driving an instance into one of those states and then issuing the command, because no input selects this branch.
RecordRefusal
connectors.mutations.RecordRefusal.
It takes:
attempt_id—connectors.mutations.AttemptIdsettled_at—Timestampterminal_result_json—String
It has two outcomes.
refused — The default branch, taken when no other outcome's condition matched. It moves a connectors.mutations.AttemptRecord from Dispatching to Failed, along the declared move refuse. The instance is the one named by the input field attempt_id. It emits connectors.mutations.AttemptRefused. It sets settled_at from input.settled_at and terminal_result_json from input.terminal_result_json. A test reaches it by constructing an input that satisfies no other outcome's condition.
wrong-state — Taken when the subject is resting in a state none of this command's moves start from — a connectors.mutations.AttemptRecord in Aborted, Completed, Failed, Indeterminate and Prepared, which is what is left of the lifecycle once this command's own moves are taken away. The document lists none of it. No entity in this specification changes. It reports connectors.mutations.AttemptStateConflict, carrying state. It emits nothing. A test reaches it by driving an instance into one of those states and then issuing the command, because no input selects this branch.
RecordUncertainty
connectors.mutations.RecordUncertainty.
It takes:
attempt_id—connectors.mutations.AttemptIdterminal_result_json—String
It has two outcomes.
indeterminate — The default branch, taken when no other outcome's condition matched. It moves a connectors.mutations.AttemptRecord from Dispatching to Indeterminate, along the declared move lose_outcome. The instance is the one named by the input field attempt_id. It emits connectors.mutations.AttemptIndeterminate. It sets terminal_result_json from input.terminal_result_json. A test reaches it by constructing an input that satisfies no other outcome's condition.
wrong-state — Taken when the subject is resting in a state none of this command's moves start from — a connectors.mutations.AttemptRecord in Aborted, Completed, Failed, Indeterminate and Prepared, which is what is left of the lifecycle once this command's own moves are taken away. The document lists none of it. No entity in this specification changes. It reports connectors.mutations.AttemptStateConflict, carrying state. It emits nothing. A test reaches it by driving an instance into one of those states and then issuing the command, because no input selects this branch.
Events
AttemptAborted
connectors.mutations.AttemptAborted.
It carries:
attempt_id—connectors.mutations.AttemptId
Emitted by connectors.mutations.AbortPrepared on its aborted outcome.
Nothing in this system reacts to it.
AttemptCompleted
connectors.mutations.AttemptCompleted.
It carries:
attempt_id—connectors.mutations.AttemptId
Emitted by connectors.mutations.RecordCompletion on its completed outcome.
Nothing in this system reacts to it.
AttemptIndeterminate
connectors.mutations.AttemptIndeterminate.
It carries:
attempt_id—connectors.mutations.AttemptId
Emitted by connectors.mutations.RecordUncertainty on its indeterminate outcome.
Nothing in this system reacts to it.
AttemptPrepared
connectors.mutations.AttemptPrepared.
It carries:
attempt_id—connectors.mutations.AttemptIdapproval_mode—connectors.mutations.ApprovalMode
Emitted by connectors.mutations.PrepareAttempt on its prepared outcome.
Nothing in this system reacts to it.
AttemptRefused
connectors.mutations.AttemptRefused.
It carries:
attempt_id—connectors.mutations.AttemptId
Emitted by connectors.mutations.RecordRefusal on its refused outcome.
Nothing in this system reacts to it.
DispatchOpened
connectors.mutations.DispatchOpened.
It carries:
attempt_id—connectors.mutations.AttemptId
Emitted by connectors.mutations.OpenDispatch on its opened outcome.
Nothing in this system reacts to it.
Errors
ApprovalSubjectMissing
It carries:
attempt_id—connectors.mutations.AttemptId
Reported by connectors.mutations.OpenDispatch on its subject-missing outcome.
AttemptStateConflict
It carries:
state—connectors.mutations.AttemptRecord.State
Reported by connectors.mutations.AbortPrepared on its wrong-state outcome.
Reported by connectors.mutations.OpenDispatch on its wrong-state outcome.
Reported by connectors.mutations.RecordCompletion on its wrong-state outcome.
Reported by connectors.mutations.RecordRefusal on its wrong-state outcome.
Reported by connectors.mutations.RecordUncertainty on its wrong-state outcome.
Actors
An actor is who may ask this context for something. Every grant below points at a command this specification declares — a grant is a resolved reference, so "may invoke" something nobody wrote is not a permission this model can express, and an authorisation that authorises nothing cannot ship quietly.
LocalHost
connectors.mutations.LocalHost.
It may invoke AbortPrepared, OpenDispatch, PrepareAttempt, RecordCompletion, RecordRefusal and RecordUncertainty.
ServiceHost
connectors.mutations.ServiceHost.
It may invoke AbortPrepared, OpenDispatch, PrepareAttempt, RecordCompletion and RecordUncertainty.
Generated from connectors v1 · model digest e1e1672d0af4753cb8f2da6c0b22a7f6ae8ce9f7abc168f86169babdf1325787 · contract digest slice-sha256/2:c6ad9d96e0126258357223c8a124920fce1844888c200158186ca624d60515e6. Do not edit this file; change the specification and regenerate it with ess generate.