Skip to content
docsv0.1.0

GateStatus

The health status of a gate (GOV-3): the honest join between the law (id, tier) and evidence derived only from `current` runs. `$condition` is `?GateOutcome`: `null` means "no signal" (no current run observed this gate) and it is NEVER collapsed with `pending`. When `$condition === null`, `$observedAt` and `$lastRunId` are also null. `$lastPassedAt` is independent of `$condition`: a gate can be `failed` now and have passed several runs ago.

GateStatus::__construct()

public function __construct(string $gateId, Milpa\Governance\EnforcementTier $tier, ?Milpa\Governance\GateOutcome $condition, ?DateTimeImmutable $observedAt, ?string $lastRunId, ?DateTimeImmutable $lastPassedAt):

Parameters

Parameters of __construct()
NameTypeDescription
$gateIdstringIdentifier of the gate in the plan
$tierEnforcementTierEnforcement level of the gate in the plan
$condition?GateOutcomeLast outcome observed in current evidence; null = no signal
$observedAt?\DateTimeImmutable`finishedAt` of the run that produced `$condition`
$lastRunId?string`runId` of that same run
$lastPassedAt?\DateTimeImmutable`finishedAt` of the last current PASSED (WAIVED does not count)

GateStatus::toArray()

public function toArray(): array

Serializes the gate status. Dates are in ISO-8601/ATOM; `condition` as null is preserved as null (distinct from `"pending"`).