CascadingDev/docs/voting-system.puml

110 lines
2.8 KiB
Plaintext

@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)
if (Current stage == feature?) then (yes)
:Update status to\n**READY_FOR_DESIGN**;
:AI generates\ndesign.discussion.md;
else if (Current stage == design?) then (yes)
:Update status to\n**READY_FOR_IMPLEMENTATION**;
:AI generates\nimplementation.discussion.md;
else if (Current stage == implementation?) then (yes)
:Update status to\n**READY_FOR_REVIEW**;
:AI generates\nreview.discussion.md;
else (review stage)
:Update status to\n**APPROVED**;
endif
else if (REJECT threshold met AND\nREADY threshold NOT met?) then (no)
if (Current stage == feature?) then (yes)
:Update status to\n**FEATURE_REJECTED**;
else if (Current stage == design?) then (yes)
:Update status to\n**DESIGN_REJECTED**;
else (other stages)
:Update status to\n**NEEDS_CHANGES**;
endif
else (no)
:Keep status as **OPEN** or **UNDER_REVIEW**;
endif
}
partition "Summary Update (summary.py)" {
:Update VOTES section in .sum.md;
note right
Example block written into the summary file:
<!-- SUMMARY:VOTES START -->
## Votes (latest per participant)
READY: X • CHANGES: Y • REJECT: Z
- Alice: READY
- Bob: CHANGES
<!-- SUMMARY:VOTES END -->
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