Skip to content
docsv0.1.0

StateMachineVerifier

Runs milpa/workflow's data-driven gate machinery as a first-class core {@see VerifierInterface} (D8 seam / D9): a generic {@see VerificationRequest} + a {@see VerificationContext} in, a {@see VerificationResult} out. This is the automated, deterministic counterpart to the human-supplied verification tools (T089) — the same seam, a different strategy. The engine evaluates a concrete transition, which the generic seam cannot express on its own, so the transition and its evaluation inputs ride in `request->payload`: - `domain`, `fromState`, `toState` (required) — the transition to check; - `actorId`, `actorRole`, `entityId` (optional) — acting actor and subject entity; - `gatePassages`, `evidenceIds` (optional int lists) — approved passages / attached evidence; - `fieldValues` (optional map) — required-field values. The acting principal comes from `context->principal`, and `context->metadata` passes through verbatim (e.g. `waived_gate` / `justification`). The verdict is produced by bridging the engine's {@see GateResult} through {@see GateResult::toVerificationResult()}, stamped with this verifier's {@see self::NAME} and the principal. Framework-agnostic: depends only on the engine ({@see StateMachineInterface}) and the core value objects — no Doctrine, no product-specific types (D9 / ADR-001).

StateMachineVerifier::__construct()

public function __construct(Milpa\Workflow\Contracts\StateMachineInterface $stateMachine):

Parameters

Parameters of __construct()
NameTypeDescription
$stateMachineMilpa\Workflow\Contracts\StateMachineInterface

StateMachineVerifier::verify()

public function verify(Milpa\ValueObjects\Verification\VerificationRequest $request, Milpa\ValueObjects\Verification\VerificationContext $context): Milpa\ValueObjects\Verification\VerificationResult

Evaluate the transition described by `request->payload` and return the bridged verdict. A payload missing `domain`, `fromState` or `toState` yields a FAILED result (the seam never throws for malformed input — it reports it as an unsatisfied verification).

Parameters

Parameters of verify()
NameTypeDescription
$requestMilpa\ValueObjects\Verification\VerificationRequest
$contextMilpa\ValueObjects\Verification\VerificationContext