Skip to main content

Module governance

Module governance 

Source
Expand description

Constitutional governance engine for WeftOS.

Implements the three-branch governance model where:

  • Legislative (SOPs, rules, manifests) defines boundaries
  • Executive (agents) acts within defined boundaries
  • Judicial (CGR engine) validates every action

No branch can modify another’s constraints. Governance violations are type-level impossibilities, not merely audited events.

§Design

All types compile unconditionally. The CGR validation engine and effect algebra scoring require the governance or ruvector-apps feature gates. Without them, GovernanceEngine::evaluate() returns GovernanceDecision::Permit (open governance).

Structs§

EffectVector
5-dimensional effect vector for scoring agent actions.
GatePrincipal
Attributed principal for a governance / gate evaluation (WEFT-636).
GovernanceEngine
Governance engine.
GovernanceRequest
Governance evaluation request.
GovernanceResult
Governance evaluation result.
GovernanceRule
A governance rule that restricts agent behavior.
ProjectAttestation
A project id whose provenance is cryptographic, ready to stamp onto a GatePrincipal with GatePrincipal::with_project.
TrajectoryRecord
A record of an agent’s decision for learning and replay.
TrajectoryRecorder
Records agent trajectories for learning and pattern extraction.

Enums§

AttestSource
Where a ProjectAttestation came from.
GateEffectKind
Privileged gate families that must publish an explicit EffectVector (WEFT-506). Cron already had inline vectors; auth / config / a2a share this enum so tests can pin dimensions per gate type.
GovernanceBranch
Governance branch that owns a rule.
GovernanceDecision
Governance decision for an action.
GovernanceRuleType
Discriminator for governance rule evaluation paths.
RuleSeverity
Rule violation severity.
TrajectoryOutcome
Outcome of an agent decision for trajectory scoring.

Constants§

BINDING_THREAD_MISMATCH_REASON
Canonical deny reason for binding-thread mismatch (WEFT-342).
BINDING_THREAD_RULE_ID
Governance rule / gate action id for binding-thread integrity (WEFT-342).
OVERLAY_APPROVAL_TAG
sop_category tag of a project-overlay require_approval rule (ADR-103 D8). A matching blocking rule yields EscalateToHuman even when the engine-wide human_approval_required flag is off.
OVERLAY_DENY_TAG
sop_category tag of a project-overlay deny rule (ADR-103 D8). A matching blocking rule is an unconditional Deny: the engine-wide human_approval_required flag does not soften it into an escalation.

Functions§

binding_thread_default_rules
Default binding-thread integrity rule (WEFT-342), anchored at genesis.
browser_policy_default_rules
Default browser_policy rules anchored at governance genesis (S7).
selector_matches
Match a selector against a candidate string (WEFT-634).
with_effect_context
Merge an explicit EffectVector into a gate context JSON object.