$failed Extensions that threw or answered invalidly. * @param ActionDescriptor|null $raw The core's descriptor with the facts; * the refined one when nothing reclassified it. * @param array $slow Fact providers over their time budget, in ms. * @param list $items A batch's items, each refined as its own * request (AF-25.11); empty for anything else. */ public function __construct( public readonly ActionDescriptor $action, public readonly ?string $refined_by = null, public readonly array $failed = array(), ?ActionDescriptor $raw = null, public readonly array $slow = array(), public readonly array $items = array() ) { $this->raw = $raw ?? $action; } /** * Whether the pipeline has anything to act on: a changed descriptor, or * a failure to fail closed on, or a batch's items to decide. Facts * alone are not a change: both descriptors carry them. */ public function changed(): bool { return null !== $this->refined_by || array() !== $this->failed || array() !== $this->items; } /** * This refinement with a batch's items. * * @param list $items The items, refined. */ public function with_items( array $items ): self { return new self( $this->action, $this->refined_by, $this->failed, $this->raw, $this->slow, $items ); } }