Skip to content
docsv0.1.0

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): self

The governance repository has no registered profile.

Parameters

Parameters of profileMissing()
NameTypeDescription
$contextstringDescription of where the access was attempted

GovernanceException::profileInvalid()

public static function profileInvalid(string $reason): self

The loaded profile has an invalid structure or content.

Parameters

Parameters of profileInvalid()
NameTypeDescription
$reasonstringSpecific description of what is invalid

GovernanceException::decisionNotFound()

public static function decisionNotFound(string $decisionId): self

An attempt was made to access a decision that does not exist in the profile.

Parameters

Parameters of decisionNotFound()
NameTypeDescription
$decisionIdstringID of the decision sought

GovernanceException::decisionDuplicate()

public static function decisionDuplicate(string $decisionId): self

The profile has two decisions with the same ID.

Parameters

Parameters of decisionDuplicate()
NameTypeDescription
$decisionIdstringDuplicated ID

GovernanceException::immutabilityViolation()

public static function immutabilityViolation(string $decisionId): self

An attempt was made to modify a decision that is already in effect (inviolable).

Parameters

Parameters of immutabilityViolation()
NameTypeDescription
$decisionIdstringID of the decision that cannot be modified

GovernanceException::supersessionCycle()

public static function supersessionCycle(array $cycle): self

There is a cycle in the supersession relationships between decisions.

Parameters

Parameters of supersessionCycle()
NameTypeDescription
$cyclearray<string>List of IDs that form the cycle

GovernanceException::decisionInactive()

public static function decisionInactive(string $decisionId, string $currentStatus): self

An attempt was made to use a decision that is not in "accepted" status.

Parameters

Parameters of decisionInactive()
NameTypeDescription
$decisionIdstringID of the decision
$currentStatusstringCurrent status it is in

GovernanceException::planStale()

public static function planStale(string $expectedHash, string $planHash): self

The compiled plan does not match the current profile (stale plan).

Parameters

Parameters of planStale()
NameTypeDescription
$expectedHashstringExpected hash of the current profile
$planHashstringHash of the profile the plan was compiled with

GovernanceException::enforcementUnproven()

public static function enforcementUnproven(string $gateId, string $tier): self

An enforcement tier is claimed with no evidence of execution.

Parameters

Parameters of enforcementUnproven()
NameTypeDescription
$gateIdstringID of the gate or rule
$tierstringClaimed enforcement tier

GovernanceException::runStale()

public static function runStale(string $reason): self

The 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

Parameters of runStale()
NameTypeDescription
$reasonstringSpecific reason returned by `GovernanceRunProjector::observe()`

GovernanceException::runInvalid()

public static function runInvalid(string $reason): self

The 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

Parameters of runInvalid()
NameTypeDescription
$reasonstringSpecific reason naming the offender, returned by `GovernanceRunProjector::observe()`

GovernanceException::historyPlanMismatch()

public static function historyPlanMismatch(string $planHash, string $historyHash): self

A 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

Parameters of historyPlanMismatch()
NameTypeDescription
$planHashstringHash of the current plan the status was requested against
$historyHashstringHash of the plan the received history belongs to

GovernanceException::snapshotMissing()

public static function snapshotMissing(string $path): self

The compiled snapshot (`snapshots/governance-plan.json`) does not exist on disk.

Parameters

Parameters of snapshotMissing()
NameTypeDescription
$pathstringAbsolute path of the expected snapshot

GovernanceException::snapshotInvalid()

public static function snapshotInvalid(string $reason): self

The compiled snapshot exists but could not be read.

Parameters

Parameters of snapshotInvalid()
NameTypeDescription
$reasonstringSpecific description of what failed while reading it