Skip to content
docsv0.1.0

GovernanceStatusProjector

Derives the per-gate health status (GOV-3 / ADR#18) ONLY over the `current` evidence of a `RunHistory` — the already-adjudicated output of GOV-2. It re-adjudicates nothing: it reuses `current()` the same way `GovernanceHistoryProjector` reused `observe()`. Each layer adds meaning; none falsifies the previous one. It is pure and total EXCEPT for one guard: if the received history belongs to another plan (a different `planHash`), it throws — a status cannot be derived from the history of another law (amendment 1). Frozen temporal semantics: "most recent" orders by `finishedAt` DESC and then `runId` DESC; a current run that does not observe a gate does not erase the previous observation; `lastPassedAt` considers only PASSED (WAIVED does not count).

GovernanceStatusProjector::project()

public function project(Milpa\Governance\GovernancePlan $plan, Milpa\Governance\RunHistory $history): Milpa\Governance\GovernanceStatus

Derives the per-gate `GovernanceStatus` for `$plan`, reading only the `current` evidence of `$history` (GOV-3 / ADR#18) — it re-adjudicates nothing, reusing `RunHistory::current()` the same way `GovernanceHistoryProjector` reuses `observe()`.

Parameters

Parameters of project()
NameTypeDescription
$planMilpa\Governance\GovernancePlan
$historyMilpa\Governance\RunHistory

Throws

GovernanceException if `$history->planHash !== $plan->planHash`