GovernanceException
Exception of the governance system: a contract broken or violated. Each factory describes what broke, why, and what to do to fix it.
GovernanceException::profileMissing()
public static function profileMissing(string $context): selfThe governance repository has no registered profile.
Parameters
| Name | Type | Description |
|---|---|---|
| $context | string | Description of where the access was attempted |
GovernanceException::profileInvalid()
public static function profileInvalid(string $reason): selfThe loaded profile has an invalid structure or content.
Parameters
| Name | Type | Description |
|---|---|---|
| $reason | string | Specific description of what is invalid |
GovernanceException::decisionNotFound()
public static function decisionNotFound(string $decisionId): selfAn attempt was made to access a decision that does not exist in the profile.
Parameters
| Name | Type | Description |
|---|---|---|
| $decisionId | string | ID of the decision sought |
GovernanceException::decisionDuplicate()
public static function decisionDuplicate(string $decisionId): selfThe profile has two decisions with the same ID.
Parameters
| Name | Type | Description |
|---|---|---|
| $decisionId | string | Duplicated ID |
GovernanceException::immutabilityViolation()
public static function immutabilityViolation(string $decisionId): selfAn attempt was made to modify a decision that is already in effect (inviolable).
Parameters
| Name | Type | Description |
|---|---|---|
| $decisionId | string | ID of the decision that cannot be modified |
GovernanceException::supersessionCycle()
public static function supersessionCycle(array $cycle): selfThere is a cycle in the supersession relationships between decisions.
Parameters
| Name | Type | Description |
|---|---|---|
| $cycle | array<string> | List of IDs that form the cycle |
GovernanceException::decisionInactive()
public static function decisionInactive(string $decisionId, string $currentStatus): selfAn attempt was made to use a decision that is not in "accepted" status.
Parameters
| Name | Type | Description |
|---|---|---|
| $decisionId | string | ID of the decision |
| $currentStatus | string | Current status it is in |
GovernanceException::planStale()
public static function planStale(string $expectedHash, string $planHash): selfThe compiled plan does not match the current profile (stale plan).
Parameters
| Name | Type | Description |
|---|---|---|
| $expectedHash | string | Expected hash of the current profile |
| $planHash | string | Hash of the profile the plan was compiled with |
GovernanceException::enforcementUnproven()
public static function enforcementUnproven(string $gateId, string $tier): selfAn enforcement tier is claimed with no evidence of execution.
Parameters
| Name | Type | Description |
|---|---|---|
| $gateId | string | ID of the gate or rule |
| $tier | string | Claimed enforcement tier |
GovernanceException::runStale()
public static function runStale(string $reason): selfThe most recent governance run observed a plan other than the current one (`profileHash`/`planHash` do not match) — it is evidence of another law, not this one.
Parameters
| Name | Type | Description |
|---|---|---|
| $reason | string | Specific reason returned by `GovernanceRunProjector::observe()` |
GovernanceException::runInvalid()
public static function runInvalid(string $reason): selfThe governance run is internally inconsistent (empty runId, inverted dates, duplicate/unknown gate, PASSED without producerRef, WAIVED without justification, or boundTo that redefines the gate's law) — it is not reliable evidence.
Parameters
| Name | Type | Description |
|---|---|---|
| $reason | string | Specific reason naming the offender, returned by `GovernanceRunProjector::observe()` |
GovernanceException::historyPlanMismatch()
public static function historyPlanMismatch(string $planHash, string $historyHash): selfA request was made to derive the health status (`status`) by consulting a history built for a plan other than the current one — evidence of another law. This is NOT re-adjudicating runs (that was done by `observe()`); it is verifying that the consulted history belongs to THIS plan.
Parameters
| Name | Type | Description |
|---|---|---|
| $planHash | string | Hash of the current plan the status was requested against |
| $historyHash | string | Hash of the plan the received history belongs to |
GovernanceException::snapshotMissing()
public static function snapshotMissing(string $path): selfThe compiled snapshot (`snapshots/governance-plan.json`) does not exist on disk.
Parameters
| Name | Type | Description |
|---|---|---|
| $path | string | Absolute path of the expected snapshot |
GovernanceException::snapshotInvalid()
public static function snapshotInvalid(string $reason): selfThe compiled snapshot exists but could not be read.
Parameters
| Name | Type | Description |
|---|---|---|
| $reason | string | Specific description of what failed while reading it |