Skip to content
docsv0.2.0

HostProfile

The architectural shape an application expects — deliberately NOT the same thing as `composer.json`. It names the contracts the host requires, the surfaces it enables, the capabilities it depends on, the legacy contracts it tolerates, and the risks it has explicitly accepted (a warning the host has acknowledged stays visible in the report but does not degrade the status). A pure value object: {@see fromArray()} validates, {@see toArray()} serializes deterministically.

HostProfile::__construct()

public function __construct(string $name, string $version, array $requiredContracts = [], array $enabledSurfaces = [], array $requiredCapabilities = [], array $allowedLegacyContracts = [], array $acceptedRisks = [], array $metadata = []):

Parameters

Parameters of __construct()
NameTypeDescription
$namestring
$versionstring
$requiredContractslist<string>
$enabledSurfaceslist<string>
$requiredCapabilitieslist<string>
$allowedLegacyContractslist<string>
$acceptedRiskslist<AcceptedRisk>
$metadataarray<string, mixed>

HostProfile::fromArray()

public static function fromArray(array $data): self

Build a host profile from a decoded array, validating `name` (non-empty) and `version` (a valid — possibly calendar — version).

Parameters

Parameters of fromArray()
NameTypeDescription
$dataarray<string, mixed>

Throws

InvalidManifestException On a missing/empty required field or an invalid version.

HostProfile::toArray()

public function toArray(): array

Serialize to an array with a fixed, deterministic key order.