{
 "library": "bootstrap",
 "version": "0.11.0",
 "root": "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5",
 "license": null,
 "slug": "Retry",
 "ref": "Retry#4f9f",
 "hash": "sema:Retry#mh:SHA-256:4f9fdfc5b1dafd31221e9426d62c02af80c6356ef5b446eddd3f50da961d1aa2",
 "stub": "4f9f",
 "layer": "Mind",
 "type": "Strategy",
 "summary": "Classified re-attempt with backoff conditioned on failure type",
 "mechanism": "Intelligent re-attempt of failed coordination with failure-informed strategy. After BREAK + COMPENSATE, agent evaluates: (1) CLASSIFY failure—transient (timeout, rate-limit, network blip) vs persistent (capability gap, protocol mismatch, explicit rejection). (2) CHECK retry_hint from BREAK (partner may say 'don't retry' or 'wait 30s'). (3) CONSULT failure_history—same error repeating? CircuitBreaker#3caa threshold reached? (4) COMPUTE Backoff#9e59—adaptive based on failure type: transient uses ExponentialBackoff#f5e5, persistent uses longer fixed delay or triggers abort. (5) VERIFY changed_conditions—has something changed that makes retry worthwhile? (6) EXECUTE retry if within budget and conditions favor success, else ABORT with retry_exhausted status. Retry CARRIES FORWARD: failure context, partner state observations, environmental data. Retry RESETS: coordination state (fresh start, don't resume mid-stream). It handles transient failures by re-queuing the task, distinguishing them from terminal failures that trigger Break#5003 and Compensate#4b87.",
 "invariants": [
  "Classifies the failure before deciding, and records the classification.",
  "Backoff#9e59 applied between attempts.",
  "Attempts do not exceed `max_attempts`."
 ],
 "parameters": [
  {
   "name": "max_attempts",
   "type": "Integer",
   "range": "[1, 10]",
   "description": "Attempts before giving up. Referenced by the third invariant, which previously named a Max_Retries nothing defined."
  }
 ],
 "signature": [],
 "preconditions": [
  "A failure has occurred and its details are available to classify"
 ],
 "postconditions": [
  "Success or definitive failure"
 ],
 "failure_modes": [
  "Misclassifying persistent failure as transient (wastes retry budget).",
  "Misclassifying transient as persistent (gives up too soon).",
  "Backoff#9e59 too aggressive (slow recovery from transient issues).",
  "Backoff#9e59 too timid (hammers already-failing system).",
  "CircuitBreaker#3caa too sensitive (abandons recoverable situations).",
  "Retry succeeds but same failure recurs (didn't address root cause).",
  "Changed_conditions check misses relevant changes."
 ],
 "domain": "",
 "caution": "",
 "sources": [],
 "name": "Retry",
 "builds_on": [
  {
   "alias": "circuit_breaker",
   "relation": "references",
   "library": "bootstrap",
   "slug": "CircuitBreaker",
   "ref": "CircuitBreaker#3caa",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/CircuitBreaker"
  },
  {
   "alias": "compensate",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Compensate",
   "ref": "Compensate#4b87",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Compensate"
  },
  {
   "alias": "break",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Break",
   "ref": "Break#5003",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Break"
  },
  {
   "alias": "backoff",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Backoff",
   "ref": "Backoff#9e59",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Backoff"
  },
  {
   "alias": "exponential_backoff",
   "relation": "composes_with",
   "library": "bootstrap",
   "slug": "ExponentialBackoff",
   "ref": "ExponentialBackoff#f5e5",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/ExponentialBackoff"
  }
 ],
 "related": [
  {
   "alias": null,
   "relation": "related",
   "library": "bootstrap",
   "slug": "Plateauturn",
   "ref": "Plateauturn#240d",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Plateauturn"
  }
 ],
 "used_by": [
  {
   "slug": "ContingencyPlan",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/ContingencyPlan"
  },
  {
   "slug": "FrameError",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/FrameError"
  },
  {
   "slug": "Plateauturn",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Plateauturn"
  },
  {
   "slug": "ReAttempt",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/ReAttempt"
  }
 ],
 "url": "https://semahash.org/vocabularies/bootstrap/patterns/Retry",
 "md_url": "https://semahash.org/vocabularies/bootstrap/patterns/Retry.md",
 "library_url": "https://semahash.org/vocabularies/bootstrap"
}
