Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 976 Bytes

File metadata and controls

37 lines (27 loc) · 976 Bytes

title: Voting Models description: Thresholds, consensus, and multi-stage votes.

Voting Models

Guardrails supports threshold-based voting out of the box. Each step has a threshold — the minimum number of approvals required to complete the step.

Simple Majority

Flow::make()->anyOfRoles(['architect'])->signedBy(3, 'Architecture Vote')->build();

Quorum + Majority (two steps)

Flow::make()
  ->anyOfRoles(['architect'])
  ->signedBy(2, 'Quorum')            // at least 2 must sign
  ->anyOfRoles(['architect'])
  ->signedBy(3, 'Majority')          // then total 3 approvals
  ->build();

Departmental Votes

Flow::make()
  ->anyOfRoles(['eng_manager','design_manager'])
  ->signedBy(2, 'Eng+Design Vote')
  ->build();

Notes

  • Each signature is stored with the signer_id (approver user id) and an optional comment.
  • Initiator can be included/preapproved; set includeInitiator(true, true) on the builder or step meta.