Skip to main content

🗳️ Pentarchy Governance

Voting System | Domain: Governance

The governance system implementing 3-agent voting for medium-stakes decisions.

Overview​

KOSMOS V2.0 Pentarchy Governance System (LangGraph Enhanced)

The Pentarchy is a 3-agent voting system for high-stakes decisions:

  • Athena (Analytics): Votes based on strategic value
  • Hephaestus (Development): Votes based on technical feasibility
  • Nur PROMETHEUS (Finance): Votes based on cost-benefit

AEGIS has security veto power over any decision.

Integrated with:

  • Database persistence for proposals and votes
  • LangGraph agent voting API
  • SDUI component generation
  • Async vote collection with timeouts
Auto-Generated

This documentation is automatically extracted from source code. Source: implementation/backend/agents/governance.py (798 lines)

Enumerations​

ProposalType​

Types of governance proposals.

MemberValue

ProposalStatus​

Status of a proposal.

MemberValue

VoteDecision​

Vote decision.

MemberValue

Data Models​

Vote​

A vote from a Pentarchy member.

@dataclass
class Vote:

SecurityReview​

Security review by AEGIS.

@dataclass
class SecurityReview:

Proposal​

A governance proposal.

@dataclass
class Proposal:

PentarchyGovernor​

Pentarchy Governance Controller (LangGraph Enhanced)

Manages the voting process for high-stakes decisions with:

  • Async vote collection from LangGraph agents
  • Security veto by AEGIS
  • Database persistence
  • Configurable quorum and thresholds
  • SDUI component generation for voting UI

Methods​

__init__()​

async initialize(db_pool) → None​

Initialize the governance system.

register_agent_voter(agent_id: str, vote_handler: Callable[Any, Awaitable[Dict[str, Any]]]) → None​

Register a LangGraph agent's vote handler.

Args: agent_id: The agent ID vote_handler: Async function that accepts proposal dict and returns vote dict

register_security_reviewer(handler: Callable[Any, Awaitable[Dict[str, Any]]]) → None​

Register AEGIS security review handler.

async submit_proposal(proposal_type: ProposalType, title: str, description: str, payload: Dict[str, Any], requestor_id: str, tenant_id: str, estimated_cost: float, requestor_agent: str, expires_in_seconds: int, metadata: Optional[Dict[str, Any]]) → Proposal​

Submit a new proposal for governance review.

async request_vote(proposal_id: str, timeout: Optional[float]) → Dict[str, Any]​

Request votes from Pentarchy members.

Returns the final decision after all votes are collected or timeout.

async quick_vote(proposal: Dict[str, Any], timeout: Optional[float]) → Dict[str, Any]​

Quick vote for inline governance checks.

Accepts a proposal dict and returns decision without full proposal lifecycle.

get_proposal(proposal_id: str) → Optional[Proposal]​

Get a proposal by ID.

get_active_proposals(tenant_id: Optional[str]) → List[Proposal]​

Get all active proposals, optionally filtered by tenant.

get_proposal_history(tenant_id: Optional[str], limit: int) → List[Proposal]​

Get completed proposals.

generate_sdui_components(proposal: Proposal, include_voting: bool) → List[Dict[str, Any]]​

Generate SDUI components for proposal display.

async shutdown() → None​

Shutdown the governance system.