@startuml voting-system !theme plain title Feature Discussion Voting and Promotion System start :Discussion file updated; partition "Vote Parsing (workflow.py)" { :Read staged discussion.md content; :Parse all lines matching: **- ParticipantName: ... VOTE: VALUE**; :Track latest vote per participant\n(most recent wins); :Count eligible voters based on\n**allow_agent_votes** rule; note right **Vote Format:** - Name: Comment text. VOTE: READY - Name: Another comment. VOTE: CHANGES - AI_BotName: Comment. VOTE: READY **Valid Values:** - READY (approve) - CHANGES (needs work) - REJECT (block) end note } partition "Promotion Logic (AI-powered)" { :AI reads promotion_rule from header: - allow_agent_votes: true/false - ready_min_eligible_votes: N or "all" - reject_min_eligible_votes: N or "all"; if (allow_agent_votes == false?) then (yes) :Exclude voters with\nnames starting with "AI_"; endif :Count eligible READY votes; :Count eligible REJECT votes; :Count CHANGES votes (neutral); if (READY threshold met AND\nREJECT threshold NOT met?) then (yes) :Update status to\n**READY_FOR_IMPLEMENTATION**; if (implementation_gate output defined?) then (yes) :AI generates\nimplementation.discussion.md; endif else if (REJECT threshold met AND\nREADY threshold NOT met?) then (no) :Update status to\n**FEATURE_REJECTED**; else (no) :Keep status as **OPEN**; endif } partition "Summary Update (summary.py)" { :Update VOTES section in .sum.md; note right Example block written into the summary file: ## Votes (latest per participant) READY: X • CHANGES: Y • REJECT: Z - Alice: READY - Bob: CHANGES end note :Auto-stage updated .sum.md file; } :Include in commit; stop legend bottom Example Promotion Rules: Simple Majority (2 approvals): ready_min_eligible_votes: 2 reject_min_eligible_votes: 1 allow_agent_votes: false Unanimous (everyone must approve): ready_min_eligible_votes: "all" reject_min_eligible_votes: 1 allow_agent_votes: false Include AI votes: ready_min_eligible_votes: 3 allow_agent_votes: true endlegend @enduml