Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/xcoder-es/governance-layer/llms.txt

Use this file to discover all available pages before exploring further.

The Neural Parliament is composed of independent ParliamentMember instances, each representing a distinct governance concern — reward, safety, integrity, curiosity, planning, social alignment, and memory. Every member scores incoming proposals with a value function V_i(s, a) in the range [-1, 1], proposes its own preferred actions, and may veto any proposal whose score falls below its personal threshold. The parliament reaches consensus by aggregating weighted scores across all members.

ParliamentMember (Abstract Base Class)

Defined in governance/committee/base.py. All concrete members extend this class and must implement evaluate_proposal and propose.

Constructor

ParliamentMember(
    member_id: str,
    veto_threshold: float,
    weight: float,
    budget: int,
)
member_id
str
required
A unique string identifier for this member (e.g. "safety", "reward"). Used in proposals, scores, and veto records.
veto_threshold
float
required
The minimum acceptable score from evaluate_proposal. If the returned score falls strictly below this value, the member blocks the proposal. A threshold of 0.0 means this member never vetoes based on score alone.
weight
float
required
The procedural voting weight w_i. Higher-weight members have proportionally greater influence over the parliament’s weighted aggregation. For example, a member with weight=3.0 contributes three times as much as one with weight=1.0.
budget
int
required
The maximum number of proposals this member may submit per governance cycle b_i. Once the budget is exhausted, the member cannot initiate further proposals until the cycle resets.

Attributes

AttributeTypeDescription
member_idstrThe member’s unique identifier string
veto_thresholdfloatScore floor below which this member vetoes
weightfloatVoting weight applied during aggregation
budgetintMax proposals allowed per cycle

Abstract Methods

evaluate_proposal(state, proposal) -> float

@abstractmethod
def evaluate_proposal(self, state: Any, proposal: Proposal) -> float:
    ...
Scores a proposal on behalf of this member. Returns a scalar in [-1, 1], where -1 represents complete opposition, 0 is neutral, and 1 is full endorsement.
state
Any
required
The current environment or agent state. Its exact schema is determined by the calling system and passed through unchanged.
proposal
Proposal
required
The Proposal object to evaluate. Concrete implementations typically inspect proposal.metadata for domain-specific signals (e.g. risk, novelty, expected_reward).
score
float
A value in [-1, 1]. Scores below the member’s veto_threshold trigger a veto on the evaluated proposal.

propose(state) -> Proposal

@abstractmethod
def propose(self, state: Any) -> Proposal:
    ...
Generates a new Proposal from this member’s perspective. The returned proposal is submitted to the parliament for evaluation by all other members.
state
Any
required
The current environment or agent state used to inform the proposal’s content and metadata.
proposal
Proposal
A Proposal instance with member_id, action, tag, timestamp, and metadata fields populated.

Built-in Members

Seven concrete members are provided in governance/committee/members.py as reference implementations and practical defaults. Each evaluates a different key in proposal.metadata.

Quick Reference

Classmember_idveto_thresholdweightbudgetMetadata key evaluated
ExampleRewardMemberreward0.01.03expected_reward
ExampleSafetyMembersafety0.52.051.0 - risk
ExampleCuriosityMembercuriosity0.20.84novelty
ExamplePlanningMemberplanning0.31.53long_term_value
ExampleMemoryMembermemory0.10.72historical_consistency
ExampleSocialMembersocial0.41.23social_acceptability
ExampleIntegrityMemberintegrity0.83.05identity_coherence

ExampleRewardMember

Optimises for immediate expected reward. With a veto_threshold of 0.0, this member never vetoes — it endorses any proposal that produces non-negative expected reward. Its score is drawn directly from proposal.metadata["expected_reward"].
class ExampleRewardMember(ParliamentMember):
    def evaluate_proposal(self, state, proposal) -> float:
        return proposal.metadata.get("expected_reward", 0.0)

ExampleSafetyMember

Highest default weight (2.0) among the non-integrity members. Scores a proposal as 1.0 - risk, so a proposal with risk=0.9 scores 0.1 — below the veto_threshold of 0.5, triggering a veto. Safety-tagged proposals use PriorityTag.CRITICAL_SAFETY.
class ExampleSafetyMember(ParliamentMember):
    def evaluate_proposal(self, state, proposal) -> float:
        risk = proposal.metadata.get("risk", 0.0)
        return 1.0 - risk

ExampleCuriosityMember

Encourages exploration. Reads novelty from metadata and defaults to 0.0 when absent, reflecting indifference to already-known actions. Tags its own proposals with PriorityTag.EXPLORATORY.
class ExampleCuriosityMember(ParliamentMember):
    def evaluate_proposal(self, state, proposal) -> float:
        return proposal.metadata.get("novelty", 0.0)

ExamplePlanningMember

A forward-looking member that evaluates long_term_value. With weight=1.5 and veto_threshold=0.3, it will block short-sighted proposals while still deferring to safety and integrity on high-stakes decisions. Tags its own proposals with PriorityTag.HIGH_IMPACT.
class ExamplePlanningMember(ParliamentMember):
    def evaluate_proposal(self, state, proposal) -> float:
        return proposal.metadata.get("long_term_value", 0.0)

ExampleMemoryMember

Checks historical consistency of proposed actions. Its low veto_threshold of 0.1 and budget=2 make it a light-touch but persistent voice — it rarely vetoes, but it consistently flags actions that contradict established behavioural history.
class ExampleMemoryMember(ParliamentMember):
    def evaluate_proposal(self, state, proposal) -> float:
        return proposal.metadata.get("historical_consistency", 1.0)

ExampleSocialMember

Evaluates social acceptability of proposals. With veto_threshold=0.4, it blocks proposals that fall below community norms. Produces cooperative_action proposals tagged as PriorityTag.ROUTINE.
class ExampleSocialMember(ParliamentMember):
    def evaluate_proposal(self, state, proposal) -> float:
        return proposal.metadata.get("social_acceptability", 0.5)

ExampleIntegrityMember

The most conservative member: veto_threshold=0.8 means it vetoes any proposal that scores below 0.8 on identity_coherence. With weight=3.0, it is the single most influential voice in the parliament. It is the primary guardian of the agent’s identity stability.
class ExampleIntegrityMember(ParliamentMember):
    def evaluate_proposal(self, state, proposal) -> float:
        return proposal.metadata.get("identity_coherence", 1.0)

Implementing a Custom Member

Subclass ParliamentMember and implement both abstract methods. The example below shows a minimal custom member that reads a single metadata field and proposes a named action each cycle.
from governance import ParliamentMember, Proposal, PriorityTag
import time

class MyCustomMember(ParliamentMember):
    def __init__(self):
        super().__init__(
            member_id="custom",
            veto_threshold=0.3,
            weight=1.5,
            budget=4,
        )

    def evaluate_proposal(self, state, proposal) -> float:
        # Return a score in [-1, 1]
        return proposal.metadata.get("my_score", 0.5)

    def propose(self, state) -> Proposal:
        return Proposal(
            member_id=self.member_id,
            action="my_action",
            tag=PriorityTag.ROUTINE,
            timestamp=time.time(),
            metadata={"my_score": 0.7},
        )
Key design points:
  • evaluate_proposal must return a float in [-1, 1]. Values outside this range are not clamped automatically — ensure your logic stays within bounds.
  • A proposal is vetoed when evaluate_proposal returns a score strictly less than the member’s veto_threshold. For example, with veto_threshold=0.3, a score of 0.29 causes a veto; 0.30 does not.
  • weight influences the parliament’s weighted aggregation but does not affect veto rights — any member can veto regardless of weight.
  • propose is called once per cycle (subject to budget). Return a Proposal with a meaningful tag so the parliament can prioritise accordingly.

Build docs developers (and LLMs) love