Skip to content

Truthful operation outcomes

Success messages describe completed, confirmed facts. UI code must not infer success from a click, optimistic intent, an in-memory record’s persisted? flag before commit, or submission to an external service.

A success response is produced after the operation’s complete transaction has returned successfully. Related writes, such as a Core resource and its Visitor location, belong to the same transaction. Validation or write failures must not show success and must not leave half the operation committed. If the server cannot determine the result of a commit or post-commit work, the response must say that the outcome could not be confirmed rather than assert a failure or invite blind retries. Recovery can require the user to inspect the data first.

Tests must verify the data in a separate read and exercise failure before and during commit. An explicit SchemaContract checks that a model’s cached mapping contains the columns required for a write, failing before that write if not. This is a guard against a stale model mapping, not a database availability check or a substitute for proper migrations. Development uses bin/dev-migrate to restart long-lived Rails processes after schema changes; deployments must have their own migration and restart procedure. The guard reads model metadata and does not introduce a database reread on every write.

A request sent to a provider, provider acceptance, delivery, and recipient reading are separate facts. Do not describe one as another. When the response is unknown, retain an explicit unconfirmed state. Delivery and retry semantics belong to the relevant channel and provider adapter. Reliable asynchronous outbound delivery, idempotency and reconciliation will be designed when those flows are implemented; this document does not add them to address search.