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§
- Effect
Vector - 5-dimensional effect vector for scoring agent actions.
- Gate
Principal - Attributed principal for a governance / gate evaluation (WEFT-636).
- Governance
Engine - Governance engine.
- Governance
Request - Governance evaluation request.
- Governance
Result - Governance evaluation result.
- Governance
Rule - A governance rule that restricts agent behavior.
- Project
Attestation - A project id whose provenance is cryptographic, ready to stamp onto a
GatePrincipalwithGatePrincipal::with_project. - Trajectory
Record - A record of an agent’s decision for learning and replay.
- Trajectory
Recorder - Records agent trajectories for learning and pattern extraction.
Enums§
- Attest
Source - Where a
ProjectAttestationcame from. - Gate
Effect Kind - 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. - Governance
Branch - Governance branch that owns a rule.
- Governance
Decision - Governance decision for an action.
- Governance
Rule Type - Discriminator for governance rule evaluation paths.
- Rule
Severity - Rule violation severity.
- Trajectory
Outcome - 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_categorytag of a project-overlayrequire_approvalrule (ADR-103 D8). A matching blocking rule yieldsEscalateToHumaneven when the engine-widehuman_approval_requiredflag is off.- OVERLAY_
DENY_ TAG sop_categorytag of a project-overlay deny rule (ADR-103 D8). A matching blocking rule is an unconditionalDeny: the engine-widehuman_approval_requiredflag 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
EffectVectorinto a gate context JSON object.