GovernanceValidator
The wall: makes it impossible to declare a gate "enforced" without a real mechanism backing it. Validates in fail-fast mode — throws on the first violation found, in input order: (a) unique decision IDs; (b) every profile reference points to an existing decision; (c) every `supersedes` points to an existing decision; (d) no supersession cycles; (e) no decision referenced by the profile is rejected or superseded (directly or derivedly); (f) every gate with tier Enforced has a real `boundTo` belonging to the allowlist — both the profile's typed `GovernanceGate`s and the gates declared as `policies` of kind `kind: 'gate'` within each decision. For the latter, a tier that does not resolve to a valid `EnforcementTier` case (typo, different casing, or absent) fails closed with `CODE_PROFILE_INVALID` — it is not treated as innocent free-form metadata. "enforced with no demonstrable mechanism is a governance lie."
GovernanceValidator::__construct()
public function __construct(array $validBoundTo):Parameters
| Name | Type | Description |
|---|---|---|
| $validBoundTo | array<string> | Allowlist of accepted enforcement mechanisms |
GovernanceValidator::validate()
public function validate(array $decisions, Milpa\Governance\GovernanceProfile $profile): voidValidates that the decisions and profile form a coherent, honest governance contract.
Parameters
| Name | Type | Description |
|---|---|---|
| $decisions | list<GovernanceDecision> | |
| $profile | Milpa\Governance\GovernanceProfile |
Throws
GovernanceException on the first violation found