GateResult
Domain verdict of a gate evaluation: pass / fail / waived, carrying the fields and evidence whose absence blocked a state transition. This is the workflow engine's domain-specific face of the framework-agnostic core verdict {@see \Milpa\ValueObjects\Verification\VerificationResult} (D8 seam). {@see self::toVerificationResult()} projects this onto the core type and {@see self::fromVerificationResult()} rebuilds it losslessly, so the state machine can speak the core vocabulary at its boundary without changing any of its live consumers.
GateResult::pass()
public static function pass(): selfCrea un resultado exitoso (gate pasado).
GateResult::fail()
public static function fail(string $message, string $gateCode, array $missingFields = [], array $missingEvidence = []): selfCrea un resultado fallido (gate no pasado).
Parameters
| Name | Type | Description |
|---|---|---|
| $message | string | Mensaje descriptivo del fallo |
| $gateCode | string | Código del gate que falló |
| $missingFields | list<string> | Campos requeridos faltantes ['field_name', ...] |
| $missingEvidence | list<string> | Evidencias requeridas faltantes ['evidence_type', ...] |
GateResult::waived()
public static function waived(string $gateCode, string $justification): selfCrea un resultado de gate exceptuado (waived). El gate fue saltado por una justificación válida.
Parameters
| Name | Type | Description |
|---|---|---|
| $gateCode | string | Código del gate exceptuado |
| $justification | string | Razón de la excepción |
GateResult::isPassed()
public function isPassed(): boolVerifica si el gate fue superado (pasado o exceptuado).
GateResult::hasMissingFields()
public function hasMissingFields(): boolVerifica si el resultado tiene campos faltantes.
GateResult::hasMissingEvidence()
public function hasMissingEvidence(): boolVerifica si el resultado tiene evidencias faltantes.
GateResult::toArray()
public function toArray(): arrayObtiene una representación en array para debugging o logging.
GateResult::toVerificationResult()
public function toVerificationResult(?string $verifier = null, ?string $principal = null): Milpa\ValueObjects\Verification\VerificationResultProjects this domain verdict onto the framework-agnostic core seam (D8). pass → PASSED, waived → WAIVED (gate code kept in metadata), fail → FAILED with the fields and evidence flattened into the generic `missing` list. The field/evidence split and the gate code survive in `metadata`, so {@see self::fromVerificationResult()} can reconstruct this result without loss. A verifier that runs the gate machinery through the core {@see VerifierInterface} (D9, e.g. {@see \Milpa\Workflow\Verification\StateMachineVerifier}) passes its own identity and the acting principal so the returned verdict is attributable.
Parameters
| Name | Type | Description |
|---|---|---|
| $verifier | (string | null) | opaque id of the verifier producing this verdict (e.g. "workflow_engine") |
| $principal | (string | null) | opaque id of the acting principal (never resolved to an entity) |
GateResult::fromVerificationResult()
public static function fromVerificationResult(Milpa\ValueObjects\Verification\VerificationResult $result): selfRebuilds a domain verdict from a core {@see VerificationResult} — the inverse of {@see self::toVerificationResult()}. A satisfied result (PASSED or WAIVED) maps to a passed gate; FAILED and the async PENDING state map to a non-passing gate. The gate code and field/evidence split are read back from metadata when present, and the reconstruction tolerates a bare core result produced elsewhere (no metadata) without error.
Parameters
| Name | Type | Description |
|---|---|---|
| $result | Milpa\ValueObjects\Verification\VerificationResult |