{
 "library": "bootstrap",
 "version": "0.11.0",
 "root": "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5",
 "license": null,
 "slug": "IdempotentWrite",
 "ref": "IdempotentWrite#7226",
 "hash": "sema:IdempotentWrite#mh:SHA-256:7226e14f5caed42394b33c28989972451a03b43ba531e8cb6a9975a0fee4ab2c",
 "stub": "7226",
 "layer": "Infrastructure",
 "type": "Primitives",
 "summary": "Safe retries via unique keys",
 "mechanism": "A technical primitive where every write request includes a unique 'Idempotency Key'. The receiver maintains a Cache#465f of processed keys. If it receives a duplicate key, it returns the stored result without re-executing the side effects. This makes 'At-Least-Once' delivery safe. It uses a keyed StateLock#c9c2 to deduplicate requests, ensuring only the first write executes while subsequent ones return the cached result.",
 "invariants": [
  "Idempotence: Apply(Apply(Req)) stands in Equivalence#23f0 with Apply(Req) — a repeated key returns the first result rather than executing again.",
  "Safety: Duplicate requests trigger zero additional side effects"
 ],
 "parameters": {},
 "signature": [],
 "preconditions": [
  "Receiver has state storage for keys"
 ],
 "postconditions": [
  "Action executed exactly once (logically)"
 ],
 "failure_modes": [
  "Key collision (two different requests use same key)."
 ],
 "domain": "",
 "caution": "",
 "sources": [],
 "name": "IdempotentWrite",
 "builds_on": [
  {
   "alias": "equivalence",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Equivalence",
   "ref": "Equivalence#23f0",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Equivalence"
  },
  {
   "alias": "cache",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Cache",
   "ref": "Cache#465f",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Cache"
  },
  {
   "alias": "state_lock",
   "relation": "references",
   "library": "bootstrap",
   "slug": "StateLock",
   "ref": "StateLock#c9c2",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/StateLock"
  }
 ],
 "related": [
  {
   "alias": null,
   "relation": "related",
   "library": "bootstrap",
   "slug": "UniqueHandle",
   "ref": "UniqueHandle#c3fb",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/UniqueHandle"
  }
 ],
 "used_by": [
  {
   "slug": "StateSnapshot",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/StateSnapshot"
  }
 ],
 "url": "https://semahash.org/vocabularies/bootstrap/patterns/IdempotentWrite",
 "md_url": "https://semahash.org/vocabularies/bootstrap/patterns/IdempotentWrite.md",
 "library_url": "https://semahash.org/vocabularies/bootstrap"
}
