{
 "library": "bootstrap",
 "version": "0.11.0",
 "root": "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5",
 "license": null,
 "slug": "ContextSwitch",
 "ref": "ContextSwitch#aa92",
 "hash": "sema:ContextSwitch#mh:SHA-256:aa928020743949b151e03433b563540eaf1bb56dad262297d2907bd0473931e2",
 "stub": "aa92",
 "layer": "Society",
 "type": "Protocols",
 "summary": "Explicit, scoped protocol-mode toggle with enter/revert boundaries",
 "mechanism": "Agent#e127s explicitly signal a change in Context#c1b7 (protocol Mode#29d3), and all subsequent messages are interpreted under the new ruleset until a 'Revert' signal is sent. The new context pushes onto a stack; Revert pops it. Unlike an ambient Mode#29d3 change (which applies to the whole agent), ContextSwitch is scoped to a specific conversation or channel and carries explicit enter/exit boundaries.",
 "invariants": [
  "The switch is signalled explicitly; it is never inferred from content.",
  "Revert pops the most recent switch, not an arbitrary one.",
  "Scoped to one conversation or channel, unlike an ambient Mode#29d3 change."
 ],
 "parameters": {},
 "signature": [],
 "preconditions": [],
 "postconditions": [],
 "failure_modes": [
  "Unbalanced stack: a switch is never reverted, so the ruleset outlives the exchange it was for.",
  "Scope leak: messages outside the switched channel are interpreted under the new ruleset."
 ],
 "domain": "",
 "caution": "",
 "sources": [],
 "name": "ContextSwitch",
 "builds_on": [
  {
   "alias": "context",
   "relation": "accepts",
   "library": "bootstrap",
   "slug": "Context",
   "ref": "Context#c1b7",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Context"
  },
  {
   "alias": "mode",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Mode",
   "ref": "Mode#29d3",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Mode"
  },
  {
   "alias": "agent",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Agent",
   "ref": "Agent#e127",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Agent"
  }
 ],
 "related": [],
 "used_by": [
  {
   "slug": "WorkerMode",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/WorkerMode"
  }
 ],
 "url": "https://semahash.org/vocabularies/bootstrap/patterns/ContextSwitch",
 "md_url": "https://semahash.org/vocabularies/bootstrap/patterns/ContextSwitch.md",
 "library_url": "https://semahash.org/vocabularies/bootstrap"
}
