pub struct GovernanceApi { /* private fields */ }Expand description
Agent governance: constitution, voting, permissions, emergency protocols
Implementations§
Source§impl GovernanceApi
impl GovernanceApi
Sourcepub async fn activate_safe_mode(
&self,
body: &ActivateSafeModeRequest,
) -> Result<EmergencyState>
pub async fn activate_safe_mode( &self, body: &ActivateSafeModeRequest, ) -> Result<EmergencyState>
Activate safe mode
Founder-only. Halts all non-essential agent execution platform-wide. Admin role is NOT sufficient.
POST /api/v1/governance/emergency/safe-mode
Sourcepub async fn ambassador_veto(
&self,
body: &AmbassadorVetoRequest,
) -> Result<VetoRecord>
pub async fn ambassador_veto( &self, body: &AmbassadorVetoRequest, ) -> Result<VetoRecord>
Veto
POST /api/v1/governance/ambassador/veto
Sourcepub async fn amend_constitution(
&self,
body: &AmendConstitutionRequest,
) -> Result<ConstitutionDocument>
pub async fn amend_constitution( &self, body: &AmendConstitutionRequest, ) -> Result<ConstitutionDocument>
Amend constitution
POST /api/v1/governance/constitution/amend
Sourcepub async fn bootstrap_ambassador(&self) -> Result<BootstrapAmbassadorResponse>
pub async fn bootstrap_ambassador(&self) -> Result<BootstrapAmbassadorResponse>
Bootstrap first ambassador
POST /api/v1/governance/ambassador/ambassadors/bootstrap
Sourcepub async fn cast_ballot(
&self,
id: &str,
body: &CastBallotRequest,
) -> Result<Ballot>
pub async fn cast_ballot( &self, id: &str, body: &CastBallotRequest, ) -> Result<Ballot>
Cast ballot
POST /api/v1/governance/voting/proposals/{id}/ballot
Sourcepub async fn check_deadlock(&self) -> Result<Map<String, Value>>
pub async fn check_deadlock(&self) -> Result<Map<String, Value>>
Check for deadlock
POST /api/v1/governance/emergency/deadlock-check
Sourcepub async fn check_governance(
&self,
body: &CheckGovernanceRequest,
) -> Result<EnforcementResult>
pub async fn check_governance( &self, body: &CheckGovernanceRequest, ) -> Result<EnforcementResult>
Check governance compliance
POST /api/v1/governance/check
Sourcepub async fn check_spawn_permission(
&self,
body: &CheckSpawnPermissionRequest,
) -> Result<PermissionCheckResult>
pub async fn check_spawn_permission( &self, body: &CheckSpawnPermissionRequest, ) -> Result<PermissionCheckResult>
Check spawn permission
POST /api/v1/governance/permissions/check-spawn
Sourcepub async fn create_ambassador_request(
&self,
body: &CreateAmbassadorRequestRequest,
) -> Result<Map<String, Value>>
pub async fn create_ambassador_request( &self, body: &CreateAmbassadorRequestRequest, ) -> Result<Map<String, Value>>
Create request
POST /api/v1/governance/ambassador/requests
Sourcepub async fn create_builder_request(
&self,
body: &DesignRequestCreate,
) -> Result<DesignRequest>
pub async fn create_builder_request( &self, body: &DesignRequestCreate, ) -> Result<DesignRequest>
Create design request
POST /api/v1/governance/builder/requests
Sourcepub async fn create_goal(&self, body: &CreateGoalRequest) -> Result<Goal>
pub async fn create_goal(&self, body: &CreateGoalRequest) -> Result<Goal>
Create goal
POST /api/v1/governance/goals
Sourcepub async fn create_improvement_proposal(
&self,
agent_id: &str,
body: &CreateImprovementProposalRequest,
) -> Result<ImprovementProposal>
pub async fn create_improvement_proposal( &self, agent_id: &str, body: &CreateImprovementProposalRequest, ) -> Result<ImprovementProposal>
Create improvement proposal
POST /api/v1/governance/improvement/{agentId}
Sourcepub async fn create_voting_proposal(
&self,
body: &CreateVotingProposalRequest,
) -> Result<VotingProposal>
pub async fn create_voting_proposal( &self, body: &CreateVotingProposalRequest, ) -> Result<VotingProposal>
Create proposal
POST /api/v1/governance/voting/proposals
Sourcepub async fn deactivate_safe_mode(&self) -> Result<DeactivateSafeModeResponse>
pub async fn deactivate_safe_mode(&self) -> Result<DeactivateSafeModeResponse>
Deactivate safe mode
Founder-only. Returns the platform to normal mode after a safe-mode activation.
POST /api/v1/governance/emergency/deactivate
Sourcepub async fn delete_spawn_policy(&self) -> Result<DeleteSpawnPolicyResponse>
pub async fn delete_spawn_policy(&self) -> Result<DeleteSpawnPolicyResponse>
Delete spawn policy
DELETE /api/v1/governance/permissions/spawn-policy
Sourcepub async fn file_arbiter_appeal(
&self,
id: &str,
body: &FileArbiterAppealRequest,
) -> Result<FileArbiterAppealResponse>
pub async fn file_arbiter_appeal( &self, id: &str, body: &FileArbiterAppealRequest, ) -> Result<FileArbiterAppealResponse>
File appeal
POST /api/v1/governance/arbiter/cases/{id}/appeal
Sourcepub async fn file_arbiter_case(
&self,
body: &FileArbiterCaseRequest,
) -> Result<Map<String, Value>>
pub async fn file_arbiter_case( &self, body: &FileArbiterCaseRequest, ) -> Result<Map<String, Value>>
File case
Files a new arbitration case. Returns 409 if the filer would have a conflict of interest with the chosen arbiter pool (server checks before persisting).
POST /api/v1/governance/arbiter/cases
Sourcepub async fn get_agent_obligations(
&self,
agent_id: &str,
) -> Result<GetAgentObligationsResponse>
pub async fn get_agent_obligations( &self, agent_id: &str, ) -> Result<GetAgentObligationsResponse>
Get agent obligations
GET /api/v1/governance/obligations/{agentId}
Sourcepub async fn get_agent_permissions(
&self,
agent_id: &str,
) -> Result<PermissionSet>
pub async fn get_agent_permissions( &self, agent_id: &str, ) -> Result<PermissionSet>
Get agent permissions
GET /api/v1/governance/permissions/{agentId}
Sourcepub async fn get_agent_violations(
&self,
agent_id: &str,
) -> Result<GetAgentViolationsResponse>
pub async fn get_agent_violations( &self, agent_id: &str, ) -> Result<GetAgentViolationsResponse>
Get agent violations
GET /api/v1/governance/violations/{agentId}
Sourcepub async fn get_ambassador(&self, id: &str) -> Result<Ambassador>
pub async fn get_ambassador(&self, id: &str) -> Result<Ambassador>
Get ambassador
GET /api/v1/governance/ambassador/ambassadors/{id}
Sourcepub async fn get_arbiter_case(&self, id: &str) -> Result<ArbiterCase>
pub async fn get_arbiter_case(&self, id: &str) -> Result<ArbiterCase>
Get case
GET /api/v1/governance/arbiter/cases/{id}
Sourcepub async fn get_arbiter_registry(&self) -> Result<ArbiterRegistry>
pub async fn get_arbiter_registry(&self) -> Result<ArbiterRegistry>
Get arbiter registry
GET /api/v1/governance/arbiter/registry
Sourcepub async fn get_builder_request(&self, id: &str) -> Result<DesignRequest>
pub async fn get_builder_request(&self, id: &str) -> Result<DesignRequest>
Get design request
GET /api/v1/governance/builder/requests/{id}
Sourcepub async fn get_constitution(&self) -> Result<ConstitutionDocument>
pub async fn get_constitution(&self) -> Result<ConstitutionDocument>
Get constitution
GET /api/v1/governance/constitution
Sourcepub async fn get_emergency_state(&self) -> Result<EmergencyState>
pub async fn get_emergency_state(&self) -> Result<EmergencyState>
Get emergency state
GET /api/v1/governance/emergency/state
Sourcepub async fn get_goal(&self, id: &str) -> Result<Goal>
pub async fn get_goal(&self, id: &str) -> Result<Goal>
Get goal
GET /api/v1/governance/goals/{id}
Sourcepub async fn get_governance_ledger(
&self,
params: &GetGovernanceLedgerParams,
) -> Result<GetGovernanceLedgerResponse>
pub async fn get_governance_ledger( &self, params: &GetGovernanceLedgerParams, ) -> Result<GetGovernanceLedgerResponse>
Get governance ledger
Entries visible to the calling tenant, newest first.
Walking prev_hash across this page is NOT a verification, and treating it as one
produces false alarms. seq is global across all tenants while this list is scoped to
one, so consecutive rows here are usually NOT consecutive in the ledger — the entry a row’s
prev_hash names belongs to another tenant and is not returned. Measured against production
on 2026-08-20 over three independent samples: every pair whose seq values were adjacent
chained correctly, and every pair with a gap did not — 10/10 and 0/5 in the last sample,
while GET /governance/ledger/verify answered valid: true at the same moment.
A client that walks the chain of a page therefore reports tampering in a ledger the server
certifies as intact. Integrity has an authority, and it is GET /governance/ledger/verify;
a page-local walk can say “adjacent and chained” or “cannot be checked from here”, never
“broken”.
GET /api/v1/governance/ledger
Sourcepub async fn get_improvement_proposal(
&self,
agent_id: &str,
version: &str,
) -> Result<ImprovementProposal>
pub async fn get_improvement_proposal( &self, agent_id: &str, version: &str, ) -> Result<ImprovementProposal>
Get proposal
GET /api/v1/governance/improvement/{agentId}/{version}
Sourcepub async fn get_permission_lineage(
&self,
agent_id: &str,
) -> Result<AgentLineage>
pub async fn get_permission_lineage( &self, agent_id: &str, ) -> Result<AgentLineage>
Get permission lineage
GET /api/v1/governance/permissions/{agentId}/lineage
Sourcepub async fn get_root_agent(&self) -> Result<GetRootAgentResponse>
pub async fn get_root_agent(&self) -> Result<GetRootAgentResponse>
Get root agent
GET /api/v1/governance/emergency/root-agent
Sourcepub async fn get_root_attestation(&self) -> Result<Map<String, Value>>
pub async fn get_root_attestation(&self) -> Result<Map<String, Value>>
Get root attestation
GET /api/v1/governance/emergency/root-attestation
Sourcepub async fn get_spawn_policy(&self) -> Result<SpawnPolicy>
pub async fn get_spawn_policy(&self) -> Result<SpawnPolicy>
Get spawn policy
GET /api/v1/governance/permissions/spawn-policy
Sourcepub async fn get_voting_proposal(&self, id: &str) -> Result<VotingProposal>
pub async fn get_voting_proposal(&self, id: &str) -> Result<VotingProposal>
Get proposal
GET /api/v1/governance/voting/proposals/{id}
Sourcepub async fn issue_arbiter_ruling(
&self,
id: &str,
body: &IssueArbiterRulingRequest,
) -> Result<IssueArbiterRulingResponse>
pub async fn issue_arbiter_ruling( &self, id: &str, body: &IssueArbiterRulingRequest, ) -> Result<IssueArbiterRulingResponse>
Issue ruling
POST /api/v1/governance/arbiter/cases/{id}/ruling
Sourcepub async fn list_ambassador_requests(
&self,
params: &ListAmbassadorRequestsParams,
) -> Result<ListAmbassadorRequestsResponse>
pub async fn list_ambassador_requests( &self, params: &ListAmbassadorRequestsParams, ) -> Result<ListAmbassadorRequestsResponse>
List requests
GET /api/v1/governance/ambassador/requests
Sourcepub async fn list_ambassadors(&self) -> Result<Vec<Ambassador>>
pub async fn list_ambassadors(&self) -> Result<Vec<Ambassador>>
List ambassadors
GET /api/v1/governance/ambassador/ambassadors
Sourcepub async fn list_ambassador_vetoes(
&self,
) -> Result<ListAmbassadorVetoesResponse>
pub async fn list_ambassador_vetoes( &self, ) -> Result<ListAmbassadorVetoesResponse>
List vetoes
GET /api/v1/governance/ambassador/vetoes
Sourcepub async fn list_arbiter_cases(&self) -> Result<ListArbiterCasesResponse>
pub async fn list_arbiter_cases(&self) -> Result<ListArbiterCasesResponse>
List cases
GET /api/v1/governance/arbiter/cases
Sourcepub async fn list_ballots(&self, id: &str) -> Result<ListBallotsResponse>
pub async fn list_ballots(&self, id: &str) -> Result<ListBallotsResponse>
List ballots
GET /api/v1/governance/voting/proposals/{id}/ballots
Sourcepub async fn list_builder_requests(&self) -> Result<ListBuilderRequestsResponse>
pub async fn list_builder_requests(&self) -> Result<ListBuilderRequestsResponse>
List design requests
GET /api/v1/governance/builder/requests
Sourcepub async fn list_goals(
&self,
params: &ListGoalsParams,
) -> Result<ListGoalsResponse>
pub async fn list_goals( &self, params: &ListGoalsParams, ) -> Result<ListGoalsResponse>
List goals
GET /api/v1/governance/goals
Sourcepub async fn list_improvement_proposals(
&self,
agent_id: &str,
) -> Result<Vec<ImprovementProposal>>
pub async fn list_improvement_proposals( &self, agent_id: &str, ) -> Result<Vec<ImprovementProposal>>
List improvement proposals
GET /api/v1/governance/improvement/{agentId}
Sourcepub async fn list_voting_proposals(&self) -> Result<ListVotingProposalsResponse>
pub async fn list_voting_proposals(&self) -> Result<ListVotingProposalsResponse>
List proposals
GET /api/v1/governance/voting/proposals
Sourcepub async fn register_ambassador(
&self,
body: &RegisterAmbassadorRequest,
) -> Result<RegisterAmbassadorResponse>
pub async fn register_ambassador( &self, body: &RegisterAmbassadorRequest, ) -> Result<RegisterAmbassadorResponse>
Register ambassador
POST /api/v1/governance/ambassador/ambassadors
Sourcepub async fn replace_constitution(
&self,
body: &ReplaceConstitutionRequest,
) -> Result<ConstitutionDocument>
pub async fn replace_constitution( &self, body: &ReplaceConstitutionRequest, ) -> Result<ConstitutionDocument>
Replace constitution
PUT /api/v1/governance/constitution
Sourcepub async fn resolve_ambassador_request(
&self,
id: &str,
body: &ResolveAmbassadorRequestRequest,
) -> Result<Map<String, Value>>
pub async fn resolve_ambassador_request( &self, id: &str, body: &ResolveAmbassadorRequestRequest, ) -> Result<Map<String, Value>>
Resolve request
POST /api/v1/governance/ambassador/requests/{id}/resolve
Sourcepub async fn set_agent_permissions(
&self,
agent_id: &str,
body: &PermissionSetUpdate,
) -> Result<SetAgentPermissionsResponse>
pub async fn set_agent_permissions( &self, agent_id: &str, body: &PermissionSetUpdate, ) -> Result<SetAgentPermissionsResponse>
Set agent permissions
WRITE SEMANTICS: merges. A field the body omits keeps its stored value; only a FIRST write
falls back to the documented defaults (budget 1.0, spawn depth 3, empty lists). A field that
IS present but of the wrong type falls to the safe default rather than to the stored value —
on a permissions surface a malformed write must fail closed, not become a silent no-op.
created_at is server-owned and ignored from the body.
PUT /api/v1/governance/permissions/{agentId}
Sourcepub async fn set_arbiter_registry(
&self,
body: &Map<String, Value>,
) -> Result<SetArbiterRegistryResponse>
pub async fn set_arbiter_registry( &self, body: &Map<String, Value>, ) -> Result<SetArbiterRegistryResponse>
Set arbiter registry
PUT /api/v1/governance/arbiter/registry
Sourcepub async fn set_root_agent(
&self,
body: &SetRootAgentRequest,
) -> Result<SetRootAgentResponse>
pub async fn set_root_agent( &self, body: &SetRootAgentRequest, ) -> Result<SetRootAgentResponse>
Set root agent
PUT /api/v1/governance/emergency/root-agent
Sourcepub async fn set_root_attestation(
&self,
body: &Map<String, Value>,
) -> Result<SetRootAttestationResponse>
pub async fn set_root_attestation( &self, body: &Map<String, Value>, ) -> Result<SetRootAttestationResponse>
Set root attestation
WRITE SEMANTICS: replaces. The body IS the attestation record — every field is required and
nothing is carried over, which is why a body missing one answers 422 rather than storing a
partial record. created_at is server-stamped, never taken from the caller.
PUT /api/v1/governance/emergency/root-attestation
Sourcepub async fn set_spawn_policy(
&self,
body: &SpawnPolicyUpdate,
) -> Result<SetSpawnPolicyResponse>
pub async fn set_spawn_policy( &self, body: &SpawnPolicyUpdate, ) -> Result<SetSpawnPolicyResponse>
Set spawn policy
PUT /api/v1/governance/permissions/spawn-policy
Sourcepub async fn tally_votes(&self, id: &str) -> Result<VoteResult>
pub async fn tally_votes(&self, id: &str) -> Result<VoteResult>
Tally votes
POST /api/v1/governance/voting/proposals/{id}/tally
Sourcepub async fn update_builder_request_status(
&self,
id: &str,
body: &UpdateBuilderRequestStatusRequest,
) -> Result<DesignRequest>
pub async fn update_builder_request_status( &self, id: &str, body: &UpdateBuilderRequestStatusRequest, ) -> Result<DesignRequest>
Update request status
PUT /api/v1/governance/builder/requests/{id}/status
Sourcepub async fn update_goal_status(
&self,
id: &str,
body: &UpdateGoalStatusRequest,
) -> Result<Map<String, Value>>
pub async fn update_goal_status( &self, id: &str, body: &UpdateGoalStatusRequest, ) -> Result<Map<String, Value>>
Update goal status
PUT /api/v1/governance/goals/{id}/status
Sourcepub async fn update_improvement_status(
&self,
agent_id: &str,
version: &str,
body: &UpdateImprovementStatusRequest,
) -> Result<ImprovementProposal>
pub async fn update_improvement_status( &self, agent_id: &str, version: &str, body: &UpdateImprovementStatusRequest, ) -> Result<ImprovementProposal>
Update proposal status (state machine enforced)
Allowed transitions:
proposed→arbiter_review|rejectedarbiter_review→voting|rejectedvoting→sandbox_testing|rejectedsandbox_testing→approved|rejectedapproved→applied
Any other transition returns 400. Requires admin/founder role.
PUT /api/v1/governance/improvement/{agentId}/{version}/status
Sourcepub async fn verify_governance_ledger(
&self,
params: &VerifyGovernanceLedgerParams,
) -> Result<LedgerIntegrity>
pub async fn verify_governance_ledger( &self, params: &VerifyGovernanceLedgerParams, ) -> Result<LedgerIntegrity>
Verify ledger integrity
GET /api/v1/governance/ledger/verify
Sourcepub async fn veto_proposal(
&self,
id: &str,
body: &VetoProposalRequest,
) -> Result<VetoProposalResponse>
pub async fn veto_proposal( &self, id: &str, body: &VetoProposalRequest, ) -> Result<VetoProposalResponse>
Veto proposal
POST /api/v1/governance/voting/proposals/{id}/veto
Trait Implementations§
Source§impl Clone for GovernanceApi
impl Clone for GovernanceApi
Source§fn clone(&self) -> GovernanceApi
fn clone(&self) -> GovernanceApi
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more