{
 "library": "bootstrap",
 "version": "0.11.0",
 "root": "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5",
 "license": null,
 "slug": "Rally",
 "ref": "Rally#3ef1",
 "hash": "sema:Rally#mh:SHA-256:3ef1a658874f6a5333a43d3362227b9ae446ee11e78868a33678cdf064b8fb35",
 "stub": "3ef1",
 "layer": "Society",
 "type": "Coordination",
 "summary": "Enable ad-hoc multi-party coordination",
 "mechanism": "Ad-hoc group-formation Protocol#f583. An initiator broadcasts RALLY with group requirements encoded as an AcceptSpec#37fa, participant Criteria#92ab, `deadline`, `min_participants`, and `max_participants`. Responders submit tentative ENLIST messages. Before `deadline`, the initiator closes ENLIST intake, executes Select#decf over the responders using the participant criteria with `limit = max_participants`, sends MUSTER to those selected, and collects confirmations. Confirmation closes when every selected responder has replied or at `deadline`; only selected responders who confirm by then count toward `min_participants`. Rally then yields one Outcome#7537 whose `outcome_id` identifies this Rally run. If fewer than `min_participants` confirmed, `outcome.value` records `{status: dissolved, confirmed_participants}` and no `context_id`. Otherwise the initiator mints a fresh `context_id`; `outcome.value` records `{status: formed, confirmed_participants, context_id}`, and every confirmed participant receives that same `context_id`.",
 "invariants": [
  "`2 <= min_participants <= max_participants <= 10000`.",
  "Exactly one Outcome#7537 is yielded per Rally run, and its `outcome_id` identifies that run.",
  "`outcome.value.confirmed_participants` contains exactly the responders selected under Criteria#92ab who confirmed before MUSTER confirmation closed.",
  "`outcome.value.status` is `formed` if and only if at least `min_participants` selected responders confirmed before confirmation closed.",
  "A formed Outcome#7537 carries exactly one `context_id`, fresh to that Rally run and shared with every confirmed participant; a dissolved outcome carries none."
 ],
 "parameters": [
  {
   "name": "deadline",
   "type": "Duration",
   "range": "(0s, unbounded)",
   "description": "Duration from Rally start by which ENLIST intake, selection, and MUSTER confirmation complete",
   "default": "5m"
  },
  {
   "name": "max_participants",
   "type": "PositiveInteger",
   "range": "[min_participants, 10000]",
   "description": "Most responders that may be selected and confirmed",
   "default": 10
  },
  {
   "name": "min_participants",
   "type": "PositiveInteger",
   "range": "[2, max_participants]",
   "description": "Fewest selected responders who must confirm at MUSTER for group formation"
  }
 ],
 "signature": [],
 "preconditions": [
  "Broadcast channel available",
  "Initiator can mint and communicate a shared group context identifier"
 ],
 "postconditions": [
  "A formed or dissolved Outcome#7537 is yielded"
 ],
 "failure_modes": [
  "Flaking: Responders ENLIST tentatively but selected responders fail to confirm at MUSTER before `deadline`.",
  "Under-quorum: Fewer than `min_participants` selected responders confirm before MUSTER confirmation closes, so no group forms."
 ],
 "domain": "",
 "caution": "",
 "sources": [],
 "name": "Rally",
 "builds_on": [
  {
   "alias": "accept_spec",
   "relation": "accepts",
   "library": "bootstrap",
   "slug": "AcceptSpec",
   "ref": "AcceptSpec#37fa",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/AcceptSpec"
  },
  {
   "alias": "selection_criteria",
   "relation": "accepts",
   "library": "bootstrap",
   "slug": "Criteria",
   "ref": "Criteria#92ab",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Criteria"
  },
  {
   "alias": "select",
   "relation": "composes_with",
   "library": "bootstrap",
   "slug": "Select",
   "ref": "Select#decf",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Select"
  },
  {
   "alias": "protocol",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Protocol",
   "ref": "Protocol#f583",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Protocol"
  },
  {
   "alias": "outcome",
   "relation": "yields",
   "library": "bootstrap",
   "slug": "Outcome",
   "ref": "Outcome#7537",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Outcome"
  }
 ],
 "related": [],
 "used_by": [
  {
   "slug": "Nucleate",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Nucleate"
  }
 ],
 "url": "https://semahash.org/vocabularies/bootstrap/patterns/Rally",
 "md_url": "https://semahash.org/vocabularies/bootstrap/patterns/Rally.md",
 "library_url": "https://semahash.org/vocabularies/bootstrap"
}
