Skip to content
docsv0.1.0

GovernanceHistoryProjector

Adjudicates a LIST of runs against the current plan, producing the full history (GOV-2 / ADR#16). Reuses the per-run wall from GOV-1 (`GovernanceRunProjector::observe()`) once for each `GovernanceRunLookup` — it does not reimplement any stale/consistency check. "Do not mix stale/invalid" is, literally, reusing the `STALE`/`INVALID` that `observe()` already produces.

GovernanceHistoryProjector::__construct()

public function __construct(Milpa\Governance\GovernanceRunProjector $runProjector):

Parameters

Parameters of __construct()
NameTypeDescription
$runProjectorMilpa\Governance\GovernanceRunProjector

GovernanceHistoryProjector::project()

public function project(Milpa\Governance\GovernancePlan $plan, array $lookups): Milpa\Governance\RunHistory

Adjudicates each lookup against the plan by reusing `observe()` (the GOV-1 wall). Does not mutate the input plan. Does not throw. The history's `planHash` is that of the observed plan. `observe()` on a FOUND lookup returns current/stale/invalid according to its own checks; on an INVALID lookup (unreadable file) it returns invalid propagating the `reason`, with `run` as null. Never NONE in this list — NONE describes an empty directory, i.e. an empty list of lookups, covered by a `RunHistory` with empty `entries`.

Parameters

Parameters of project()
NameTypeDescription
$planMilpa\Governance\GovernancePlan
$lookupslist<GovernanceRunLookup>